/**
 * dichvuhuthamcaugiareuytin.com
 * Phát triển bởi: MDDev
 */

.blog-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
    overflow-x: hidden;
    width: 100%;
    box-sizing: border-box;
}

.blog-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 20px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.03), rgba(0, 0, 0, 0.01));
    border-radius: 0;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

/* Hide blog-header when transparent header and hero banner are enabled */
.has-transparent-header .blog-header {
    display: none;
}

.blog-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.blog-title i {
    color: var(--primary);
}

.blog-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumb a:hover {
    color: var(--primary);
}

.breadcrumb span {
    color: var(--text-muted);
}

.blog-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
}

@media (max-width: 900px) {
    .blog-layout {
        grid-template-columns: 1fr;
    }

    .blog-sidebar {
        order: 1;
        position: static;
    }

    .sidebar-widget {
        background: #ffffff;
        border: 1px solid rgba(0, 0, 0, 0.1);
    }
}

.section-heading {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-heading i {
    color: #000000;
}

.featured-section {
    margin-bottom: 40px;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.featured-grid-2 {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 768px) {

    .featured-section {
        overflow: hidden;
    }

    .featured-grid,
    .featured-grid-2 {
        grid-template-columns: 1fr;
    }
}

.featured-card {
    display: block;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 0;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.featured-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.featured-image {
    position: relative;
    height: 180px;
    overflow: hidden;
}

.featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.featured-card:hover .featured-image img {
    transform: scale(1.05);
}

.featured-image .no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.02));
    color: var(--text-muted);
    font-size: 2rem;
}

.featured-category {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--primary);
    color: #fff;
    padding: 4px 12px;
    border-radius: 0;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.featured-content {
    padding: 20px;
}

.featured-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.featured-content p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 12px;
}

.featured-meta {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: var(--text-muted);
}

.featured-meta i {
    margin-right: 5px;
}

.posts-section {
    margin-bottom: 40px;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

@media (max-width: 600px) {
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

.post-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 0;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.post-card:hover {
    transform: translateY(-3px);
    border-color: rgba(0, 0, 0, 0.2);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.post-image {
    height: 180px;
    overflow: hidden;
}

@media (max-width: 600px) {
    .post-image {
        height: 120px;
    }
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-card:hover .post-image img {
    transform: scale(1.05);
}

.post-image .no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.02));
    color: var(--text-muted);
    font-size: 1.5rem;
}

.post-content {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

@media (max-width: 600px) {
    .post-content {
        padding: 10px;
    }
}

.post-category {
    display: inline-block;
    background: rgba(0, 0, 0, 0.08);
    color: var(--primary);
    padding: 3px 10px;
    border-radius: 0;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 8px;
    width: fit-content;
}

.post-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 600px) {
    .post-title {
        font-size: 0.85rem;
        -webkit-line-clamp: 2;
    }
}

.post-excerpt {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 10px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 600px) {
    .post-excerpt {
        display: none;
    }
}

.post-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: auto;
}

.post-meta i {
    margin-right: 4px;
}

.no-posts {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.no-posts i {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
}

.load-more-wrap {
    text-align: center;
    margin-top: 30px;
}

.btn-load-more {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    background: transparent;
    color: #000000;
    border: 1px solid #000000;
    border-radius: 0;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-load-more:hover {
    background: #000000;
    color: #ffffff;
}

.btn-load-more:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    background: transparent;
    color: #000000;
}

.blog-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.sidebar-widget {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 0;
    padding: 20px;
    margin-bottom: 20px;
}

.widget-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 8px;
}

.widget-title i {
    color: var(--primary);
}

.category-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.category-list li {
    margin-bottom: 8px;
}

.category-list li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-radius: 0;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
}

.category-list li a:hover,
.category-list li.active a {
    background: rgba(0, 0, 0, 0.05);
    color: var(--primary);
}

.category-count {
    background: rgba(0, 0, 0, 0.08);
    padding: 3px 10px;
    border-radius: 0;
    font-size: 11px;
}

.latest-posts-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.latest-post-item {
    display: flex;
    gap: 12px;
    padding: 10px;
    border-radius: 0;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s;
    background: rgba(0, 0, 0, 0.02);
}

.latest-post-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.latest-post-thumb {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border-radius: 0;
    overflow: hidden;
}

.latest-post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.latest-post-thumb .no-thumb {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-muted);
    font-size: 1rem;
}

.latest-post-info {
    flex: 1;
    min-width: 0;
}

.latest-post-info h4 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.latest-post-info p {
    font-size: 11px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.4;
}

.latest-post-info p span {
    color: var(--primary);
    font-weight: 500;
}

.single-post {
    max-width: 800px;
    margin: 0 auto 40px;
}

.post-header {
    text-align: center;
    margin-bottom: 30px;
}

.post-category-badge {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 6px 16px;
    border-radius: 0;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    text-decoration: none;
    margin-bottom: 15px;
}

.post-main-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.3;
}

@media (max-width: 600px) {
    .post-main-title {
        font-size: 1.5rem;
    }
}

.post-info {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 14px;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.post-info i {
    margin-right: 5px;
    color: var(--primary);
}

.post-featured-image {
    margin-bottom: 30px;
    border-radius: 0;
    overflow: hidden;
}

.post-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

.post-body {
    font-size: 16px;
    line-height: 1.8;
    color: rgba(0, 0, 0, 0.85);
}

.post-body h2,
.post-body h3,
.post-body h4 {
    margin: 30px 0 15px;
    font-weight: 600;
}

.post-body h2 {
    font-size: 1.5rem;
}

.post-body h3 {
    font-size: 1.25rem;
}

.post-body h4 {
    font-size: 1.1rem;
}

.post-body p {
    margin-bottom: 18px;
    text-align: justify;
}

.post-body img {
    max-width: 100%;
    height: auto;
    border-radius: 0;
    margin: 20px auto;
    display: block;
}

.post-body figure,
.post-body .wp-caption {
    text-align: center;
    margin: 20px auto;
    max-width: 100%;
}

.post-body figure img,
.post-body .wp-caption img {
    margin: 0 auto 10px;
}

.post-body figcaption,
.post-body .wp-caption-text {
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 8px;
}

.post-body ul,
.post-body ol {
    margin: 15px 0;
    padding-left: 25px;
}

.post-body li {
    margin-bottom: 8px;
}

.post-body blockquote {
    margin: 25px 0;
    padding: 20px 25px;
    border-left: 4px solid var(--primary);
    background: rgba(0, 0, 0, 0.03);
    border-radius: 0;
    font-style: italic;
}

.post-body a {
    color: var(--primary);
    text-decoration: underline;
}

.post-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.post-body table th,
.post-body table td {
    padding: 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    text-align: left;
}

.post-body table th {
    background: rgba(0, 0, 0, 0.05);
}

.post-tags {
    margin-top: 30px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.post-tags strong {
    color: var(--text-muted);
}

.post-tags strong i {
    color: var(--primary);
}

.tag {
    display: inline-block;
    padding: 5px 12px;
    background: rgba(0, 0, 0, 0.08);
    color: var(--primary);
    border-radius: 0;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.3s;
}

.tag:hover {
    background: var(--primary);
    color: #fff;
}

.post-share {
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.post-share strong {
    color: var(--text-muted);
}

.share-btn {
    width: 40px;
    height: 40px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s;
}

.share-btn:hover {
    transform: translateY(-3px);
}

.share-btn.facebook {
    background: #1877f2;
}

.share-btn.twitter {
    background: #1da1f2;
}

.share-btn.telegram {
    background: #0088cc;
}

.related-posts {
    max-width: 1000px;
    margin: 0 auto;
    padding-top: 40px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.blog-slider-section {
    padding: 60px 20px;
    background: rgba(0, 0, 0, 0.02);
}

.blog-slider-section .container {
    max-width: 1200px;
    margin: 0 auto;
}

.blog-slider-section .section-title {
    text-align: center;
    margin-bottom: 40px;
}

.blog-slider {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

@media (max-width: 900px) {
    .blog-slider {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .blog-slider {
        grid-template-columns: 1fr;
    }
}

.blog-slider-item {
    display: block;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 0;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.blog-slider-item:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.1);
}

.blog-slider-image {
    height: 150px;
    overflow: hidden;
}

.blog-slider-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.blog-slider-item:hover .blog-slider-image img {
    transform: scale(1.05);
}

.blog-slider-content {
    padding: 15px;
}

.blog-slider-content h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-slider-content .date {
    font-size: 12px;
    color: var(--text-muted);
}

.blog-slider-content .date i {
    color: var(--primary);
    margin-right: 5px;
}

.view-all-link {
    text-align: center;
    margin-top: 30px;
}

.view-all-link a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
}

.view-all-link a:hover {
    gap: 12px;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

@media (max-width: 1024px) {
    .related-posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .related-posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

.featured-slider-wrapper {
    position: relative;
}

.featured-slider-btn {
    display: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 0;
    background: var(--primary);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s;
    align-items: center;
    justify-content: center;
}

.featured-slider-btn:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.featured-slider-prev {
    left: -10px;
}

.featured-slider-next {
    right: -10px;
}

@media (max-width: 768px) {
    .featured-slider-wrapper {
        overflow: hidden;
    }

    .featured-slider-track {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 15px;
        transition: transform 0.4s ease;
    }

    .featured-slider-track .featured-card {
        flex: 0 0 calc(100% - 30px);
        min-width: calc(100% - 30px);
    }

    .featured-slider-btn {
        display: flex;
    }

    .featured-slider-prev {
        left: 5px;
    }

    .featured-slider-next {
        right: 5px;
    }
}

html,
body {
    overflow-x: hidden;
    max-width: 100vw;
}

.main-content {
    overflow-x: hidden;
    max-width: 100%;
}

@media (max-width: 768px) {

    .blog-container,
    .blog-layout,
    .blog-main,
    .posts-section,
    .featured-section {
        max-width: 100%;
        overflow-x: hidden;
    }

    .blog-header {
        margin-left: -5px;
        margin-right: -5px;
        padding-left: 15px;
        padding-right: 15px;
    }

    .posts-grid {
        gap: 10px;
    }

    .featured-slider-wrapper {
        margin: 0 -5px;
        padding: 0 5px;
    }
}

/* === Blog Post Layout with Sidebar === */
.blog-post-layout {
    display: flex;
    gap: 30px;
}

.has-sidebar .single-post {
    flex: 1;
    min-width: 0;
    max-width: none;
}

.has-sidebar .blog-sidebar {
    width: 320px;
    flex-shrink: 0;
}

@media (max-width: 1024px) {
    .blog-post-layout {
        flex-direction: column;
    }

    .has-sidebar .blog-sidebar {
        width: 100%;
        order: 1;
    }
}

/* === Sidebar Product Widget === */
.sidebar-products-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-product-item {
    display: flex;
    gap: 12px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.02);
    text-decoration: none;
    color: inherit;
    transition: all 0.3s;
}

.sidebar-product-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.sidebar-product-thumb {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    overflow: hidden;
}

.sidebar-product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-product-thumb .no-thumb {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-muted);
    font-size: 1rem;
}

.sidebar-product-info {
    flex: 1;
    min-width: 0;
}

.sidebar-product-info h4 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sidebar-product-price {
    font-size: 13px;
    margin: 0;
}

.sidebar-product-price .sale-price {
    color: #e74c3c;
    font-weight: 600;
}

.sidebar-product-price .original-price {
    color: var(--text-muted);
    text-decoration: line-through;
    margin-left: 6px;
    font-size: 12px;
}

.sidebar-product-price .price {
    color: var(--primary);
    font-weight: 600;
}

/* === Inline Table of Contents (after first H2) - Float Left Layout === */
.toc-inline {
    float: left;
    width: 320px;
    max-width: 45%;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    margin: 0 25px 20px 0;
}

@media (max-width: 768px) {
    .toc-inline {
        float: none;
        width: 100%;
        max-width: 100%;
        margin: 20px 0;
    }
}

.toc-inline .toc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    cursor: pointer;
}

.toc-inline .toc-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.toc-inline .toc-toggle-icon {
    transition: transform 0.3s;
}

.toc-inline.toc-collapsed .toc-toggle-icon {
    transform: rotate(0deg);
}

.toc-inline:not(.toc-collapsed) .toc-toggle-icon {
    transform: rotate(180deg);
}

.toc-inline.toc-collapsed .toc-content {
    display: none;
}

.toc-inline .toc-content {
    padding: 0;
}

.toc-inline .toc-list {
    display: flex;
    flex-direction: column;
}

.toc-inline .toc-item {
    display: block;
    padding: 10px 15px;
    color: rgba(0, 0, 0, 0.7);
    text-decoration: none;
    font-size: 14px;
    line-height: 1.4;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.toc-inline .toc-item:hover {
    background: rgba(0, 0, 0, 0.03);
    color: var(--primary);
}

.toc-inline .toc-item.active {
    border-left-color: var(--primary);
    color: var(--primary);
    background: rgba(0, 0, 0, 0.02);
    font-weight: 500;
}

/* === Table of Contents (TOC) - Fixed Sidebar === */
.toc-sidebar {
    position: fixed;
    top: 120px;
    right: 20px;
    width: 280px;
    max-height: calc(100vh - 160px);
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    z-index: 100;
    opacity: 0;
    transform: translateX(20px);
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.toc-sidebar.toc-visible {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.toc-sidebar.toc-hidden {
    display: none !important;
}

.toc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

.toc-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.toc-close {
    display: flex;
    background: none;
    border: none;
    font-size: 16px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.toc-close:hover {
    color: #000;
}

.toc-content {
    flex: 1;
    overflow-y: auto;
    max-height: 280px;
    position: relative;
}

.toc-expanded .toc-content {
    max-height: none;
}

.toc-list {
    display: flex;
    flex-direction: column;
    padding-bottom: 40px;
}

.toc-item {
    display: block;
    padding: 8px 12px;
    color: rgba(0, 0, 0, 0.65);
    text-decoration: none;
    font-size: 13px;
    line-height: 1.4;
    border-left: 2px solid transparent;
    transition: all 0.2s;
}

.toc-item:hover {
    background: rgba(0, 0, 0, 0.03);
    color: var(--primary);
}

.toc-item.active {
    border-left-color: var(--primary);
    color: var(--primary);
    background: rgba(0, 0, 0, 0.02);
    font-weight: 500;
}

.toc-level-3 {
    font-size: 12px;
}

.toc-level-4,
.toc-level-5,
.toc-level-6 {
    font-size: 11px;
    color: var(--text-muted);
}

.toc-expand-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px;
    background: linear-gradient(to top, #ffffff 70%, transparent);
    border: none;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    font-size: 12px;
    font-weight: 500;
    color: var(--primary);
    cursor: pointer;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}

.toc-expand-btn i {
    transition: transform 0.3s;
}

.toc-expanded .toc-expand-btn {
    position: static;
    background: transparent;
}

/* Hide TOC sidebar on smaller screens */
@media (max-width: 1200px) {
    .toc-sidebar {
        display: none;
    }
}

/* === Mobile TOC Button, Overlay & Panel === */
.toc-mobile-toggle {
    display: none;
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #000000;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    z-index: 9999;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s, box-shadow 0.3s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.toc-mobile-toggle:hover,
.toc-mobile-toggle:active {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.toc-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e74c3c;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

.toc-mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.toc-mobile-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.toc-mobile-panel {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 70vh;
    background: #fff;
    z-index: 10001;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    overflow: hidden;
    border-radius: 16px 16px 0 0;
}

.toc-mobile-panel.active {
    transform: translateY(0);
}

.toc-mobile-panel .toc-header {
    padding: 16px 20px;
    border-radius: 16px 16px 0 0;
}

.toc-mobile-panel .toc-content {
    max-height: calc(70vh - 60px);
    overflow-y: auto;
    padding-bottom: 20px;
}

.toc-mobile-panel .toc-list {
    padding-bottom: 0;
}

.toc-mobile-panel .toc-item {
    padding: 12px 20px;
    font-size: 15px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

@media (max-width: 768px) {

    .toc-mobile-toggle,
    .toc-mobile-overlay,
    .toc-mobile-panel {
        display: block;
    }
}