/* Homepage slider — scoped styles (prefix: .hero-)
   base.html links this before css/styles.css, so every rule on an element that a site-wide rule there
   also reaches (.carousel-item, its img, h1 and p, section) starts at .hero-slider to win over it;
   the .hero-slider__* elements are reached by none. The values are those of the Education Quality Assurance
   page's hero: the site's brand blue (#0096db) and the Roboto Slab font from base.html. */

.hero-slider {
    --hero-primary: #0096db;
    --hero-primary-dark: #0987c2;
    --hero-deep: #075e87;
    --hero-deep-rgb: 7, 94, 135;
    /* from 1200px every slide takes the frame of the slider's pictures (2000 × 830), so a picture
       with its text drawn in fills it uncropped and the slides keep one height */
    --hero-ratio: 2000 / 830;
    /* the room the tabs take at the bottom of the frame from 1200px */
    --hero-nav-space: 104px;
    /* overrides the global `section { padding: 3.5rem 0 }` from styles.css */
    padding: 0;
    background: var(--hero-deep);
}

.hero-slider .carousel-item {
    max-height: none;
    overflow: hidden;
}

/* A picture with its text drawn in is shown whole: cropping it to a fixed height cut its words off.
   Three classes, to win over the global `.carousel-item.active img { transform: scale(1.2) }`. */
.hero-slider .carousel-item .hero-slide__photo {
    display: block;
    width: 100%;
    height: auto;
    transform: none;
    transition: none;
}

/* ---------- A slide with its text on the page ---------- */
.hero-slider .hero-slide--text .hero-slide__photo {
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

@media (min-width: 768px) {
    .hero-slider .hero-slide--text .hero-slide__photo {
        aspect-ratio: var(--hero-ratio);
    }
}

.hero-slider .hero-slide__body {
    background: linear-gradient(160deg, var(--hero-primary-dark) 0%, var(--hero-deep) 100%);
    padding: 26px 0 8px;
}

.hero-slider .hero-slide__text {
    max-width: 640px;
    color: #fff;
}

/* overrides the global `.carousel-item h1` and `.carousel-item p` from styles.css */
.hero-slider .hero-slide__text * {
    text-shadow: none;
}

.hero-slider .hero-slide__eyebrow {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 16px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
    opacity: .9;
}

.hero-slider .hero-slide__eyebrow::before {
    content: "";
    width: 32px;
    height: 2px;
    background: currentColor;
}

.hero-slider .hero-slide__title {
    margin: 0 0 20px;
    color: #fff;
    font-size: clamp(30px, 5vw, 54px);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: 0;
    text-transform: none;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-slider .hero-slide__lead {
    max-width: 560px;
    margin: 0 0 32px;
    color: rgba(255, 255, 255, .92);
    font-size: clamp(15px, 1.6vw, 18px);
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-slider .hero-slide__cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
}

.hero-slider .hero-slide__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 13px 24px;
    border-radius: 999px;
    border: 2px solid transparent;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    transition: transform .15s ease, background .15s ease, color .15s ease, border-color .15s ease;
}

.hero-slider .hero-slide__btn:hover {
    transform: translateY(-2px);
    text-decoration: none;
}

.hero-slider .hero-slide__btn--primary {
    background: var(--hero-primary);
    color: #fff;
    box-shadow: 0 8px 20px -8px rgba(0, 150, 219, .8);
}

.hero-slider .hero-slide__btn--primary:hover {
    background: var(--hero-primary-dark);
    color: #fff;
}

.hero-slider .hero-slide__btn--ghost {
    background: transparent;
    color: #fff;
    border-color: rgba(255, 255, 255, .55);
}

.hero-slider .hero-slide__btn--ghost:hover {
    background: rgba(255, 255, 255, .12);
    color: #fff;
    border-color: #fff;
}

.hero-slider .hero-slide__phone {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    gap: 8px;
    margin-left: 10px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
}

.hero-slider .hero-slide__phone:hover {
    color: #fff;
    text-decoration: underline;
}

.hero-slider a:focus-visible,
.hero-slider button:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

@media (max-width: 575.98px) {
    .hero-slider .hero-slide__cta {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .hero-slider .hero-slide__phone {
        justify-content: center;
        margin: 4px 0 0;
    }
}

/* ---------- The tabs: one per slide, its bar filling over the slide's interval ---------- */
.hero-slider__nav {
    background: var(--hero-deep);
    color: #fff;
    padding: 6px 0 18px;
}

.hero-slider__nav-inner {
    display: flex;
    align-items: center;
    gap: 16px;
}

.hero-slider__tabs {
    flex: 1;
    min-width: 0;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 6px;
}

.hero-slider__tab {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 10px;
    min-width: 0;
    padding: 12px 0;
    border: 0;
    background: none;
    color: #fff;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    text-align: left;
    opacity: .62;
    cursor: pointer;
    transition: opacity .15s ease;
}

.hero-slider__tab:hover,
.hero-slider__tab:focus-visible,
.hero-slider__tab.active {
    opacity: 1;
}

.hero-slider__tab-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity .3s ease;
}

.hero-slider__tab-bar {
    height: 3px;
    border-radius: 2px;
    background: rgba(255, 255, 255, .3);
    overflow: hidden;
}

.hero-slider__tab-bar i {
    display: block;
    height: 100%;
    background: #fff;
    transform: scaleX(0);
    transform-origin: left center;
}

/* slider.js moves the carousel on when the active bar's fill ends */
.hero-slider__tab.active .hero-slider__tab-bar i {
    animation: hero-progress var(--hero-interval, 7000ms) linear forwards;
}

.hero-slider.is-paused .hero-slider__tab.active .hero-slider__tab-bar i,
.hero-slider:has(:focus-visible) .hero-slider__tab.active .hero-slider__tab-bar i {
    animation-play-state: paused;
}

@media (hover: hover) {
    .hero-slider:hover .hero-slider__tab.active .hero-slider__tab-bar i {
        animation-play-state: paused;
    }
}

@keyframes hero-progress {
    to {
        transform: scaleX(1);
    }
}

.hero-slider__count {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.hero-slider__controls {
    display: flex;
    gap: 10px;
}

.hero-slider__ctrl {
    width: 44px;
    height: 44px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .55);
    background: transparent;
    color: #fff;
    transition: background .15s ease, border-color .15s ease;
}

.hero-slider__ctrl:hover {
    background: rgba(255, 255, 255, .12);
    border-color: #fff;
}

/* Below 1200px the slide's text stands under its photo, and the tabs are bars with a count:
   their names stay for screen readers, and a swipe moves the slides. */
@media (max-width: 1199.98px) {
    .hero-slider__tab-label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
    }

    .hero-slider__tab {
        min-height: 44px;
        padding: 0;
        justify-content: center;
    }

    .hero-slider__controls [data-bs-slide] {
        display: none;
    }
}

/* ---------- From 1200px: one frame for every slide, the text over the photo, the tabs along its bottom ---------- */
@media (min-width: 1200px) {
    .hero-slider .carousel-item {
        aspect-ratio: var(--hero-ratio);
    }

    .hero-slider .carousel-item .hero-slide__photo {
        position: absolute;
        inset: 0;
        height: 100%;
        aspect-ratio: auto;
        object-fit: cover;
    }

    .hero-slider .hero-slide__body {
        position: absolute;
        inset: 0;
        display: flex;
        align-items: center;
        padding: 24px 0 var(--hero-nav-space);
        background: linear-gradient(90deg, rgba(var(--hero-deep-rgb), .94) 0%, rgba(var(--hero-deep-rgb), .82) 30%, rgba(var(--hero-deep-rgb), .25) 58%, rgba(var(--hero-deep-rgb), 0) 72%);
    }

    .hero-slider .hero-slide__body > .container {
        width: 100%;
    }

    /* the frame grows with the width, so the title does too: 54px from 1440px, 45px at 1200px,
       where three lines of title and two of text still clear the tabs */
    .hero-slider .hero-slide__title {
        font-size: clamp(30px, 3.75vw, 54px);
    }

    .hero-slider .hero-slide__lead {
        -webkit-line-clamp: 2;
    }

    .hero-slider__nav {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 2;
        padding: 56px 0 24px;
        background: linear-gradient(0deg, rgba(4, 40, 60, .5) 0%, rgba(4, 40, 60, 0) 100%);
        pointer-events: none;
    }

    .hero-slider__nav-inner {
        pointer-events: auto;
    }

    .hero-slider__tabs {
        gap: 28px;
    }

    /* over a picture with its text drawn in, the names of the other slides would sit on its words */
    .hero-slider.is-picture .hero-slider__tab-label {
        opacity: 0;
    }

    .hero-slider__count {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-slider .hero-slide__btn,
    .hero-slider .hero-slide__btn:hover {
        transition: none;
        transform: none;
    }
}
