/* Fixed TOC Shortcode Styles */

.fixed-toc-shortcode {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px 10px;
    /* margin: 30px 0; */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Header */
.toc-shortcode-header {
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.toc-shortcode-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    display: flex;
    align-items: center;
}

.toc-shortcode-title svg {
    margin-right: 10px;
}

/* List */
.toc-shortcode-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.toc-shortcode-list li {
    margin: 3px 0;
    line-height: 1.6;
}

.toc-shortcode-list a {
    color: #4b5563;
    text-decoration: none;
    display: inline-block;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.2s ease;
    position: relative;
}

.toc-shortcode-list a:hover {
    color: var(--primary-color);
    background: #ede9fe;
    transform: translateX(5px);
}

.toc-shortcode-list a:before {
    content: "›";
    margin-right: 8px;
    color: var(--primary-color);
    font-weight: bold;
}

/* Active link highlight */
.toc-shortcode-list a.active {
    color: var(--primary-color);
    font-weight: 600;
    border-left: 3px solid var(--primary-color);
    padding-left: 7px;
    background: #f3f4f6;
}

.toc-shortcode-list a.active:before {
    color: var(--primary-color);
    font-weight: bold;
}

/* Numbering */
.toc-numbered .toc-shortcode-list a:before {
    display: none;
}

.toc-numbered .toc-number {
    display: inline-block;
    min-width: 25px;
    color: var(--primary-color);
    font-weight: bold;
}

/* Level indentation */
.toc-level-1 {
    padding-left: 0;
    font-weight: 600;
    font-size: 16px;
}

.toc-level-2 {
    padding-left: 0px;
    font-size: 15px;
}

.toc-level-3 {
    padding-left: 0px;
    font-size: 14px;
}

.toc-level-4 {
    padding-left: 60px;
    font-size: 13px;
}

.toc-level-5 {
    padding-left: 80px;
    font-size: 12px;
}

.toc-level-6 {
    padding-left: 100px;
    font-size: 12px;
}

/* Position variants */
.toc-position-inline {
    width: 100%;
    max-width: 100%;
}

.toc-position-float-right {
    float: right;
    width: 300px;
    margin: 0 0 20px 30px;
}

.toc-position-float-left {
    float: left;
    width: 300px;
    margin: 0 30px 20px 0;
}

/* Responsive */
@media (max-width: 768px) {
    .toc-position-float-right,
    .toc-position-float-left {
        float: none;
        width: 100%;
        margin: 20px 0;
    }
    
    .toc-level-3,
    .toc-level-4,
    .toc-level-5,
    .toc-level-6 {
        padding-left: 0px;
    }
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}

/* Print styles */
@media print {
    .fixed-toc-shortcode {
        background: white;
        border: 1px solid #000;
    }
}
.ul.toc-shortcode-list li{
    padding-left: 0;
}
/* TOC sticky trên mobile */
@media (max-width: 768px) {
  .large-3.col.col_toc {
    position: sticky;
    top: 75px; /* chỉnh theo chiều cao header */
    z-index: 999;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    margin: 10px;
    padding: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  }

  .fixed-toc-shortcode .toc-shortcode-header {
    cursor: pointer;
    padding: 10px;
    background: #f8f8f8;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .fixed-toc-shortcode .toc-shortcode-title {
    margin: 0;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .fixed-toc-shortcode .toc-shortcode-list {
    max-height: 300px;
    overflow-y: auto;
    transition: all 0.3s ease;
    padding: 10px 15px;
  }

  /* Thu gọn */
  .fixed-toc-shortcode.collapsed .toc-shortcode-list {
    display: none;
  }
}
