/**
 * InGoal HLS player mount.
 *
 * Occupies exactly the box the Vimeo iframe occupied, because it replaces the
 * iframe INSIDE the wrappers both renderers already emit (.sa-video-embed,
 * .igpr-single-video, .ig-responsive-video__landscape/__portrait). Those
 * wrappers own the aspect ratio and the responsive breakpoint; this owns the
 * poster, the play affordance, and the video element. Changing layout here
 * would move the goalposts for the flag-on diff review (W2), whose whole
 * premise is that every diff is confined to video-embed markup.
 *
 * @package InGoal
 */

.ig-hls-player {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 0;
    background-color: var(--ig-navy, #0A1628);
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    overflow: hidden;
}

/* The iframes these replace are absolutely positioned inside a padding-top
   aspect box, so match that rather than introducing a second sizing model. */
.ig-hls-player video,
.ig-hls-player iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: #000;
}

.ig-hls-player__play {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    padding: 0;
    margin: 0;
    cursor: pointer;
    background: rgba(10, 22, 40, 0.28);
    transition: background-color 0.18s ease;
}

.ig-hls-player__play:hover,
.ig-hls-player__play:focus-visible {
    background: rgba(10, 22, 40, 0.12);
}

/* Visible focus ring — the mount is a real button and keyboard users must be
   able to see where they are. */
.ig-hls-player__play:focus-visible {
    outline: 3px solid var(--ig-gold, #C9A961);
    outline-offset: -3px;
}

.ig-hls-player__play-icon {
    width: 74px;
    height: 74px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--ig-shadow-lg, 0 10px 30px rgba(0, 0, 0, 0.35));
    position: relative;
    transition: transform 0.18s ease;
}

.ig-hls-player__play:hover .ig-hls-player__play-icon {
    transform: scale(1.06);
}

/* Play triangle, drawn rather than shipped as an asset. */
.ig-hls-player__play-icon::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 54%;
    transform: translate(-50%, -50%);
    border-style: solid;
    border-width: 13px 0 13px 21px;
    border-color: transparent transparent transparent var(--ig-navy, #0A1628);
}

.ig-hls-player.is-loading .ig-hls-player__play-icon {
    opacity: 0.55;
    animation: ig-hls-pulse 1s ease-in-out infinite;
}

@keyframes ig-hls-pulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(0.92); }
}

@media (prefers-reduced-motion: reduce) {
    .ig-hls-player__play-icon,
    .ig-hls-player.is-loading .ig-hls-player__play-icon {
        transition: none;
        animation: none;
    }
}

@media (max-width: 600px) {
    .ig-hls-player__play-icon {
        width: 58px;
        height: 58px;
    }
    .ig-hls-player__play-icon::after {
        border-width: 10px 0 10px 16px;
    }
}

/* Last-resort state: no poster, no iframe to fall back to. Keeps the box from
   collapsing to nothing so the page doesn't reflow around a hole. */
.ig-hls-player.is-error {
    min-height: 180px;
}
