/* ── 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;
}

.card-section__track > .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-4 .card-section__track {
    grid-auto-columns: calc((100% - 3 * var(--track-gap, 24px)) / 4);
    --card-image-h: 228px;
}

/* 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__link {
    margin-top: 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;
}


/* 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: 20px;
    }

    .card-section__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .card-section__heading {
        gap: 16px;
    }

    .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__inner {
        gap: 20px;
    }

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

    /* Tablet and mobile: the buttons sit where the section says. */
    .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;
    }

    .card-section__bottom .card-section__actions {
        flex-direction: column-reverse;
        gap: 12px;
        width: 100%;
    }

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

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