/* === Page Template Styles === */



/* Page Content Styles */
.page-content {
    padding: 24px 0 60px 0;
}

#primary .site-main {
    padding-top: 24px;
}

.home #primary .site-main,
.front-page #primary .site-main,
.home .page-content,
.front-page .page-content {
    padding-top: 0 !important;
}

.page-article {
    max-width: 1200px;
    margin: 0 auto;
}

.page-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.page-title {
    font-size: 36px;
    font-weight: 800;
    color: #222;
    margin: 0 0 15px 0;
    line-height: 1.3;
    position: relative;
    padding-bottom: 15px;
    display: inline-block;
}

.page-title::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 90px;
    height: 3px;
    background: #cca471;
}

.page-entry-content,
.single-post-content {
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: #495057;
}

.page-entry-content p,
.single-post-content p {
    margin: 0 0 20px;
}

.page-entry-content h1,
.page-entry-content h2,
.page-entry-content h3,
.page-entry-content h4,
.page-entry-content h5,
.single-post-content h1,
.single-post-content h2,
.single-post-content h3,
.single-post-content h4,
.single-post-content h5 {
    color: #212529;
    font-weight: 700;
    line-height: 1.35;
}

.page-entry-content h1,
.single-post-content h1 {
    font-size: 32px;
    margin: 42px 0 20px;
}

.page-entry-content h2,
.single-post-content h2 {
    font-size: 28px;
    margin: 38px 0 18px;
}

.page-entry-content h3,
.single-post-content h3 {
    font-size: 18px;
    margin: 16px 0 16px;
}

.page-entry-content h4,
.single-post-content h4 {
    font-size: 20px;
    margin: 24px 0 14px;
}

.page-entry-content h5,
.single-post-content h5 {
    font-size: 18px;
    margin: 22px 0 12px;
}

.page-entry-content ul,
.page-entry-content ol,
.single-post-content ul,
.single-post-content ol {
    margin-bottom: 20px;
    padding-left: 30px;
    list-style-position: outside;
}

.page-entry-content li,
.single-post-content li {
    margin-bottom: 10px;
}

.page-entry-content li > p,
.single-post-content li > p {
    display: inline;
    margin: 0;
}

.page-entry-content blockquote,
.single-post-content blockquote {
    margin: 1.2em 0 1.2em 1.2em;
    padding: 0 0 0 1em;
    border-left: 3px solid #d8d8d8;
    color: #4a4a4a;
    font-style: italic;
    line-height: 1.7;
}

.page-entry-content blockquote p:last-child,
.single-post-content blockquote p:last-child {
    margin-bottom: 0;
}

.page-entry-content img,
.single-post-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px auto;
    border-radius: 8px;
}

/* Mobile Responsiveness */
@media screen and (max-width: 768px) {
    .page-content {
        padding-top: 16px;
    }

    #primary .site-main {
        padding-top: 16px;
    }

    .home #primary .site-main,
    .front-page #primary .site-main,
    .home .page-content,
    .front-page .page-content {
        padding-top: 0 !important;
    }



    /* Standard Page Spacing (20px left/right) */
    .page-content .container {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }



    .page-title {
        font-size: 28px;
    }

    .page-header {
        margin-bottom: 30px;
    }

    .page-entry-content,
    .single-post-content {
        font-size: 15px;
    }

    .page-entry-content h1,
    .single-post-content h1 {
        font-size: 28px;
    }

    .page-entry-content h2,
    .single-post-content h2 {
        font-size: 24px;
    }

    .page-entry-content h3,
    .single-post-content h3 {
        font-size: 21px;
    }

    .page-entry-content h4,
    .single-post-content h4 {
        font-size: 18px;
    }

    .page-entry-content h5,
    .single-post-content h5 {
        font-size: 16px;
    }
}

/* === SINGLE POST TEMPLATE STYLES === */

/* Single Post Layout */
.single-post .single-post {
    margin: 0 0 60px 0;
}

/* Remove inherited top gap from wrapper, banner spacing is handled below */
main.single-post,
main.single-post .container {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

main.single-post .single-post-article {
    padding-top: 0;
}

/* Post Banner Image */
.single-post-banner {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    margin-top: 24px;
    margin-bottom: 30px;
    overflow: hidden;
    border-radius: 18px;
    background: #f0f0f0;
}

.single-post-banner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

@media screen and (max-width: 768px) {
    .single-post-banner {
        aspect-ratio: 16 / 9;
        margin-top: 18px;
        margin-bottom: 20px;
        border-radius: 0;
        width: 100vw;
        left: 50%;
        right: 50%;
        margin-left: -50vw;
        margin-right: -50vw;
    }
}

.single-post-article {
    max-width: 900px;
    margin: 0 auto;
}

/* Post Header */
.single-post-header {
    text-align: left;
    margin-bottom: 30px;
}

.single-post-title {
    font-size: 42px;
    font-weight: 800;
    color: #222;
    margin: 0 0 20px 0;
    line-height: 1.3;
    position: relative;
    padding-bottom: 20px;
    display: inline-block;
}

.single-post-title::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 110px;
    height: 3px;
    background: #cca471;
}

.single-post-meta {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 15px;
    color: #6c757d;
}

.single-post-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
}

.single-post-meta-row span {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

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

.meta-reading-time .reading-time-number {
    display: inline-block;
    margin-left: 4px;
    margin-right: 2px;
}

@media screen and (min-width: 769px) {
    .single-post-meta {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 20px;
        align-items: center;
    }

    .single-post-meta-row {
        display: contents;
    }
}

/* Excerpt Box */
.single-post-excerpt {
    background-color: #f0f0f0;
    padding: 15px;
    margin: 0 0 40px 0;
    border-left: 4px solid #cca471;
    font-style: italic;
    font-size: 17px;
    line-height: 1.7;
    color: #333;
    border-radius: 5px;
    box-shadow: 0 10px 24px rgba(17, 17, 17, 0.08);
}

.single-post-excerpt p {
    margin-bottom: 0;
}

.single-post-access-notice {
    margin: 30px 0 70px;
}

.single-post-access-notice-inner {
    background: linear-gradient(180deg, #fffaf1 0%, #f5efe4 100%);
    border: 1px solid rgba(197, 143, 22, 0.18);
    border-left: 4px solid #cca471;
    border-radius: 20px;
    padding: 58px 28px;
    box-shadow: 0 12px 26px rgba(122, 86, 8, 0.08);
    color: #111111;
}

.single-post-access-notice-title {
    margin: 0 0 12px;
    font-size: 28px;
    line-height: 1.35;
    color: #111111;
    font-weight: 800;
    text-align: center;
}

.single-post-access-notice-text {
    margin: 0;
    font-size: 17px;
    line-height: 1.8;
    color: #111111;
    text-align: center;
}

.single-post-access-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 22px;
    justify-content: center;
    align-items: center;
}

.single-post-access-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 22px;
    border-radius: 999px;
    text-decoration: none !important;
    font-weight: 700;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.single-post-access-btn-home {
    background: #f7f1e7;
    border: 2px solid #111111;
    color: #111111;
}

.single-post-access-btn-guide {
    background: linear-gradient(135deg, #f0c66a 0%, #cca471 100%);
    border: 1px solid transparent;
    color: #171717;
    box-shadow: 0 10px 18px rgba(138, 101, 17, 0.16);
}

.single-post-access-btn:hover {
    transform: translateY(-1px);
}

.single-post-access-btn-home:hover {
    color: #111111;
    border-color: #111111;
    box-shadow: 0 8px 16px rgba(138, 101, 17, 0.1);
}

.single-post-access-btn-guide:hover {
    color: #171717;
    box-shadow: 0 14px 24px rgba(138, 101, 17, 0.22);
}

@media screen and (max-width: 768px) {
    .single-post-meta {
        gap: 8px;
    }

    .single-post-meta-row {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 16px;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 2px;
    }

    .single-post-meta-row::-webkit-scrollbar {
        display: none;
    }

    .single-post-meta-row span {
        flex: 0 0 auto;
    }

    .single-post-access-notice {
        margin: 30px 0 70px;
    }

    .single-post-access-notice-inner {
        padding: 58px 20px;
    }

    .single-post-access-actions {
        justify-content: center;
        flex-direction: column;
        align-items: center;
    }

    .single-post-access-btn {
        width: min(100%, 320px);
    }
}

/* Share Buttons */
.sdnh-share-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 0 30px 0;
    flex-wrap: wrap;
}

.sdnh-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 26px;
    height: 26px;
    padding: 0;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: background 0.2s ease, color 0.2s ease, opacity 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
    line-height: 1;
    flex: 0 0 26px;
    box-shadow: 0 10px 18px rgba(122, 86, 8, 0.18), 0 4px 10px rgba(17, 17, 17, 0.1);
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.sdnh-share-btn:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

.sdnh-share-fb {
    background: #cca471;
    color: #111;
}

.sdnh-share-fb:hover,
.sdnh-share-fb:focus,
.sdnh-share-fb:active {
    color: #111;
}

.sdnh-share-copy {
    background: #cca471;
    color: #111;
}

.sdnh-share-label {
    display: none;
}

.sdnh-share-copy.copied {
    background: #d29a1f;
    color: #111;
}

.sdnh-share-cta {
    margin: 42px 0 20px;
    padding-top: 24px;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.sdnh-share-cta-text {
    margin: 0 0 18px;
    color: #1f1f1f;
    font-size: 18px;
    line-height: 1.7;
    font-weight: 700;
    text-align: center;
}

.sdnh-share-buttons-card {
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    gap: 12px;
}

.sdnh-share-btn-wide {
    width: auto;
    min-width: 144px;
    height: 38px;
    padding: 0 18px;
    border-radius: 12px;
    font-size: 15px;
    justify-content: center;
    flex: 0 1 auto;
    background: #cca471;
    color: #111;
    box-shadow: 0 14px 28px rgba(122, 86, 8, 0.2), 0 6px 14px rgba(17, 17, 17, 0.12);
}

.sdnh-share-btn-wide:hover,
.sdnh-share-btn-wide:focus,
.sdnh-share-btn-wide:active,
.sdnh-share-btn-wide:focus-visible,
.sdnh-share-btn:hover,
.sdnh-share-btn:focus,
.sdnh-share-btn:active,
.sdnh-share-btn:focus-visible {
    background: #d29a1f;
    color: #111;
    outline: none !important;
    box-shadow: none !important;
}

.sdnh-share-btn-wide .sdnh-share-label {
    display: inline;
}

.sdnh-share-btn-wide .copy-label,
.sdnh-share-btn-wide .sdnh-share-label {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.sdnh-manual-cta {
    margin: 56px 0 0;
    padding-top: 0;
    border-top: none;
}

.sdnh-manual-cta-inner {
    position: relative;
    display: flex;
    align-items: stretch;
    background: #f0f0f0;
    border: 1px solid rgba(204, 164, 113, 0.65);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 16px 34px rgba(17, 17, 17, 0.1);
    transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.sdnh-manual-cta-inner:hover {
    border-color: rgba(204, 164, 113, 0.95);
    box-shadow: 0 22px 42px rgba(17, 17, 17, 0.14);
    transform: translateY(-2px);
}

.sdnh-manual-cta-accent {
    width: 4px;
    flex: 0 0 4px;
    background: #cca471;
}

.sdnh-manual-cta-content {
    width: 100%;
    padding: 28px 30px;
    color: #333;
    text-align: center;
}

.sdnh-manual-cta-title {
    margin: 0 0 12px;
    color: #1f1f1f;
    font-size: 30px;
    line-height: 1.25;
    font-weight: 800;
}

.sdnh-manual-cta-desc {
    color: #333;
    font-size: 16px;
    line-height: 1.8;
    max-width: 760px;
    margin: 0 auto;
}

.sdnh-manual-cta-desc p:last-child {
    margin-bottom: 0;
}

.sdnh-manual-cta-actions {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid #d9d9d9;
    display: flex;
    justify-content: center;
}

.sdnh-manual-cta-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px;
    border-radius: 999px;
    background: linear-gradient(135deg, #f0c66a 0%, #cca471 100%);
    color: #171717;
    font-size: 15px;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 10px 22px rgba(197, 143, 22, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.sdnh-manual-cta-button:hover {
    color: #111;
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(197, 143, 22, 0.34);
    opacity: 0.96;
}

.sdnh-manual-cta-arrow {
    font-size: 16px;
    line-height: 1;
}

.single-post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
    font-size: 16px;
}

.single-post-tags-above-share {
    margin: 34px 0 18px;
}

.single-post-tags-after-cta {
    margin: 26px 0 0;
}

.single-post-tags-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #8a6511;
    font-size: 13px;
    line-height: 1;
    margin-right: 2px;
}

.single-post-tag {
    display: inline-flex;
    align-items: center;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: none;
    color: #8a6511;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.7;
    text-decoration: none;
    transition: all 0.2s ease;
}

.single-post-tag:hover {
    color: #d8b27f;
}

@media screen and (max-width: 768px) {
    .sdnh-share-buttons {
        gap: 6px;
    }
    .sdnh-share-btn {
        width: 24px;
        height: 24px;
        flex-basis: 24px;
        font-size: 11px;
    }

    .sdnh-zalo-icon {
        width: 13px;
        height: 13px;
    }

    .sdnh-share-cta {
        margin-top: 34px;
        padding-top: 20px;
    }

    .sdnh-share-cta {
        border-bottom: 1px solid #d9d9d9;
    }

    .sdnh-share-cta-text {
        font-size: 16px;
        margin-bottom: 14px;
    }

    .sdnh-share-buttons-card {
        gap: 8px;
        display: flex;
        flex-wrap: nowrap;
    }

    .sdnh-share-btn-wide {
        min-width: 0;
        flex: 0 0 calc(50% - 4px);
        max-width: calc(50% - 4px);
        height: 34px;
        border-radius: 10px;
        font-size: 14px;
        padding: 0 10px;
    }

    .sdnh-manual-cta {
        margin-top: 48px;
        padding-top: 0;
    }

    .sdnh-manual-cta-inner {
        border-radius: 12px;
    }

    .sdnh-manual-cta-content {
        padding: 24px 20px;
    }

    .sdnh-manual-cta-title {
        font-size: 22px;
    }

    .sdnh-manual-cta-desc {
        font-size: 15px;
        line-height: 1.7;
    }

    .sdnh-manual-cta-button {
        width: 100%;
        justify-content: center;
        padding: 13px 18px;
    }

    .single-post-tags {
        gap: 8px;
        margin-top: 16px;
    }

    .single-post-tags-above-share {
        margin: 30px 0 12px;
    }

    .single-post-tag {
        font-size: 0.9375rem;
    }

    .single-post-tags-icon {
        font-size: 12px;
    }
}

/* Table of Contents - Inline (Compact) */
.toc-container {
    background: #f0f0f0;
    border-left: 4px solid #cca471;
    border-radius: 4px;
    padding: 12px 35px;
    margin: 20px 0;
    margin-left: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.toc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toc-title {
    font-size: 15px;
    font-weight: 700;
    color: #495057;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.toc-toggle {
    background: #eee;
    border: none;
    color: #444;
    cursor: pointer;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 3px;
    font-weight: 600;
    transition: all 0.2s;
}

.toc-toggle:hover {
    background: #c40d2e;
    color: #fff;
}

.toc-content {
    font-size: 13.5px;
}

.toc-content ul,
.toc-content ol {
    list-style: none;
    padding: 0;
    margin-top: 10px;
}

.toc-content li {
    margin-bottom: 4px;
}

.toc-content a {
    color: #555;
    text-decoration: none;
    transition: all 0.2s;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.4;
    padding: 2px 0;
}

.toc-content .toc-item-number {
    flex: 0 0 20px;
    color: #8a6511;
    font-weight: 700;
}

.toc-content .toc-item-label {
    flex: 1 1 auto;
    min-width: 0;
}

.toc-content a:hover {
    color: #cca471;
    padding-left: 3px;
}

/* TOC Hierarchy */
.toc-content .toc-h2 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 5px;
}

.toc-content .toc-h3 {
    font-size: 0.95em;
    padding-left: 12px;
}

.toc-content .toc-h4 {
    font-size: 0.9em;
    padding-left: 24px;
    opacity: 0.8;
}

.toc-content .toc-h5 {
    font-size: 12px;
    padding-left: 45px;
}

/* TOC active state */
.toc-content a.active {
    color: #cca471;
    font-weight: 600;
}

/* Sticky TOC Sidebar */
.toc-sidebar {
    position: fixed;
    left: 20px;
    top: 100px;
    width: 280px;
    max-height: calc(100vh - 150px);
    overflow-y: auto;
    background: #fff;
    border: 1px solid #eee;
    border-left: 3px solid #e9ecef;
    border-radius: 4px;
    padding: 15px;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), opacity 0.3s ease;
}

/* Position sidebar next to content on wide screens */
/* Position sidebar next to content on wide screens - REMOVED for far-left alignment */
/* @media screen and (min-width: 1500px) { ... } */

.toc-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e9ecef;
}

.toc-sidebar-title {
    font-size: 16px;
    font-weight: bold;
    color: #495057;
    margin: 0;
}

.toc-sidebar-toggle {
    background: none;
    border: none;
    color: #0066cc;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
}

.toc-sidebar-toggle:hover {
    text-decoration: underline;
}

.toc-sidebar-content {
    font-size: 14px;
}

.toc-sidebar-content ul,
.toc-sidebar-content ol {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-sidebar-content li {
    margin-bottom: 6px;
}

/* TOC Overlay */
.toc-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    z-index: 9998;
    /* Above header */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.toc-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Sticky TOC Sidebar */
.toc-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 350px;
    height: 100%;
    max-height: 100vh;
    overflow-y: auto;
    background: #fff;
    border: none;
    border-right: 3px solid #e9ecef;
    border-radius: 0;
    padding: 30px 20px;
    z-index: 9999;
    /* Highest priority */
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.15);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), opacity 0.3s ease;
    transform: translateX(-100%);
    opacity: 0;
    pointer-events: none;
}

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

/* Adjust for Admin Bar */
.admin-bar .toc-sidebar {
    top: 32px;
    height: calc(100% - 32px);
}

.admin-bar .toc-overlay {
    top: 32px;
    height: calc(100% - 32px);
}

@media screen and (max-width: 782px) {

    .admin-bar .toc-sidebar,
    .admin-bar .toc-overlay {
        top: 46px;
        height: calc(100% - 46px);
    }
}

.toc-sidebar.hidden {
    transform: translateX(-100%);
    opacity: 0;
    pointer-events: none;
}

/* Position sidebar next to content on wide screens - REMOVED as requested far left */

.toc-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.toc-sidebar-title {
    font-size: 20px;
    font-weight: 700;
    color: #495057;
    margin: 0;
}

.toc-sidebar-toggle {
    background: linear-gradient(135deg, #1f1f1f 0%, #cca471 100%);
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.2s;
    box-shadow: 0 4px 10px rgba(197, 143, 22, 0.18);
}

.toc-sidebar-toggle:hover {
    background: linear-gradient(135deg, #151515 0%, #d9a229 100%);
    color: #fff;
}

.toc-sidebar-content a {
    color: #212529;
    text-decoration: none;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    transition: color 0.3s ease;
}

.toc-sidebar-content .toc-item-number {
    flex: 0 0 22px;
    color: #8a6511;
    font-weight: 700;
}

.toc-sidebar-content .toc-item-label {
    flex: 1 1 auto;
    min-width: 0;
}

.toc-sidebar-content a:hover {
    color: #cca471;
}

.toc-sidebar-content .toc-h2 {
    font-size: 14px;
    font-weight: bold;
}

.toc-sidebar-content .toc-h3 {
    font-size: 13px;
    padding-left: 15px;
}

.toc-sidebar-content .toc-h4 {
    font-size: 12px;
    padding-left: 30px;
}

.toc-sidebar-content .toc-h5 {
    font-size: 12px;
    padding-left: 45px;
}

/* TOC Sidebar Toggle Button */
.toc-sidebar-toggle-btn {
    position: fixed;
    left: 0;
    /* Far left */
    top: 25%;
    transform: translateY(-50%);
    min-width: 45px;
    height: 50px;
    padding: 0 15px 0 10px;
    background: rgba(108, 117, 125, 0.95);
    color: #fff;
    border-left: none;
    border-radius: 0 25px 25px 0;
    /* Only right corners rounded */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 99;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    white-space: nowrap;
    border: none;
}

@media screen and (max-width: 1500px) {

    /* Ensure toggle btn stays far left even on smaller desktops */
    .toc-sidebar-toggle-btn {
        left: 0 !important;
    }
}

@media screen and (max-width: 1280px) {
    .toc-sidebar {
        width: 240px;
        left: 10px;
    }
}

@media screen and (max-width: 1024px) {
    .toc-sidebar {
        /* Allow sidebar on tablet/mobile but adjust width */
        width: 260px;
        left: 0;
        border-radius: 0 8px 8px 0;
    }

    .toc-sidebar-toggle-btn {
        display: flex;
        /* Force show toggle button initially, but allow JS to hide */
        left: 10px;
    }
}

@media screen and (max-width: 768px) {
    .toc-sidebar {
        width: 100%;
        /* Full screen as requested */
    }

    .toc-sidebar-toggle-btn {
        top: 25%;
        width: 42px;
        height: 42px;
        min-height: 42px;
        min-width: 42px;
        padding: 0;
        background: rgba(108, 117, 125, 0.55);
        border-radius: 0 8px 8px 0;
        left: 0;
        justify-content: center;
    }

    .toc-sidebar-toggle-btn i {
        font-size: 16px;
        margin-bottom: 0;
    }

    .toc-sidebar-toggle-btn .btn-text {
        display: none;
    }

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

@media screen and (max-width: 768px) {
    .single-post-title {
        font-size: 32px;
    }

    .single-post-meta {
        font-size: 14px;
        gap: 15px;
    }

    .single-post-excerpt {
        padding: 20px;
        font-size: 16px;
    }

    .single-post-content {
        font-size: 16px;
    }

    .related-posts {
        margin-top: 30px;
        padding: 20px -15px;
        /* Negative margin hack or just full width? */
        /* Better: utilize the container width */
        margin-left: -15px;
        margin-right: -15px;
        padding: 25px 15px;
        border-top: 2px solid #cca471;
        /* Add a colored top border for Flair */
    }

    .related-posts-title {
        font-size: 24px;
    }

    .related-posts-list {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 18px !important;
    }

    .related-post-card {
        display: flex !important;
        flex-direction: row !important;
        align-items: flex-start !important;
        margin-bottom: 18px !important;
        padding-bottom: 18px !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
    }

    .related-post-thumb {
        width: 36% !important;
        margin-bottom: 0 !important;
    }

    .related-post-content {
        width: 64% !important;
        padding-left: 14px !important;
        padding-top: 0 !important;
    }
}

/* === Page & Post Content Width (Desktop) === */
@media (min-width: 992px) {

    /* Constrain the main wrapper itself */
    .page-content,
    main.single-post,
    body.page .site-content,
    body.single .site-content {
        max-width: 800px !important;
        width: 100% !important;
        margin-left: auto !important;
        margin-right: auto !important;
        display: block !important;
    }

    /* Constrain internal containers just in case */
    .page-content .container,
    .elementor-section.elementor-section-boxed>.elementor-container {
        max-width: 100% !important;
    }

    /* Ensure only content containers are auto-width inside the 900px wrapper, 
       BUT DO NOT target global .container which affects footer */
    body.single .site-content main .container {
        max-width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* Ensure Related Posts also respect width if they are outside main container */
    .related-posts .container,
    .related-posts {
        max-width: 100% !important;
    }
}

/* === Center Images in Content === */
.page-entry-content img,
.single-post-content img {
    display: block;
    margin-left: auto;
    margin-right: auto;
    max-width: 100%;
    height: auto;
}


/* Mobile specific gap reduction */
@media screen and (max-width: 768px) {


    .single-post-header {
        margin-top: 5px !important;
        margin-bottom: 30px !important;
    }

    .single-post-title {
        font-size: 24px !important;
        /* Ensure title isn't too huge on mobile */
        margin-top: 0 !important;
    }

    /* Fix full-width issue on mobile: Add horizontal padding */
    .page-content .container,
    main.single-post .container,
    .page-entry-content,
    .blog-archive .container,
    .course-archive-page .container {
        padding-left: 20px !important;
        padding-right: 20px !important;
        width: auto !important;
        /* Allow padding to work on box-sizing */
    }
}
