/*
  Pagination 04 — Stage Path — standalone HTML/CSS/JS implementation.
  No build step, no framework, no external dependency: copy index.html,
  this file, and script.js into any project as-is.
*/

:root {
  --pagination-accent: #39ff14;
  --pagination-fg: oklch(0.145 0 0);
  --pagination-muted: oklch(0.52 0 0);
  --pagination-disabled: oklch(0.78 0 0);
  --pagination-hover: oklch(0.96 0 0);
  --pagination-track: oklch(0.93 0 0);
  --pagination-track-hover: oklch(0.88 0 0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Recomposes by the space the control actually has, not the viewport. */
.pagination04 {
  container-type: inline-size;
  width: 100%;
  font-family:
    Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji";
}

.pagination04__row {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.pagination04__step {
  display: flex;
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 9999px;
  background: none;
  padding: 0;
  font-family: inherit;
  color: var(--pagination-fg);
  cursor: pointer;
  outline: none;
  transition: background-color 150ms;
}

.pagination04__step svg {
  width: 1rem;
  height: 1rem;
}

.pagination04__step:hover {
  background-color: var(--pagination-hover);
}

.pagination04__step:disabled {
  cursor: not-allowed;
  background: none;
  color: var(--pagination-disabled);
}

.pagination04__path {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pagination04__path li {
  display: flex;
  min-width: 0;
}

.pagination04__stage {
  display: flex;
  width: 100%;
  min-width: 0;
  height: 2.75rem;
  flex-direction: column;
  justify-content: center;
  gap: 0.625rem;
  border: 0;
  border-radius: 0.5rem;
  background: none;
  padding: 0;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  outline: none;
}

.pagination04__bar {
  position: relative;
  display: block;
  width: 100%;
  height: 0.375rem;
  overflow: hidden;
  border-radius: 9999px;
  background-color: var(--pagination-track);
  transition: background-color 150ms;
}

.pagination04__stage:hover .pagination04__bar {
  background-color: var(--pagination-track-hover);
}

/* Every bar owns a fill that is simply "in" (read or current) or "out"
   (upcoming). Sweeping in from the left and retracting back to it is the
   whole transition, so single steps and multi-section jumps animate the
   same way. */
.pagination04__fill {
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  background-color: var(--pagination-fg);
  transform: scaleX(0);
  transform-origin: left center;
  transition:
    transform 380ms cubic-bezier(0.3, 0.8, 0.25, 1),
    background-color 220ms ease-out;
}

.pagination04__stage[data-state="read"] .pagination04__fill {
  transform: scaleX(1);
}

.pagination04__stage[data-state="current"] .pagination04__fill {
  transform: scaleX(1);
  background-color: var(--pagination-accent);
}

.pagination04__labels {
  display: none;
  min-width: 0;
  flex-direction: column;
}

.pagination04__index {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1rem;
  color: var(--pagination-muted);
}

.pagination04__title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.25rem;
  color: var(--pagination-muted);
  transition: color 150ms;
}

.pagination04__stage:hover .pagination04__title,
.pagination04__stage[data-state="read"] .pagination04__title {
  color: var(--pagination-fg);
}

.pagination04__stage[data-state="current"] .pagination04__title {
  font-weight: 600;
  color: var(--pagination-fg);
}

.pagination04__meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--pagination-muted);
}

.pagination04__caption {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0 2.5rem;
  font-size: 0.75rem;
  line-height: 1rem;
}

.pagination04__caption-index {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  color: var(--pagination-muted);
}

.pagination04__caption-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  color: var(--pagination-fg);
}

.pagination04__step:focus-visible,
.pagination04__stage:focus-visible {
  outline: 2px solid var(--pagination-fg);
  outline-offset: 2px;
}

@container (min-width: 36rem) {
  .pagination04__step,
  .pagination04__caption {
    display: none;
  }
  .pagination04__path {
    gap: 0.5rem;
  }
  .pagination04__stage {
    height: auto;
    justify-content: flex-start;
    padding: 0.25rem 0 0.375rem;
  }
  .pagination04__bar {
    height: 0.5rem;
  }
  .pagination04__labels {
    display: flex;
  }
}

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

/*
  Page layout — the canvas this resource is presented on. Adjust or drop it
  when placing the resource inside your own layout.
*/

*,
*::before,
*::after {
  box-sizing: border-box;
}
body {
  margin: 0;
  line-height: 1.5;
  font-family:
    Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(to bottom, #fafafa, #f4f4f5);
}
p {
  margin: 0;
}
.pagination04-layout {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
}
.pagination04-layout__card {
  width: 100%;
  max-width: 47.5rem;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 1rem;
  background: #ffffff;
  padding: 1.25rem 1rem 1.5rem;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 16px 40px -16px rgba(0, 0, 0, 0.14);
}
.pagination04-layout__eyebrow {
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  color: oklch(0.556 0 0);
}
.pagination04-layout__nav {
  margin-top: 1rem;
}
.pagination04-layout__content {
  margin-top: 1.25rem;
  border-top: 1px solid oklch(0.97 0 0);
  padding-top: 1.25rem;
}
.pagination04-layout__title {
  font-size: 1.25rem;
  line-height: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: oklch(0.205 0 0);
}
.pagination04-layout__body {
  max-width: 35rem;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.625;
  color: oklch(0.439 0 0);
}
@media (min-width: 640px) {
  .pagination04-layout {
    padding: 3rem 2.5rem;
  }
  .pagination04-layout__card {
    padding: 1.5rem 1.75rem 2rem;
  }
}
