/* ============================================================
   ACCOMMODATION — repeating asymmetric grid
   Visually mirrors the homepage `.our-rooms__grid`:
     - 2-column grid
     - Every 3rd card from index 1 (1, 4, 7, 10, …) is TALL
       (col 1, span 2 rows). Auto-flow places the rest into col 2,
       producing the "1 tall + 2 wide stacked" rhythm for any count.
   All values come from utility.css design tokens.
   ============================================================ */
.accommodation-wrapper {
    background: var(--color-cream-50);
    padding: var(--space-20) 0;
}

.accommodation-wrapper .accommodation-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: clamp(180px, 24vw, 260px);
    gap: var(--space-4);
}

/* Tall cards: every 3rd starting from card 1 (1, 4, 7, 10, …) */
.accommodation-wrapper .accom-room-card:nth-child(3n + 1) {
    grid-column: 1;
    grid-row: span 2;
}

/* ---- Card base ---- */
.accommodation-wrapper .accom-room-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--space-1);
    background: var(--color-neutral-200);
    color: var(--primary-contrast);
    isolation: isolate;
    transition: transform 0.45s cubic-bezier(0.22, 0.61, 0.36, 1),
        box-shadow 0.45s ease;
}

.accommodation-wrapper .accom-room-card:hover,
.accommodation-wrapper .accom-room-card:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 var(--space-4) var(--space-10) calc(var(--space-4) * -1) var(--primary-alpha-40);
}

/* Stretched-link: the <a> is empty + absolutely positioned to cover
   the whole card, so the card is clickable but the inner "Book now"
   link is NOT nested inside it (avoids invalid HTML). */
.accommodation-wrapper .accom-room-card__link {
    position: absolute;
    inset: 0;
    z-index: 3;
    text-decoration: none;
    color: inherit;
}

.accommodation-wrapper .accom-room-card__link:focus-visible {
    outline: 3px solid var(--a11y-focus-ring);
    outline-offset: -3px;
}

/* ---- Media ---- */
.accommodation-wrapper .accom-room-card__media {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background: var(--color-neutral-100);
}

.accommodation-wrapper .accom-room-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: scale(1.02);
    transition: transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
    will-change: transform;
}

.accommodation-wrapper .accom-room-card:hover .accom-room-card__img,
.accommodation-wrapper .accom-room-card:focus-within .accom-room-card__img {
    transform: scale(1.08);
}

/* "No image" placeholder — primary-blue gradient (uses sky palette) */
.accommodation-wrapper .accom-room-card__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    color: var(--primary-contrast);
    background:
        radial-gradient(120% 120% at 100% 50%,
            var(--primary-dark) 0%,
            var(--primary-darker) 100%),
        var(--primary-darker);
    font-family: var(--font-sora);
    font-weight: var(--font-semibold);
    font-size: var(--text-sm);
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.accommodation-wrapper .accom-room-card__placeholder svg {
    width: var(--space-12);
    height: var(--space-12);
    stroke: var(--primary-contrast);
}

/* ---- Bottom gradient overlay ---- */
.accommodation-wrapper .accom-room-card__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg,
            transparent 35%,
            color-mix(in srgb, var(--color-ink-900) 45%, transparent) 75%,
            color-mix(in srgb, var(--color-ink-900) 78%, transparent) 100%);
    transition: background 0.45s ease;
    pointer-events: none;
}

.accommodation-wrapper .accom-room-card:hover .accom-room-card__overlay,
.accommodation-wrapper .accom-room-card:focus-within .accom-room-card__overlay {
    background: linear-gradient(180deg,
            color-mix(in srgb, var(--color-ink-900) 5%, transparent) 0%,
            color-mix(in srgb, var(--color-ink-900) 55%, transparent) 60%,
            color-mix(in srgb, var(--color-ink-900) 85%, transparent) 100%);
}

/* ---- Content (title + excerpt) ---- */
.accommodation-wrapper .accom-room-card__content {
    position: absolute;
    inset: auto 0 0 0;
    z-index: 2;
    padding: var(--space-5) var(--space-6);
    color: var(--primary-contrast);
    pointer-events: none;
}

.accommodation-wrapper .accom-room-card__title {
    margin: 0;
    color: var(--primary-contrast);
    font-family: var(--font-cormorant);
    font-weight: var(--font-semibold);
    font-size: var(--text-lg);
    line-height: 1.2;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-shadow: 0 var(--space-1) var(--space-4) color-mix(in srgb, var(--color-ink-900) 45%, transparent);
}

.accommodation-wrapper .accom-room-card__excerpt {
    margin: var(--space-2) 0 0;
    color: color-mix(in srgb, var(--primary-contrast) 88%, transparent);
    font-family: var(--font-sora);
    font-size: var(--text-sm);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.4s ease, margin-top 0.4s ease;
}

.accommodation-wrapper .accom-room-card:hover .accom-room-card__excerpt,
.accommodation-wrapper .accom-room-card:focus-within .accom-room-card__excerpt {
    max-height: var(--space-12);
    opacity: 1;
}

/* Tall cards have the room: show 3 lines */
.accommodation-wrapper .accom-room-card:nth-child(3n + 1) .accom-room-card__excerpt {
    -webkit-line-clamp: 3;
}

.accommodation-wrapper .accom-room-card:nth-child(3n + 1):hover .accom-room-card__excerpt,
.accommodation-wrapper .accom-room-card:nth-child(3n + 1):focus-within .accom-room-card__excerpt {
    max-height: var(--space-16);
}

/* ---- Actions (floating Book-now button at top-right) ---- */
.accommodation-wrapper .accom-room-card__actions {
    position: absolute;
    inset: var(--space-3) var(--space-3) auto auto;
    z-index: 4;
    display: flex;
    gap: var(--space-2);
    opacity: 0;
    transform: translateY(calc(var(--space-1) * -1));
    transition: opacity 0.35s ease, transform 0.35s ease;
    pointer-events: none;
}

.accommodation-wrapper .accom-room-card:hover .accom-room-card__actions,
.accommodation-wrapper .accom-room-card:focus-within .accom-room-card__actions {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.accommodation-wrapper .accom-room-card__book {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--primary-solid);
    color: var(--primary-contrast);
    border: 1px solid var(--primary-solid);
    border-radius: var(--space-1);
    font-family: var(--font-sora);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.accommodation-wrapper .accom-room-card__book svg {
    width: var(--space-4);
    height: var(--space-4);
}

.accommodation-wrapper .accom-room-card__book:hover,
.accommodation-wrapper .accom-room-card__book:focus-visible {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: var(--primary-contrast);
    transform: translateX(2px);
    outline: none;
}

.accommodation-wrapper .accom-room-card__book:focus-visible {
    box-shadow: 0 0 0 3px var(--primary-alpha-40);
}

/* ---- High-contrast mode ---- */
body.high-contrast .accommodation-wrapper .accom-room-card__book {
    background: var(--color-neutral-0);
    color: var(--color-neutral-950);
    border-color: var(--color-neutral-0);
}

body.high-contrast .accommodation-wrapper .accom-room-card__placeholder {
    background: var(--color-neutral-950);
    color: var(--color-neutral-0);
    border: 1px solid var(--color-neutral-0);
}

/* ---- Responsive ---- */
@media (max-width: 991px) {
    .accommodation-wrapper .accommodation-card-grid {
        grid-auto-rows: clamp(160px, 28vw, 220px);
    }

    .accommodation-wrapper .accom-room-card__title {
        letter-spacing: 0.08em;
    }
}

@media (max-width: 767px) {
    .accommodation-wrapper {
        padding: var(--space-12) 0;
    }

    /* Collapse to single column; cancel all spans */
    .accommodation-wrapper .accommodation-card-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: clamp(180px, 52vw, 260px);
        gap: var(--space-3);
    }

    .accommodation-wrapper .accom-room-card:nth-child(3n + 1) {
        grid-column: 1;
        grid-row: auto;
    }

    /* On touch devices the actions are always visible (no hover) */
    .accommodation-wrapper .accom-room-card__actions {
        opacity: 1;
        transform: none;
        pointer-events: auto;
    }
}