/**
 * YouTube slider. Geometry follows the reference layout: one 16:9 player per
 * slide, 15px corners, dots underneath.
 */

.hebd-yt {
    --hebd-green: #136532;
    --hebd-ink: #1c2b21;

    padding: var(--hebd-section-space, 44px) 0;
    font-family: var(--hebd-font-body);
}

.hebd-yt__title {
    margin: 0 0 24px;
    font-family: var(--hebd-font-heading);
    font-size: 32px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--hebd-ink);
    text-align: center;
}

.hebd-yt__viewport {
    position: relative;
    /* A centred featured video rather than an edge-to-edge banner. The 16:9
       frame scales from this width, so the ratio is always preserved. */
    max-width: 840px;
    margin-inline: auto;
}

.hebd-yt__swiper {
    overflow: hidden;
    border-radius: 15px;
}

.hebd-yt__slide {
    height: auto;
}

/* ------------------------------------------------------------------ */
/* Player                                                              */
/* ------------------------------------------------------------------ */

.hebd-yt__frame {
    position: relative;
    aspect-ratio: 16 / 9;
    width: 100%;
    border-radius: 15px;
    overflow: hidden;
    background: #000;
}

.hebd-yt__poster {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: #000;
    cursor: pointer;
}

.hebd-yt__poster[hidden] {
    display: none;
}

.hebd-yt__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .5s ease, opacity .3s ease;
}

.hebd-yt__poster:hover .hebd-yt__image {
    transform: scale(1.02);
    opacity: .92;
}

.hebd-yt__play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 68px;
    height: 48px;
    display: block;
    pointer-events: none;
}

.hebd-yt__play svg {
    display: block;
    width: 100%;
    height: 100%;
}

.hebd-yt__play-bg {
    fill: #212121;
    fill-opacity: .8;
    transition: fill .18s ease, fill-opacity .18s ease;
}

.hebd-yt__poster:hover .hebd-yt__play-bg,
.hebd-yt__poster:focus-visible .hebd-yt__play-bg {
    fill: #f00;
    fill-opacity: 1;
}

.hebd-yt__poster:focus-visible {
    outline: 3px solid rgba(19, 101, 50, .5);
    outline-offset: -3px;
}

.hebd-yt__iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.hebd-yt .screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

/* ------------------------------------------------------------------ */
/* Navigation                                                          */
/* ------------------------------------------------------------------ */

.hebd-yt__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid #e2e8e4;
    border-radius: 50%;
    background: #fff;
    color: var(--hebd-green);
    cursor: pointer;
    box-shadow: 0 2px 12px -4px rgba(16, 40, 26, .5);
    transition: background-color .18s ease, color .18s ease, opacity .18s ease;
}

.hebd-yt__nav:hover {
    background: var(--hebd-green);
    color: #fff;
}

.hebd-yt__nav--prev {
    left: 16px;
}

.hebd-yt__nav--next {
    right: 16px;
}

.hebd-yt__nav.swiper-button-disabled,
.hebd-yt__nav.swiper-button-lock {
    opacity: 0;
    pointer-events: none;
}

/* ------------------------------------------------------------------ */
/* Dots                                                                */
/* ------------------------------------------------------------------ */

.hebd-yt__pagination.swiper-pagination {
    position: static;
    margin-top: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.hebd-yt__pagination .swiper-pagination-bullet {
    width: 9px;
    height: 9px;
    margin: 0 !important;
    background: #c9d2cc;
    opacity: 1;
    transition: background-color .18s ease, transform .18s ease;
}

.hebd-yt__pagination .swiper-pagination-bullet-active {
    background: var(--hebd-ink);
    transform: scale(1.15);
}

.hebd-yt-empty {
    padding: 24px;
    text-align: center;
    color: #6b7c71;
    border: 1px dashed #e2e8e4;
    border-radius: 12px;
}

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */

@media (max-width: 767.98px) {
    .hebd-yt {
        padding: 32px 0;
    }

    .hebd-yt__title {
        font-size: 22px;
        margin-bottom: 16px;
    }

    .hebd-yt__frame,
    .hebd-yt__swiper {
        border-radius: 10px;
    }

    .hebd-yt__play {
        width: 54px;
        height: 38px;
    }

    .hebd-yt__nav {
        width: 36px;
        height: 36px;
    }

    .hebd-yt__nav--prev {
        left: 8px;
    }

    .hebd-yt__nav--next {
        right: 8px;
    }
}
