/* ==========================================================================
   DABACO OIL — Homepage Hero carousel (client feedback 2026-09-30)
   Swiper 14 fade carousel; markup: Views/Home/Sections/_HeroCarousel.cshtml,
   behaviour: wwwroot/js/hero-carousel.js. Branding is plain, static text.

   Variants
     .do-hero-slide--photo   full-bleed photograph, dark green scrim, light text
     .do-hero-slide--studio  studio product photo on an ivory ground, dark text
   ========================================================================== */

.do-hero-carousel {
  --hc-green: var(--dabaco-blue);
  --hc-ink: #0B261B;
  --hc-ivory: #F1ECE2;           /* matches the studio backdrop of ELM_7316 */
  --hc-gold: var(--dabaco-orange);
  --hc-gutter: clamp(1rem, 4vw, 3.5rem);
  /* The Hero fills the first screen below the header; the top bar (scrolls away, 0 if absent) sits above it. */
  --hc-height: var(--hero-banner-height);
  position: relative;
  background-color: var(--hc-green);
  isolation: isolate;
}

.do-hero-carousel__swiper {
  height: var(--hc-height);
}

.do-hero-carousel--api {
  --hc-height: min(calc(100vw * 734 / 1920), calc(100svh - var(--header-height) - var(--topbar-height)));
  background: var(--hc-ivory);
}

.do-hero-carousel--api .do-hero-slide { background: var(--hc-ivory); }
.do-hero-carousel--api .do-hero-slide__img { object-fit: cover; transform: none; }

@media (max-width: 767.98px) {
  .do-hero-carousel--mobile-art { --hc-height: min(calc(100vw * 1350 / 1080), calc(100svh - var(--header-height) - var(--topbar-height))); }
  .do-hero-carousel--mobile-art.is-desktop-set { --hc-height: min(calc(100vw * 734 / 1920), calc(100svh - var(--header-height) - var(--topbar-height))); }
}

.do-hero-slide__banner-link {
  position: absolute;
  inset: 0;
  z-index: 2;
}

/* --- Slide ---------------------------------------------------------------- */
.do-hero-slide {
  position: relative;
  overflow: hidden;
  height: 100%;
  background-color: var(--hc-green);
}

.do-hero-slide__media {
  position: absolute;
  inset: 0;
}

.do-hero-slide__media picture,
.do-hero-slide__img {
  display: block;
  width: 100%;
  height: 100%;
}

.do-hero-slide__img {
  max-width: none;
  object-fit: cover;
  object-position: var(--focal-d, 50% 50%);
  /* Very subtle settle (1.02 → 1.00) on the active banner; none with reduced motion. */
  transform: scale(1.02);
  transition: transform 6.5s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.swiper-slide-active .do-hero-slide__img {
  transform: scale(1);
}

.do-hero-slide__video {
  position: absolute;
  inset: 0;
  overflow: hidden;
  container-type: size;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

.do-hero-slide.is-video-ready .do-hero-slide__video {
  opacity: 1;
}

.do-hero-slide__video iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  width: max(100cqw, 177.78cqh);
  height: max(100cqh, 56.25cqw);
  border: 0;
  transform: translate(-50%, -50%);
}

.do-hero-slide a:focus-visible,
.do-hero-carousel__btn:focus-visible,
.do-hero-carousel__bullet:focus-visible {
  outline: 3px solid var(--hc-gold);
  outline-offset: 3px;
}

/* Licence credit for third-party photographs (bottom-right, above the scrim). */

/* --- Studio variant (product photo on ivory) ------------------------------ */

/* --- Controls (2026-10-02 navigation refinement) ------------------------------
   The controls wrapper is a click-through overlay over the whole Hero; each control is
   positioned against the Hero viewport, never against the text block:
     prev / next   far left / far right, vertically centred (top 50%, translateY(-50%))
     pagination    one row of dots, bottom centre
     pause / play  bottom-left on the dots' baseline (WCAG 2.2.2 control for the autoplay)
   Swiper configuration (hero-carousel.js) is unchanged; this is placement and styling only. */
.do-hero-carousel__controls {
  --hc-nav-inset: clamp(12px, 2vw, 32px);            /* side inset: 27px @1366, 32px @1920, 16px @820 */
  --hc-dots-y: clamp(22px, 2.2vw, 32px);             /* bottom edge → centre of the dots */
  position: absolute;
  z-index: 5;
  inset: 0;
  pointer-events: none;        /* swipe/drag and slide links stay usable under the overlay */
  visibility: hidden;          /* shown once Swiper is initialised */
}

.do-hero-carousel.is-ready .do-hero-carousel__controls {
  visibility: visible;
}

.do-hero-carousel__controls > * {
  pointer-events: auto;
}

/* Hit area 44 × 44; the visible mark is a quiet outline circle drawn inside it. */
.do-hero-carousel__btn {
  position: absolute;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #FFFFFF;
  cursor: pointer;
}

.do-hero-carousel__btn::before {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: rgba(11, 38, 27, 0.16);  /* only enough tone for contrast on light areas */
  transition: border-color 180ms ease, background-color 180ms ease;
}

.do-hero-carousel__btn svg {
  position: relative;
}

.do-hero-carousel__btn:hover::before {
  border-color: #FFFFFF;
  background: rgba(11, 38, 27, 0.32);
}

.do-hero-carousel__btn.swiper-button-disabled {
  opacity: 0.4;
  cursor: default;
}

.do-hero-carousel__prev,
.do-hero-carousel__next {
  top: 50%;
  transform: translateY(-50%);
}

.do-hero-carousel__prev { left: var(--hc-nav-inset); }
.do-hero-carousel__next { right: var(--hc-nav-inset); }

/* Scoped under the controls so it outranks Swiper's own
   `.swiper-pagination-bullets.swiper-pagination-horizontal { left: 0; width: 100% }`. */
.do-hero-carousel__controls .do-hero-carousel__pagination {
  position: absolute;
  top: auto;
  left: 50%;
  bottom: calc(var(--hc-dots-y) - 22px);
  width: max-content;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Each dot is a 28 × 44 button (WCAG 2.5.8 target); the visible mark is drawn inside it. */
.do-hero-carousel__bullet {
  position: relative;
  flex: 0 0 28px;
  width: 28px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.do-hero-carousel__bullet::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  box-shadow: 0 0 0 1px rgba(11, 38, 27, 0.12);
  transform: translate(-50%, -50%);
  transition: background-color 300ms ease, transform 300ms ease;
}

.do-hero-carousel__bullet:hover::before {
  background: rgba(255, 255, 255, 0.8);
}

.do-hero-carousel__bullet.is-active::before {
  background: #FFFFFF;
  transform: translate(-50%, -50%) scale(1.15);
}

.do-hero-video-modal {
  width: min(1100px, calc(100vw - 32px));
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: #000;
  overflow: visible;
}

.do-hero-video-modal::backdrop { background: rgba(15, 23, 42, 0.85); }

.do-hero-video-modal__frame {
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
}

.do-hero-video-modal__frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.do-hero-video-modal__close {
  position: absolute;
  top: -48px;
  right: 0;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  cursor: pointer;
}

.do-hero-video-modal__close:hover,
.do-hero-video-modal__close:focus-visible {
  background: var(--hc-gold, var(--dabaco-orange));
  outline: none;
}
