/* ===============================================
    Home hero slider
    Artwork carries its own text, so it is never cropped or covered:
    slides are fitted (contain) over a blurred copy of themselves and
    all controls live in a bar underneath.
------------------------*/

.mp-hero {
    --mp-ink: var(--brand-ink);
    --mp-navy: var(--brand-navy);
    --mp-green: var(--brand-green);
    --mp-accent: var(--brand-orange);
    --mp-accent-dark: var(--brand-orange-text);
    --mp-line: var(--brand-line);
    --mp-muted: var(--brand-muted);

    position: relative;
    background: #fff;
}


/* Stage
------------------------*/

.mp-hero__stage {
    position: relative;
    width: 100%; /* explicit, or max-height would shrink the width through the ratio */
    aspect-ratio: 5 / 2;
    max-height: 640px;
    overflow: hidden;
    background: var(--mp-navy);
    touch-action: pan-y;
}

.mp-hero__slides {
    position: absolute;
    inset: 0;
}

.mp-hero .mp-slide {
    position: absolute;
    inset: 0;
    margin: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: opacity .9s ease, visibility 0s linear .9s;
}

.mp-hero .mp-slide.is-active {
    z-index: 1;
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
}

/* blurred copy of the artwork fills whatever the fitted image leaves */
.mp-hero .mp-slide:before {
    content: "";
    position: absolute;
    inset: -40px;
    background: var(--mp-slide-bg, none) center / cover no-repeat;
    filter: blur(28px) saturate(1.15);
}

.mp-hero .mp-slide img {
    position: relative;
    display: block;
    width: 100%;
    max-width: none;
    height: 100%;
    object-fit: contain;
    transform: scale(1.015);
    transition: transform 1.4s ease-out;
}

.mp-hero .mp-slide.is-active img {
    transform: none;
}


/* Control bar
------------------------*/

.mp-hero__bar {
    position: relative;
    z-index: 2;
    background: #fff;
    border-bottom: 1px solid var(--mp-line);
    box-shadow: 0 -12px 30px -20px rgba(var(--brand-navy-rgb), .45);
}

.mp-hero__bar-inner {
    display: flex;
    align-items: center;
    gap: 32px;
    min-height: 78px;
}

.mp-hero__tabs {
    display: flex;
    flex: 1 1 auto;
    gap: 20px;
    min-width: 0;
}

.mp-hero__tab {
    flex: 1 1 0;
    min-width: 0;
    margin: 0;
    padding: 4px 0;
    border: 0;
    border-radius: 4px;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.mp-hero__tab-meta {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 10px;
}

.mp-hero__tab-num {
    flex: none;
    color: #93a0ab;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .08em;
    font-variant-numeric: tabular-nums;
    transition: color .25s ease;
}

.mp-hero__tab-label {
    min-width: 0;
    overflow: hidden;
    color: var(--mp-muted);
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    white-space: nowrap;
    text-overflow: ellipsis;
    transition: color .25s ease;
}

.mp-hero__tab:hover .mp-hero__tab-label,
.mp-hero__tab[aria-selected="true"] .mp-hero__tab-label {
    color: var(--mp-ink);
}

.mp-hero__tab[aria-selected="true"] .mp-hero__tab-num {
    color: var(--mp-accent-dark);
}

.mp-hero__line {
    display: block;
    height: 3px;
    overflow: hidden;
    border-radius: 3px;
    background: var(--mp-line);
}

.mp-hero__fill {
    display: block;
    width: 100%;
    height: 100%;
    background: var(--mp-accent);
    transform: scaleX(0);
    transform-origin: 0 50%;
}

.mp-hero__controls {
    display: flex;
    flex: none;
    gap: 10px;
}

.mp-hero__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: 1px solid var(--mp-line);
    border-radius: 50%;
    background: #fff;
    color: var(--mp-ink);
    cursor: pointer;
    transition: background-color .25s ease, border-color .25s ease, color .25s ease, transform .25s ease;
    -webkit-appearance: none;
    appearance: none;
}

.mp-hero__btn:hover {
    border-color: var(--mp-navy);
    background: var(--mp-navy);
    color: #fff;
}

.mp-hero__btn:active {
    transform: scale(.94);
}

.mp-hero__btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mp-hero__btn .mp-icon-play {
    display: none;
    fill: currentColor;
    stroke-width: 1;
}

.mp-hero.is-paused .mp-icon-pause {
    display: none;
}

.mp-hero.is-paused .mp-icon-play {
    display: block;
}

.mp-hero__tab:focus-visible,
.mp-hero__btn:focus-visible {
    outline: 2px solid var(--mp-green);
    outline-offset: 3px;
}


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

@media (max-width: 991.98px) {

    .mp-hero__stage {
        aspect-ratio: 11 / 5;
    }

    .mp-hero__bar-inner {
        gap: 24px;
    }

    .mp-hero__tabs {
        gap: 14px;
    }
}

/* Phones: tabs shrink to progress segments, the name is still read aloud */
@media (max-width: 767.98px) {

    .mp-hero__bar-inner {
        gap: 16px;
        min-height: 64px;
    }

    .mp-hero__tabs {
        gap: 6px;
    }

    .mp-hero__tab {
        padding: 18px 0;
    }

    .mp-hero__tab-meta {
        display: none;
    }

    .mp-hero__line {
        height: 4px;
    }

    .mp-hero__controls {
        gap: 8px;
    }

    .mp-hero__btn {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 575.98px) {

    .mp-hero__stage {
        aspect-ratio: 2 / 1;
    }

    .mp-hero .container {
        padding-left: 16px;
        padding-right: 16px;
    }

    .mp-hero__bar-inner {
        gap: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {

    .mp-hero .mp-slide,
    .mp-hero .mp-slide img,
    .mp-hero__btn {
        transition: none;
    }

    .mp-hero .mp-slide img {
        transform: none;
    }
}
