/* ══════════════════════════════════════════════════════════════════
   Videos — poster tiles + modal player.
   Two patterns:
   1. Row of tiles (home) → click plays IN-PLACE (poster swapped for <video>).
   2. Single card (custom tour + tour aside) → click opens MODAL <dialog>.
   All source clips are 9:16 vertical.
   ══════════════════════════════════════════════════════════════════ */

/* ── Home strip section ── */
.rx-videos-strip {
    position: relative;
    z-index: 1;
    padding: clamp(2rem, 5vw, 3.5rem) 0;
    /* Transparent on mobile — the horizontal-snap row has visible gaps
       between tiles, and a section-level gradient would peek through them
       as a hard-looking gray band. Desktop restores the gradient below. */
    background: transparent;
    /* Parent `.rx-home` is a flex column and orders its children explicitly:
       rx-hero=1, rx-tours=2, rx-features=3, rx-custom-cta=4. A default (0)
       order would render the strip BEFORE the hero. Matching order:3 ties
       with rx-features and source-order tie-break places us right after it,
       just before the CTA — exactly the intended slot. */
    order: 3;
}
.rx-videos-strip .rx-section-title {
    text-align: center;
    margin: 0 auto clamp(1rem, 2.5vw, 1.75rem);
    padding: 0 clamp(1rem, 5vw, 2rem);
    max-width: 100%;
    box-sizing: border-box;
}

/* Desktop-only subtle gradient (safe here — 3-across grid has no visible
   gaps that would reveal the background as a band). */
@media (min-width: 768px) {
    .rx-videos-strip {
        background: linear-gradient(180deg, #f8faf9 0%, #ffffff 100%);
    }
}
/* Mobile: narrow the title so long headings wrap ("Experience Rome / with us"
   instead of stretching flush to both screen edges). */
@media (max-width: 575.98px) {
    .rx-videos-strip .rx-section-title {
        max-width: 15ch;
    }
}

/* Desktop: 3-across grid. Mobile: horizontal snap-scroll. */
.rx-videos-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(0.75rem, 2vw, 1.5rem);
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 clamp(1rem, 4vw, 2rem);
}
@media (max-width: 767.98px) {
    .rx-videos-row {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 0.75rem;
        padding-left: 1rem;
        padding-right: 1rem;
        scrollbar-width: none;
    }
    .rx-videos-row::-webkit-scrollbar { display: none; }
    .rx-videos-row > * {
        flex: 0 0 82%;
        scroll-snap-align: center;
    }
}

/* ── Shared tile / card visual (poster + play badge) ── */
.rx-video-tile,
.ret-video-card {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 9 / 16;
    padding: 0;
    border: 0;
    border-radius: 18px;
    overflow: hidden;
    background-color: #0b1013;
    background-size: cover;
    background-position: center;
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.14);
    cursor: pointer;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.rx-video-tile:hover,
.rx-video-tile:focus-visible,
.ret-video-card:hover,
.ret-video-card:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 14px 34px rgba(16, 24, 40, 0.2);
    outline: none;
}
.rx-video-tile::after,
.ret-video-card::after {
    /* Subtle bottom scrim for text/icon legibility */
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 45%;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.55) 100%);
    pointer-events: none;
}

.rx-video-play,
.ret-video-card-play {
    position: absolute;
    inset: 0;
    margin: auto;
    width: clamp(56px, 12vw, 76px);
    height: clamp(56px, 12vw, 76px);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    color: #26724f;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1.6rem, 3.5vw, 2.2rem);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
    transition: transform 0.22s ease, background 0.22s ease;
    z-index: 2;
}
.rx-video-tile:hover .rx-video-play,
.ret-video-card:hover .ret-video-card-play {
    transform: scale(1.08);
    background: #ffffff;
}

/* ── In-place replacement video ── */
.rx-video-tile.is-playing,
.ret-video-card.is-playing {
    cursor: default;
    background: #000;
}
.rx-video-tile > video,
.ret-video-card > video {
    display: block;
    width: 100%;
    height: 100%;
    /* `contain` (not cover): keep the whole video visible + controls always in-bounds.
       Cover was cropping/overflowing when box aspect ≠ video aspect, hiding controls. */
    object-fit: contain;
    background: #000;
}

/* Bigger play triangle on desktop */
.rx-video-play svg,
.ret-video-card-play svg {
    width: 26px;
    height: 26px;
}
@media (min-width: 768px) {
    .rx-video-play svg,
    .ret-video-card-play svg {
        width: 34px;
        height: 34px;
    }
}

/* ── Video CARD variant (used on custom-tour + single tour aside) ── */
.ret-video-card {
    max-width: 340px;
    margin: 0 auto;
}
/* Custom-tour variant: landscape thumbnail (looks better beside the hero text).
   The real video is 9:16 and opens in the modal at its native aspect anyway. */
.ret-video-card--horizontal {
    aspect-ratio: 16 / 9;
    max-width: 420px;
}
.ret-video-card--horizontal::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.32);
    pointer-events: none;
    /* Sits under label (z:2) and play button (z:2) — dims the poster only. */
}
.ret-video-card-label {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 14px;
    color: #fff;
    font-weight: 700;
    font-size: 0.98rem;
    text-align: left;
    z-index: 2;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
/* Wrapper for aside placement — matches surrounding card spacing */
.tp-aside-video-block,
.ctr-video-block {
    margin-top: 1.25rem;
}
.ctr-video-block {
    display: flex;
    justify-content: center;
    padding: 0 clamp(1rem, 4vw, 2rem);
    margin-bottom: clamp(1.25rem, 3vw, 2rem);
}
.ctr-video-block-caption {
    text-align: center;
    color: #6f7c80;
    font-size: 0.88rem;
    margin: 0.55rem auto 0;
    max-width: 340px;
}

/* ── Modal player ── */
.ret-video-modal {
    padding: 0;
    border: 0;
    background: transparent;
    max-width: 100vw;
    max-height: 100vh;
    overflow: visible;
}
.ret-video-modal::backdrop {
    background: rgba(8, 12, 15, 0.82);
    backdrop-filter: blur(4px);
}
.ret-video-modal-inner {
    position: relative;
    width: min(360px, 92vw);
    aspect-ratio: 9 / 16;
    background: #000;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}
.ret-video-modal video {
    width: 100%;
    height: 100%;
    display: block;
    background: #000;
}
.ret-video-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 0;
    background: rgba(255, 255, 255, 0.95);
    color: #1a1a1a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    z-index: 3;
    transition: background 0.18s ease, transform 0.18s ease;
}
.ret-video-modal-close:hover {
    background: #ffffff;
    transform: scale(1.06);
}
.ret-video-modal-close svg {
    display: block;
}

/* ── Custom-tour hero placement (desktop: inside hero; mobile: below hero) ── */
/* The .ctr-video-hero copy lives INSIDE the hero header (absolute-positioned
   on desktop). The .ctr-video-block copy lives BELOW the hero. Media queries
   swap which one is visible. */
.ctr-video-hero { display: none; }

@media (min-width: 900px) {
    .ctr-hero {
        /* Ensure absolute-positioned video is contained */
        position: relative;
    }
    .ctr-video-hero {
        display: block;
        position: absolute;
        right: clamp(2rem, 5vw, 4rem);
        bottom: clamp(3rem, 6vw, 5rem);
        z-index: 3;
        width: clamp(280px, 30vw, 380px);
    }
    .ctr-video-hero .ret-video-card {
        max-width: none;
        width: 100%;
    }
    /* Hide the mobile block on desktop */
    .ctr-video-block { display: none; }
}
