/* ==========================================================================
   1. Global Reset & Typography
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #F4F0E8;
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
}

h2, h3, h4 {
    color: #0056b3;
    display: inline-block;
    padding-bottom: 5px;
}

h3 {
    font-size: 2.0rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

h4 {
    margin-bottom: 1.5rem;
    border-bottom: 3px solid #F2C14E;
    font-size: 1.15rem;
}

.section-label {
    text-align: center;
    font-family: 'Cinzel', serif;
    font-size: 1.15rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #0056b3;
    opacity: 0.75;
    display: block;
    width: 100%;
    margin: 2rem 0 1rem;
    position: relative;
}

.section-label::before,
.section-label::after {
    content: "";
    display: inline-block;
    width: 40px;
    height: 2px;
    background: #F2C14E;
    vertical-align: middle;
    margin: 0 10px;
    opacity: 0.9;
}

/* ==========================================================================
   1a. History & Trivia — Two-Column Layout with Timeline Sidebar
   ========================================================================== */
.history-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 2rem;
    align-items: start;
    overflow: visible;
}

.history-main {
    min-width: 0;
}

.history-sidebar {
    position: sticky;
    top: 1rem;
    align-self: start;

    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    overscroll-behavior: contain;

    background: #0B1F3A;
    border: 2px solid #F2C14E;
    border-radius: 15px;
    padding: 1.25rem 1.1rem 1.25rem 1.25rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.12);

    scrollbar-width: thin;
    scrollbar-color: #F2C14E #0B1F3A;
}

.history-sidebar::-webkit-scrollbar {
    width: 8px;
}

.history-sidebar::-webkit-scrollbar-track {
    background: #0B1F3A;
    border-radius: 10px;
}

.history-sidebar::-webkit-scrollbar-thumb {
    background: #F2C14E;
    border-radius: 10px;
}

.history-sidebar::-webkit-scrollbar-thumb:hover {
    background: #d9a900;
}

.sidebar-title {
    display: block;
    font-family: 'Cinzel', serif;
    font-size: 1.05rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #F2C14E;
    text-align: center;
    margin: 0 0 1.4rem;
    padding-bottom: 0.85rem;
    border-bottom: 2px solid rgba(242, 193, 78, 0.4);
}

.timeline-list {
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
}

.timeline-list::before {
    content: "";
    position: absolute;
    left: 5px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: rgba(242, 193, 78, 0.35);
}

.timeline-list li {
    position: relative;
    padding-left: 26px;
    margin-bottom: 1.3rem;
    font-size: 0.83rem;
    line-height: 1.55;
    color: #F8F1E0;
}

.timeline-list li:last-child {
    margin-bottom: 0;
}

.timeline-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 4px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #F2C14E;
    box-shadow:
        0 0 0 3px #0B1F3A,
        0 0 0 4px rgba(242, 193, 78, 0.5);
}

.timeline-year {
    display: block;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    color: #F2C14E;
    font-size: 0.92rem;
    margin-bottom: 0.2rem;
}

/* The shared .intro-box padding uses a viewport-relative clamp() sized for
   full-width pages. Inside the narrower history-main column, that math still
   references the full browser width, so use fixed proportional padding here. */
.history-main .intro-box {
    padding: 25px 2rem;
}

/* Tablet / small desktop: move the timeline below the content */
@media (max-width: 1150px) {
    .history-layout {
        grid-template-columns: 1fr;
    }

    .history-main {
        max-width: 900px;
        width: 100%;
        margin: 0 auto;
    }

    .history-sidebar {
        position: static;
        max-height: none;
        overflow-y: visible;
        width: 100%;
        max-width: 900px;
        margin: 0 auto;
        padding: 1.5rem;
    }

    .timeline-list {
        columns: 2;
        column-gap: 2rem;
    }

    .timeline-list li {
        break-inside: avoid;
    }
}

@media (max-width: 650px) {
    .history-main .intro-box {
        padding: 25px 1.25rem;
    }

    .history-sidebar {
        padding: 1.25rem;
    }

    .timeline-list {
        columns: 1;
    }
}

/* ==========================================================================
   2. Global Header & Hero Section
   ========================================================================== */

#main-header {
    position: relative;
    background-image:
        url("images/theater_curtains.webp"),
        radial-gradient(1.5px 1.5px at 8% 20%, rgba(248,241,224,0.55), transparent),
        radial-gradient(1px 1px at 18% 55%, rgba(248,241,224,0.4), transparent),
        radial-gradient(2px 2px at 27% 15%, rgba(248,241,224,0.5), transparent);
        opacity: 90%;
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    padding: 3rem 1rem 2.5rem; 
    text-align: center;
}

#main-header::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: #F2C14E;
    opacity: 0.95;
}

.marquee-frame {
    position: relative;
    display: inline-block;
    min-width: 1200px;
    padding: 1.5rem 3.5rem; 
    border: 4px solid #F2C14E;
    border-radius: 18px;
    background: rgba(11,31,58,.25);
    outline: 1px solid rgba(242, 193, 78, 0.45);
    outline-offset: -10px;
    box-shadow:
        /* outer glow — warm amber halo */
        0 0 18px 4px rgba(242, 193, 78, 0.45),
        /* mid glow — slightly tighter, brighter */
        0 0 8px 2px rgba(242, 193, 78, 0.65),
        /* inner glow — pressed against the border edge */
        inset 0 0 12px 2px rgba(242, 193, 78, 0.18);
}

#main-header a { text-decoration: none; color: inherit; }

#main-header h1 {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 4.2rem;
    letter-spacing: 0.04em;
    margin-bottom: 0;
    line-height: 1.1; 
    color: #F2C14E;
}

#main-header h2 {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 1.8rem;
    color: #F8F1E0;
    margin-top: 0; 
    line-height: 1.2;
}

.page-heading { 
    display: flex;
    flex-direction: column;
    align-items: center; 
    text-align: center; 
    margin: 1.25rem 0 1.5rem; 
}
        
.page-heading h3 { 
    border-bottom: 3px solid #F2C14E; 
    margin-bottom: 0; 
}

/* ==========================================================================
   3. Core Structural Wrappers
   ========================================================================== */
#content {
    max-width: 1400px;
    margin: 1.5rem auto 4rem;
    padding: 0 1.5rem;
    flex: 1 0 auto;
    width: 100%;
}

/* ==========================================================================
   4. Homepage (Index) Specific Styles & Resource Cards
   ========================================================================== */
.welcome-area, .intro-box {
    position: relative;
    background: #ffffff;
    padding: 25px clamp(1.25rem, 8vw, 150px);
    border-radius: 15px;
    border: 2px solid #F2C14E;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    margin-bottom: 2.5rem;
}

.welcome-area p, .intro-box p {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 0;
}

.welcome-area::before {
    content: "";
    position: absolute;
    top: 20px;
    left: -2px;
    width: 8px;
    height: 80px;
    background: #F2C14E;
    border-radius: 0 6px 6px 0;
}

.welcome-area h2 {
    margin-bottom: 0.5rem;
    border: none;
    display: block;
    text-align: center;
}
        
#welcome-wrap .welcome-area { margin-bottom: 0; }
.welcome-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.85rem;
}

/* Homepage-only correction button spacing: keeps the welcome box compact. */
#welcome-wrap .welcome-actions {
    margin-top: 0.45rem;
    line-height: 1;
}

#welcome-wrap .welcome-actions > .cta-button {
    margin: 0;
    min-height: 34px;
    height: auto;
    padding: 0.45rem 1.15rem;
    flex-shrink: 0;
}


@media (max-width: 650px) {
    #welcome-wrap .welcome-actions {
        margin-top: 0.35rem;
    }

    #welcome-wrap .welcome-actions > .cta-button {
        min-height: 32px;
        padding: 0.4rem 1rem;
        font-size: 0.9rem;
    }
}


/* Homepage welcome panel with featured posters inside the main box */
.homepage-welcome-panel {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr) 150px;
    grid-template-areas: "left intro right";
    align-items: center;
    gap: 1.6rem;
    width: 100%;
    margin-bottom: 2.5rem;
    padding: 1.6rem 1.8rem;
    background: #ffffff;
    border: 2px solid #F2C14E;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    overflow: hidden;
}

.homepage-welcome-panel #welcome-wrap {
    grid-area: intro;
    min-width: 0;
}

.homepage-welcome-panel #welcome-wrap .welcome-area {
    margin: 0;
    padding: 0 clamp(1rem, 2.4vw, 2.5rem);
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.homepage-welcome-panel #welcome-wrap .welcome-area::before {
    display: none;
}

.homepage-welcome-panel #welcome-wrap .welcome-area p {
    max-width: 820px;
    margin: 0 auto;
    text-align: center;
}

.homepage-welcome-panel .welcome-actions {
    max-width: 720px;
    margin-right: auto;
    margin-left: auto;
}


.homepage-feature {
    display: flex;
    justify-content: center;
    min-width: 0;
    text-align: center;
}

.homepage-feature-left {
    grid-area: left;
}

.homepage-feature-right {
    grid-area: right;
}

.homepage-feature a {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    max-width: 100%;
    color: #0056b3;
    text-decoration: none;
}

.homepage-feature-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    max-width: 100%;
    margin-bottom: 0.55rem;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    background: #0056b3;
    color: #F2C14E;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.055em;
    line-height: 1.2;
    text-transform: uppercase;
    white-space: nowrap;
}

.homepage-feature-poster {
    display: block;
    width: 138px;
    max-width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border: 3px solid #F2C14E;
    border-radius: 10px;
    background: #0B1F3A;
    box-shadow: 0 8px 18px rgba(11, 31, 58, 0.17);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.homepage-feature a:hover .homepage-feature-poster,
.homepage-feature a:focus-visible .homepage-feature-poster {
    transform: translateY(-3px);
    box-shadow: 0 11px 22px rgba(11, 31, 58, 0.24);
}

.homepage-feature a:focus-visible {
    outline: 2px solid #0056b3;
    outline-offset: 4px;
    border-radius: 10px;
}

@media (max-width: 1050px) {
    .homepage-welcome-panel {
        grid-template-columns: 120px minmax(0, 1fr) 120px;
        gap: 1.1rem;
        padding: 1.35rem 1.4rem;
    }

    .homepage-feature-poster {
        width: 108px;
    }

    .homepage-feature-label {
        font-size: 0.57rem;
        padding-inline: 0.5rem;
    }

    .homepage-welcome-panel #welcome-wrap .welcome-area {
        padding-inline: 0.75rem;
    }
}

@media (max-width: 760px) {
    .homepage-welcome-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-areas:
            "intro intro"
            "left right";
        gap: 1.15rem 0.8rem;
        padding: 1.2rem 1rem 1.3rem;
        margin-bottom: 1.5rem;
    }

    .homepage-welcome-panel #welcome-wrap .welcome-area {
        padding: 0;
    }

    .homepage-welcome-panel #welcome-wrap .welcome-area p {
        font-size: 0.98rem;
        line-height: 1.65;
    }

    .homepage-welcome-panel .welcome-actions {
        width: 100%;
    }

    .homepage-feature {
        align-items: flex-start;
    }

    .homepage-feature-poster {
        width: min(128px, 34vw);
    }

    .homepage-feature-label {
        font-size: 0.58rem;
    }
}

@media (max-width: 480px) {

    .homepage-welcome-panel {
        padding: 1rem 0.75rem 1.15rem;
        gap: 1rem 0.55rem;
    }

    .homepage-welcome-panel .welcome-actions {
        gap: 0.65rem;
    }

    .homepage-feature-poster {
        width: min(118px, 36vw);
    }

    .homepage-feature-label {
        max-width: 100%;
        padding: 0.28rem 0.45rem;
        font-size: 0.52rem;
        white-space: normal;
    }
}

.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin: 0 0 3rem;
}

.resource-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 2px solid #F2C14E; 
    text-align: center;
    position: relative;
}

.resource-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 6px;
    background: #F2C14E;
    border-radius: 0 0 6px 6px;
    opacity: 0.9;
    pointer-events: none;
}

.resource-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.12);
}

.resource-card a {
    text-decoration: none;
    color: #0056b3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 2rem;
    height: 100%;
}

.resource-card i {
    width: 150px; 
    height: 150px; 
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #F2C14E; 
    font-size: 4.5em; 
    color: #0056b3; 
    margin-bottom: 1.0rem;
    box-shadow: 0 4px 10px rgba(242, 193, 78, 0.3); 
    transition: all 0.3s ease;
}

.resource-card:hover i { 
    background: #0B1F3A; 
    color: #F2C14E; 
    transform: scale(1.08); 
    box-shadow: 0 6px 15px rgba(11, 31, 58, 0.3);
}

.resource-card span {
    position: relative;
    display: inline-block;
    padding-top: 1.25rem;
    font-family: 'Cinzel', serif;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.4;
    color: #0056b3;
}

.resource-card span::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 70px; 
    height: 4px; 
    background: #F2C14E;
}

.resource-count {
    display: block;
    font-size: 0.8rem;
    color: #0056b3;
    margin-top: 0.4rem;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    letter-spacing: 0.03em;
}

/* ==========================================================================
   5. Buttons & Navigation Links
   ========================================================================== */
.cta-button, .home-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    height: 36px;
    padding: 0 20px;
    margin: 5px 8px;
    background: #0056b3;
    border: 1px solid #0056b3;
    border-radius: 20px;
    color: #F2C14E;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cta-button:hover, .home-button:hover {
    background: #0B1F3A;
    color: #ffffff;
    border-color: #0B1F3A;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(11,31,58,0.15);
}

.horizontal-nav-wrapper {
    background: #ffffff;
    border: 2px solid #F2C14E;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 0 auto 2.5rem;
    max-width: 1400px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.03);
}

.horizontal-nav, .quick-links {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.horizontal-nav a, .quick-links a, .timeline-filter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 0 20px;
    background: #fdfdfd; 
    border-radius: 20px;
    text-decoration: none;
    color: #0056b3; 
    font-weight: 600;
    font-size: 0.95rem;
    border: 1px solid #b3d7ff; 
    transition: all 0.2s ease;
}

.horizontal-nav a { height: 36px; }
.quick-links a { height: 42px; padding: 0 22px; }

.horizontal-nav a i, .quick-links a i, .timeline-filter i {
    font-size: 1rem;
    color: #F2C14E;
    margin-right: 8px;
}

.horizontal-nav a:hover, .quick-links a:hover, .timeline-filter:hover, .timeline-filter:focus-visible {
    background: #0056b3;
    color: #ffffff;
    border-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 86, 179, 0.2);
}

/* ==========================================================================
   6. Standard List Layouts (Media Lists)
   ========================================================================== */
.list-container, .catalog-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    padding: 2.5rem;
    margin-bottom: 2.5rem;
}

.list-container { margin-bottom: 4rem; }

/* Center the existing catalog help text without changing page markup. */
.catalog-section .catalog-heading-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 1rem;
}

.catalog-section .catalog-heading-row h4 {
    grid-column: 1;
    justify-self: start;
    width: max-content;
    max-width: 100%;
    margin: 0;
}

.catalog-section .catalog-heading-row .catalog-help {
    grid-column: 2;
    justify-self: center;
    max-width: 100%;
    padding: 0.55rem 1.1rem;
    color: #084d8f;
    background: #eef7ff;
    border: 1px solid #b8daf5;
    border-radius: 999px;
    box-shadow: 0 3px 10px rgba(0, 86, 179, 0.09);
    font-size: 0.90rem;
    font-weight: 400;
    line-height: 1.35;
    margin-top: -40px;
    text-align: center;
}

@media (max-width: 640px) {
    .catalog-section .catalog-heading-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .catalog-section .catalog-heading-row h4,
    .catalog-section .catalog-heading-row .catalog-help {
        grid-column: 1;
    }
}

.media-list {
    column-count: 2;
    column-gap: 40px;
    list-style-position: inside;
    font-size: 1.1rem; 
    color: #333;
    padding-left: 20px;
    margin-left: 0;
}

.media-list li {
    margin-bottom: 12px; 
    padding: 0px 0px 4px 0px; 
    border-bottom: 1px solid #f0f0f0;
    break-inside: avoid;
    line-height: 1.5;
}

.network { font-weight: bold; color: #0056b3; font-size: 0.8rem; }
.dates, .film-rating, .tv-rating, .game-rating { color: #0056b3; font-style: italic; font-size: 0.9rem; }
.list-note { margin-top: 1rem; font-style: italic; color: #666; font-size: 0.9rem; }

.anthology-title {
    font-weight: 700;
    
    /* We removed display: block; so this stays on the same line as the number */
}

.sub-title-row {
    display: block; /* This automatically forces the sub-title to a new line */
    padding-left: 1.5rem;
    font-size: 0.95rem;
    margin-top: 4px; 
    margin-bottom: 2px;
    position: relative;
    line-height: 1.4;
}

.sub-title-row::before {
    content: "★"; /* Changed to a star. You could also use "•" for a round bullet */
    position: absolute;
    left: 0.35rem;
    color: #F2C14E;
    font-size: 0.85em; 
}

.title-info-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    text-decoration: none;
    font-size: 0.95rem;
    vertical-align: middle;
    
}

/* ==========================================================================
   7. Modals (Corrections & Random Titles)
   ========================================================================== */
.modal-overlay {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0; 
    top: 0; 
    width: 100%; 
    height: 100%; 
    background-color: rgba(11, 31, 58, 0.85); 
    align-items: center; 
    justify-content: center;
}

.modal-content, .random-modal-content {
    background-color: #ffffff;
    padding: 2.5rem;
    border: 3px solid #F2C14E; 
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.random-modal-content { text-align: center; }

.close-modal {
    color: #0056b3;
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover { color: #F2C14E; }

.modal-content label {
    display: block;
    margin-top: 1rem;
    font-weight: 600;
    color: #0056b3;
    font-size: 0.9rem;
}

.modal-content input, .modal-content textarea {
    width: 100%;
    padding: 10px;
    margin-top: 5px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    background-color: #fdfdfd;
}
        
.modal-content input:focus, .modal-content textarea:focus {
    outline: none;
    border-color: #F2C14E;
    box-shadow: 0 0 5px rgba(242, 193, 78, 0.5);
}

.modal-submit { width: 100%; margin-top: 1.5rem; }
.modal-title, .random-modal-title { margin-bottom: 0.5rem; border-bottom: none; }
.random-modal-title i { color: #F2C14E; margin-right: 8px; }
.modal-subtitle { font-size: 0.85rem; color: #666; margin-bottom: 1rem; }

.random-result {
    font-size: 1.25rem;
    font-weight: 600;
    color: #003366;
    margin-bottom: 1.5rem;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

/* ==========================================================================
   8. FAQ Page Styles
   ========================================================================== */
.faq-answer-card {
    background: white; 
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05); 
    margin-bottom: 1.25rem;
    border: 1px solid #e8e8e8;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.faq-answer-card:hover { box-shadow: 0 14px 28px rgba(11,31,58,0.1); }

.faq-answer-card summary {
    padding: 1.5rem 1.75rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: #0056b3;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    transition: color 0.2s ease;
}

.faq-answer-card summary::-webkit-details-marker { display: none; }

.faq-answer-card summary::after {
    content: '\f067';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: #d9a900;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.faq-answer-card[open] summary { color: #0B1F3A; border-bottom: 1px solid #f0f0f0; }
.faq-answer-card[open] summary::after { content: '\f068'; }

.faq-answer { padding: 1.5rem 1.75rem; background: #fdfdfd; }
.answer-label { font-weight: bold; color: #666; display: block; margin-bottom: 0.5rem; text-transform: uppercase; font-size: 0.8rem; }
.faq-answer p { margin-bottom: 1.2rem; }
ol, ul { margin-left: 2rem; margin-bottom: 1.5rem; }

.history-page-heading {
    margin: 0 0 1.5rem;
}


/* ==========================================================================
   8a. Disney Timeline Page
   Uses the shared .page-heading, .intro-box, .horizontal-nav-wrapper,
   .nav-section-label, and .quick-links components above.
   ========================================================================== */
.timeline-page {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.timeline-page-heading {
    margin-top: 0;
    margin-bottom: 1.1rem;
}

.timeline-intro-box {
    width: min(900px, 100%);
    margin: 0 auto 1.25rem;
    padding: 1.35rem 2.75rem;
    text-align: center;
}

.timeline-eyebrow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.45rem;
    color: #0056b3;
    font-family: 'Cinzel', serif;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.timeline-intro-box > p {
    max-width: 760px;
    margin: 0 auto;
    color: #41546d;
}

.timeline-filter-panel {
    width: min(1080px, 100%);
    padding: 0.9rem 1.15rem;
    margin: 0 auto 1.35rem;
}

.timeline-filter-panel .nav-section-label {
    margin-bottom: 0.7rem;
}

.timeline-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 9px;
}

.timeline-filter {
    min-height: 40px;
    margin: 0;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
}

.timeline-filter.is-active {
    background: #0056b3;
    border-color: #0056b3;
    color: #ffffff;
}

.timeline-filter.is-active i {
    color: #F2C14E;
}

/* JavaScript positions desktop entries vertically so the cards interlock
   instead of reserving a full row for each milestone. */
.disney-timeline {
    position: relative;
    width: 100%;
    max-width: 1240px;
    min-height: 120px;
    margin: 0 auto;
    padding: 0;
    list-style: none;
}

.disney-timeline::before {
    content: "";
    position: absolute;
    z-index: 0;
    top: 0.35rem;
    bottom: 0.35rem;
    left: 50%;
    width: 3px;
    background: #F2C14E;
    transform: translateX(-50%);
}

.timeline-decade {
    position: absolute;
    z-index: 4;
    left: 0;
    width: 100%;
    margin: 0;
    text-align: center;
}

.timeline-decade[hidden] {
    display: none;
}

.timeline-decade-label {
    position: relative;
    display: inline-block;
    padding: 0.2rem 0.95rem;
    background: #F4F0E8;
    color: #0B1F3A;
    font-family: 'Cinzel', serif;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Each card stops 34px before the center rail. */
.timeline-item {
    position: absolute;
    z-index: 1;
    width: calc(50% - 34px);
    margin: 0;
}

.timeline-item[hidden] {
    display: none;
}

.timeline-item-left {
    left: 0;
}

.timeline-item-right {
    right: 0;
}

.timeline-card-wrap {
    position: relative;
    width: 100%;
}

/* A short connector makes the relationship between card, pointer, marker,
   and center rail unmistakable. All four are centered at exactly 2rem. */
.timeline-card-wrap::after {
    content: "";
    position: absolute;
    z-index: 0;
    top: 2rem;
    width: 34px;
    height: 1px;
    background: #E2B43D;
}

.timeline-item-left .timeline-card-wrap::after {
    right: -34px;
}

.timeline-item-right .timeline-card-wrap::after {
    left: -34px;
}

/* The 68px rail spans the complete center gap. Its midpoint is the main line. */
.timeline-rail {
    position: absolute;
    top: 0;
    width: 68px;
    height: 100%;
    pointer-events: none;
}

.timeline-item-left .timeline-rail {
    right: -68px;
}

.timeline-item-right .timeline-rail {
    left: -68px;
}

.timeline-marker {
    position: absolute;
    z-index: 3;
    top: 2rem;
    left: 50%;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #F2C14E;
    box-shadow:
        0 0 0 4px #F4F0E8,
        0 0 0 5px #0B1F3A;
    transform: translate(-50%, -50%);
}

.timeline-marker i {
    display: none;
}

.timeline-item.is-landmark .timeline-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 0;
    background: #F4F0E8;
    box-shadow: none;
    color: #F2C14E;
    font-size: 1.45rem;
    line-height: 1;
    filter:
        drop-shadow(0 0 1px #0B1F3A)
        drop-shadow(0 1px 1px rgba(11, 31, 58, 0.2));
}

.timeline-item.is-landmark .timeline-marker i {
    display: block;
    line-height: 1;
    transform: translateY(-0.5px);
}

.timeline-card {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 0.95rem 1.1rem 1rem;
    border: 1px solid #F2C14E;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 5px 15px rgba(11, 31, 58, 0.065);
}

/* The pointer is 16px tall. top: 1.5rem places its center at 2rem,
   exactly matching the connector and marker positions above. */
.timeline-item-left .timeline-card::before {
    content: "";
    position: absolute;
    top: 1.5rem;
    right: -9px;
    width: 16px;
    height: 16px;
    border-top: 1px solid #F2C14E;
    border-right: 1px solid #F2C14E;
    background: #ffffff;
    transform: rotate(45deg);
}

.timeline-item-right .timeline-card::before {
    content: "";
    position: absolute;
    top: 1.5rem;
    left: -9px;
    width: 16px;
    height: 16px;
    border-bottom: 1px solid #F2C14E;
    border-left: 1px solid #F2C14E;
    background: #ffffff;
    transform: rotate(45deg);
}

.timeline-item.is-landmark .timeline-card {
    border-color: #E2B43D;
    background: #FFFBEF;
    box-shadow: 0 6px 17px rgba(176, 127, 0, 0.1);
}

.timeline-item.is-landmark.timeline-item-left .timeline-card::before,
.timeline-item.is-landmark.timeline-item-right .timeline-card::before {
    border-color: #E2B43D;
    background: #FFFBEF;
}

.timeline-card-topline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.4rem;
}

.timeline-year-badge {
    color: #0B1F3A;
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    font-weight: 700;
}

.timeline-category {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    background: #0B1F3A;
    color: #F2C14E;
    font-size: 0.69rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.timeline-category i {
    font-size: 0.78rem;
}

.timeline-landmark-label {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: #8B6500;
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.timeline-card h4 {
    display: block;
    margin: 0 0 0.35rem;
    padding: 0;
    border: 0;
    color: #0B1F3A;
    font-size: 1.1rem;
    line-height: 1.3;
}

.timeline-card p {
    margin: 0;
    color: #41546d;
    line-height: 1.55;
}

.timeline-title-trigger {
    font-weight: 800;
}

.timeline-popover-note {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.55rem;
    color: #65768A;
    font-size: 0.75rem;
    font-weight: 700;
}

.timeline-empty-message {
    display: none;
    padding: 2rem;
    border: 1px dashed #B8CBE0;
    border-radius: 14px;
    background: #ffffff;
    color: #53657A;
    text-align: center;
}

.timeline-empty-message.is-visible {
    display: block;
}

/* Mobile returns to a straightforward single-column timeline. */
@media (max-width: 700px) {
    .timeline-intro-box {
        width: 100%;
        padding: 1.25rem 1rem;
    }

    .timeline-filter-panel {
        width: 100%;
    }

    .disney-timeline {
        height: auto !important;
        min-height: 0;
    }

    .disney-timeline::before {
        left: 13px;
    }

    .timeline-decade {
        position: relative;
        top: auto !important;
        left: auto;
        width: auto;
        margin: 1.15rem 0 0.55rem;
        padding-left: 34px;
        text-align: left;
    }

    .timeline-decade:first-child {
        margin-top: 0;
    }

    .timeline-item,
    .timeline-item-left,
    .timeline-item-right {
        position: relative;
        top: auto !important;
        right: auto;
        left: auto;
        display: grid;
        grid-template-columns: 26px minmax(0, 1fr);
        gap: 0.6rem;
        width: 100%;
        margin-bottom: 0.7rem;
    }

    .timeline-card-wrap {
        grid-column: 2;
        grid-row: 1;
    }

    .timeline-card-wrap::after {
        display: none;
    }

    .timeline-rail,
    .timeline-item-left .timeline-rail,
    .timeline-item-right .timeline-rail {
        position: relative;
        grid-column: 1;
        grid-row: 1;
        top: 0;
        right: auto;
        left: auto;
        width: 26px;
        height: 100%;
    }

    .timeline-marker {
        top: 2rem;
        left: 13px;
    }

    .timeline-item-left .timeline-card::before,
    .timeline-item-right .timeline-card::before {
        display: none;
    }
}


/* ==========================================================================
   9. Urban Legends Page Styles
   ========================================================================== */
.legend-card {
    background: white;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    border-left: 5px solid #0056b3;
    display: flex;
    overflow: hidden;
}

.legend-thumb { width: 200px; min-width: 200px; background-color: #e1e4e8; position: relative; }
.legend-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.legend-body { padding: 2rem; flex: 1; }

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

.legend-header h3 {
    color: #0056b3;
    font-size: 1.3rem;
    flex: 1;
    padding-right: 1rem;
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
    display: block;
}

.status-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    color: white;
    white-space: nowrap;
}

.status-false { background-color: #d9534f; }
.status-true { background-color: #5cb85c; }
.status-mixed { background-color: #f0ad4e; }

.legend-body p { margin-bottom: 0.8rem; }
.legend-body strong { color: #222; }

.legend-source { font-size: 0.85rem; margin-top: 1rem; border-top: 1px dashed #eee; padding-top: 0.75rem; }
.legend-source a { color: #0056b3; text-decoration: none; font-weight: 600; }
.legend-source a:hover { text-decoration: underline; }

/* ==========================================================================
   10. Badges (Characters, Format, Genre)
   ========================================================================== */
.badge {
    display: inline-block;
    font-size: 0.75rem;
    padding: 2px 10px;
    border-radius: 12px;
    margin-left: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    vertical-align: middle;
    border: 1px solid transparent;
}

/* Character Badges */
.badge-alice { background: #e0e0e0; color: #333; border: 1px solid #ccc; }
.badge-oswald { background: #0B1F3A; color: #F2C14E; }
.badge-mickey { background: #d9534f; color: #ffffff; }
.badge-donald { background: #0275d8; color: #ffffff; }
.badge-goofy { background: #5cb85c; color: #ffffff; }
.badge-pluto { background: #f0ad4e; color: #ffffff; }
.badge-pixar { background: #005A9B; color: #ffffff; }
.badge-chip { background: #40E0D0; color: #ffffff; }
.badge-figaro { background: #222222; color: #ffffff; }
.badge-humphrey { background: #8B4513; color: #ffffff; }
.badge-roger { background: #FF4500; color: #ffffff; }
.badge-pooh { background: #FFD700; color: #000000; }
.badge-frozen { background: #87CEEB; color: #000000; }
.badge-symphony { background: #4B0082; color: #ffffff; }
.badge-daisy { background: #D8BFD8; color: #000000; }
.badge-minnie { background: #E91E63; color: #ffffff; }
.badge-special { background: #708090; color: #ffffff; }
.badge-wartime {
    background: #6b4f2a;
    color: #fff3d6;
}


/* --- CATEGORY & GENRE BADGES --- */
/* Genre Badge Styles */
.badge-animation   { background: #27AE60; color: #FFFFFF; } /* Vibrant Green */
.badge-anime       { background: #4B0082; color: #FFFFFF; } /* Indigo */
.badge-musical     { background: #E91E63; color: #FFFFFF; } /* Pink / Magenta */
.badge-comedy      { background: #f0ad4e; color: #FFFFFF; } /* Amber / Yellow-Orange */
.badge-action      { background: #d9534f; color: #FFFFFF; } /* Crimson Red */
.badge-adventure   { background: #8A5A00; color: #FFFFFF; } /* Expedition Brown */
.badge-action-adventure { background: #C44536; color: #FFFFFF; } /* Compact TV grouping */
.badge-fantasy     { background: #00BFFF; color: #FFFFFF; } /* Deep Sky Blue */
.badge-fantasy-scifi { background: #5E35B1; color: #FFFFFF; } /* Compact TV grouping */
.badge-romance     { background: #AD1457; color: #FFFFFF; } /* Rose */
.badge-thriller    { background: #263238; color: #FFFFFF; } /* Slate Charcoal */
.badge-drama       { background: #0275d8; color: #FFFFFF; } /* Deep Navy Blue */
.badge-documentary { background: #145A32; color: #FFFFFF; } /* Deep Forest Green */
.badge-docuseries { background: #005A9B; color: #FFFFFF; }
.badge-scifi      { background: #40E0D0; color: #FFFFFF; }
.badge-variety { background: #9C27B0; color: #FFFFFF; }
.badge-mystery { background: #607D8B; color: #FFFFFF; } 
.badge-reality { background: #D81B60; color: #FFFFFF; }
.badge-educational { background-color: #20B2AA; color: #FFFFFF; }

/* Doc/Game Sub-category Badges */
.badge-nature      { background: #27AE60; color: #FFFFFF; }
.badge-biography   { background: #0275d8; color: #FFFFFF; }
.badge-bts         { background: #708090; color: #FFFFFF; }
.badge-parks       { background: #F2C14E; color: #0B1F3A; }
.badge-music       { background: #E91E63; color: #FFFFFF; }
.badge-arcade { background-color: #ffd32a; color: #1e272e;}
.badge-retro { background-color: #cd6133; color: #ffffff; }
.badge-nintendo { background-color: #e60012; color: #ffffff; }
.badge-sega { background-color: #0054a6;  color: #ffffff; }
.badge-playstation { background-color: #003087; color: #ffffff; }
.badge-xbox { background-color: #107c10; color: #ffffff; }
.badge-pc { background-color: #4b6584; color: #ffffff; }
.badge-mac { background-color: #1d1d1f; color: #ffffff; }
.badge-apple-mobile { background-color: #007aff; color: #ffffff; }
.badge-android { background-color: #3ddc84; color: #1e272e; }

/* Video-game platform marks: larger, unframed logos rather than badge circles. */
body .media-list .platform-icon-group {
    gap: 8px !important;
}

body .media-list .platform-family-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    min-width: 26px !important;
    height: 26px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: 26px !important;
}

body .media-list .platform-family-icon i,
body .media-list .platform-family-icon i::before,
body .media-list .platform-family-icon .platform-icon-letter {
    font-size: 26px !important;
    line-height: 1 !important;
}

/* The Nintendo and Sega fallbacks are letters, so retain their identifying rings. */
body .media-list .platform-family-icon.platform-nintendo,
body .media-list .platform-family-icon.platform-sega {
    width: 26px !important;
    min-width: 26px !important;
    border: 2px solid var(--platform-icon-color, currentColor) !important;
    border-radius: 50% !important;
}

body .media-list .platform-family-icon.platform-nintendo .platform-icon-letter,
body .media-list .platform-family-icon.platform-sega .platform-icon-letter {
    font-size: 15px !important;
}

/* ========================================================================== 
   11. Filter / Legend UI
   ========================================================================== */
.legend-section {
    background: #ffffff; 
    border: 2px solid #F2C14E; 
    border-radius: 12px;
    padding: 1.0rem 2.5rem; 
    margin-bottom: 2.5rem; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.03);
}

.legend-section h4 { color: #0056b3; margin-top: 0; margin-bottom: 0.4rem; }
.legend-grid, .badge-legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; justify-content: center; }
.legend-row { text-align: center; }
.legend-row h4 { margin: 0 0 0.6rem 0; font-size: 0.95rem; border-bottom: none; text-align: center; color: #0056b3; }
.legend-hint { font-size: 0.8em; font-weight: normal; opacity: 0.65; font-style: italic; }

.filter-badge { cursor: pointer; transition: opacity 0.2s, transform 0.15s, outline 0.15s; user-select: none; }
.filter-badge:hover { transform: scale(1.08); }
.filter-badge.filter-active { outline: 2px solid currentColor; outline-offset: 2px; transform: scale(1.05); }
.filter-badge.filter-dimmed { opacity: 0.3; }

.catalog-section.catalog-hidden,
.list-container.catalog-hidden,
.list-container.section-hidden,
.media-list li.item-hidden { display: none; }
.media-list li.item-visible { display: list-item; }

.filter-status { margin-top: 0.6rem; display: flex; align-items: center; gap: 0.75rem; font-size: 0.88em; color: #888; }
.filter-clear-btn { background: none; border: 1px solid currentColor; border-radius: 4px; padding: 0.15rem 0.5rem; font-size: 0.85em; cursor: pointer; color: inherit; transition: opacity 0.15s; }
.filter-clear-btn:hover { opacity: 0.7; }

.nav-legend-separator { height: 2px; background: #eee; margin: 1rem 0; }
.nav-section-label { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: #0056b3; text-align: center; margin-bottom: 1.2rem; }
.nav-sep { color: #0056b3; margin: 0 10px; }
.badge-key { font-size: 0.72rem; color: #aaa; text-align: center; margin-top: 0.6rem; letter-spacing: 0.02em; }

/* ==========================================================================
   12. Global Footer Styles
   ========================================================================== */
#main-footer {
    position: relative;
    text-align: center;
    padding: 4rem 1rem 3rem;
    background: #0B1F3A;
    color: rgba(248,241,224,0.55);
}

#main-footer a { 
    color: #F2C14E; 
    text-decoration: none; 
    font-weight: 600; 
}

#main-footer a:hover { 
    text-decoration: underline; 
}

/* Shared constraints for perfect alignment */
.footer-disclaimer,
.copyright {
    max-width: 900px; 
    margin: 0 auto 10px; 
    padding: 0 20px;
    text-align: center;
}

.footer-disclaimer { 
    font-size: 0.9rem; 
    color: rgba(248,241,224,0.45); 
    line-height: 1.6; 
}

.copyright { 
    font-size: 0.95rem; 
    margin-bottom: 0; 
}

.source-note {
    max-width: 900px;
    margin: 2rem auto 0;
    padding: 1rem 1.25rem;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #334;
    background: rgba(255, 255, 255, 0.75);
    border-left: 4px solid #F2C14E;
    border-radius: 8px;
}

.source-note p {
    margin: 0;
}

.source-note a {
    font-weight: 700;
}

/* ==========================================================================
   13. Global Header Navigation
   ========================================================================== */
/* Update the container width */
.global-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0;
    min-height: 50px;
    margin-top: 0;
    padding: 0 1rem;
    max-width: 1400px; /* Expanded from 1400px */
    margin-left: auto;
    margin-right: auto;
    position: sticky;
    top: 0;
    z-index: 1000;
    
}

/* Update padding for better text spacing */
.global-nav > a,
.dropbtn,
.global-nav > button.nav-random-title {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 50px;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 1.0rem;
    padding: 0px 28px; /* Increased from 14px for better spacing */
    border: none;
    border-right: 2px solid #F2C14E;
    border-radius: 0;
    transition: all 0.2s ease;
    white-space: nowrap;
    cursor: pointer;
    box-sizing: border-box;
    color: #ffffff;
    background-color: #0056b3;
}

/* Last button in the bar shouldn't have a trailing divider */
.global-nav > *:last-child,
.global-nav > *:last-child > .dropbtn {
    border-right: none;
}

.global-nav > a:hover,
.dropdown:hover .dropbtn {
    background: #F2C14E;
    color: #0B1F3A;
    box-shadow: none;
    transform: none;
}

/* Icons that lead a button's text (Home, Pick a Title) need space on
   their right; the dropdown caret trails its text, so it needs space
   on its left instead. */
.global-nav > a i,
.global-nav > button.nav-random-title i {
    margin-right: 8px;
    font-size: 0.9em;
}

.dropbtn i {
    margin-left: 8px;
    font-size: 0.85em;
    color: inherit;
}

/* Dropdown Container */
.dropdown {
    position: relative;
    display: inline-flex;
    align-items: stretch;
}

/* The container for the dropdown list */
.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 100%; 
    width: max-content; 
    background-color: #0056b3; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    z-index: 100;
    border: 2px solid #F2C14E;
    box-sizing: border-box; 
    border-radius: 0 0 12px 12px;
}

/* Hover logic to trigger the display */
.dropdown:hover .dropdown-content {
    display: block; 
}

/* The individual links inside the dropdown */
.dropdown-content a {
    color: #ffffff;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    font-family: 'Inter', sans-serif;
    font-size: 1.0rem; /* Adjust this value to your liking */
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
    border-bottom: 1px solid rgba(242, 193, 78, 0.2);
}

/* Hover state for links */
.dropdown-content a:hover {
    background-color: #F2C14E;
    color: #0B1F3A;
}

/* Mobile global navigation: corner button + slide-out drawer */
body.mobile-menu-open {
    overflow: hidden;
}

body.mobile-menu-open::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(11,31,58,0.48);
    z-index: 999;
}

.mobile-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 2px solid #F2C14E;
    border-radius: 999px;
    background: #0056b3;
    color: #F2C14E;
    box-shadow: 0 8px 18px rgba(11,31,58,0.28);
    cursor: pointer;
}

.mobile-menu-toggle:hover,
.mobile-menu-toggle:focus-visible {
    background: #0B1F3A;
    color: #ffffff;
    outline: 2px solid #F2C14E;
    outline-offset: 3px;
}

.mobile-menu-icon {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 22px;
    height: 18px;
}

.mobile-menu-icon span {
    display: block;
    height: 2px;
    width: 100%;
    border-radius: 999px;
    background: currentColor;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.mobile-menu-toggle[aria-expanded="true"] .mobile-menu-icon span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle[aria-expanded="true"] .mobile-menu-icon span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle[aria-expanded="true"] .mobile-menu-icon span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: inline-flex;
        position: fixed;
        top: 0.85rem;
        right: 0.85rem;
        z-index: 1002;
    }

   .global-nav {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        z-index: 1001;
        display: flex;
        flex-direction: column;
        flex-wrap: nowrap; 
        align-items: stretch;
        justify-content: flex-start;
        gap: 0;
        width: min(84vw, 340px);
        max-width: none;
        height: 100dvh; /* Uses Dynamic Viewport Height to respect mobile browser UI */
        margin: 0;
        padding: 4.8rem 0 3rem; /* Extra bottom padding clears the phone swipe indicator */
        background: #0056b3;
        border-left: 3px solid #F2C14E;
        box-shadow: -14px 0 30px rgba(11,31,58,0.32);
        overflow-y: auto; 
        overflow-x: hidden; 
        overscroll-behavior: contain;
        transform: translateX(105%);
        visibility: hidden;
        pointer-events: none;
        transition: transform 0.25s ease, visibility 0.25s ease;
    }

    .global-nav.nav-open {
        transform: translateX(0);
        visibility: visible;
        pointer-events: auto;
    }

    .dropdown {
        display: contents;
    }

    .dropbtn {
        display: none;
    }

    .dropdown-content {
        display: contents;
        position: static;
        width: auto;
        min-width: 0;
        margin: 0;
        padding: 0;
        border: 0;
        background: transparent;
        box-shadow: none;
        opacity: 1;
        animation: none;
    }

    .dropdown:hover .dropdown-content {
        display: contents;
    }

    .global-nav > a,
    .dropdown-content a,
    .global-nav > button.nav-random-title {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        width: 100%;
        min-height: 48px;
        height: auto;
        padding: 0.9rem 1.35rem;
        border: 0;
        border-bottom: 1px solid rgba(242,193,78,0.35);
        border-radius: 0;
        background: transparent;
        color: #ffffff;
        font-family: 'Inter', sans-serif;
        font-size: 0.95rem;
        font-weight: 600;
        line-height: 1.25;
        text-align: left;
        text-decoration: none;
        white-space: normal;
        box-shadow: none;
        transform: none;
    }

    .global-nav > a:hover,
    .dropdown-content a:hover,
    .global-nav > button.nav-random-title:hover,
    .global-nav > a:focus-visible,
    .dropdown-content a:focus-visible,
    .global-nav > button.nav-random-title:focus-visible {
        background: #F2C14E;
        color: #0B1F3A;
        outline: none;
    }

    .global-nav > a i,
    .global-nav > button.nav-random-title i {
        width: 1.25rem;
        margin-right: 0.65rem;
        text-align: center;
        font-size: 0.95em;
    }

    .global-nav > button.nav-random-title {
        flex: 0 0 auto;
        margin-bottom: 1rem;
    }
}


.global-nav > button.nav-random-title {
    color: #0B1F3A;
    background: #F2C14E;
    font-weight: 700;
}

.global-nav > button.nav-random-title:hover {
    background: #0B1F3A;
    color: #F2C14E;
}

/* ==========================================================================
   14. Responsive Design (Media Queries)
   ========================================================================== */
/* 14-inch laptops and smaller desktops (901px–1199px) */
@media (max-width: 1199px) {
    #main-header { padding: 1.75rem 1rem 1.5rem; }
    .marquee-frame { 
        padding: 1rem 2.5rem; 
        min-width: 0; /* THIS FIXES THE MOBILE SCROLL BUG */
        width: 95%;   /* Keeps it contained nicely within the header */
    }
    #main-header h1 { font-size: 2.6rem; }
    #main-header h2 { font-size: 1.3rem; }
}

/* Tablet & small laptop (769px – 1024px) */
@media (max-width: 1024px) {
    .resource-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
    .resource-card i { width: 110px; height: 110px; font-size: 3.2em; }
    .resource-card span { font-size: 0.9rem; }
}

/* Tablet (601px – 900px) — header + content */
@media (max-width: 900px) {
    #main-header { padding: 1.5rem 1rem; }
    .marquee-frame { padding: 0.9rem 1.5rem; }
    #main-header h1 { font-size: 1.8rem; }
    #main-header h2 { font-size: 1.05rem; }
    #content { margin: 2rem auto 3rem; padding: 0 1rem; }
    .resource-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
    .resource-card a { padding: 1.5rem 1rem; }
    .resource-card i { width: 90px; height: 90px; font-size: 2.6em; margin-bottom: 0.75rem; }
    .resource-card span { font-size: 0.85rem; letter-spacing: 0.04em; }
    .welcome-area, .intro-box { border-radius: 10px; }
    .welcome-area p, .intro-box p { font-size: 1rem; }
    .page-heading { margin: 1.5rem 0 1rem; }
}

/* Phones and narrow tablets (≤ 850px) — collapse media list */
@media (max-width: 850px) { 
    .media-list { column-count: 1; } 
}

/* Tablet / Mobile (≤ 768px) */
@media (max-width: 768px) {
    .media-list { column-gap: 20px; padding-left: 0.75rem; margin: 0; }
    .media-list li { margin-bottom: 4px; padding: 2px 0; line-height: 1.6; }
    .list-container, .catalog-section { padding: 1rem; margin-bottom: 2rem; }
    
    .horizontal-nav { gap: 10px; }
    .horizontal-nav a { font-size: 0.85rem; padding: 0 16px; height: 44px; } 
    .horizontal-nav a i { margin-right: 5px; }
    
    .quick-links { gap: 10px; }
    .quick-links a { font-size: 0.85rem; padding: 0 16px; height: 44px; }
    .quick-links a i { margin-right: 5px; }

    .legend-card { flex-direction: column; }
    .legend-thumb { width: 100%; height: 150px; }
    .cta-button, .home-button { font-size: 0.875rem; padding: 0 16px; height: 44px; }
    
    .catalog-section .catalog-heading-row .catalog-help {
        margin-top: 0.5rem;   /* replaces -40px */
        justify-self: center; /* keeps it centered */
    }
}

/* Mobile (≤ 600px) */
@media (max-width: 600px) {
    #main-header { padding: 1.25rem 0.75rem; }
    .marquee-frame {
        width: 92%;
        margin: 0 auto;
        padding: 0.75rem 0.65rem;
        border: 3px solid #F2C14E;
        border-radius: 14px;
    }
    #main-header h1 { font-size: 1.0rem; line-height: 1.25; letter-spacing: 0.03em; }
    #main-header h2 { font-size: 0.85rem; margin-top: 0.25rem; }

    #content { padding: 0 0.75rem; margin: 1.5rem auto 2rem; }

    h3 { font-size: 1.35rem; margin-bottom: 1rem; }
    h4 { font-size: 1rem; margin-bottom: 1rem; }
    .page-heading { margin: 1.25rem 0 1rem; }

    .welcome-area,
    .intro-box {
        border-radius: 10px;
        margin-bottom: 1.5rem;
        padding: 1.25rem 1rem;
    }

    .welcome-area::before {
        top: 16px;
        height: 60px;
        width: 6px;
    }

    .welcome-area p,
    .intro-box p { font-size: 0.95rem; line-height: 1.6; }

    .section-label {
        font-size: 0.92rem;
        letter-spacing: 0.11em;
        margin: 1.5rem 0 0.75rem;
        line-height: 1.4;
    }

    .section-label::before,
    .section-label::after {
        width: 22px;
        margin: 0 6px;
    }

    .resource-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        margin-bottom: 1.5rem;
    }

    .resource-card a { padding: 1.15rem 0.75rem; }
    .resource-card i {
        width: 68px;
        height: 68px;
        font-size: 2rem;
        margin-bottom: 0.65rem;
    }
    .resource-card span {
        font-size: 0.72rem;
        letter-spacing: 0.035em;
        line-height: 1.25;
        padding-top: 0.9rem;
    }
    .resource-card span::before { width: 45px; height: 3px; }
    .resource-count { font-size: 0.72rem; }

    .horizontal-nav-wrapper {
        padding: 1rem 0.75rem;
        margin-bottom: 1.5rem;
        border-radius: 10px;
    }

    .nav-section-label {
        font-size: 0.72rem;
        line-height: 1.35;
        margin-bottom: 0.8rem;
    }

    .nav-sep { display: none; }
    .nav-legend-separator { margin: 0.8rem 0; }

    .horizontal-nav,
    .quick-links,
    .legend-grid,
    .badge-legend {
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 8px;
        padding-bottom: 0.2rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .horizontal-nav a,
    .quick-links a,
    .timeline-filter,
    .filter-badge {
        flex: 0 0 auto;
    }

    .horizontal-nav a,
    .quick-links a,
    .timeline-filter {
        height: 40px;
        padding: 0 14px;
        font-size: 0.8rem;
    }

    .filter-status {
        align-items: flex-start;
        justify-content: center;
        flex-direction: column;
        gap: 0.45rem;
        margin-top: 0.8rem;
        text-align: left;
    }

    .media-list {
        font-size: 0.98rem;
        padding-left: 1.1rem;
    }

    .media-list li {
        margin-bottom: 0.35rem;
        padding: 0.25rem 0;
        line-height: 1.55;
    }

    .badge {
        font-size: 0.62rem;
        padding: 2px 7px;
        margin-left: 6px;
        line-height: 1.4;
    }

    .legend-card { margin-bottom: 1.1rem; }
    .legend-body { padding: 1.25rem; }
    .legend-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.6rem;
    }
    .legend-header h3 { font-size: 1.1rem; padding-right: 0; }
    .status-badge { font-size: 0.75rem; padding: 5px 10px; }

    .modal-content,
    .random-modal-content {
        width: calc(100% - 1.5rem);
        padding: 1.5rem 1.1rem;
    }
}
