/* ============================================================================
 * sb-slider.css — styling for the Swiper.js Slider / Hero-Carousel widget.
 * Pairs with sb-slider.js. Load AFTER swiper-bundle.min.css so these win.
 * Brand colors come from CSS custom properties when present, with fallbacks:
 *   --sb-accent (CTA / bullets), --sb-on-accent (CTA text).
 * ========================================================================== */

.sb-slider { position: relative; width: 100%; }
.sb-swiper { width: 100%; height: 100%; }

/* ── Heights ── */
.sb-slider-h-large  .sb-swiper { height: clamp(420px, 70vh, 760px); }
.sb-slider-h-medium .sb-swiper { height: clamp(320px, 52vh, 520px); }
.sb-slider-h-small  .sb-swiper { height: clamp(220px, 38vh, 380px); }
.sb-slider-h-full   .sb-swiper { height: 100vh; height: 100dvh; }
.sb-slider-h-auto   .sb-swiper { height: auto; }

/* ── Slide + background ── */
.sb-slide { position: relative; overflow: hidden; display: flex; }
.sb-slide-bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center; z-index: 0;
}
.sb-slider-h-auto .sb-slide-bg { position: static; height: auto; }

/* Dark tint for legibility. */
.sb-slide-tint { position: absolute; inset: 0; background: #000; z-index: 1; pointer-events: none; }

/* ── Overlay image (logo / badge) ── */
.sb-slide-oi { position: absolute; inset: 0; z-index: 2; display: flex; padding: 4%; pointer-events: none; }
.sb-slide-oi img { height: auto; display: block; filter: drop-shadow(0 2px 12px rgba(0,0,0,.35)); }
.sb-oi-center       { align-items: center;      justify-content: center; }
.sb-oi-top          { align-items: flex-start;   justify-content: center; }
.sb-oi-bottom       { align-items: flex-end;     justify-content: center; }
.sb-oi-left         { align-items: center;       justify-content: flex-start; }
.sb-oi-right        { align-items: center;       justify-content: flex-end; }
.sb-oi-top-left     { align-items: flex-start;   justify-content: flex-start; }
.sb-oi-top-right    { align-items: flex-start;   justify-content: flex-end; }
.sb-oi-bottom-left  { align-items: flex-end;     justify-content: flex-start; }
.sb-oi-bottom-right { align-items: flex-end;     justify-content: flex-end; }

/* ── Text content ── */
.sb-slide-content {
  position: relative; z-index: 3; margin: auto; max-width: 60rem; padding: 2rem 1.5rem;
  color: #fff; text-shadow: 0 2px 16px rgba(0,0,0,.45);
}
.sb-align-center { text-align: center; }
.sb-align-left   { text-align: left;  margin-left: 6%;  margin-right: auto; }
.sb-align-right  { text-align: right; margin-right: 6%; margin-left: auto; }
.sb-slide-heading { font-size: clamp(1.9rem, 5vw, 3.6rem); line-height: 1.08; margin: 0 0 .5rem; font-weight: 800; }
.sb-slide-sub     { font-size: clamp(1rem, 2.2vw, 1.4rem); margin: 0 0 1.25rem; opacity: .96; }
.sb-slide-cta {
  display: inline-block; padding: .8rem 1.6rem; border-radius: 999px; font-weight: 700;
  text-decoration: none; background: var(--sb-accent, #d4a23a); color: var(--sb-on-accent, #1a1410);
  transition: transform .15s ease, filter .15s ease;
}
.sb-slide-cta:hover { transform: translateY(-1px); filter: brightness(1.05); }

/* ── Content entrance animations (play on the active slide) ── */
.sb-slide-content { opacity: 0; }
.swiper-slide-active .sb-slide-content { opacity: 1; }
.swiper-slide-active .sb-anim-fade        { animation: sbFade .8s both; }
.swiper-slide-active .sb-anim-slide-left  { animation: sbSlideL .8s both; }
.swiper-slide-active .sb-anim-slide-right { animation: sbSlideR .8s both; }
.swiper-slide-active .sb-anim-slide-up    { animation: sbSlideU .8s both; }
.swiper-slide-active .sb-anim-zoom-in     { animation: sbZoomIn .8s both; }
.swiper-slide-active .sb-anim-zoom-out    { animation: sbZoomOut .8s both; }
/* Ken Burns animates the background, not the content. */
.sb-anim-ken-burns { opacity: 1; }
.swiper-slide-active .sb-slide-content.sb-anim-ken-burns ~ * ,
.swiper-slide-active .sb-anim-ken-burns + .sb-slide-bg { /* no-op guard */ }
.swiper-slide-active .sb-slide-bg { animation: none; }
.sb-anim-ken-burns.sb-slide-content { opacity: 1; }

@keyframes sbFade   { from { opacity: 0; } to { opacity: 1; } }
@keyframes sbSlideL { from { opacity: 0; transform: translateX(-40px); } to { opacity: 1; transform: none; } }
@keyframes sbSlideR { from { opacity: 0; transform: translateX(40px); }  to { opacity: 1; transform: none; } }
@keyframes sbSlideU { from { opacity: 0; transform: translateY(40px); }  to { opacity: 1; transform: none; } }
@keyframes sbZoomIn { from { opacity: 0; transform: scale(.9); }  to { opacity: 1; transform: none; } }
@keyframes sbZoomOut{ from { opacity: 0; transform: scale(1.1); } to { opacity: 1; transform: none; } }

/* Ken Burns drift on the slide background. */
.sb-slide:has(.sb-anim-ken-burns).swiper-slide-active .sb-slide-bg { animation: sbKenBurns 12s ease-out both; }
@keyframes sbKenBurns { from { transform: scale(1); } to { transform: scale(1.12) translate(-2%, -2%); } }

@media (prefers-reduced-motion: reduce) {
  .swiper-slide-active .sb-slide-content,
  .sb-slide:has(.sb-anim-ken-burns).swiper-slide-active .sb-slide-bg { animation: none !important; opacity: 1; }
}

/* ── Swiper chrome theming ── */
.sb-swiper { --swiper-theme-color: var(--sb-accent, #d4a23a); }
.sb-swiper .swiper-button-next, .sb-swiper .swiper-button-prev { color: #fff; }
.sb-swiper .swiper-pagination-bullet { background: #fff; opacity: .55; }
.sb-swiper .swiper-pagination-bullet-active { background: var(--sb-accent, #d4a23a); opacity: 1; }
.sb-swiper .swiper-pagination-fraction,
.sb-swiper .swiper-pagination { color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,.4); }

/* ── Thumbnail strip ── */
.sb-swiper-thumbs { margin-top: .6rem; }
.sb-swiper-thumbs .swiper-slide { width: 96px; height: 64px; opacity: .55; cursor: pointer; border-radius: 6px; overflow: hidden; }
.sb-swiper-thumbs .swiper-slide-thumb-active { opacity: 1; outline: 2px solid var(--sb-accent, #d4a23a); }
.sb-swiper-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.sb-thumb-ph { display: block; width: 100%; height: 100%; background: #d1d5db; }

/* ── Editor empty state ── */
.sb-swiper-empty {
  display: flex; align-items: center; justify-content: center; min-height: 200px;
  background: repeating-linear-gradient(45deg, #f3f4f6, #f3f4f6 12px, #e9eaee 12px, #e9eaee 24px);
  color: #6b7280; font: 600 .95rem/1.4 system-ui, sans-serif; border-radius: 10px;
}

/* ── Editor: per-slide overlay-image label ── */
.sb-slide-imglabel { font: 700 .72rem/1.4 system-ui, sans-serif; text-transform: uppercase; letter-spacing: .05em; color: #6b7280; margin: .6rem 0 .25rem; }
