/* =============================================================================
   UB HERITAGE — LEGACY PAGE
   File: assets/css/legacy.css  (complete, standalone — enqueue for the template)
   Tokens: gold #d2ab67 · IvyBodoni (display, italic) · Avenir (body)
   Rules honoured: no border-radius on images · 1200px major breakpoint
   Section 3 is a SIMPLE arrow-driven decade slider (one map image per decade).
   ============================================================================= */

.legacy {
    --lg-gold: #d2ab67;
    --lg-ink: #161616;
    --lg-hero-bg: #e5e5e5;
    --lg-dark: #000000;
    --lg-hair: #dcdcdc;
    --lg-meta: #444444;
    --lg-year: #9a9a9a;
    --lg-disp: "IvyBodoni", Georgia, "Times New Roman", serif;
    --lg-body: "Avenir", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}

/* Shared content wrapper (matches 1820 container + 50 gutter) */
.legacy .legacy-wrap {
    width: 100%;
    max-width: 1820px;
    margin-inline: auto;
    padding-inline: clamp(20px, 5vw, 50px);
}

/* ----------------------------------------------------------------------------
   1. HERO
   ---------------------------------------------------------------------------- */
/* Structure:  section.legacy-hero > .legacy-hero__container
                                   > .legacy-hero__row
                                   > .legacy-hero__inner

   - The image is no longer an <img>, it is the SECTION's background (cover).
     The mobile image swaps via a CSS custom-property — no extra markup.
   - Heading / Sub heading / Button are all optional. With no text, only the
     image shows and no overlay is applied.
   - Figma (286:6946): banner 1920x700, heading LEFT-aligned aur
     vertically ~centered. */
.legacy-hero {
    position: relative;
    width: 100%;
    min-height: var(--lg-hero-h, 700px);
    display: flex;
    align-items: center;
    background-color: var(--lg-hero-bg);
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    overflow: hidden;
}

.legacy-hero.has-bg {
    background-image: var(--lg-hero-img);
}

/* overlay only when there is text — otherwise the image shows undistorted */
/* .legacy-hero.has-content::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(255, 255, 255, .78) 0%, rgba(255, 255, 255, .45) 38%, rgba(255, 255, 255, 0) 66%);
    pointer-events: none;
} */

.legacy-hero__container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1820px;
    margin-inline: auto;
    padding-inline: clamp(20px, 5vw, 50px);
    padding-block: clamp(40px, 6vw, 72px);
}

.legacy-hero__row {
    display: flex;
    justify-content: flex-start;
    width: 100%;
}

.legacy-hero__inner {
    max-width: 620px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: clamp(14px, 1.6vw, 22px);
    text-align: left;
    /* Figma: heading container is slightly more inset from the edge (x=163) */
    padding-inline-start: clamp(0px, 6vw, 113px);
}

.legacy-hero__sub {
    margin: 0;
    font-family: var(--lg-body);
    font-weight: 600;
    font-size: clamp(12px, 1vw, 14px);
    line-height: 1.4;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--lg-gold);
}

.legacy-hero__title {
    margin: 0;
    font-family: var(--lg-disp);
    font-style: italic;
    font-weight: 400;
    font-size: 64px;
    line-height: 64px;
    letter-spacing: 0px;
    color: var(--lg-ink);
}

.legacy-hero__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: clamp(6px, 1vw, 12px);
    padding: 15px 38px;
    border: 1px solid var(--lg-ink);
    border-radius: 80px;
    /* pill — no-radius rule se exempt */
    font-family: var(--lg-body);
    font-weight: 600;
    font-size: 14px;
    line-height: 1.15;
    letter-spacing: .08em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--lg-ink);
    transition: background-color .25s ease, color .25s ease;
}

.legacy-hero__btn:hover {
    background: var(--lg-ink);
    color: #fff;
}

/* ----------------------------------------------------------------------------
   2. INTRO
   ---------------------------------------------------------------------------- */
.legacy-intro {
    background: #fff;
    padding-block: clamp(56px, 7vw, 112px);
}

/* Layout is decided by the modifier class passed from PHP:
     .is-split -> left content + right image
     .is-text  -> content only, full width (Figma current state)
     .is-media -> image only, full width                        */
.legacy-intro__grid {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-content: center;
    justify-content: space-between;
    align-items: center;
    gap: 48px;
}

.legacy-intro__grid.is-text .legacy-intro__text {
    max-width: 100%;
    width: 100%;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-content: center;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.legacy-intro__grid .legacy-intro__text,
.legacy-intro__grid .legacy-intro__media {
    max-width: 45%;
    width: 100%;
}

.legacy-intro__title {
    margin: 0 0 clamp(20px, 2.5vw, 30px);
    font-family: var(--lg-disp);
    font-style: italic;
    font-weight: 400;
    color: var(--lg-ink);
    font-size: clamp(26px, 2.6vw, 40px);
    line-height: 1.12;
}

.legacy-intro__body {
    /*     max-width: 470px; */
    font-family: var(--lg-body);
    color: #2a2a2a;
    font-size: 16px;
    line-height: 1.72;
}

.legacy-intro__body p {
    margin: 0 0 18px;
}

.legacy-intro__body p:last-child {
    margin-bottom: 0;
}

.legacy-intro__media {
    display: flex;
    justify-content: flex-end;
}

.legacy-intro__media img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
}

/* only in the image state does the image take full width */
.legacy-intro__grid.is-media .legacy-intro__media {
    justify-content: center;
}

.legacy-intro__grid.is-media .legacy-intro__media img {
    max-width: 100%;
}

/* content-only state — Figma: body up to ~1405px so lines stay readable
   layak rahein aur 1820 container me saans le sake */
.legacy-intro__grid.is-text .legacy-intro__body {
    max-width: 60%;
}

/* ----------------------------------------------------------------------------
   3. ADDRESSES THAT GREW WITH AHMEDABAD  —  simple arrow slider
   ---------------------------------------------------------------------------- */
.legacy-map {
    background: var(--lg-dark);
    padding-block: clamp(48px, 6vw, 90px);
    overflow: hidden;
    margin-bottom: 32px;
}

/* Heading + optional paragraph */
.legacy-map__intro {
    max-width: 940px;
    margin: 0 auto clamp(28px, 4vw, 54px);
    padding-inline: clamp(20px, 5vw, 50px);
    text-align: center;
}

.legacy-map__title {
    margin: 0;
    font-family: var(--lg-disp);
    font-style: italic;
    font-weight: 400;
    color: var(--lg-gold);
    font-size: clamp(24px, 2.8vw, 40px);
    letter-spacing: 0.01em;
}

.legacy-map__lead {
    max-width: 720px;
    margin: clamp(14px, 1.8vw, 22px) auto 0;
    font-family: var(--lg-body);
    font-weight: 400;
    color: rgba(255, 255, 255, 0.72);
    font-size: clamp(14px, 1.05vw, 17px);
    line-height: 1.7;
}

/* Slider shell */
.legacy-sl {
    max-width: 1820px;
    margin-inline: auto;
    padding-inline: clamp(20px, 5vw, 50px);
}

/* Stage — all slides stacked in one grid cell; only the active one is opaque. */
.legacy-sl__stage {
    display: grid;
    position: relative;
    width: 100%;
}

.legacy-sl__slide {
    grid-area: 1 / 1;
    margin: 0;
    opacity: 0;
    transition: opacity 0.55s ease;
}

.legacy-sl__slide:not(.is-active) {
    pointer-events: none;
}

.legacy-sl__slide.is-active {
    opacity: 1;
}

.legacy-sl__img {
    display: block;
    max-width: 100%;
    width: 100%;
    height: 575px;
    object-fit: contain;
}

/* Timeline / decade nav (arrow-driven).
   Vertical model (matches Figma):
     • a clear gap sits between the map image and the ruler line (margin-top);
     • the gold dots sit ON the ruler line;
     • every decade label is centred on one common line (--lg-label-y), so the
       active label stays exactly aligned under its dot regardless of its size;
     • arrows sit at the label's height. */
.legacy-sl__nav {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: clamp(12px, 2vw, 30px);
    margin-top: clamp(42px, 4.4vw, 60px);
    /* gap between the map image and the ruler */
    padding-bottom: clamp(18px, 2.4vw, 34px);
    --lg-line-y: 7px;
    /* ruler-line centre, from nav content top */
    --lg-label-y: clamp(66px, 6vw, 98px);
    /* label centre, from nav content top */
}

/* Full-width gold rule + evenly-spaced ticks; line centre = --lg-line-y. */
.legacy-sl__ruler {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 14px;
    pointer-events: none;
    background:
        linear-gradient(var(--lg-gold), var(--lg-gold)) 0 50% / 100% 1px no-repeat,
        repeating-linear-gradient(90deg, rgba(210, 171, 103, 0.85) 0 1px, transparent 1px 46px) 0 50% / 100% 10px no-repeat;
    opacity: 0.9;
}

.legacy-sl__viewport {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    height: calc(var(--lg-label-y) + clamp(42px, 4vw, 64px));
    overflow: hidden;
}

.legacy-sl__strip {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    display: flex;
    align-items: flex-start;
    gap: clamp(220px, 30vw, 560px);
    /* dot-to-dot spacing (~31vw, as in Figma) */
    transition: transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
    will-change: transform;
}

.legacy-sl__decade {
    position: relative;
    flex: 0 0 auto;
    padding: 0;
    background: none;
    border: 0;
    cursor: pointer;
    font-family: var(--lg-disp);
    font-style: italic;
}

/* Dot centred on the ruler line. */
.legacy-sl__dot {
    display: block;
    width: clamp(11px, 0.8vw, 15px);
    height: clamp(11px, 0.8vw, 15px);
    margin: 0 auto;
    border-radius: 50%;
    background: var(--lg-gold);
}

/* Every label centred on one common line => stays aligned under its dot. */
.legacy-sl__label {
    position: absolute;
    top: var(--lg-label-y);
    left: 50%;
    transform: translate(-50%, -50%);
    white-space: nowrap;
    line-height: 1;
    color: #8f8f8f;
    /* inactive decade = neutral grey (dim) */
    font-size: clamp(22px, 2.6vw, 44px);
    transition: color 0.4s ease;
}

.legacy-sl__decade.is-active .legacy-sl__label {
    color: #fff;
    /* active decade = white */
    font-size: clamp(44px, 5.2vw, 96px);
}

.legacy-sl__arrow {
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
    width: clamp(48px, 5vw, 82px);
    margin-top: calc(var(--lg-label-y) - clamp(6px, 0.7vw, 10px));
    padding: 0;
    background: none;
    border: 0;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.legacy-sl__arrow svg {
    width: 100%;
    height: auto;
    stroke: var(--lg-gold);
    /* enabled = gold */
    stroke-width: 1.4;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke 0.3s ease;
}

.legacy-sl__arrow:disabled {
    cursor: default;
}

.legacy-sl__arrow:disabled svg {
    stroke: #4c4c4c;
    /* disabled = grey (as in Figma) */
}

.legacy-sl__arrow--prev:not(:disabled):hover {
    transform: translateX(-4px);
}

.legacy-sl__arrow--next:not(:disabled):hover {
    transform: translateX(4px);
}

.legacy-sl__arrow:focus-visible,
.legacy-sl__decade:focus-visible {
    outline: 2px solid var(--lg-gold);
    outline-offset: 5px;
}

/* ----------------------------------------------------------------------------
   4. COMPLETED PROJECTS (sticky heading + scrolling list)
   ---------------------------------------------------------------------------- */
.legacy-cp {
    background: #fff;
    padding-block: clamp(40px, 6vw, 92px);
}

.legacy-cp__grid {
    display: grid;
    grid-template-columns: minmax(260px, 380px) minmax(0, 1fr);
    column-gap: clamp(30px, 5vw, 90px);
    align-items: start;
}

.legacy-cp__head {
    align-self: stretch;
}

.legacy-cp__title {
    position: sticky;
    top: clamp(120px, 16vh, 210px);
    margin: 0;
    font-family: var(--lg-disp);
    font-style: italic;
    font-weight: 400;
    color: var(--lg-ink);
    font-size: clamp(34px, 4vw, 62px);
    line-height: 1.05;
}

.legacy-cp__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.legacy-cp__item {
    display: grid;
    grid-template-columns: clamp(56px, 6vw, 96px) 1fr;
    column-gap: clamp(12px, 2vw, 30px);
    align-items: start;
    padding: clamp(22px, 3vw, 40px) 0;
    border-bottom: 1px solid var(--lg-hair);
}

.legacy-cp__item:first-child {
    padding-top: 0;
}

.legacy-cp__year {
    padding-top: clamp(6px, 0.6vw, 12px);
    font-family: var(--lg-disp);
    font-style: italic;
    font-weight: 400;
    color: var(--lg-year);
    font-size: clamp(12px, 1vw, 15px);
}

.legacy-cp__body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.legacy-cp__name {
    font-family: var(--lg-disp);
    font-style: italic;
    font-weight: 400;
    color: var(--lg-ink);
    font-size: clamp(22px, 2.4vw, 34px);
    line-height: 1.05;
}

.legacy-cp__meta {
    font-family: var(--lg-body);
    font-weight: 400;
    color: var(--lg-meta);
    font-size: clamp(13px, 1vw, 15px);
    letter-spacing: 0.01em;
}

/* ----------------------------------------------------------------------------
   RESPONSIVE — major layout shift at 1200px
   ---------------------------------------------------------------------------- */
@media (max-width: 1200px) {

    /* split also collapses to one column here (text on top, image below) */
    /* .legacy-intro__grid,
    .legacy-intro__grid.is-split {
        grid-template-columns: minmax(0, 1fr);
        row-gap: clamp(28px, 5vw, 44px);
    } */

    .legacy-intro__grid {
        gap: 24px;
    }

    .legacy-intro__grid .legacy-intro__text,
    .legacy-intro__grid .legacy-intro__media {
        max-width: 47%;
        width: 100%;
    }

    .legacy-intro__grid.is-split .legacy-intro__body {
        max-width: 620px;
    }

    .legacy-cp__grid {
        grid-template-columns: 1fr;
    }

    .legacy-cp__head {
        align-self: auto;
    }

    .legacy-cp__title {
        position: static;
        top: auto;
        margin-bottom: clamp(24px, 4vw, 40px);
    }
}

@media (max-width: 1024px) {
    .legacy-hero {
        --lg-hero-h: 480px;
    }

    .legacy-hero__inner {
        padding-inline-start: 0;
        max-width: 560px;
    }

    .legacy-hero__title {
        font-size: 48px;
        line-height: 48px;
    }

    .legacy-intro__grid.is-text .legacy-intro__body {
        max-width: 90%;
    }
}

@media (max-width: 768px) {
    .legacy-hero {
        --lg-hero-h: 768px;
        background-position: center bottom;
    }

    /* use the mobile image when provided, otherwise the desktop one */
    .legacy-hero.has-bg {
        background-image: var(--lg-hero-img-mobile, var(--lg-hero-img));
    }

    /* mobile text is full width, so the overlay flows top-to-bottom */
    /* .legacy-hero.has-content::before {
        background: linear-gradient(180deg, rgba(255, 255, 255, .55) 0%, rgba(255, 255, 255, .82) 100%);
    } */

    .legacy-hero__inner {
        max-width: 100%;
    }

    .legacy-hero__title {
        font-size: 40px;
        line-height: 40px;
    }

    .legacy-hero__btn {
        padding: 13px 30px;
        font-size: 13px;
    }

    .legacy-sl__nav {
        gap: 6px;
        margin-top: clamp(30px, 8vw, 44px);
        --lg-label-y: clamp(52px, 15vw, 78px);
    }

    .legacy-sl__strip {
        gap: clamp(150px, 46vw, 300px);
    }

    .legacy-sl__arrow {
        width: clamp(40px, 12vw, 56px);
    }

    .legacy-sl__label {
        font-size: clamp(20px, 6vw, 30px);
    }

    .legacy-sl__decade.is-active .legacy-sl__label {
        font-size: clamp(34px, 11vw, 60px);
    }

    .legacy-cp__item {
        grid-template-columns: 1fr;
        row-gap: 6px;
    }

    .legacy-cp__year {
        padding-top: 0;
    }

    .legacy .legacy-wrap {
        padding: 0 16px;
    }

    .legacy-intro__grid .legacy-intro__text,
    .legacy-intro__grid .legacy-intro__media {
        max-width: 100%;
        width: 100%;
    }

    .legacy-intro__grid.is-text .legacy-intro__body {
        max-width: 100%;
    }
}

@media (max-width: 600px) {
    .legacy-hero {
        --lg-hero-h: 540px;
    }

    .legacy-hero__title {
        font-size: 32px;
        line-height: 32px;
    }

    .legacy-hero__btn {
        width: 100%;
    }
}

@media (max-width: 425px) {

    .legacy-hero__title {
        font-size: 24px;
        line-height: 24px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

    .legacy-sl__slide,
    .legacy-sl__strip,
    .legacy-sl__decade,
    .legacy-sl__label,
    .legacy-sl__dot,
    .legacy-sl__arrow {
        transition: none !important;
    }
}