/* ── Card section ────────────────────────────────────────────
   Figma (home): rooms 1397:12129, experiences 1397:12199,
   meetings & events 1397:12275, Journal 1397:12324.
   ─────────────────────────────────────────────────────────── */

.card-section {
    padding: var(--section-y) var(--pad-x);
    background: var(--color-canvas);
}

.card-section--candle {
    background: var(--color-candle-wax);
}

.card-section__inner {
    display: flex;
    flex-direction: column;
    gap: 32px;
    max-width: var(--site-max-w);
    margin: 0 auto;
}

.card-section__header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 64px;
}

.card-section__heading {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 750px;
}

.card-section__eyebrow {
    color: var(--color-umber-muted);
}

.card-section__top,
.card-section__actions,
.card-section__arrows {
    display: flex;
    align-items: center;
}

.card-section__top {
    flex-shrink: 0;
    gap: 20px;
}

.card-section__actions {
    gap: 24px;
}

.card-section__arrows {
    gap: 23.5px;
}

.card-section__bottom {
    display: flex;
    justify-content: flex-end;
}

/* Desktop: the buttons sit where the section says. */
.card-section--actions-bottom .card-section__top .card-section__actions,
.card-section--actions-top .card-section__bottom {
    display: none;
}


/* ── The cards ─────────────────────────────────────────────── */
.card-section__track {
    --card-image-h: 380px;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - 2 * var(--track-gap, 24px)) / 3);
    gap: var(--track-gap, 24px);
    /* Sideways only: overflow-x on its own makes the browser scroll y too,
       by the pixel or two a card pokes out. */
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.card-section__track::-webkit-scrollbar {
    display: none;
}

.card-section__track:focus-visible {
    outline: 2px solid var(--color-copper);
    outline-offset: 4px;
}

/* The Journal's two smaller stories sit in __side; the row stops at
   them too, or it would only ever snap back to the first. */
.card-section__track > .card,
.card-section__side > .card {
    scroll-snap-align: start;
}

/* A short paragraph with the heading: under it, or beside it (Stay suites) */
.card-section__intro {
    font-size: 16px;
    line-height: 1.65;
    letter-spacing: 0.08px;
    color: var(--color-umber);
}

.card-section--intro-below .card-section__heading {
    gap: 12px;
}

.card-section--intro-beside .card-section__heading {
    flex-direction: row;
    align-items: center;
    gap: 16px;
    max-width: none;
    width: 100%;
}

.card-section--intro-beside .card-section__title {
    flex: 0 0 791px; /* of 1312, as in the Figma */
    max-width: 60%;
}

.card-section--intro-beside .card-section__intro {
    flex: 1;
    color: var(--color-ink-soft);
}

/* Four across */
.card-section--cols-2 .card-section__track {
    grid-auto-columns: calc((100% - var(--track-gap, 24px)) / 2);
}

.card-section--cols-4 .card-section__track {
    grid-auto-columns: calc((100% - 3 * var(--track-gap, 24px)) / 4);
    --card-image-h: 228px;
}

/* Grid: every card showing, in rows (desktop only — tablet and mobile
   swipe like the rest). Junior Suites, Figma 1366:65226. */
@media (min-width: 1025px) {
    .card-section--grid .card-section__track {
        grid-auto-flow: row;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        row-gap: 32px;
        overflow: visible;
    }

    .card-section--grid .card-section__heading {
        max-width: none;
    }

    .card-section--grid.card-section--cols-4 .card-section__track {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Figma Desktop/H2: 64px */
.card-section--title-h2 .card-section__title {
    font-size: 64px;
    line-height: 0.9;
    letter-spacing: -0.96px;
}

.card-section--title-h2 .card-section__inner {
    gap: 40px;
}

/* Rooms: taller pictures on the home page, more room above the link */
#rooms .card-section__track {
    --card-image-h: 350px;
}

.card-section--rooms-cards .card__body {
    margin-bottom: 12px;
}

/* Meetings and the Journal: eyebrow closer to the heading */
#meetings-events .card-section__heading,
.card-section--journal .card-section__heading {
    gap: 12px;
}

/* Experiences (home and Stay) */
#experiences .card-section__track,
#stay-experiences .card-section__track {
    --track-gap: 32px;
}

/* Journal — the big story and the two beside it */
.card-section--journal .card-section__inner {
    gap: 40px;
}

.card-section--journal .card-section__heading {
    max-width: none;
}

/* Figma Desktop/H2 */
.card-section--journal .card-section__title {
    font-size: 64px;
    line-height: 0.9;
    letter-spacing: -0.96px;
}

.card-section--journal .card-section__track {
    grid-auto-flow: row;
    grid-template-columns: 800fr 480fr;
    gap: 32px;
    overflow: visible;
}

.card-section--journal .card--feature {
    --card-image-h: 460px;
}

.card-section__side {
    display: flex;
    flex-direction: column;
    gap: 40px;
    --card-image-h: 200px;
}


/* Split header: the eyebrow and heading on the left; the intro and the
   buttons stacked on the right. Dining's Four places to gather
   (1366:71244), Weddings' Four weddings (1366:72474). */
@media (min-width: 1025px) {
    .card-section--header-split .card-section__header {
        display: grid;
        grid-template-columns: minmax(0, 680px) minmax(0, var(--header-split-right, 610px));
        grid-template-areas:
            "eyebrow intro"
            "title intro"
            "title actions";
        justify-content: space-between;
        align-items: start;
        gap: 12px 64px;
    }

    .card-section--header-split .card-section__heading {
        display: contents;
    }

    .card-section--header-split .card-section__eyebrow { grid-area: eyebrow; }
    .card-section--header-split .card-section__title { grid-area: title; flex: none; max-width: none; }
    .card-section--header-split .card-section__intro { grid-area: intro; }
    .card-section--header-split .card-section__top { grid-area: actions; margin-top: 8px; }
}

@media (max-width: 1366px) and (min-width: 1025px) {
    .card-section--header-split .card-section__header {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
}


/* Tablet and mobile — 1024px and below (Figma mobile frames):
   a swipe row of mobile-sized cards, the next peeking in. */
@media (max-width: 1024px) {
    .card-section__inner {
        gap: 40px;
    }

    /* Tablet: the heading and the buttons side by side, as on desktop */
    .card-section__header {
        gap: 32px;
    }

    .card-section__heading {
        gap: 16px;
        min-width: 0; /* wraps, to leave the buttons room beside it */
    }

    .card-section__arrows {
        display: none;
    }

    .card-section--intro-beside .card-section__heading {
        flex-direction: column;
        align-items: flex-start;
    }

    .card-section--intro-beside .card-section__title {
        flex: none;
        max-width: none;
    }

    .card-section--title-h2 .card-section__title,
    .card-section--journal .card-section__title {
        font-size: 32px;
        line-height: 1.06;
        letter-spacing: -0.32px;
    }

    .card-section--rooms-cards .card__link {
        margin-top: 8px;
    }

    .card-section__track,
    .card-section--cols-4 .card-section__track,
    .card-section--journal .card-section__track {
        --card-image-h: auto;
        grid-auto-flow: column;
        grid-template-columns: none;
        grid-auto-columns: min(330px, calc(100% - 23px));
        gap: 20px;
        margin-right: calc(-1 * var(--pad-x));
        padding-right: var(--pad-x);
        scroll-padding-left: 0;
        overflow-x: auto;
        overflow-y: hidden;
    }

    .card-section__side {
        display: contents;
    }

    .card-section__track .card__media {
        height: auto;
        aspect-ratio: 4 / 3;
    }

    .card-section--rooms-cards .card-section__track .card__media {
        aspect-ratio: 313 / 249;
    }

    .card-section__track .card--feature,
    .card-section__track .card--small {
        --card-image-h: auto;
    }
}

/* The rooms' cards a little narrower, as on the mobile frames */
@media (max-width: 1024px) {
    .card-section--rooms-cards .card-section__track {
        grid-auto-columns: min(313px, calc(100% - 40px));
    }

    /* Buttons under the cards: the main one the full width, the other
       under it, as the Dining and Weddings features */
    .card-section__bottom .card-section__actions {
        flex-direction: column-reverse;
        gap: 12px;
        width: 100%;
    }

    .card-section__bottom .card-section__primary {
        width: 100%;
    }
}

/* Mobile: the buttons sit where the section says for mobile (tablet
   keeps them where they are on desktop). */
@media (max-width: 767px) {
    .card-section__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .card-section--actions-bottom .card-section__top .card-section__actions {
        display: flex;
    }

    .card-section--mobile-actions-bottom .card-section__top,
    .card-section--mobile-actions-top .card-section__bottom {
        display: none;
    }

    .card-section--actions-top.card-section--mobile-actions-bottom .card-section__bottom {
        display: flex;
    }

    /* The main button under the heading the full width (Browse all rooms) */
    .card-section__top,
    .card-section__top .card-section__actions,
    .card-section__top .card-section__primary {
        width: 100%;
    }
}


/* ── Tabs (Home's rooms: All, Rooms, Suites) ──────────────────
   Figma 1498:17897. Under the title on the left, the buttons and
   arrows on the right; a grey line under them, copper under the one
   showing.
   ─────────────────────────────────────────────────────────── */
.card-section--tabs .card-section__header {
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
}

/* The title the full width, on one line where it fits */
.card-section--tabs .card-section__heading {
    max-width: none;
}

/* The tabs left; the button then the arrows right */
.card-section__bar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px 32px;
}

.card-section__bar .card-section__top {
    flex-direction: row-reverse;
}

.card-section__tabs {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    gap: 3px;
    max-width: 100%;
}

.card-section__tab-list {
    display: flex;
    gap: 24px;
}

.card-section__tab {
    padding: 0;
    border: 0;
    background: none;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.65;
    letter-spacing: 0.08px;
    color: var(--color-beamwood);
    white-space: nowrap;
    cursor: pointer;
    transition: color var(--transition);
}

.card-section__tab:hover {
    color: var(--color-copper-text);
}

.card-section__tab:focus-visible {
    outline: 2px solid var(--color-copper);
    outline-offset: 4px;
}

/* The grey line, and the copper bar under the tab showing */
.card-section__tab-bar {
    position: relative;
    display: block;
    height: 3px;
    background: #DFDCD8;
}

.card-section__tab-bar::after {
    content: "";
    position: absolute;
    top: 0;
    left: var(--tab-x, 0px);
    width: var(--tab-w, 35px);
    height: 3px;
    background: var(--color-copper);
    transition: left var(--transition), width var(--transition);
}

@media (prefers-reduced-motion: reduce) {
    .card-section__tab-bar::after {
        transition: none;
    }
}

/* Tablet and mobile: the buttons go under the cards anyway. Wider apart,
   and taller, so each tab is easier to tap */
@media (max-width: 1024px) {
    .card-section__tab-list {
        gap: 32px;
    }

    .card-section__tab {
        padding: 6px 0;
    }
}


/* Seasonal (Home's Christmas band, Figma 1873:1534 / mobile 1872:24220):
   32px above it, the heading on one line across, 20px between eyebrow,
   heading and line; cards 32px apart; and each card's Explore … → always
   showing its words, not only on hover. */
@media (min-width: 1025px) {
    .card-section--seasonal {
        padding-top: 32px;
    }

    .card-section--seasonal .card-section__heading {
        gap: 20px;
        max-width: none;
    }

    .card-section--seasonal .card-section__track {
        --track-gap: 32px;
    }

    .card-section--seasonal .card__link.button--secondary {
        gap: 10px;
    }

    .card-section--seasonal .card__link.button--secondary .button__label:not(.screen-reader-text) {
        max-width: none;
        padding-right: 0;
        opacity: 1;
    }
}

/* Phones (Figma 1872:24220): 24px above it, 16px in the heading block. */
@media (max-width: 767px) {
    .card-section--seasonal {
        padding-top: 24px;
    }

    .card-section--seasonal .card-section__heading {
        gap: 16px;
    }
}
