/* Landing page hero slider (Admin > Hero slider) and the admin's live preview of it.
   The slides sit in a framed picture card beside the headline (not behind it), so busy pictures such as flyers stay
   readable and never fight the text. Each slide runs a gentle zoom/pan for the whole time it is on screen and keeps
   moving while it fades out (the .leaving class), so nothing snaps back to its starting size mid-fade. */

.hero-slider { --hs-dur: 7.6s; position: relative; aspect-ratio: 3 / 2; overflow: hidden; border-radius: 26px; background: #07073f;
  box-shadow: 0 40px 90px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 255, 255, .14); isolation: isolate; }

.hs-slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity 1s ease, visibility 0s linear 1s; }
.hs-slide.active { opacity: 1; visibility: visible; z-index: 1; transition: opacity 1s ease; }
.hs-slide.leaving { opacity: 0; visibility: visible; z-index: 0; }
.hs-slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; transform-origin: 50% 50%; will-change: transform; }

/* Only the bottom edge is shaded, for the caption and the controls; the picture itself stays clear. */
.hs-slide::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(0deg, rgba(5, 5, 45, .78) 0%, rgba(5, 5, 45, .25) 30%, transparent 48%); }

.hs-slide.active img, .hs-slide.leaving img { animation-duration: var(--hs-dur); animation-timing-function: cubic-bezier(.3, 0, .7, 1); animation-fill-mode: both; }
.hs-slide[data-animation="zoom-in"].active img, .hs-slide[data-animation="zoom-in"].leaving img { animation-name: hsZoomIn; }
.hs-slide[data-animation="zoom-out"].active img, .hs-slide[data-animation="zoom-out"].leaving img { animation-name: hsZoomOut; }
.hs-slide[data-animation="pan-left"].active img, .hs-slide[data-animation="pan-left"].leaving img { animation-name: hsPanLeft; }
.hs-slide[data-animation="pan-right"].active img, .hs-slide[data-animation="pan-right"].leaving img { animation-name: hsPanRight; }
.hs-slide[data-animation="rise"].active img, .hs-slide[data-animation="rise"].leaving img { animation-name: hsRise; }
/* Small movements: in a card, a big zoom would crop the edges of a flyer. */
@keyframes hsZoomIn { from { transform: scale(1); } to { transform: scale(1.07); } }
@keyframes hsZoomOut { from { transform: scale(1.08); } to { transform: scale(1); } }
@keyframes hsPanLeft { from { transform: translate3d(1.5%, 0, 0) scale(1.05); } to { transform: translate3d(-1.5%, 0, 0) scale(1.05); } }
@keyframes hsPanRight { from { transform: translate3d(-1.5%, 0, 0) scale(1.05); } to { transform: translate3d(1.5%, 0, 0) scale(1.05); } }
@keyframes hsRise { from { transform: translate3d(0, 1.5%, 0) scale(1.05); } to { transform: translate3d(0, -1.5%, 0) scale(1.05); } }

/* Caption (the slide's own title, line and button), along the bottom of the picture. */
.hs-caption { position: absolute; z-index: 2; left: 1.1rem; right: 1.1rem; bottom: 3.5rem; color: #fff; max-width: 26rem; }
.hs-caption h3 { color: #fff; font-size: 1.2rem; font-weight: 800; line-height: 1.2; margin: 0 0 .3rem; text-shadow: 0 2px 12px rgba(0, 0, 0, .45); }
.hs-caption p { color: rgba(255, 255, 255, .9); font-size: .9rem; margin: 0 0 .75rem; text-shadow: 0 1px 8px rgba(0, 0, 0, .45); }
.hs-caption h3:last-child, .hs-caption p:last-child { margin-bottom: 0; }
.hs-caption .btn { font-weight: 700; padding: .4rem .95rem; font-size: .88rem; }
.hs-slide.active .hs-caption > * { animation: hsCapIn .8s cubic-bezier(.22, .85, .4, 1) both; }
.hs-slide.active .hs-caption > *:nth-child(1) { animation-delay: .35s; }
.hs-slide.active .hs-caption > *:nth-child(2) { animation-delay: .5s; }
.hs-slide.active .hs-caption > *:nth-child(3) { animation-delay: .65s; }
@keyframes hsCapIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (max-width: 575.98px) { .hs-caption p { display: none; } .hs-caption { bottom: 3.2rem; } }

/* With captions: the picture keeps its 3:2 area and the caption sits on a solid strip beneath it, with the controls
   at the strip's right end, so neither ever covers the picture. */
.hero-slider.has-captions { --hs-strip: 84px; aspect-ratio: auto; height: 0; padding-top: calc(66.667% + var(--hs-strip)); }
.has-captions .hs-slide img { height: calc(100% - var(--hs-strip)); }
.has-captions .hs-slide::after { display: none; }
.has-captions .hs-slide { background: #06063a; }
.has-captions .hs-caption { left: 0; right: 0; bottom: 0; max-width: none; height: var(--hs-strip); padding: .7rem 1.2rem; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 1rem; align-content: center; align-items: center; }
.has-captions .hs-caption h3 { grid-column: 1; font-size: 1.02rem; text-shadow: none; margin-bottom: .15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.has-captions .hs-caption p { grid-column: 1; font-size: .83rem; text-shadow: none; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.has-captions .hs-caption .btn { grid-column: 2; grid-row: 1 / span 2; white-space: nowrap; }
/* Arrows and dots move to the picture's top-right corner, on a small dark pill. */
.has-captions .hs-controls { left: auto; right: .8rem; top: .8rem; bottom: auto; gap: .5rem; padding: .3rem; border-radius: 999px; background: rgba(7, 7, 63, .55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.has-captions .hs-arrow { width: 28px; height: 28px; border: 0; background: rgba(255, 255, 255, .14); }
@media (max-width: 575.98px) {
  .hero-slider.has-captions { --hs-strip: 64px; }
  .has-captions .hs-caption p { display: none; }
  .has-captions .hs-caption .btn { grid-row: 1; padding: .3rem .7rem; font-size: .8rem; }
}

/* Previous / dots / next along the bottom of the picture. Each dot fills as its picture's time runs out. */
.hs-controls { position: absolute; z-index: 3; left: 0; right: 0; bottom: .9rem; display: flex; align-items: center; justify-content: center; gap: .8rem; pointer-events: none; }
.hs-controls > * { pointer-events: auto; }
.hs-arrow { width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .35); background: rgba(7, 7, 63, .5); color: #fff; display: grid; place-items: center; font-size: .8rem;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: background .2s, transform .2s; cursor: pointer; }
.hs-arrow:hover { background: var(--gold); border-color: var(--gold); color: #3a2a00; transform: scale(1.06); }
.hs-dots { display: flex; align-items: center; gap: .45rem; }
.hs-dot { position: relative; width: 9px; height: 9px; padding: 0; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .5); cursor: pointer; overflow: hidden; transition: width .35s ease, background .2s; }
.hs-dot:hover { background: rgba(255, 255, 255, .85); }
.hs-dot.active { width: 34px; background: rgba(255, 255, 255, .35); }
.hs-dot.active::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--gold); transform-origin: left; animation: hsFill var(--hs-time, 6.5s) linear both; }
.hero-slider.paused .hs-dot.active::after { animation-play-state: paused; }
@keyframes hsFill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@media (prefers-reduced-motion: reduce) {
  .hs-slide img { animation: none !important; }
  .hs-slide.active .hs-caption > * { animation: none !important; }
  .hs-dot.active::after { animation: none; transform: none; }
}

/* ---- Admin: live preview of a slide's motion ---- */
.hs-mini { aspect-ratio: 16 / 9; border-radius: 16px; box-shadow: var(--shadow-sm); }
.hs-mini .hs-slide::after { background: linear-gradient(0deg, rgba(5, 5, 45, .55), transparent 55%); }
.hs-mini .hs-slide, .hs-mini .hs-slide.active { transition: none; }
.hs-mini .hs-empty { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255, 255, 255, .6); font-weight: 600; text-align: center; padding: 1rem; }
