/* Single Post Template Styles */
.single-post-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
}

/* Hero Section */
.single-hero-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 40px;
    padding-top: 20px;
}

/* Hide toggle icon by default (Desktop) */
.toc-toggle-icon {
    display: none !important;
    /* Force hide on desktop */
}

.hero-image-wrapper {
    width: 80%;
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.hero-image-wrapper img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    max-height: 60vh;
    /* Prevent it from being too tall */
}

.single-post-title {
    font-size: 48px;
    line-height: 1.05;
    text-align: center;
    margin-top: 32px;
    margin-bottom: 16px;
    font-family: 'Josefin Sans', sans-serif;
    width: 80%;
}

/* Main Layout Grid */
.single-post-layout {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 20px 60px 20px;
    /* User requested padding. Added 20px side padding. */
}

/* Center content when TOC is not available */
.single-post-layout.no-toc {
    justify-content: center;
}

.single-post-layout.no-toc .single-post-content-col {
    width: 100%;
    max-width: 850px; /* Optimal reading width when centered */
    padding-left: 0;
    padding-right: 0;
}

.single-post-layout.no-toc .single-post-whitespace-col {
    display: none;
}

/* Left Column: TOC */
.single-post-toc-col {
    width: 16%;
    /* User requested 16% */
    padding-right: 20px;
}

.toc-sticky-wrapper {
    position: sticky;
    top: 100px;
    /* Adjust based on sticky header height */
    padding: 20px 0;
}

.toc-title {
    font-size: 18px;
    font-weight: 700;
    /* User requested 700 */
    margin-bottom: 15px;
    font-family: 'Josefin Sans', sans-serif;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-list li {
    margin-bottom: 10px;
}

.toc-list a {
    text-decoration: none;
    color: #1D1D1D;
    font-size: 14px;
    font-family: 'Josefin Sans', sans-serif;
    /* User Requested (Moat Task 46): Use Josefin Sans 400 */
    padding-left: 10px;
    /* "Add some padding left" */
    transition: color 0.3s ease;
    display: block;
    line-height: 1.4;
    font-weight: 400;
    /* User Requested (Moat Task 46): 400 weight */
}

.toc-list a:hover,
.toc-list a.active {
    /* "remove the hover state" - User likely means don't change appearance on hover, or keep it very minimal?
       If I remove this block, active state won't show.
       User task: "remove the hover state". I will remove :hover color change, but keep .active for usability?
       Task text: "remove the hover state". Literal interpretation: no change on hover. */
    color: #1D1D1D;
    /* Keep same color on hover? Or just no special hover effect. */
    font-weight: normal;
    /* Remove bold */
}

/* Re-adding active state solely if needed, but if user wants "remove hover state", they might want a static list. 
   However, "Thi A hein" task `a[href="#heading-0"]` suggests specific item targeting. 
   I'll apply "remove hover state" generally to correct the "Use secondary font" requirement. 
   Wait, the task says "Use secondary font". */
.toc-list a.toc-link-item {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 400;
}

/* Center Column: Content */
.single-post-content-col {
    width: 64%;
    /* Moat Task 46: Add padding */
    padding-left: 24px;
    padding-right: 48px;
}

.post-content {
    font-family: 'Jost', sans-serif;
    font-size: 18px;
    line-height: 1.6;
    color: #1D1D1D;
}

.post-content h2,
.post-content h3,
.post-content h4 {
    font-family: 'Josefin Sans', sans-serif;
    margin-top: 40px;
    margin-bottom: 20px;
    color: #000;
}

.post-content p {
    margin-bottom: 24px;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
}

/* Right Column: Whitespace */
.single-post-whitespace-col {
    width: 10%;
    /* User requested 10% */
}

/* Mobile Layout */
@media (max-width: 768px) {
    .single-hero-section {
        padding-top: 0;
        margin-bottom: 20px;
    }

    .hero-image-wrapper {
        width: calc(100% - 40px);
        margin: 0 auto;
        border-radius: 16px;
        /* User requested rounded edges */
        box-shadow: none;
    }

    .single-post-title {
        width: 90%;
        font-size: 32px;
        order: 3;
        /* Title comes after Image and TOC */
    }

    .single-post-layout {
        flex-direction: column;
        padding: 0 20px;
    }

    .single-post-toc-col {
        width: 100%;
        padding-right: 0;
        order: 2;
        /* TOC comes second */
        margin-bottom: 30px;
    }

    .toc-sticky-wrapper {
        position: relative;
        top: 0;
        background: #f9f9f9;
        padding: 15px;
        border-radius: 8px;
    }

    .toc-header-mobile {
        display: flex;
        justify-content: space-between;
        align-items: center;
        cursor: pointer;
    }

    .toc-title {
        margin-bottom: 0;
        /* Remove margin to ensure vertical centering */
    }

    .toc-content-mobile {
        display: none;
        /* Hidden by default on mobile */
        margin-top: 15px;
    }

    .toc-content-mobile.show {
        display: block;
    }

    .toc-toggle-icon {
        display: block !important;
        /* Show on mobile */
        transition: transform 0.3s ease;
    }

    .toc-toggle-icon.rotate {
        transform: rotate(180deg);
    }

    .single-post-content-col {
        width: 100%;
        order: 4;
        /* Content comes last */
        padding-left: 0;
        /* Reset for mobile */
        padding-right: 0;
        /* Reset for mobile */
    }

    .single-post-whitespace-col {
        display: none;
    }
}