/* ============================================================
   Homepage hero slider
   Layered on top of .bt-hero (home.css) — the slide inner reuses
   .bt-hero__inner / __headline / __sub / __ctas so a slide looks
   exactly like the original hero.
   ============================================================ */

.bt-slider {
  /* the section owns the padding; slides must not add their own */
  padding-bottom: clamp(2rem, 4vw, 3rem);
}

/* the hero is a full-screen flex column: the viewport takes the slack so a
   slide is as tall as the screen rather than as tall as its own copy.
   The viewport is a one-cell grid: a grid item stretches to the row's definite
   height without the percentage that collapsed the track back to its copy, and
   unlike a flex row it does not re-resolve the slides' own 100% widths. */
.bt-slider__viewport { flex: 1 1 auto; display: grid; }
.bt-slider__track    { min-width: 100%; }

/* ---- viewport + track ----
   Native scroll-snap rather than transform maths: gives real swipe on
   touch, survives resize, and degrades to a plain scroller without JS. */
.bt-slider__viewport {
  position: relative;
  z-index: 1;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;             /* Firefox */
  -ms-overflow-style: none;          /* old Edge */
  overscroll-behavior-x: contain;
}
.bt-slider__viewport::-webkit-scrollbar { display: none; }

@media (prefers-reduced-motion: reduce) {
  .bt-slider__viewport { scroll-behavior: auto; }
}

.bt-slider__track {
  display: flex;
  align-items: stretch;
}

/* ---- slide ---- */
.bt-slide {
  position: relative;
  flex: 0 0 100%;
  min-width: 100%;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  isolation: isolate;
  display: flex;
  align-items: center;
  padding-block: clamp(1rem, 2vw, 2rem);
}

/* tone washes — sit under the copy, over any background image */
.bt-slide::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.bt-slide--navy::before {
  background:
    radial-gradient(900px 520px at 82% 0%, rgba(56,189,248,0.16), transparent 62%),
    radial-gradient(620px 440px at 0% 100%, rgba(249,115,22,0.10), transparent 62%);
}
.bt-slide--blue::before {
  background:
    radial-gradient(900px 520px at 78% 4%, rgba(56,189,248,0.30), transparent 60%),
    linear-gradient(120deg, rgba(11,83,148,0.55) 0%, rgba(7,17,31,0.10) 70%);
}
.bt-slide--orange::before {
  background:
    radial-gradient(820px 500px at 80% 0%, rgba(249,115,22,0.30), transparent 62%),
    linear-gradient(120deg, rgba(194,87,15,0.40) 0%, rgba(7,17,31,0.10) 68%);
}

/* ---- background image ---- */
.bt-slide__media {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
}
/* <picture> is inline with auto height, which breaks the percentage-height
   chain and collapses the banner to its intrinsic strip. Make it a block box
   that fills the media area so height:100% on the img resolves. */
.bt-slide__media picture {
  display: block;
  width: 100%;
  height: 100%;
}
.bt-slide__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
/* keep the copy readable over any photograph the client might upload.
   Kept light on the right so a designed banner's product still reads. */
.bt-slide__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(7,17,31,0.86) 0%, rgba(7,17,31,0.55) 42%, rgba(7,17,31,0.10) 100%);
}

/* the tone wash is the backdrop for slides with no banner; with a banner the
   image supplies the colour and a second wash just muddies it */
.bt-slide--has-media::before { background: none; }

/* a slide with no side panel lets the copy breathe wider */
.bt-slide:not(.bt-slide--has-aside) .bt-hero__inner {
  grid-template-columns: 1fr;
}
.bt-slide:not(.bt-slide--has-aside) .bt-hero__sub {
  max-width: 52ch;
}

/* the section's own padding handles the top offset */
.bt-slider .bt-hero__inner { width: 100%; }

.bt-slide__eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--color-accent-warm);
  margin-bottom: var(--space-sm);
}

/* ---- control bar ---- */
.bt-slider__bar {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-top: clamp(1.5rem, 3vw, 2.5rem);
}
.bt-slider__bar .bt-hero__meta {
  border-top: 0;
  padding-top: 0;
  margin: 0;
}

.bt-slider__controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.bt-slider__arrow,
.bt-slider__play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background 160ms var(--ease-out), border-color 160ms var(--ease-out);
}
.bt-slider__arrow {
  width: 2.75rem;
  height: 2.75rem;
  font-size: 1rem;
  line-height: 1;
}
.bt-slider__arrow:hover,
.bt-slider__play:hover {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.34);
}
.bt-slider__arrow:disabled {
  opacity: 0.35;
  cursor: default;
}

.bt-slider__play {
  padding: 0 0.9rem;
  height: 2.75rem;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
}
.bt-slider__play-icon {
  width: 8px;
  height: 10px;
  /* two bars = pause; the play triangle is swapped in when paused */
  border-left: 3px solid currentColor;
  border-right: 3px solid currentColor;
}
.bt-slider__play[aria-pressed="true"] .bt-slider__play-icon {
  width: 0;
  height: 0;
  border: 0;
  border-left: 8px solid currentColor;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}

/* ---- dots ---- */
.bt-slider__dots {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0 0.25rem;
}
.bt-slider__dot {
  width: 2rem;
  height: 3px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.24);
  cursor: pointer;
  transition: background 160ms var(--ease-out), width 220ms var(--ease-out);
}
.bt-slider__dot:hover { background: rgba(255,255,255,0.45); }
.bt-slider__dot[aria-selected="true"] {
  width: 3.25rem;
  background: var(--color-accent);
}

/* visible keyboard focus on every control */
.bt-slider__arrow:focus-visible,
.bt-slider__play:focus-visible,
.bt-slider__dot:focus-visible,
.bt-slider__viewport:focus-visible {
  outline: 2px solid var(--color-secondary);
  outline-offset: 3px;
}

@media (max-width: 640px) {
  .bt-slider__bar {
    flex-direction: column;
    align-items: flex-start;
  }
  .bt-slider__bar .bt-hero__meta {
    border-top: 1px solid rgba(255,255,255,0.12);
    padding-top: var(--space-sm);
    width: 100%;
  }

  /* On a phone the copy stacks at the top and the portrait banner puts the
     product low, so the shield has to run top-down, not left-right. */
  .bt-slide { align-items: flex-start; }
  .bt-slide__media::after {
    background: linear-gradient(180deg, rgba(7,17,31,0.94) 0%, rgba(7,17,31,0.74) 44%, rgba(7,17,31,0.14) 100%);
  }
}

/* ---- no-JS: the scroller still swipes, so hide only what needs JS ---- */
.no-js .bt-slider__arrow,
.no-js .bt-slider__play,
.no-js .bt-slider__dots { display: none; }
