/* ==========================================================================
   Hero slider — the client's existing banners, linked to circular thumbnails.
   Keeps the interaction from the original site (thumb ↔ slide link,
   3D icon spin + rotating ring on hover) in the new brand system.
   Requires tokens.css.
   ========================================================================== */

.hero-slider {
  padding-block: var(--space-6) var(--space-7);
  background: var(--color-background);
  overflow: hidden;
}

/* Same container as the rest of the page so the slider lines up with the
   logo, navigation and section content. */
.hero-slider__container {
  position: relative;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---- Slides ------------------------------------------------------------ */

/* All slides share one grid cell so the tallest sets the height (no jump). */
.hero-slider__viewport {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  touch-action: pan-y;
}

.hero-slide {
  grid-area: 1 / 1;
  min-width: 0;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 600ms var(--ease),
    visibility 0s linear 600ms;
}

.hero-slide.is-active {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

/* Banners are 1024 × 300 artwork with text baked in, so they are shown
   whole (never cropped). */
.hero-banner {
  position: relative;
  display: block;
  aspect-ratio: 1024 / 300;
  overflow: hidden;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.hero-banner:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.hero-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  -webkit-user-drag: none;
  user-select: none;
}

/* ---- Thumbnails -------------------------------------------------------- */

.hero-slider__nav {
  margin-top: var(--space-6);
}

.hero-thumbs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.hero-thumb {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-1);
  border: 0;
  border-radius: var(--radius-md);
  background: none;
  cursor: pointer;
  font: var(--fw-semibold) var(--fs-small) / 1.3 var(--font-body);
  color: var(--color-text);
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}

.hero-thumb:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.hero-thumb__icon {
  position: relative;
  width: 100px;
  height: 100px;
  display: grid;
  place-items: center;
  perspective: 400px;
}

/* Half-red ring, as on the original site, drawn with a masked conic gradient. */
.hero-thumb__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(var(--color-primary) 0 50%, var(--color-border) 0 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
  transform: rotate(-45deg);
  transition: transform 600ms var(--ease);
}

.hero-thumb__img {
  width: 76%;
  height: 76%;
  border-radius: 50%;
  object-fit: contain;
  background: #fff;
  transition: transform 600ms var(--ease);
}

.hero-thumb__img--cover { object-fit: cover; }

.hero-thumb:hover .hero-thumb__img,
.hero-thumb:focus-visible .hero-thumb__img {
  transform: rotateY(360deg);
}

.hero-thumb:hover .hero-thumb__ring,
.hero-thumb:focus-visible .hero-thumb__ring {
  transform: rotate(315deg);
}

.hero-thumb.is-active .hero-thumb__ring { background: var(--color-primary); }
.hero-thumb.is-active .hero-thumb__label { color: var(--color-primary-hover); }

/* ---- Pause / play -------------------------------------------------------
   Not shown visually (client request). It stays in the page for keyboard and
   screen-reader users and appears over the banner only when it has focus. */

.hero-slider__toggle {
  position: absolute;
  top: var(--space-3);
  right: calc(var(--gutter) + var(--space-3));
  z-index: 2;
  display: grid;
  place-items: center;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: var(--color-text);
  cursor: pointer;
}

.hero-slider__toggle:focus-visible {
  width: 40px;
  height: 40px;
  clip: auto;
  box-shadow: var(--focus-ring);
}

.hero-slider__toggle .icon-play { display: none; }
.hero-slider.is-paused .hero-slider__toggle .icon-play { display: block; }
.hero-slider.is-paused .hero-slider__toggle .icon-pause { display: none; }

/* ---- Tablet: smaller thumbs so all six fit ----------------------------- */

@media (max-width: 991.98px) {
  .hero-thumb__icon { width: 84px; height: 84px; }
  .hero-thumb { font-size: 13px; }
}

/* ---- Phone ------------------------------------------------------------- */

@media (max-width: 767.98px) {
  .hero-slider { padding-block: 0 var(--space-6); }

  /* Banner runs edge to edge directly under the header. */
  .hero-banner {
    margin-inline: calc(-1 * var(--gutter));
    border-radius: 0;
    box-shadow: none;
  }

  .hero-slider__toggle { right: var(--space-3); }

  /* Six thumbs as a 3 × 2 grid: nothing is cut off, no sideways scroll. */
  .hero-slider__nav { margin-top: var(--space-5); }

  .hero-thumbs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    row-gap: var(--space-3);
  }

  .hero-thumb { gap: var(--space-2); font-size: 12.5px; }
  .hero-thumb__icon { width: 72px; height: 72px; }
  .hero-thumb__ring {
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
            mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-slide,
  .hero-thumb__ring,
  .hero-thumb__img { transition: none; }

  .hero-thumb:hover .hero-thumb__img,
  .hero-thumb:focus-visible .hero-thumb__img,
  .hero-thumb:hover .hero-thumb__ring,
  .hero-thumb:focus-visible .hero-thumb__ring { transform: none; }

  .hero-thumb__ring { transform: rotate(-45deg); }
}
