/* =============================================================
   Shared video trigger + modal styles (all ACF blocks).
   Registered as the 'pifmag-video-modal' handle in inc/enqueue.php
   and listed in each block.json "style" — loads only on pages
   using a block that declares it.
   Design tokens (:root vars) come from style.css.

   Generic classes: .pifmag-video-trigger, .pifmag-video__play,
   .pifmag-video__cap — used by every block with a video trigger.
   ============================================================= */

/* ---------- Trigger (thumbnail with play button) ---------- */

/* <button> reset so the video trigger looks like a plain media link. */
.pifmag-video-trigger {
    padding: 0;
    border: 0;
    background: none;
    text-align: inherit;
    cursor: pointer;
}

/* Play button — 1:1 from mockup .video__play. */
.pifmag-video__play {
    position: absolute;
    inset: 0;
    margin: auto;
    z-index: 3;
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--accent) 92%, transparent);
    display: grid;
    place-items: center;
    transition: transform .2s;
    box-shadow: 0 10px 30px -8px rgba(0, 0, 0, .5);
}

.pifmag-video-trigger:hover .pifmag-video__play,
.pifmag-video-trigger:focus-visible .pifmag-video__play {
    transform: scale(1.07);
}

.pifmag-video__play svg {
    margin-left: 5px;
}

/* Caption on the thumbnail — mockup .video__cap. */
.pifmag-video__cap {
    position: absolute;
    left: 18px;
    bottom: 16px;
    z-index: 3;
    color: #fff;
    font-size: 12px;
    letter-spacing: .04em;
    font-family: var(--font-title);
}

/* ---------- Modal ---------- */

/* Transparent chrome: the video floats on the dimmed backdrop. */
.pifmag-video-modal {
    background-color: rgba(255, 255, 255, 0);
    padding-block: 50px;
}

.pifmag-video-modal .modal-content {
    background-color: rgba(255, 255, 255, 0);
}

.pifmag-video-modal video {
    width: 100%;
    height: 100%;
    background: #000;
}

/* Close button above the video (top-right), rotates on hover. */
.pifmag-video-modal__close {
    position: absolute;
    top: -50px;
    right: 0;
    z-index: 4;
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .3);
    color: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background .2s, transform .25s, border-color .2s;
}

.pifmag-video-modal__close:hover,
.pifmag-video-modal__close:focus-visible {
    background: var(--accent);
    border-color: transparent;
    transform: rotate(90deg);
}

/* Instagram embeds are portrait — center a phone-shaped iframe. */
.pifmag-video-modal__ig {
    display: flex;
    justify-content: center;
    padding: 0 0 8px;
}

.pifmag-video-modal__ig iframe {
    width: min(420px, 100%);
    aspect-ratio: 9 / 16;
    max-height: 80vh;
    border: 0;
    background: #fff;
}
