
/* ─── Inline video container ─────────────────────────────── */

.dp-hero__slide--video {
    background: #000;
    overflow: hidden;
}

.dp-hero-video {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
    overflow: hidden;
    cursor: pointer;
}

/* Iframe covers container with no black bars (object-fit:cover equivalent).
   aspect-ratio:16/9 + min-width/min-height forces the 16:9 frame to always
   fill the container in both axes; centered via transform. */
.dp-hero-video > iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: auto !important;
    height: auto !important;
    min-width: calc(100% + 160px) !important;
    min-height: calc(100% + 160px) !important;
    aspect-ratio: 16 / 9;
    border: 0;
    pointer-events: none;
    display: block;
}

/* Poster thumbnail — shown instantly while the YouTube iframe loads, so the user
   sees the hero immediately instead of a black frame. Fades out once the video plays.
   Sits above the iframe (z-index auto) but below click-area/controls/center button. */
.dp-hero-video__poster {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    opacity: 1;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.dp-hero-video.dp-video--started .dp-hero-video__poster {
    opacity: 0;
}

/* <4-item (full-width solo) video: the poster can be the YouTube thumbnail, which bakes in
   left/right black bars for non-16:9 videos. Zoom it slightly to crop those bars out. */
.dp-hero__grid-main--solo .dp-hero-video__poster {
    transform: scale(1.35) !important;
}

/* Desktop fullscreen overlay: zoom the poster thumbnail to crop letterbox bars. */
@media (min-width: 600px) {
    .dp-video-fullscreen .dp-hero-video__poster {
        transform: scale(1.50) !important;
    }
}

/* Lightbox video: zoom the poster thumbnail to crop letterbox bars. */
.dp-hero-lightbox__video-wrap .dp-hero-video__poster {
    transform: scale(1.50) !important;
}

/* Desktop grid main tile with video */
.dp-hero__grid-main--video {
    position: relative;
    overflow: hidden;
    background: #000;
}

.dp-hero__grid-main--video .dp-hero-video {
    position: absolute;
    inset: 0;
}

/* Transparent overlay — sits above iframe (z-index auto), below controls (z-index 3).
   Captures clicks on the video body and forwards play/pause via JS. */
.dp-hero-video__click-area {
    position: absolute;
    inset: 0;
    z-index: 2;
    cursor: pointer;
}

/* ─── Controls bar ───────────────────────────────────────── */

.dp-hero-video__controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 3;
    height: 64px;
    padding: 0 20px;
    background: rgba(45, 45, 45, 0.4);
    backdrop-filter: blur(7.5px);
    -webkit-backdrop-filter: blur(7.5px);
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.dp-hero-video:hover .dp-hero-video__controls,
.dp-hero-video.dp-video--controls-visible .dp-hero-video__controls {
    opacity: 1;
    pointer-events: auto;
}

.dp-hero-video.dp-video--controls-hidden .dp-hero-video__controls {
    opacity: 0 !important;
    pointer-events: none !important;
}

.dp-hero-video:not(.dp-video--started) .dp-hero-video__controls {
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ─── Left controls ──────────────────────────────────────── */

.dp-video-controls-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

/* ─── Right controls ─────────────────────────────────────── */

.dp-video-controls-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* ─── Timestamp ──────────────────────────────────────────── */

.dp-video-timestamp {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    padding: 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
}

.dp-video-timestamp__current {
    color: #fff;
}

.dp-video-timestamp__sep {
    color: rgba(255, 255, 255, 0.4);
}

.dp-video-timestamp__total {
    color: rgba(255, 255, 255, 0.6);
}

/* ─── Progress bar ───────────────────────────────────────── */

.dp-video-progress {
    flex: 1 0 0;
    position: relative;
    height: 24px;
    display: flex;
    align-items: center;
    cursor: pointer;
    min-width: 0;
}

.dp-video-progress__track {
    position: relative;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.2);
}

.dp-video-progress__buffered {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    pointer-events: none;
    width: 0%;
}

.dp-video-progress__fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: #fff;
    border-radius: 2px;
    pointer-events: none;
    width: 0%;
    transition: width 0.1s linear;
}

.dp-video-progress__thumb {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    left: 0%;
    pointer-events: none;
    transition: left 0.1s linear;
}

.dp-video-progress__seek {
    position: absolute;
    inset: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    margin: 0;
    padding: 0;
    -webkit-appearance: none;
}

/* ─── Control buttons ────────────────────────────────────── */

.dp-video-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #fff;
    padding: 0;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.15s ease;
    line-height: 1;
    flex-shrink: 0;
}

.dp-video-btn:hover {
    background: rgba(255, 255, 255, 0.18);
}

.dp-video-btn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.dp-video-icon {
    display: block;
    flex-shrink: 0;
}

/* ─── Center play button ─────────────────────────────────── */

.dp-hero-video__center-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 4;
    display: flex;
    width: 60px;
    height: 60px;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    background: rgba(45, 45, 45, 0.40);
    backdrop-filter: blur(7.5px);
    -webkit-backdrop-filter: blur(7.5px);
    border: 1px solid rgba(255, 255, 255, 0.20);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.dp-hero-video.dp-video--paused .dp-hero-video__center-btn {
    opacity: 1;
}

/* ─── Fullscreen overlay ─────────────────────────────────── */

.dp-video-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 9100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.95);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.dp-video-fullscreen.open {
    opacity: 1;
    pointer-events: auto;
}

.dp-video-fullscreen__backdrop {
    position: absolute;
    inset: 0;
    cursor: pointer;
}

.dp-video-fullscreen__dialog {
    position: relative;
    width: 90vw;
    max-width: 1200px;
    max-height: calc(100vh - 80px);
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.8);
    z-index: 1;
}

.dp-video-fullscreen__close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 5;
    background: rgba(0, 0, 0, 0.55);
    border: none;
    cursor: pointer;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.dp-video-fullscreen__close:hover {
    background: rgba(0, 0, 0, 0.8);
}

.dp-video-fullscreen__close svg {
    width: 18px;
    height: 18px;
    stroke: #fff;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
}

/* dp-hero-video wrapper fills the fullscreen dialog */
.dp-video-fullscreen__dialog .dp-hero-video {
    position: absolute;
    inset: 0;
}

/* Controls always visible in fullscreen — no hover/tap needed */
.dp-video-fullscreen.open .dp-hero-video .dp-hero-video__controls {
    opacity: 1;
    pointer-events: auto;
}

/* Override hero iframe oversizing — just fill the 16:9 dialog */
.dp-video-fullscreen .dp-hero-video > iframe {
    top: 0 !important;
    left: 0 !important;
    transform: none !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    aspect-ratio: 16 / 9;
}

/* ─── Responsive adjustments ─────────────────────────────── */

@media (min-width: 600px) and (max-width: 1024px) and (hover: none) {
    .dp-hero__grid .dp-hero-video .dp-hero-video__controls {
        opacity: 1;
        pointer-events: auto;
    }
}

/* ── Video slide inside hero lightbox (IsFullWidthVideo) ─── */

.dp-hero-lightbox__slide--video {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.dp-hero-lightbox__video-wrap {
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 2px;
}

.dp-hero-lightbox__video-wrap .dp-hero-video {
    position: absolute;
    inset: 0;
}

/* Override inline-player cover sizing — fill the 16:9 lightbox frame exactly */
.dp-hero-lightbox__video-wrap .dp-hero-video > iframe {
    top: 0 !important;
    left: 0 !important;
    transform: none !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    pointer-events: none !important;
}

@media (max-width: 1024px) and (hover: none) {
    .dp-hero-lightbox__video-wrap .dp-hero-video.dp-video--started .dp-hero-video__controls {
        opacity: 1;
        pointer-events: auto;
    }
}

@media (max-width: 599px) {
    .dp-video-fullscreen__dialog {
        width: 96vw;
    }

    .dp-hero-video__controls {
        height: 38px;
        padding: 0 16px;
        gap: 16px;
    }

    /* Play / replay / timestamp sit close together (2px) per the design. */
    .dp-video-controls-left {
        gap: 2px;
    }
}
