.montessori-hero {
    position: relative;
    isolation: isolate;
    color: #fff;
    background: #68584d;
    --hero-arrow-size: 70px;
}

.montessori-hero__track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
}

.montessori-hero__slide {
    position: relative;
    flex: 0 0 100%;
    height: 500px;
    scroll-snap-align: start;
    overflow: hidden;
}

.montessori-hero [hidden] {
    display: none;
}

@media (prefers-reduced-motion: no-preference) {
    .montessori-hero__slide:not([hidden]) {
        animation: montessori-slide-reveal 300ms ease-out;
    }

    @keyframes montessori-slide-reveal {
        from { opacity: 0; }
        to { opacity: 1; }
    }

    .montessori-hero__slide:not([hidden]) .montessori-hero__copy p {
        animation: montessori-lead-reveal 1500ms 300ms cubic-bezier(.7, 0, .84, 0) both;
    }

    .montessori-hero__slide:not([hidden]) .montessori-hero__copy h3 {
        animation: montessori-title-reveal 2000ms 200ms cubic-bezier(.76, 0, .24, 1) both;
    }

    .montessori-hero__slide:not([hidden]) .montessori-hero__link {
        animation: montessori-link-reveal 800ms 1300ms ease-in-out both;
    }

    .montessori-hero__slide:focus-within .montessori-hero__copy > * {
        animation: none;
    }

    @keyframes montessori-lead-reveal {
        from { opacity: 0; transform: scale(.9); }
        to { opacity: 1; transform: scale(1); }
    }

    @keyframes montessori-title-reveal {
        from { clip-path: inset(0 50%); }
        to { clip-path: inset(0); }
    }

    @keyframes montessori-link-reveal {
        from { opacity: 0; transform: translateY(100%); }
        to { opacity: 1; transform: translateY(0); }
    }
}

.montessori-hero__photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.montessori-hero__copy {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 188px 16px 0;
    text-align: center;
}

.montessori-hero__copy p {
    margin: 0;
    color: #fcfcfc;
    text-shadow: 1px 1px 1px #000;
    font: bold clamp(19px, 2.55vw, 32px)/30px Georgia, serif;
}

.montessori-hero__copy h3 {
    margin: -4px 0 40px;
    color: #fff;
    font: bold clamp(30px, 7.6vw, 96px)/1.32 "Palatino Linotype", "Book Antiqua", Palatino, serif;
}

.montessori-hero__slide:not(:first-child) .montessori-hero__copy {
	padding-top: 194px;
}

.montessori-hero__slide:not(:first-child) h3 {
	font-size: clamp(28px, 6.1vw, 77px);
	line-height: 1.4;
	margin-bottom: 22px;
}

.montessori-hero__link {
    display: inline-block;
    padding: 10px 20px;
    color: #333;
    background: #ffb606;
    font: bold 18px/21px Roboto, sans-serif;
}

.montessori-hero__link:hover {
    color: #333;
    background: #ffca44;
}

.montessori-hero .montessori-hero__controls button {
    position: absolute;
    z-index: 1;
    display: grid;
    box-sizing: border-box;
    place-items: center;
    padding: 0;
    border: 0;
    color: #fff;
    opacity: 0;
}

.montessori-hero .montessori-hero__controls [data-hero-previous],
.montessori-hero .montessori-hero__controls [data-hero-next] {
    top: calc(50% - var(--hero-arrow-size) / 2);
    width: var(--hero-arrow-size);
    height: var(--hero-arrow-size);
    border: 2px solid #fff;
    border-radius: 50%;
    background: rgb(0 0 0 / 25%);
}

.montessori-hero__controls [data-hero-previous]::before,
.montessori-hero__controls [data-hero-next]::before {
    content: '';
    box-sizing: border-box;
    width: 25%;
    aspect-ratio: 1;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
    transform: translateX(-15%) rotate(45deg);
}

.montessori-hero__controls [data-hero-previous]::before {
    transform: translateX(15%) rotate(-135deg);
}

.montessori-hero__controls [data-hero-previous] {
    left: 20px;
}

.montessori-hero__controls [data-hero-next] {
    right: 20px;
}

.montessori-hero:hover .montessori-hero__controls button,
.montessori-hero:focus-within .montessori-hero__controls button {
    opacity: 1;
}

.montessori-hero__link:focus-visible,
.montessori-hero__controls button:focus-visible {
    outline: 2px solid #ffdc75;
    outline-offset: 3px;
}

@media (max-width: 767px) {
    .montessori-hero__controls {
        display: none;
    }

    .montessori-hero__slide {
        height: clamp(200px, 63.85vw, 420px);
    }

    .montessori-hero__photo {
        object-position: center;
    }

    .montessori-hero__copy {
        padding: 0 12px;
    }

    .montessori-hero__slide:not(:first-child) .montessori-hero__copy {
        padding-top: 0;
    }

    .montessori-hero__copy p {
        position: absolute;
        top: 20%;
        font-size: clamp(10px, 3.08vw, 22px);
        line-height: 1.2;
    }

    .montessori-hero__copy h3,
    .montessori-hero__slide:not(:first-child) h3 {
        position: absolute;
        top: 33%;
        width: calc(100% - 24px);
        margin: 0;
        font-size: clamp(22px, 7.44vw, 54px);
        line-height: 1.14;
    }

    .montessori-hero__slide:not(:first-child) .montessori-hero__copy p {
        font-size: clamp(12px, 3.85vw, 24px);
    }

    .montessori-hero__slide:last-child h3 {
        font-size: clamp(21px, 6.16vw, 48px);
    }

    .montessori-hero__link {
        position: absolute;
        top: 70%;
        padding: 8px 17px;
        font-size: 14px;
    }
}

@media (min-width: 768px) and (max-width: 1239px) {
    .montessori-hero__slide {
        height: min(400px, 51.04vw);
    }

    .montessori-hero__copy,
    .montessori-hero__slide:not(:first-child) .montessori-hero__copy {
        padding-top: 138px;
    }

    .montessori-hero__copy h3 {
        font-size: clamp(38px, 6vw, 74px);
    }

    .montessori-hero__slide:not(:first-child) h3 {
        font-size: clamp(35px, 5.5vw, 68px);
    }
}
