/* ---------------------------------------------------------------------------
   hero.css - home page hero (replaces Revolution Slider, ADO 1341, 2026-10-10).
   Geometry matches the old slider exactly: 1170x580 grid, full width, height
   scales with width below 1170px and caps at 580px.
--------------------------------------------------------------------------- */
.hero {
    position: relative;
    width: 100%;
    aspect-ratio: 1170 / 580;
    max-height: 580px;
    overflow: hidden;
    background: #0d1b26;
    z-index: 1;
}

/* Slides: zoom-out crossfade (Revolution "zoomout", 1.5 s) */
.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transform: scale(1.08);
    transition: opacity 1.5s ease, transform 1.5s ease, visibility 0s linear 1.5s;
}
.hero-slide.is-active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    transition: opacity 1.5s ease, transform 1.5s ease, visibility 0s;
    z-index: 2;
}
.hero-slide.is-leaving {
    visibility: visible;
    z-index: 1;
}

/* Background image + Ken Burns. The animation keeps running while a slide fades
   out (.is-leaving) so it doesn't snap back mid-transition. */
.hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    will-change: transform;
}
.hero-bg.kb-in  { transform-origin: 50% 0%; }
.is-active .hero-bg.kb-in,
.is-leaving .hero-bg.kb-in  { animation: hero-kb-in 25s linear forwards; }
.is-active .hero-bg.kb-pan,
.is-leaving .hero-bg.kb-pan { animation: hero-kb-pan 10s linear forwards; }

@keyframes hero-kb-in {
    from { transform: scale(1); }
    to   { transform: scale(1.2); }
}
@keyframes hero-kb-pan {
    from { transform: scale(1.3) translateX(10%); }
    to   { transform: scale(1) translateX(0); }
}

/* Readability scrim between the photo and the captions (ADO 1342, Dale 2026-10-10):
   darker behind the left-aligned captions, even behind the centred one. */
.hero-slide::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.38) 45%, rgba(0, 0, 0, 0.12) 100%);
}
.hero-slide:has(.hero-center)::after { background: rgba(0, 0, 0, 0.42); }

/* Captions */
/* Column flex: vertically centred, and the theme's .container keeps its normal
   centred width (750/970/1170px), so captions sit on the same grid as the old slider. */
.hero-caption {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 3;
    pointer-events: none;
}
.hero-caption a, .hero-caption button { pointer-events: auto; }
/* Below wide desktop the theme container's auto margins would shrink-wrap it inside the
   flex column (short captions drift sideways), and its gutter is narrower than the arrows.
   Take the full width and pad past the arrow buttons instead. */
@media (max-width: 1279px) {
    .hero-caption .container {
        width: 100%;
        padding-left: calc(clamp(30px, 3.5vw, 44px) + 12px);
        padding-right: calc(clamp(30px, 3.5vw, 44px) + 12px);
    }
}
.hero-center { text-align: center; }
.hero-center .hero-rule { margin-left: auto; margin-right: auto; }

.hero-line1,
.hero-line2,
.hero-sub {
    color: #fff;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    margin: 0;
    max-width: 800px;
}
.hero-center .hero-line1,
.hero-center .hero-line2,
.hero-center .hero-sub { margin-left: auto; margin-right: auto; }

.hero-line1 {
    font: 700 clamp(17px, 3.4vw, 40px)/1.15 Arial, Helvetica, sans-serif;
}
.hero-line2 {
    font: 800 clamp(24px, 5vw, 58px)/1.05 "Open Sans", Arial, Helvetica, sans-serif;
}
.hero-rule {
    display: block;
    width: clamp(70px, 17vw, 200px);
    height: clamp(4px, 0.5vw, 6px);
    background: #88c425;
    margin: clamp(8px, 2.2vw, 24px) 0;
}
.hero-sub {
    font: 700 clamp(11px, 1.7vw, 20px)/1.35 Arial, Helvetica, sans-serif;
    color: #ececec;
    margin-bottom: clamp(8px, 1.8vw, 22px);
}
.hero .btn {
    font-size: clamp(11px, 1.2vw, 14px);
    padding: clamp(4px, 0.8vw, 10px) clamp(10px, 1.7vw, 20px);
}

/* Caption entrances: titles drop in, the rest rises (Revolution lft / lfb, start 1.2-1.4 s) */
.hero-slide .cap {
    opacity: 0;
    transform: translateY(-40px);
}
.hero-slide .cap.cap-up { transform: translateY(40px); }
.hero-slide.is-active .cap {
    animation: hero-cap-in 0.5s cubic-bezier(0.16, 1, 0.3, 1) 1.2s forwards;
}
.hero-slide.is-active .cap.cap-late { animation-delay: 1.4s; }
@keyframes hero-cap-in {
    to { opacity: 1; transform: none; }
}

/* Arrows (Revolution "solo / preview4" look) */
.hero-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 4;
    width: clamp(30px, 3.5vw, 44px);
    height: clamp(44px, 6vw, 70px);
    border: 0;
    padding: 0;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    font-size: clamp(22px, 3vw, 36px);
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease;
}
.hero-arrow:hover,
.hero-arrow:focus-visible { background: rgba(0, 0, 0, 0.6); }
.hero-arrow:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }
.hero-prev { left: 0; }
.hero-next { right: 0; }

/* Respect reduced-motion preferences: no zoom, no slide-in, no auto-rotate (hero.js) */
@media (prefers-reduced-motion: reduce) {
    .hero-slide, .hero-slide.is-active { transition: opacity 0.3s ease; transform: none; }
    .is-active .hero-bg.kb-in, .is-leaving .hero-bg.kb-in,
    .is-active .hero-bg.kb-pan, .is-leaving .hero-bg.kb-pan { animation: none; }
    .hero-slide .cap, .hero-slide.is-active .cap { animation: none; opacity: 1; transform: none; }
}
