/* ── Past events ─────────────────────────────────────────────
   Figma (What's on, Our past events): desktop 1366:93568, mobile
   1366:93455. The row as the photo row's; each tile as Stay's
   room types (category tiles): the name over the picture, the
   details opening under it on hover.
   ─────────────────────────────────────────────────────────── */

.past-events {
    padding: 20px var(--pad-x) 64px;
}

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

.past-events__header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

/* Figma Desktop/H2 */
.past-events__title {
    font-size: 64px;
    line-height: 0.9;
    letter-spacing: -0.96px;
}

.past-events__arrows {
    display: flex;
    gap: 20px;
}

.past-events__track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - 2 * 16px) / 3);
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.past-events__track::-webkit-scrollbar {
    display: none;
}

/* The tile: the picture, a wash, the name at the foot */
.past-events__tile {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    aspect-ratio: 4 / 3;
    padding: 20px;
    overflow: hidden;
    isolation: isolate;
    scroll-snap-align: start;
    background: var(--color-beamwood);
    color: var(--color-canvas);
}

.past-events__image {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.past-events__tile:hover .past-events__image {
    transform: scale(1.03);
}

/* Lighter at rest, deeper when open (category tiles' washes) */
.past-events__tile::before,
.past-events__tile::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    transition: opacity var(--transition);
}

.past-events__tile::before {
    background: linear-gradient(359.33deg, rgba(0, 0, 0, 0.6) -9.34%, rgba(0, 0, 0, 0.6) 11.52%, rgba(0, 0, 0, 0) 64.57%);
}

.past-events__tile::after {
    background: linear-gradient(359deg, rgba(0, 0, 0, 0.9) -9.34%, rgba(0, 0, 0, 0.85) 30%, rgba(0, 0, 0, 0) 85%);
    opacity: 0;
}

.past-events__body {
    display: flex;
    flex-direction: column;
}

.past-events__name {
    font-size: 28px;
    font-weight: 300;
    line-height: 1.15;
    letter-spacing: -0.14px;
}

/* The details and arrow open up under the name */
.past-events__more {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    transition: grid-template-rows var(--transition), opacity var(--transition);
}

.past-events__more-inner {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    min-height: 0;
    overflow: hidden;
}

.past-events__words {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    padding-top: 8px;
}

.past-events__when {
    font-family: var(--font-heading);
    font-size: 15px;
    font-style: italic;
    color: var(--color-candle-wax);
}

.past-events__place,
.past-events__text {
    font-size: 14px;
    line-height: 1.55;
    letter-spacing: 0.07px;
    color: rgba(240, 239, 236, 0.85);
}

.past-events__place {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* A few lines, then an ellipsis: the rest is on the event's page */
.past-events__text {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.past-events__link {
    flex-shrink: 0;
    margin-left: auto;
}

/* The arrow stays put: its row hides what runs past its edge */
.past-events__link .button__icon,
.past-events__link:hover .button__icon {
    transform: none;
}

/* The arrow's hit area covers the tile */
.past-events__link::after {
    content: "";
    position: absolute;
    inset: 0;
}

.past-events__tile:hover::after,
.past-events__tile:focus-within::after {
    opacity: 1;
}

.past-events__tile:hover .past-events__more,
.past-events__tile:focus-within .past-events__more {
    grid-template-rows: 1fr;
    opacity: 1;
}

.past-events__tile:focus-within {
    outline: 2px solid var(--color-copper);
    outline-offset: -2px;
}

.past-events__link:focus-visible {
    outline: none;
}

@media (prefers-reduced-motion: reduce) {
    .past-events__image {
        transition: none;
    }
}


/* Tablet and mobile — 1024px and below: no hover, so the details show */
@media (max-width: 1024px) {
    .past-events {
        padding: 20px var(--pad-x) var(--pad-y);
    }

    .past-events__inner {
        gap: 20px;
    }

    .past-events__title {
        font-size: 32px;
        line-height: 1.06;
        letter-spacing: -0.32px;
    }

    .past-events__arrows {
        display: none;
    }

    /* Two and a peek, swiped */
    .past-events__track {
        grid-auto-columns: calc((100% - 20px) / 2.15);
        gap: 20px;
        margin-right: calc(-1 * var(--pad-x));
        padding-right: var(--pad-x);
    }

    .past-events__tile {
        padding: 16px;
    }

    .past-events__tile::before {
        opacity: 0;
    }

    .past-events__tile::after {
        opacity: 1;
    }

    .past-events__name {
        font-size: 24px;
        line-height: 1.18;
        letter-spacing: -0.12px;
    }

    .past-events__more {
        grid-template-rows: 1fr;
        opacity: 1;
    }

    .past-events__place {
        display: none;
    }
}

@media (max-width: 767px) {
    .past-events__track {
        grid-auto-columns: min(330px, calc(100% - 23px));
    }

    .past-events__tile {
        aspect-ratio: 4 / 3.4;
    }
}
