/*
  Pagination 01 — Precision Numeric — 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.48 0 0);
  --pagination-disabled: oklch(0.75 0 0);
  --pagination-border: oklch(0.88 0 0);
  --pagination-hover: oklch(0.96 0 0);
}

.pagination01 {
  display: flex;
  width: 100%;
  /* Top-aligned: the track reserves room below the pages for the marker,
     so centring would lift the pages above the step buttons. */
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.25rem;
  font-family:
    Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji";
}

.pagination01__step {
  display: flex;
  height: 2.25rem;
  min-width: 2.25rem;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  border: 0;
  border-radius: 0.5rem;
  background: none;
  padding: 0 0.5rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--pagination-fg);
  cursor: pointer;
  outline: none;
  transition: background-color 150ms;
}

.pagination01__step svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.pagination01__step-label {
  display: none;
}

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

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

.pagination01__track {
  position: relative;
  padding-bottom: 0.5rem;
}

.pagination01__list {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pagination01__page {
  display: flex;
  height: 2.25rem;
  min-width: 2.25rem;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  background: none;
  padding: 0 0.375rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--pagination-muted);
  cursor: pointer;
  outline: none;
  transition:
    color 150ms,
    background-color 150ms,
    border-color 150ms,
    box-shadow 150ms;
}

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

.pagination01__page[aria-current="page"] {
  border-color: var(--pagination-border);
  background-color: #ffffff;
  font-weight: 600;
  color: var(--pagination-fg);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.06),
    0 4px 12px -6px rgba(0, 0, 0, 0.18);
}

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

.pagination01__gap {
  display: flex;
  height: 2.25rem;
  width: 1.5rem;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  color: var(--pagination-muted);
  user-select: none;
}

.pagination01__marker {
  position: absolute;
  bottom: 0;
  left: 0;
  display: block;
  width: 1.25rem;
  height: 3px;
  margin-left: -0.625rem;
  pointer-events: none;
}

/* The marker only glides once it has been placed, so it never slides in
   from the list's left edge on first paint. */
.pagination01__marker[data-ready] {
  transition: transform 260ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* Re-drawn on every page change, so the marker still acknowledges the
   move when the current page keeps its slot in the middle of the range. */
.pagination01__marker-bar {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 9999px;
  background-color: var(--pagination-accent);
  transform-origin: center;
  animation: pagination01-draw 280ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes pagination01-draw {
  from {
    transform: scaleX(0.25);
    opacity: 0.4;
  }
  to {
    transform: scaleX(1);
    opacity: 1;
  }
}

@media (min-width: 640px) {
  .pagination01 {
    gap: 0.75rem;
  }
  .pagination01__step {
    height: 2.5rem;
    padding: 0 0.75rem;
  }
  .pagination01__step-label {
    display: inline;
  }
  .pagination01__page {
    height: 2.5rem;
    min-width: 2.5rem;
  }
  .pagination01__gap {
    height: 2.5rem;
    width: 2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pagination01__marker[data-ready] {
    transition: none;
  }
  .pagination01__marker-bar {
    animation: 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;
}
.pagination01-layout {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
}
.pagination01-layout__card {
  width: 100%;
  max-width: 42.5rem;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 1rem;
  background: #ffffff;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 16px 40px -16px rgba(0, 0, 0, 0.14);
}
.pagination01-layout__summary {
  border-bottom: 1px solid oklch(0.97 0 0);
  padding: 1rem;
  font-size: 0.75rem;
  color: oklch(0.556 0 0);
}
.pagination01-layout__summary strong {
  font-weight: 600;
  color: oklch(0.205 0 0);
  font-variant-numeric: tabular-nums;
}
.pagination01-layout__results {
  margin: 0;
  padding: 0 1rem;
  list-style: none;
}
.pagination01-layout__result {
  padding: 1rem 0;
}
.pagination01-layout__result + .pagination01-layout__result {
  border-top: 1px solid oklch(0.97 0 0);
}
.pagination01-layout__url {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.75rem;
  color: oklch(0.556 0 0);
}
.pagination01-layout__title {
  margin-top: 0.25rem;
  font-size: 15px;
  font-weight: 600;
  color: oklch(0.205 0 0);
}
.pagination01-layout__snippet {
  display: -webkit-box;
  margin-top: 0.25rem;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 0.875rem;
  line-height: 1.625;
  color: oklch(0.439 0 0);
}
.pagination01-layout__footer {
  border-top: 1px solid oklch(0.97 0 0);
  padding: 0.75rem 0.5rem 0.5rem;
}
@media (min-width: 640px) {
  .pagination01-layout {
    padding: 3rem 2.5rem;
  }
  .pagination01-layout__summary {
    padding: 1rem 1.5rem;
  }
  .pagination01-layout__results {
    padding: 0 1.5rem;
  }
  .pagination01-layout__footer {
    padding: 0.75rem 1rem 0.5rem;
  }
}
