/*
 * Step screens: a horizontal scroll-snap track with one screen per width, and the Back / dots / Next navigation under
 * it (core/js/step-screens.js, templates/core/guides/_step_nav.html). Used by the guide swimlane and the compensation
 * models on /guides/. The content of a screen is styled by the partial that renders it; this file owns the frame.
 * Tokens only, so dark mode follows. A centred column of at most 720px on wide screens.
 */

.step-screens {
  display: flex;
  flex-direction: column;
  gap: var(--ds-space-12);
  width: 100%;
  max-width: 720px;
  margin-inline: auto;
  font-family: var(--ds-font-family);
  color: var(--ds-text);
}

.step-screens__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--ds-space-16);
}

.step-screens__title {
  margin: 0;
  color: var(--ds-text-muted);
  font-size: var(--ds-type-eyebrow-size);
  line-height: var(--ds-type-eyebrow-leading);
  letter-spacing: var(--ds-type-eyebrow-tracking);
  font-weight: 600;
  text-transform: uppercase;
}

/* One screen per width: swipe, buttons, dots, arrow keys and hash routes all end in a scroll of this track */
.step-screens__track {
  position: relative;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}

.step-screens__track::-webkit-scrollbar {
  display: none;
}

.step-screens__track:focus-visible,
.step-screens__dot:focus-visible {
  outline: 2px solid var(--ds-focus-ring);
  outline-offset: 2px;
}

.step-screens__screen {
  display: flex;
  flex-direction: column;
  flex: 0 0 100%;
  min-width: 0;
  box-sizing: border-box;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.step-screens__inner {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--ds-space-12);
  min-width: 0;
  padding-block: var(--ds-space-4) var(--ds-space-8);
}

/* Navigation: Back, the dots with the counter, Next. The two buttons are at least 44px high. */
.step-screens__nav {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--ds-space-8);
  padding-bottom: var(--ds-space-8);
}

.step-screens__nav .ds-btn {
  min-height: 44px;
  padding-inline: var(--ds-space-16);
  font-size: var(--ds-type-small-size);
  line-height: var(--ds-type-small-leading);
}

.step-screens__button--next {
  justify-self: end;
}

.step-screens__progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--ds-space-4);
  min-width: 0;
}

.step-screens__dots {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: var(--ds-space-4);
}

/* 28px hit area around an 8px dot; the current dot is a longer bar */
.step-screens__dot {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: var(--ds-radius-12);
  background: transparent;
  cursor: pointer;
}

.step-screens__dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: var(--ds-radius-pill);
  background: var(--ds-border);
  transition:
    width var(--ds-motion-hover) ease,
    background-color var(--ds-motion-hover) ease;
}

.step-screens__dot[aria-current="true"]::before {
  width: 22px;
  background: var(--ds-text);
}

.step-screens__count {
  color: var(--ds-text-muted);
  font-size: var(--ds-type-caption-size);
  line-height: var(--ds-type-caption-leading);
  font-variant-numeric: tabular-nums;
}

/* Phones: the dots and the counter get a row of their own above Back and Next, so five 28px dots never wrap */
@media (max-width: 480px) {
  .step-screens__nav {
    grid-template-columns: auto auto;
    grid-template-areas:
      "progress progress"
      "prev next";
    justify-content: space-between;
    row-gap: var(--ds-space-8);
  }

  .step-screens__progress {
    grid-area: progress;
    flex-direction: row;
    justify-content: center;
    gap: var(--ds-space-12);
  }

  .step-screens__button--prev {
    grid-area: prev;
  }

  .step-screens__button--next {
    grid-area: next;
  }
}

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