/* Videos page. Page hero: see hero.css */

.videos-sec { padding: 80px 0 130px; }

.videos-intro { max-width: 760px; margin: 0 auto 60px; text-align: center; }
.videos-intro p { font-family: var(--poppins); font-size: 18px; color: var(--body-color); }

.video-card { margin: 0 auto; }
/* Keep every video short enough to fit on screen below the sticky header
   (about 130px), so nothing is cut off on short screens */
.video-card-wide {
    max-width: min(1000px, calc((100vh - 170px) * 1024 / 576));
    max-width: min(1000px, calc((100svh - 170px) * 1024 / 576));
}

.video-pair {
    display: flex;
    justify-content: center;
    gap: 60px;
    flex-wrap: wrap;
    margin-bottom: 80px;
}
.video-pair .video-card {
    width: min(380px, max(200px, calc((100vh - 170px) * 478 / 850)));
    width: min(380px, max(200px, calc((100svh - 170px) * 478 / 850)));
    max-width: 100%;
    margin: 0;
}

.video-frame {
    position: relative;
    /* No dark background: at browser zoom levels like 90%/110%/125% the
       rounded, clipped edge lands on a fraction of a pixel and a dark
       background bleeds through as a thin line. The video fills the frame
       (object-fit: cover), so nothing needs to show behind it. */
    background: transparent;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 18px 50px rgba(0,0,0,.18);
}
.video-frame-landscape { aspect-ratio: 1024 / 576; }
.video-frame-portrait { aspect-ratio: 478 / 850; }
.video-frame video {
    display: block;
    /* 1px larger than the frame on every side: at browser zoom levels like
       110%/125%/150% the browser draws the video snapped to whole screen
       pixels, which can leave the frame's last pixel column uncovered (a thin
       line on the right). The overscan is clipped by the frame's rounded corners. */
    width: calc(100% + 2px);
    height: calc(100% + 2px);
    max-width: none;
    margin: -1px;
    /* The frame has the video's exact aspect ratio, so cover crops at most a
       fraction of a pixel. (contain left a sub-pixel strip of the black frame
       background showing at the edge when the frame width was fractional.) */
    object-fit: cover;
}

.video-caption { margin-top: 22px; text-align: center; }
.video-caption h3 {
    font-family: var(--prata);
    font-weight: 400;
    text-transform: uppercase;
    color: var(--header-color);
    margin-bottom: 6px;
}
.video-caption p {
    font-family: var(--poppins);
    font-size: 14px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--marron-btn);
    margin: 0;
}

/* Play / pause overlay */
.video-toggle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 84px;
    height: 84px;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(255,255,255,.7);
    border-radius: 50%;
    background: rgba(82,16,2,.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 10px 30px rgba(0,0,0,.3);
    color: var(--white);
    font-size: 26px;
    cursor: pointer;
    z-index: 2;
    transition: opacity .3s ease, transform .3s ease, background-color .3s ease;
}
.video-toggle .fa-play { margin-left: 5px; } /* optically centre the triangle */
.video-toggle:hover,
.video-toggle:focus-visible { background: rgba(82,16,2,.85); transform: translate(-50%, -50%) scale(1.08); }
.video-toggle:focus-visible { outline: 2px solid var(--white); outline-offset: 4px; }

/* While playing, hide the button until the video is hovered */
.video-frame.is-playing .video-toggle { opacity: 0; pointer-events: none; }
.video-frame.is-playing:hover .video-toggle,
.video-frame.is-playing .video-toggle:focus-visible { opacity: 1; pointer-events: auto; }
@media (hover: none) {
    .video-frame.is-playing:hover .video-toggle { opacity: 0; pointer-events: none; }
}

@media only screen and (max-width: 991px) {
    .videos-sec { padding: 50px 0 80px; }
    .video-pair { gap: 60px; margin-bottom: 60px; }
}

@media only screen and (max-width: 767px) {
    .videos-intro { margin-bottom: 40px; }
    .videos-intro p { font-size: 16px; }
    .video-caption h3 { font-size: 1.4rem; }
    .video-toggle { width: 68px; height: 68px; font-size: 22px; }
}
