/**
 * trc-video-lightbox.css — modal styling for trc-video-lightbox.js.
 *
 * Loaded on every page where a `.trc-video-trigger` or `.trc-watch-video-btn`
 * could exist. The actual lightbox element is created on-demand by JS, so
 * these rules only apply once a video is opened.
 */

.trc-video-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
    /* KAAM-QA (Anuja 2026-08-04) — fade-in animation on open matches LIVE.
       display swaps flex/none, but opacity + transition give the smooth entry. */
    opacity: 0;
    transition: opacity 0.25s ease-out;
}

.trc-video-lightbox.is-open {
    display: flex;
    opacity: 1;
}

.trc-video-lightbox__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(2px);
    cursor: pointer;
}

.trc-video-lightbox__inner {
    position: relative;
    /* LIVE parity (2026-07-28) — LIVE uses `.videoWrapper { width: 800px }`
       fixed-width popup. Matches LIVE exactly on desktop, plus a mobile
       fallback so it doesn't overflow small viewports. */
    width: 800px;
    max-width: min(90vw, 800px);
    z-index: 1;
}

/* KAAM-QA (Anuja 2026-08-04): close button INSIDE the video, matching LIVE's
   `#close-btn` (LIVE spec: top:10 right:10, bg rgba(255,255,255,0.9), black icon,
   transition `background 0.3s, transform 0.2s`). Prior STG used top:-44 right:0
   which put the X ABOVE the video and outside the screen edge on some viewports.
   z-index:2 ensures it renders above the iframe. */
.trc-video-lightbox__close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 4px;
    color: #000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s, transform 0.2s;
    z-index: 2;
}

.trc-video-lightbox__close:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.08);
}

.trc-video-lightbox__close:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.trc-video-lightbox__frame-wrap {
    position: relative;
    width: 100%;
    /* Modern aspect-ratio (widely supported since 2021) gives parent a REAL
       computed height so child's height:100% resolves correctly. Previous
       padding-top:56.25% hack made height "indefinite" per CSS spec, causing
       iframe height:100% to fall back to intrinsic 150px on 1920 viewport. */
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.trc-video-lightbox__iframe {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    border: 0;
    display: block;
}

/* Prevent page scroll while open */
body.trc-video-lightbox-open {
    overflow: hidden;
}

/* Mobile */
@media (max-width: 767px) {
    .trc-video-lightbox {
        padding: 12px;
    }
    .trc-video-lightbox__close {
        /* Still INSIDE video on mobile — smaller size to save real estate */
        top: 8px;
        right: 8px;
        width: 34px;
        height: 34px;
    }
    .trc-video-lightbox__frame-wrap {
        border-radius: 4px;
    }
}
