/*
 * Carousels, on any page: an optional heading, a row of cards scrolling sideways,
 * a dot per card below the cards, centred. Over the sliver of a card
 * peeking in at a side, a large chevron pulsing gently. See carousel.js for the markup.
 *
 * Colours follow the text around the carousel; to change them, set on the carousel
 * or any element around it:
 *   --sd-carousel-accent        the current dot (default #00B1E2, the site's blue)
 *   --sd-carousel-dot           the other dots (default #A4A4A4)
 *   --sd-carousel-peek          the peek arrow (default #EEEEEE, almost white)
 *   --sd-carousel-peek-border   its border (default #3C3C3C, dark grey)
 *   --sd-carousel-gap           space between cards (default 20px)
 *   --sd-carousel-card          a card's width (default 85% of the carousel)
 * Cards per view, as classes on the carousel: sd-per-view-2, sd-per-view-3 (on
 * screens 900 px and wider; phones always show one card and a bit of the next).
 */

/* Rows: heading, cards, dots */
.sd-scroller {
  position: relative;
  container-type: inline-size;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.sd-scroller > .sd-head {
  grid-row: 1;
  margin: 0 0 24px;
}

.sd-scroller > .sd-track {
  grid-row: 2;
  width: 100%;
  margin: 0;
}

.sd-scroller > .sd-nav {
  grid-row: 3;
  justify-self: center;
  margin: 12px 0 0;
  padding: 0;
}

/* ---- The track and its cards -------------------------------------------------------- */

.sd-track {
  display: flex;
  gap: var(--sd-carousel-gap, 20px);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  box-sizing: border-box;
}

.sd-track::-webkit-scrollbar {
  display: none;
}

/* Cards: any block; the layout's own margins between blocks don't apply in a row */
.sd-track > * {
  flex: 0 0 var(--sd-carousel-card, 85%);
  min-width: 0;
  margin: 0 !important;
  scroll-snap-align: start;
  box-sizing: border-box;
}

@media (min-width: 900px) {
  .sd-scroller.sd-per-view-2 .sd-track > * {
    flex-basis: calc((100% - var(--sd-carousel-gap, 20px)) / 2);
  }

  .sd-scroller.sd-per-view-3 .sd-track > * {
    flex-basis: calc((100% - 2 * var(--sd-carousel-gap, 20px)) / 3);
  }
}

/* ---- The dots ----------------------------------------------------------------------- */

/* Added by carousel.js: the current card's is a slightly bigger, coloured dot */
.sd-nav {
  display: flex;
  align-items: center;
}

.sd-dot:focus-visible {
  outline: 2px solid var(--sd-carousel-accent, #00B1E2);
  outline-offset: -8px;
  border-radius: 8px;
}

.sd-dot {
  width: 28px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.sd-dot::before {
  content: "";
  display: block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--sd-carousel-dot, #A4A4A4);
  transition: width 0.25s ease, height 0.25s ease, background-color 0.25s ease;
}

.sd-dot:hover::before {
  background: currentColor;
}

.sd-dot.is-on::before {
  width: 16px;
  height: 16px;
  background: var(--sd-carousel-accent, #00B1E2);
}

@media (prefers-reduced-motion: reduce) {
  .sd-dot::before {
    transition: none;
  }
}

/* ---- Peek arrows ------------------------------------------------------------------ */

/* Placed by carousel.js on the middle of a sliver; hidden while the track moves */
.sd-peek {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  width: 28px;
  height: 52px;
  translate: -50% -50%;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease, visibility 0s linear 0.12s;
  -webkit-tap-highlight-color: transparent;
}

.sd-peek.is-shown {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s ease;
}

.sd-scroller.is-moving > .sd-peek {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease, visibility 0s linear 0.12s;
}

@media (min-width: 900px) {
  .sd-peek {
    width: 34px;
    height: 63px;
  }
}

.sd-peek svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 1px 3px rgb(0 0 0 / 25%));
  animation: sd-peek-pulse 3s ease-in-out infinite;
}

.sd-peek-border {
  stroke: var(--sd-carousel-peek-border, #3C3C3C);
}

.sd-peek-arrow {
  stroke: var(--sd-carousel-peek, #EEEEEE);
}

@keyframes sd-peek-pulse {
  0%,
  100% {
    opacity: 0.85;
    transform: scale(1);
  }

  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}

/*
 * The pulse and the fade run also for visitors who asked for reduced motion: decided
 * 2026-11-24 - a small, slow change of a small control, not movement across the page.
 */

/* ---- Brochure --------------------------------------------------------------------- */

/* The script stands still in brochure mode: a Group carousel shows its cards one under the other */
.brochure-mode .sd-scroller {
  display: block;
}
