/* ============================================================
   Homepage — Video Reels (TikTok / Instagram / MP4) + popup
   Markup: template-parts/home/video-reels.php
   ============================================================ */

.home-videos {
    background: var(--main);
    color: var(--color-white);
}

.home-videos .section-title,
.home-videos .section-subtitle {
    color: var(--color-white);
}

/* Centered header: title, subtitle, then follow buttons stacked */
.home-videos .section-header {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 14px;
}

/* Fewer videos than fit on screen (.is-few set by home-videos.js): center the cards */
.home-videos__slider.is-few .swiper-wrapper { justify-content: center; }
/* Swiper adds a gap after the last slide too — drop it so a full row doesn't overflow when centered */
.home-videos__slider.is-few .swiper-slide:last-child { margin-right: 0 !important; }

.home-videos__follow {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    flex-shrink: 0;
}

.home-videos__follow-btn {
    display: inline-flex;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-white);
    border: 1.5px solid var(--color-white);
    padding: 8px 18px;
    border-radius: 50px;
    white-space: nowrap;
    transition: background .2s, color .2s;
}

.home-videos__follow-btn:hover,
.home-videos__follow-btn:focus-visible {
    background: var(--color-white);
    color: var(--main-dark);
}

/* ── Slider ─────────────────────────────────────────────────── */
.home-videos__slider {
    position: relative;
    padding-bottom: 4px;
}

.video-reel {
    position: relative;
    display: block;
    aspect-ratio: 9 / 16;
    border-radius: 16px;
    overflow: hidden;
    border: 3px solid var(--color-white);
    background: #0d3f3c;
    color: var(--color-white);
    text-decoration: none;
}

.video-reel__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}

.video-reel::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,.65) 0%, rgba(0,0,0,0) 45%);
    pointer-events: none;
}

.video-reel:hover .video-reel__img { transform: scale(1.04); }

/* Hover preview (MP4 only) — created by home-videos.js on first hover */
.video-reel__preview {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity .3s ease;
    pointer-events: none;
}

.video-reel.is-previewing .video-reel__preview { opacity: 1; }
.video-reel.is-previewing .video-reel__play { opacity: 0; transform: scale(.8); }
.video-reel__play { transition: background .2s, transform .2s, opacity .2s; }
.video-reel:focus-visible { outline: 3px solid var(--second); outline-offset: 2px; }

.video-reel__badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .02em;
    padding: 3px 9px;
    border-radius: 50px;
    background: rgba(0,0,0,.55);
    color: var(--color-white);
}

.video-reel__play {
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 1;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 2.5px solid var(--color-white);
    background: rgba(0,0,0,.25);
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 3px;
    transition: background .2s, transform .2s;
}

.video-reel:hover .video-reel__play {
    background: var(--main);
    transform: scale(1.08);
}

.video-reel__caption {
    position: absolute;
    left: 12px;
    right: 66px;
    bottom: 14px;
    z-index: 1;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    text-shadow: 0 1px 3px rgba(0,0,0,.6);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.home-videos__nav {
    position: absolute;
    top: calc(50% - 20px);
    z-index: 2;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 0;
    background: var(--color-white);
    color: var(--main-dark);
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
    cursor: pointer;
    transform: translateY(-50%);
}

.home-videos__nav--prev { left: 8px; }
.home-videos__nav--next { right: 8px; }
.home-videos__nav.is-disabled { opacity: 0; pointer-events: none; }
.home-videos__nav.swiper-button-lock { display: none !important; }

@media (min-width: 768px) {
    .home-videos__nav { display: flex; }
}

.home-videos__dots.swiper-pagination {
    position: relative;
    bottom: auto;
    margin-top: 18px;
}

.home-videos__dots .swiper-pagination-bullet { background: var(--color-white); opacity: .5; }
.home-videos__dots .swiper-pagination-bullet-active { opacity: 1; }

@media (max-width: 767px) {
    .video-reel__play { width: 40px; height: 40px; }
    .video-reel__caption { font-size: 13px; right: 58px; }
}

/* ── Popup ──────────────────────────────────────────────────── */
.video-modal-open,
.video-modal-open body { overflow: hidden; }

.video-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 56px 16px 24px;
}

.video-modal[hidden] { display: none; }

.video-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 20, 20, .94);
}

.video-modal__stage {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    max-height: 100%;
}

.video-modal__frame {
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    /* 9:16 box that always fits the screen */
    height: min(82vh, calc((100vw - 32px) * 16 / 9));
    aspect-ratio: 9 / 16;
    max-width: calc(100vw - 32px);
}

.video-modal__frame--instagram {
    /* Instagram embed includes header + caption: wider, scrollable box */
    aspect-ratio: auto;
    width: min(420px, calc(100vw - 32px));
    height: min(82vh, 760px);
    background: #fff;
}

.video-modal__frame iframe,
.video-modal__frame video {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    object-fit: contain;
    background: #000;
}

.video-modal__frame--instagram iframe { background: #fff; }

.video-modal__open {
    color: #ddd;
    font-size: 14px;
    text-decoration: underline;
}

.video-modal__open:hover { color: var(--color-white); }

.video-modal__close,
.video-modal__arrow {
    position: relative;
    z-index: 2;
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 0;
    background: rgba(255,255,255,.14);
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s;
}

.video-modal__close:hover,
.video-modal__arrow:hover { background: rgba(255,255,255,.28); }

.video-modal__close:focus-visible,
.video-modal__arrow:focus-visible { outline: 2px solid var(--color-white); outline-offset: 2px; }

.video-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
}

.video-modal__arrow[hidden] { display: none; }

@media (max-width: 767px) {
    /* Phones: arrows float over the video edges; swipe also works */
    .video-modal { gap: 0; }
    .video-modal__arrow {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 40px;
        height: 40px;
        background: rgba(0,0,0,.45);
    }
    .video-modal__arrow--prev { left: 6px; }
    .video-modal__arrow--next { right: 6px; }
}
