/**
 * CSS Styling for Single Post with Sticky Table of Contents
 */

/* Main Layout Grid */
.ns-single-post-grid-container {
    max-width: 100%;
    margin: 0 auto 80px auto;
    padding: 40px 40px;
    box-sizing: border-box;
    font-family: 'Metropolis', sans-serif;
}

.ns-single-post-grid {
    display: flex;
    gap: 48px;
    position: relative;
    padding: 0px 155px;
}

/* Left Column - Content */
.ns-single-post-left {
    width: 80%;
    box-sizing: border-box;
	margin:auto;
}

/* Right Column - Table of Contents */
.ns-single-post-right {
    width: 20%;
    box-sizing: border-box;
	display:none;
}

/* Sticky TOC Box */
.ns-toc-container {
    position: sticky;
    top: 20px;
    /* Adjust based on the theme header height */
    background-color: #fcfcfc;
    padding: 0px;
    box-sizing: border-box;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
}

.ns-toc-title {
    font-size: 36px;
    font-weight: 600;
    color: #00224D;
    margin: 0 0 32px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 0px;
}

.ns-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    border-radius: 8px;
    border: 1px solid var(--Stroke-Color-Soft-grey, #E1E1E1);
}

.ns-toc-item {
    margin-bottom: 12px;
}

.ns-toc-item:last-child {
    margin-bottom: 0;
}

.ns-toc-link {
    display: block;
    color: var(--Text-Color-Black-50, rgba(29, 29, 29, 0.50));
    text-box: trim-both cap alphabetic;
    font-family: var(--Body-Family, Metropolis);
    font-size: var(--Body-B3, 16px);
    font-style: normal;
    font-weight: 400;
    line-height: var(--Body-Line-height-3, 22px);
    letter-spacing: var(--Body-Letter-spacing, 0);
    transition: all 0.3s ease;
    padding: 24px 12px;
    border-bottom: 1px solid var(--Stroke-Color-Soft-grey, #E1E1E1);
}

.ns-toc-link.active {
    color: var(--Text-Color-Black, #1D1D1D);
    text-box: trim-both cap alphabetic;
    font-family: var(--Body-Family, Metropolis);
    font-size: var(--Body-B3, 20px);
    font-style: normal;
    font-weight: 400;
    line-height: var(--Body-Line-height-3, 22px);
    /* 137.5% */
    letter-spacing: var(--Body-Letter-spacing, 0);
    background: var(--Stroke-Color-Soft-grey, #E1E1E1);
    padding: 24px 12px;
}

/* Content Sections Styling */
.ns-post-section {
    margin-bottom: 80px;
    padding-bottom: 0px;
    border-bottom: 1px solid #f0f0f0;
}

.ns-post-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.ns-post-section-title {
    color: var(--Text-Color-Black, #1D1D1D);
    text-box: trim-both cap alphabetic;
    font-family: var(--Heading-Family, Metropolis);
    font-size: var(--Heading-H2, 36px);
    font-style: normal;
    font-weight: 600;
    line-height: var(--Heading-Line-height-2, 36px);
    /* 180% */
    letter-spacing: var(--Heading-Letter-spacing, 0);
    margin-bottom: 32px;
}

.ns-post-section-content {
    color: var(--Text-Color-Black, #1D1D1D);
    text-box: trim-both cap alphabetic;
    font-family: var(--Body-Family, Metropolis);
    font-size: var(--Body-B3, 20px);
    font-style: normal;
    font-weight: 400;
    line-height: var(--Body-Line-height-2, 28px);
    /* 175% */
    letter-spacing: var(--Body-Letter-spacing, 0);
}

.ns-post-section-content p {
    margin: 0 0 20px 0;
}

.ns-post-section-content p:last-child {
    margin-bottom: 0;
}

.ns-post-section-img-wrapper {
    margin-top: 24px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #eaeaea;
    background: #fff;
    padding: 6px;
    box-sizing: border-box;
}

.ns-post-section-img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 4px;
    transition: transform 0.4s ease;
}

.ns-post-section-img-wrapper:hover .ns-post-section-img {
    transform: scale(1.02);
}

/* --- Tablet Responsive Layout --- */
@media (max-width: 1024px) {
    .ns-single-post-grid-container {
        margin: 0 auto 40px auto;
    }

    .ns-single-post-grid {
        flex-direction: column;
        gap: 32px;
        padding: 0px;
    }

    .ns-single-post-left {
        width: 100%;
        order: 2;
    }

    .ns-single-post-right {
        width: 100%;
        order: 1;
    }

    .ns-toc-container {
        position: static;
        width: 100%;
        max-height: none;
    }
}

/* --- Mobile Responsive Layout --- */
@media (max-width: 768px) {
    .ns-single-post-grid-container {
        margin: 0 auto 30px auto;
        padding: 0 16px;
    }

    .ns-toc-container {
        padding: 16px;
    }

    .ns-toc-title {
        font-size: 16px;
        margin-bottom: 12px;
    }

    /* Horizontal list on mobile */
    .ns-toc-list {
        display: flex;
        overflow-x: auto;
        white-space: nowrap;
        gap: 12px;
        padding-bottom: 8px;
        scrollbar-width: none;
        /* Firefox */
        -webkit-overflow-scrolling: touch;
    }

    .ns-toc-list::-webkit-scrollbar {
        display: none;
        /* Safari/Chrome */
    }

    .ns-toc-item {
        margin-bottom: 0;
    }

    .ns-toc-link {
        border-left: none;
        border-bottom: 2px solid transparent;
        padding-left: 0;
        padding-bottom: 6px;
    }

    .ns-toc-link:hover {
        border-bottom-color: rgba(0, 34, 77, 0.3);
    }

    .ns-toc-link.active {
        border-bottom-color: #3a86ff;
    }

    .ns-post-section {
        margin-bottom: 40px;
        padding-bottom: 24px;
    }

    .ns-post-section-title {
        font-size: 24px;
        line-height: 32px;
    }
}

/* --- Header Styling Overrides for Single Posts --- */
body.single-post .site-header,
body.single .site-header {
    background-color: #ffffff !important;
    border-bottom: 1px solid #eaeaea;
    position: relative !important;
    padding-top: 24px !important;
    padding-bottom: 24px !important;
}

/* Sticky navy bar still applies if these pages use fixed positioning elsewhere */
body.single-post .site-header.is-scrolled,
body.single .site-header.is-scrolled {
    background-color: #ffffff !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

body.single-post .site-header .light-logo,
body.single .site-header .light-logo {
    display: none !important;
}

body.single-post .site-header .dark-logo,
body.single .site-header .dark-logo {
    display: inline-block !important;
}

body.single-post .mobile-svg-logo svg path,
body.single .mobile-svg-logo svg path {
    fill: #00224D !important;
}

body.single-post .main-navigation>ul>li>a,
body.single .main-navigation>ul>li>a {
    color: #00224D !important;
}

body.single-post .main-navigation>ul>li.menu-item-has-children>a::after,
body.single .main-navigation>ul>li.menu-item-has-children>a::after {
    background-image: url('data:image/svg+xml;utf8,<svg width="12" height="12" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M6 9L12 15L18 9" stroke="%2300224D" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/></svg>') !important;
}

body.single-post .main-navigation>ul>li:hover>a,
body.single .main-navigation>ul>li:hover>a {
    color: #3a86ff !important;
}

body.single-post .mobile-menu-toggle svg path,
body.single .mobile-menu-toggle svg path {
    stroke: #00224D !important;
}

/* --- Hero Banner & Title Layout --- */
.ns-post-hero-section {
    background-color: #ffffff;
    padding-top: 40px;
    padding-bottom: 80px;
}

.ns-post-hero-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 40px;
    box-sizing: border-box;
}

.ns-post-hero-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 56px;
    text-box: trim-both cap alphabetic;
    gap: 32px;
}

.ns-post-hero-left {
    flex: 1;
}

.ns-post-hero-title {
    color: var(--Text-Color-Black, #1D1D1D);
    text-box: trim-both cap alphabetic;
    font-family: var(--Title-Family, Metropolis);
    font-size: var(--Title-T2, 64px);
    font-style: normal;
    font-weight: 400;
    line-height: var(--Title-Line-height-2, 72px);
    letter-spacing: var(--Title-Letter-spacing, -2px);
    width: 70%
}

.ns-post-hero-right {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-shrink: 0;
}

.ns-post-meta-item {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-family: 'Metropolis', sans-serif;
    gap: 14px;
}

.ns-post-meta-label {
    color: var(--Fill-color-Dark-grey, #616161);
    text-box: trim-both cap alphabetic;
    font-family: var(--Body-Family, Metropolis);
    font-size: 14px;
    font-style: normal;
    font-weight: 400;
    line-height: var(--Body-Line-height, 40px);
    /* 285.714% */
    letter-spacing: var(--Body-Letter-spacing, 0);
    text-transform: uppercase;
}

.ns-post-meta-value {
    color: var(--Text-Color-Dark-blue, #00224D);
    text-box: trim-both cap alphabetic;
    font-family: var(--Title-Family, Metropolis);
    font-size: 20px;
    font-style: normal;
    font-weight: 500;
    line-height: var(--Title-Line-height-2, 72px);
    /* 360% */
    letter-spacing: var(--Title-Letter-spacing, -2px);
}

.ns-post-meta-divider {
    width: 1px;
    height: 32px;
    background-color: #eaeaea;
}

.ns-post-hero-featured-image {
    width: 100%;
    overflow: hidden;
}

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

/* Tablet Layout overrides for hero */
@media (max-width: 1024px) {
    .ns-post-hero-container {
        padding: 0 0px;
    }

    .ns-post-hero-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 0px 40px;
        gap: 40px;
    }

    .ns-post-hero-featured-image img {
        width: 100%;
        height: 100%;
    }

    .ns-post-hero-featured-image {
        height: 800px;
    }

    .ns-post-hero-title {
        width: 100%;
        font-size: var(--Display-D1, 56px);
        font-style: normal;
        font-weight: 400;
        line-height: var(--Display-Line-height, 64px);
        /* 114.286% */
        letter-spacing: var(--Letter-spacing-0, 0);
    }
}

@media (max-width: 768px) {
    .ns-post-hero-section {
        padding-top: 24px;
        padding-bottom: 40px;
    }

    .ns-post-hero-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
        border-bottom: 1px solid #eaeaea;
        padding-bottom: 40px;
    }

    .ns-post-hero-title {
        font-size: 32px;
        line-height: 40px;
    }

    .ns-post-hero-right {
        width: 100%;
        justify-content: flex-start;
        gap: 40px;
    }

    .ns-post-meta-item {
        align-items: flex-start;
    }
}