/* ============================================================
   Home page hero banner slider (no library – see front/js/hero-slider.js)
   Banners are uploaded from Admin › Banner. Recommended size 1920 × 700.

   Full width, edge to edge. The slider takes the exact shape of the banners,
   so a 1920 × 700 banner is shown complete (never zoomed or stretched). The transition is a "curtain"
   reveal (clip-path) of the incoming banner over the outgoing one.
   ============================================================ */
.hero-slider-section {
    width: 100%;
    margin-top: 0;
    /* Starts right below the fixed top bar + header, so no part of the banner hides behind it.
       --hero-top is measured by hero-slider.js; 214px is the measured desktop header height. */
    padding: var(--hero-top, 214px) 0 0;      /* full width: no side padding, no gap below */
    overflow: visible;
}

.hero-slider {
    --hero-orange: #f35a2a;
    --hero-speed: 1100ms;
    --hero-ease: cubic-bezier(.77, 0, .18, 1);
    position: relative;
    overflow: hidden;
    background: #e9f1fa;         /* light, close to the banners – no dark flash while the image loads */
    outline: none;
    isolation: isolate;
}
.hero-slider:focus-visible { box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .7); }

/* Full width, in the real shape of the first banner (--hero-ratio is set in the view,
   e.g. 1920 / 700), so a banner of that size fills the slider edge to edge – nothing is
   cut and there is no empty space on any side. A banner of a clearly different shape
   gets .is-contain (decided in the view): it is shown complete, never cropped, and the
   spare area is filled with a soft blurred copy of the same banner. */
.hero-track {
    position: relative;
    width: 100%;
    aspect-ratio: var(--hero-ratio, 1920 / 700);
    min-height: 240px;
}

.hero-slide {
    position: absolute;
    inset: 0;
    overflow: hidden;
    visibility: hidden;
    z-index: 0;
}
.hero-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    user-select: none;
    -webkit-user-drag: none;
}

.hero-slide.is-contain img {
    position: relative;
    z-index: 1;
    object-fit: contain;
}
.hero-slide-bg {
    position: absolute;
    inset: -40px;                /* bleed so the blur has no soft edge */
    background-position: center;
    background-size: cover;
    filter: blur(28px) brightness(.85) saturate(1.15);
}

.hero-slide.is-active  { visibility: visible; z-index: 2; }
.hero-slide.is-leaving { visibility: visible; z-index: 1; }

/* Incoming banner: curtain reveal from the right (next) or left (prev) */
.hero-slide.enter-next { animation: heroRevealNext var(--hero-speed) var(--hero-ease) both; }
.hero-slide.enter-prev { animation: heroRevealPrev var(--hero-speed) var(--hero-ease) both; }
.hero-slide.enter-next img,
.hero-slide.enter-prev img { animation: heroBrighten var(--hero-speed) ease-out both; }

/* soft light edge that travels with the curtain */
.hero-slide.enter-next::after,
.hero-slide.enter-prev::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 120px;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .35), rgba(255, 255, 255, 0));
    opacity: 0;
}
.hero-slide.enter-next::after, .hero-slide.enter-prev::after { z-index: 2; }
.hero-slide.enter-next::after { left: 0;  animation: heroEdgeNext var(--hero-speed) var(--hero-ease) both; }
.hero-slide.enter-prev::after { right: 0; animation: heroEdgePrev var(--hero-speed) var(--hero-ease) both; }

/* Outgoing banner: dims a little while it is being covered */
.hero-slide.is-leaving img { animation: heroDim var(--hero-speed) ease both; }

@keyframes heroRevealNext { from { clip-path: inset(0 0 0 100%); } to { clip-path: inset(0 0 0 0); } }
@keyframes heroRevealPrev { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes heroBrighten   { from { filter: brightness(1.18) saturate(1.1); } to { filter: none; } }
@keyframes heroDim        { to { opacity: .45; } }
@keyframes heroEdgeNext   { 0% { transform: translateX(100vw); opacity: 1; } 85% { opacity: 1; } 100% { transform: translateX(-120px); opacity: 0; } }
@keyframes heroEdgePrev   { 0% { transform: translateX(-100vw); opacity: 1; } 85% { opacity: 1; } 100% { transform: translateX(120px); opacity: 0; } }

/* ── Bottom bar: progress dots ──────────────────────────── */
.hero-ui {
    position: absolute;
    bottom: 18px;
    left: 50%;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 40px;
    background: rgba(15, 35, 64, .38);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    transform: translateX(-50%);
}
.hero-dots { display: flex; align-items: center; gap: 8px; }
.hero-dot {
    position: relative;
    width: 10px;
    height: 10px;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, .5);
    cursor: pointer;
    transition: width .45s var(--hero-ease), background .25s ease;
}
.hero-dot:hover { background: rgba(255, 255, 255, .85); }
.hero-dot.is-active { width: 42px; background: rgba(255, 255, 255, .35); }
.hero-dot span {
    position: absolute;
    inset: 0;
    width: 0;
    border-radius: inherit;
    background: var(--hero-orange);
}
.hero-dot.is-active span { animation: heroProgress var(--hero-delay, 5000ms) linear forwards; }
.hero-slider.is-paused .hero-dot.is-active span { animation-play-state: paused; }
.hero-dot:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

@keyframes heroProgress { from { width: 0; } to { width: 100%; } }

@media (max-width: 991px) {
    .hero-ui { bottom: 10px; gap: 10px; padding: 6px 10px; }
}

/* Same as before: banner is hidden on phones */
@media (max-width: 768px) {
    .hero-slider-section { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .hero-slide.enter-next, .hero-slide.enter-prev,
    .hero-slide.enter-next img, .hero-slide.enter-prev img,
    .hero-slide.is-leaving img,
    .hero-slide.enter-next::after, .hero-slide.enter-prev::after { animation: none; }
    .hero-dot { transition: none; }
    .hero-dot.is-active span { animation: none; width: 100%; }
}
