/* ==========================================================================
   Disney Timeline page (timeline.php)
   Loaded with $pageStyles = ['timeline.css'] before header.php.
   Uses the shared .page-heading, .intro-box, .horizontal-nav-wrapper and
   .nav-section-label from styles.css.
   Layout of this file (order matters, later rules win):
     1. Filter pills (the .quick-links pill look, scoped to .timeline-filter)
     2. Page, filter panel, timeline rail and cards (was styles.css 8a)
     3. Hero, filter panel and card refinements (was an inline <style> in
        timeline.php). Where a selector appears here a second time it is a
        deliberate override of section 2; the superseded declarations were
        removed from section 2 so no property is defined twice.
   ========================================================================== */

/* --- Filter buttons: the same pill look as .quick-links a (was a grouped selector in styles.css) --- */
.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;
    min-height: 40px;
    margin: 0;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.timeline-filter i {
    font-size: 1rem;
    color: #F2C14E;
    margin-right: 8px;
}

.timeline-filter:hover,
.timeline-filter:focus-visible {
    background: #0056b3;
    color: #ffffff;
    border-color: #0056b3;
}

/* --- Page, filter panel and timeline cards --- */
.timeline-page-heading {
    margin-top: 0;
    margin-bottom: 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;
}

/* The filter row also carries .quick-links (shared styles.css), whose phone
   rules turn a row into a sideways-scrolling strip. The pills here wrap
   instead, like on desktop, so every category stays visible. */
.timeline-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 9px;
}

.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;
    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%;
    /* Wider cards with more breathing room around the copy. */
    padding: 1.25rem clamp(1.5rem, 2.2vw, 2.15rem) 1.4rem;
    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.65;
}

/* (A .timeline-title-trigger { font-weight: 800 } rule used to sit here. It
   never took effect: .media-title-trigger in catalog_popovers.css loads later
   and sets 600. It was removed so the file says what the page really does.
   Add the rule back with a more specific selector to make titles bolder.) */

.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;
    }
}

/* --- Phone: filter buttons (was grouped with .quick-links a in styles.css, max-width: 600px) --- */
@media (max-width: 600px) {
    .timeline-filter {
        flex: 0 0 auto;
        height: 40px;
        padding: 0 14px;
        font-size: 0.8rem;
    }
}

/* --- Hero, filter and card refinements (previously an inline <style> in timeline.php) --- */
/* Timeline page full-width hero and card refresh ------------------------- */
.timeline-page {
    width: 100%;
    max-width: none;
    margin: 0;
}

.timeline-hero {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr) 160px;
    grid-template-areas:
        "left intro right"
        "filters filters filters";
    column-gap: 1.6rem;
    row-gap: 1.35rem;
    align-items: start;
    width: 100%;
    margin: 0 0 1.75rem;
    padding: 1.55rem 1.8rem 1.45rem;
    background: #ffffff;
    border: 1px solid #d8e1eb;
    border-top: 4px solid #F2C14E;
    border-radius: 16px;
    box-shadow: 0 10px 26px rgba(11, 31, 58, 0.08);
}

.timeline-hero-media {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0.65rem;
    min-width: 0;
    margin: 0;
    padding: 0.35rem 0.25rem;
}

.timeline-hero-media-left {
    grid-area: left;
}

.timeline-hero-media-right {
    grid-area: right;
}

.timeline-hero-media a {
    display: block;
    width: 100%;
    max-width: 155px;
    margin: 0 auto;
    border-radius: 12px;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.timeline-hero-media a:hover,
.timeline-hero-media a:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(11, 31, 58, 0.18);
}

.timeline-hero-media a:focus-visible {
    outline: 3px solid rgba(0, 86, 179, 0.22);
    outline-offset: 2px;
}

.timeline-hero-media img {
    display: block;
    width: 100%;
    max-width: 155px;
    aspect-ratio: 2 / 3;
    margin: 0 auto;
    object-fit: cover;
    border: 3px solid #F2C14E;
    border-radius: 12px;
    background: #eef3f8;
    box-shadow: 0 10px 22px rgba(11, 31, 58, 0.14);
}

.timeline-hero-caption {
    display: block;
    text-align: center;
    color: #5e6a76;
    font-size: 0.82rem;
    line-height: 1.35;
    font-weight: 700;
}

.timeline-hero-main {
    grid-area: intro;
    min-width: 0;
}

.timeline-hero-copy {
    max-width: 820px;
    margin: 0 auto;
    padding: 0 1.5rem;
    text-align: center;
}

.timeline-hero-copy .timeline-eyebrow {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 0.7rem;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #1a2a3a;
}

.timeline-hero-copy .timeline-eyebrow i {
    font-size: 2rem;
    color: #F2C14E;
}

.timeline-hero-copy p {
    max-width: 760px;
    margin: 0 auto;
    font-size: 1.08rem;
    line-height: 1.75;
}

/* Clickable Once Upon a Studio feature ------------------------------- */
.timeline-hero-watch {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin: 1.15rem auto 0;
    color: #0056b3;
    text-decoration: none;
    border-radius: 14px;
    padding: 0.35rem 0.45rem 0.5rem;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.timeline-hero-watch img {
    display: block;
    width: 200px;
    max-width: min(200px, 70vw);
    height: auto;
    border: 3px solid #F2C14E;
    border-radius: 12px;
    background: #eef3f8;
    box-shadow: 0 7px 16px rgba(11, 31, 58, 0.14);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.timeline-hero-watch-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    font-size: 0.92rem;
    line-height: 1.25;
    font-weight: 700;
}

.timeline-hero-watch-label i {
    font-size: 0.95rem;
}

.timeline-hero-watch:hover,
.timeline-hero-watch:focus-visible {
    background: #f5f9fd;
    transform: translateY(-2px);
    text-decoration: none;
    box-shadow: 0 5px 14px rgba(0, 86, 179, 0.10);
}

.timeline-hero-watch:hover img,
.timeline-hero-watch:focus-visible img {
    border-color: #F2C14E;
    box-shadow: 0 10px 22px rgba(11, 31, 58, 0.19);
    transform: translateY(-2px);
}

.timeline-hero-watch:focus-visible {
    outline: 3px solid rgba(0, 86, 179, 0.22);
    outline-offset: 2px;
}

.timeline-hero-watch:active {
    transform: translateY(0);
}


.timeline-filter-panel {
    grid-area: filters;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 1.05rem 1.25rem 1.1rem;
    border: 1px solid #d8e1eb;
    border-radius: 12px;
    background: linear-gradient(180deg, #f8fbff 0%, #eef5fb 100%);
    box-shadow: none;
}

.timeline-filter-panel .nav-section-label {
    margin-bottom: 0.75rem;
    text-align: center;
}

/* Hover lift for the filter pills; overrides the base hover rule near the top
   (kept separate because .timeline-filter.is-active sits between the two). */
.timeline-filter:hover,
.timeline-filter:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 86, 179, 0.14);
}

/* Use the full site container for the timeline itself. (After the phone rules
   for .disney-timeline above, so it is kept as its own rule.) */
.disney-timeline {
    width: 100%;
    max-width: none;
}

.timeline-external-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.75rem;
    color: #0056b3;
    font-weight: 700;
    text-decoration: none;
}

.timeline-external-link:hover,
.timeline-external-link:focus-visible {
    text-decoration: underline;
}

@media (max-width: 1050px) {
    .timeline-hero {
        grid-template-columns: 130px minmax(0, 1fr) 130px;
        column-gap: 1.15rem;
        padding: 1.35rem 1.4rem 1.3rem;
    }

    .timeline-hero-copy {
        padding: 0 0.75rem;
    }

    .timeline-hero-copy .timeline-eyebrow {
        font-size: 1.4rem;
    }

    .timeline-hero-copy .timeline-eyebrow i {
        font-size: 1.7rem;
    }

    .timeline-card {
        padding-right: 1.5rem;
        padding-left: 1.5rem;
    }
}

@media (max-width: 760px) {
    .timeline-hero {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-areas:
            "intro intro"
            "left right"
            "filters filters";
        gap: 1rem;
        padding: 1.15rem;
    }

    .timeline-hero-copy {
        padding: 0;
    }

    .timeline-hero-media {
        padding: 0.25rem;
    }

    .timeline-hero-media a {
        max-width: min(150px, 34vw);
    }

    .timeline-hero-media img {
        width: min(150px, 34vw);
    }

    .timeline-hero-copy .timeline-eyebrow {
        font-size: 1.2rem;
        gap: 0.6rem;
    }

    .timeline-hero-copy .timeline-eyebrow i {
        font-size: 1.5rem;
    }

    .timeline-hero-copy p {
        font-size: 1rem;
        line-height: 1.65;
    }
}

@media (max-width: 520px) {
    .timeline-hero {
        padding: 1rem 0.85rem;
    }

    .timeline-hero-media a {
        max-width: min(135px, 36vw);
    }

    .timeline-hero-media img {
        width: min(135px, 36vw);
    }

    .timeline-hero-copy .timeline-eyebrow {
        font-size: 1rem;
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    .timeline-hero-copy .timeline-eyebrow i {
        font-size: 1.3rem;
    }

    .timeline-filter-panel {
        padding: 0.9rem 0.8rem 0.95rem;
    }

    .timeline-card {
        padding: 1rem 1.1rem 1.15rem;
    }
}
