/*
 * Styles for the custom single post template in the epodBlog theme.
 */
/* --- 4. Dynamic Hero Font Colors --- */
/* This section allows hero text to be dark when on a light background */
.article-hero.dark-text .hero-title,
.article-hero.dark-text .hero-subtitle {
    color: #1a1a1a; /* Dark text from your main style.css */
}

.article-hero.dark-text .hero-category {
    color: #1a1a1a;
    border-bottom-color: #1a1a1a; /* Change underline to match text */
}

/* Ensure the default white text is still applied when needed */
.article-hero.light-text .hero-title,
.article-hero.light-text .hero-subtitle,
.article-hero.light-text .hero-category {
    color: #ffffff;
}

.article-hero.light-text .hero-category {
    border-bottom-color: #ffffff;
}
/* --- Main Wrapper & Static Background --- */
.single-post-wrapper {
    /* New blended background using your color palette */
    /* background-color: #000000; /* Fallback for older browsers */
    /* background: radial-gradient(ellipse at top center, #df0050 0%, #00c9d3 35%, #000000 80%); */ */
}

/* --- 1. Hero Section --- */
.article-hero {
    height: 95vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.5rem;
    color: #ffffff;
    /* background-color: #df0050; */
}
.article-hero-content {
    max-width: 56rem; /* 896px */
}
.hero-category {
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    border-bottom: 2px solid #fff;
    display: inline-block;
    padding-bottom: 0.5rem;
}
.hero-title {
    font-size: 3rem; /* 48px */
    font-weight: 700;
    line-height: 1.1;
    color: #fff;
}
.hero-subtitle {
    font-size: 1.25rem; /* 20px */
    font-weight: 400;
    color: #fff;
    opacity: 0.9;
    margin-top: 1.5rem;
    max-width: 44rem; /* 704px */
    margin-left: auto;
    margin-right: auto;
}
@media (min-width: 768px) {
    .hero-title { font-size: 4.5rem; } /* 72px */
    .hero-subtitle { font-size: 1.5rem; } /* 24px */
}

/* --- 2. Main Article & Overlap Effect --- */
.article-main-wrapper {
    padding: 0 1.5rem;
    /* background: linear-gradient(to bottom, #df0050 0%, #00c9d3 30%, #000000 90%); */

}
.featured-image-wrapper {
    width: 90%; /* 1024px */
    max-width: 1400px;
    margin: 0 auto;
    padding-top: 6rem; /* Space above the image */
    margin-bottom: -15rem;
    position: relative;
    z-index: 10;
}
.featured-image-wrapper img {
    width: 100%;
    height: auto;
    display: block;
}
.article-content-box {
    width: 100%;
    max-width: 1400px;
    background-color: #ffffff;
    margin-left: auto;
    margin-right: auto;
    padding: 15rem 2rem !important;
    position: relative;
    z-index: 2;
    /* margin-top: -8rem; /* THIS LINE IS REMOVED */ 
    margin-top: 4rem; /* We add a positive margin for spacing */
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
}
@media (min-width: 768px) {
    .article-content-box { width: 100%; padding: 5rem 4rem; }
}

/* --- Typography within the Article Body --- */
.article-body {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #374151;
}
.article-body p:first-of-type {
    font-size: 1.25rem;
    line-height: 1.7;
    color: #111827;
}
.article-body h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
    margin-top: 3.5rem;
    margin-bottom: 1.5rem;
}
.article-body .wp-block-pullquote p {
    font-size: 2.25rem !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    color: #df0050 !important; /* Your theme's pink */
    border: none !important;
    padding: 0 !important;
}
.article-body .wp-block-pullquote {
    border-color: #df0050 !important;
    margin: 4rem auto;
}
.article-body a {
    color: #df0050;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* --- 3. Author Bio & CTA Sections --- */
.author-bio-section,
.article-cta-section {
    padding: 8rem 1.5rem;
    text-align: center;
    color: #fff;
}
.author-bio-content,
.article-cta-content {
    max-width: 44rem;
    margin: 0 auto;
}
.author-bio-content img.avatar {
    border-radius: 50%;
    border: 4px solid #fff;
    margin-bottom: 1.5rem;
}
.author-name {
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
}
.author-description {
    font-size: 1.125rem;
    margin-top: 1rem;
    opacity: 0.9;
}
.article-cta-section h2 {
    font-size: 3rem;
    font-weight: 700;
    color: #fff;
}
.cta-button {
    display: inline-block;
    background-color: #fff;
    color: #000;
    font-weight: 600;
    padding: 1rem 3rem;
    border-radius: 50px;
    text-decoration: none;
    margin-top: 2.5rem;
    transition: transform 0.2s ease, background-color 0.2s ease;
}
.cta-button:hover {
    background-color: #f0f0f0;
    transform: translateY(-3px);
}
@media (min-width: 768px) {
    .article-cta-content h2 { font-size: 4rem; }
}

/* ==========================================================================
   NEW: Mobile Responsive Adjustments
========================================================================== */
@media (max-width: 767px) {

    /* 1. Adjust Hero Section Typography */
    .hero-title {
        font-size: 2.5rem !important; /* Make title smaller on mobile */
    }
    .hero-subtitle {
        font-size: 1.1rem !important; /* Make subtitle smaller on mobile */
    }

    /* 2. Reduce the Dramatic Image Overlap for Mobile */
    .featured-image-wrapper {
        margin-bottom: -6rem; /* Reduce negative margin */
    }
    .article-content-box {
        /* Adjust padding to match new overlap, using !important to override original style */
        padding: 8rem 1.5rem 3rem 1.5rem !important;
    }

    /* 3. Adjust Typography in Article Body */
    .article-body h2 {
        font-size: 1.75rem; /* Make headings smaller */
    }
    .article-body .wp-block-pullquote p {
        font-size: 1.8rem !important; /* Make pullquotes smaller */
    }

    /* 4. Reduce Vertical Spacing in Lower Sections */
    .author-bio-section,
    .article-cta-section {
        padding: 4rem 1.5rem; /* Reduce top and bottom padding */
    }

    /* 5. Adjust CTA Heading and Button */
    .article-cta-section h2 {
        font-size: 2.25rem; /* Make CTA heading smaller */
    }
    .cta-button {
        padding: 0.8rem 2rem; /* Make button padding smaller */
    }
}

/* ===========================================================================
   NEW: Responsive Table of Contents (TOC)
========================================================================== */

/* 1. Mobile-First Default Styles (Accordion View) */
.toc-layout-grid {
    display: block; /* Stacks TOC on top of content on mobile */
}

.toc-container {
    width: 100%;
    margin-bottom: 2.5rem; /* Space between TOC and article body on mobile */
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background-color: #f8f9fa;
}

.toc-container h2 {
    font-size: 1.1rem !important; /* Added !important as requested */
    font-weight: 700;
    color: #1a1a1a !important; /* Added !important as requested */
    margin: 0;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer; /* Indicates it's clickable */
    position: relative;
}

/* Add a dropdown arrow icon */
.toc-container h2::after {
    content: '▼';
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

/* Rotate arrow when open */
.toc-container.is-open h2::after {
    transform: translateY(-50%) rotate(180deg);
}

/* Hide the TOC navigation by default on mobile */
#toc-nav {
    display: none;
    padding: 0.5rem 1.5rem 1.5rem 1.5rem;
}

.toc-container.is-open #toc-nav {
    display: block; /* Show nav when accordion is open */
}

.toc-container ul {
    list-style: none;
    padding: 0;
    margin: 10px 0 0 0;
    border-left: 2px solid #e5e7eb;
}

.toc-container ul ul {
    border-left: none;
    padding-left: 1rem;
    margin-top: 5px;
}

.toc-container li a {
    display: block;
    text-decoration: none;
    color: #4b5563;
    padding: 8px 15px;
    font-size: 0.95rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.toc-container li a.toc-h3 {
    padding-top: 5px;
    padding-bottom: 5px;
    font-weight: 400;
}

.toc-container li a:hover {
    color: #1a1a1a;
}

.toc-container li a.main-active {
    color: #df0050;
    font-weight: 700 !important;
    border-left-color: #df0050;
}

.toc-container .toc-h3.child-active {
    color: #1a1a1a;
    font-weight: 600 !important;
}

/* 2. Desktop Styles (Sticky Sidebar View) */
@media (min-width: 1024px) {
    /* Restore grid layout */
    .toc-layout-grid {
        display: grid;
        grid-template-columns: 300px 1fr;
        align-items: start;
        gap: 4rem;
    }

    /* Restore sidebar styles */
    .toc-container {
        width: 300px;
        margin-bottom: 0;
        position: sticky;
        top: 60px;
        max-height: calc(100vh - 120px);
        overflow-y: auto;
        border: none; /* Remove border/background for desktop view */
        border-radius: 0;
        background-color: transparent;
    }

    .toc-container h2 {
        cursor: default; /* Not clickable on desktop */
        padding: 0;
        padding-bottom: 10px;
        background-color: transparent;
    }

    /* Hide dropdown arrow on desktop */
    .toc-container h2::after {
        display: none;
    }
    
    /* Ensure the nav is always visible on desktop */
    #toc-nav {
        display: block;
        padding: 0;
    }
}