/* ==========================================================================
   LabPreparation — labpreparation.com
   Hand-written stylesheet. No imports, no external fonts, no network requests.
   White clinical base, one accent color, generous whitespace.
   Mobile-first; WCAG AA; reduced-motion aware.
   ========================================================================== */

:root {
  --paper: #ffffff;
  --mist: #f5f9fa;
  --wash: #e7f1f3;
  --accent-wash: #e3f1f4;
  --ink: #12222c;
  --ink-2: #41535e;
  --ink-3: #5f7280;
  --line: #dfe9ec;
  --line-strong: #c6d6db;
  --accent: #0b6e83;
  --accent-deep: #085568;
  --danger-ink: #7a2e2e;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(18, 34, 44, 0.06);
  --shadow: 0 1px 2px rgba(18, 34, 44, 0.06), 0 10px 28px -14px rgba(18, 34, 44, 0.22);
  --wrap: 72rem;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

/* --------------------------------------------------------------------------
   Reset
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body,
h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input {
  font: inherit;
  color: inherit;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3 {
  line-height: 1.18;
  letter-spacing: -0.015em;
  color: var(--ink);
  font-weight: 650;
}

h1 {
  font-size: clamp(1.75rem, 1.35rem + 2.2vw, 2.6rem);
}

h2 {
  font-size: clamp(1.35rem, 1.15rem + 1.1vw, 1.75rem);
}

h3 {
  font-size: 1.0625rem;
}

p {
  color: var(--ink-2);
}

a {
  color: var(--accent-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--accent);
}

strong {
  color: var(--ink);
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.page-main:focus {
  outline: none;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* --------------------------------------------------------------------------
   Skip link
   -------------------------------------------------------------------------- */

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: var(--paper);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  transition: top 0.15s ease;
}

.skip:focus {
  top: 0;
  color: var(--paper);
}

/* --------------------------------------------------------------------------
   Masthead
   -------------------------------------------------------------------------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
}

.masthead-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-block: 0.85rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-size: 1.125rem;
}

.wordmark:hover {
  color: var(--accent-deep);
}

.wordmark-text {
  color: var(--ink);
}

.wordmark:hover .wordmark-text {
  color: var(--accent-deep);
}

.wordmark-small {
  font-size: 1rem;
}

.menu-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.5rem;
  list-style: none;
}

.menu-list a {
  display: inline-block;
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  text-decoration: none;
  font-weight: 550;
  font-size: 0.95rem;
}

.menu-list a:hover {
  background: var(--mist);
  color: var(--accent-deep);
}

/* --------------------------------------------------------------------------
   Page head
   -------------------------------------------------------------------------- */

.pagehead {
  padding-block: 2.5rem 1.5rem;
  background:
    radial-gradient(60rem 24rem at 85% -8rem, var(--accent-wash), transparent 62%),
    var(--paper);
}

.pagehead .wrap > * + * {
  margin-top: 0.75rem;
}

.kicker {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent-deep);
}

.lede {
  max-width: 46rem;
  font-size: 1.0625rem;
  color: var(--ink-2);
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  padding-top: 0.35rem;
}

.pill {
  padding: 0.25rem 0.65rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--paper);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-2);
}

/* --------------------------------------------------------------------------
   Bands (content sections)
   -------------------------------------------------------------------------- */

.band {
  padding-block: 1.75rem;
}

.band + .band {
  border-top: 1px solid var(--line);
}

.band-tint {
  background: var(--mist);
}

.band-head {
  margin-bottom: 1.25rem;
}

.band-head > * + * {
  margin-top: 0.45rem;
}

.band-lede {
  max-width: 46rem;
  color: var(--ink-2);
}

/* --------------------------------------------------------------------------
   Crumbs
   -------------------------------------------------------------------------- */

.crumbs {
  padding-block: 0.9rem;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.crumbs-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  list-style: none;
  font-size: 0.83rem;
  color: var(--ink-3);
}

.crumbs-list li + li::before {
  content: "/";
  padding-right: 0.45rem;
  color: var(--line-strong);
}

.crumbs-list a {
  color: var(--ink-3);
  text-decoration: none;
}

.crumbs-list a:hover {
  color: var(--accent-deep);
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Racks & tiles
   -------------------------------------------------------------------------- */

.rack {
  list-style: none;
  display: grid;
  gap: 0.85rem;
  grid-template-columns: 1fr;
}

@media (min-width: 40rem) {
  .rack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 64rem) {
  .rack-tests,
  .rack-guides {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .rack-states,
  .rack-cities {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.tile {
  display: flex;
}

.tile-link {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  width: 100%;
  padding: 1rem 1.1rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.tile-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-deep);
}

.tile-name {
  font-weight: 650;
  color: var(--ink);
  line-height: 1.3;
}

.tile-note {
  font-size: 0.86rem;
  color: var(--ink-3);
}

@media (hover: hover) {
  .tile-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--line-strong);
  }
}

.tile-link:focus-visible {
  border-color: var(--accent);
}

/* --------------------------------------------------------------------------
   Principles / link lists / button rows
   -------------------------------------------------------------------------- */

.principles {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: 1fr;
}

@media (min-width: 48rem) {
  .principles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.principle {
  padding: 1.1rem 1.15rem;
  background: var(--mist);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.principle h3 {
  margin-bottom: 0.4rem;
  color: var(--accent-deep);
}

.principle p {
  font-size: 0.94rem;
}

.link-list {
  list-style: none;
  display: grid;
  gap: 0.5rem;
  grid-template-columns: 1fr;
  max-width: 34rem;
}

@media (min-width: 40rem) {
  .link-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.link-list a {
  display: block;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  background: var(--paper);
}

.link-list a:hover {
  border-color: var(--accent);
  background: var(--accent-wash);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

/* --------------------------------------------------------------------------
   Finder (search form)
   -------------------------------------------------------------------------- */

.finder {
  max-width: 40rem;
}

.finder-label {
  display: block;
  margin-bottom: 0.45rem;
  font-weight: 600;
  color: var(--ink);
}

.finder-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.finder-input {
  flex: 1 1 14rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--paper);
}

.finder-input::placeholder {
  color: var(--ink-3);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.button {
  display: inline-block;
  padding: 0.7rem 1.2rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--paper);
  font-weight: 650;
  text-decoration: none;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.button:hover {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
  color: var(--paper);
}

.button-ghost {
  background: var(--paper);
  color: var(--accent-deep);
}

.button-ghost:hover {
  background: var(--accent-wash);
  color: var(--accent-deep);
}

@media (hover: hover) {
  .button:hover {
    transform: translateY(-1px);
  }
}

/* --------------------------------------------------------------------------
   Facts (definition list)
   -------------------------------------------------------------------------- */

.facts {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: 1fr;
}

@media (min-width: 40rem) {
  .facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.fact {
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--mist);
}

.fact dt {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-deep);
}

.fact dd {
  margin-top: 0.25rem;
  color: var(--ink);
  font-size: 0.95rem;
}

/* --------------------------------------------------------------------------
   Q&A (native details/summary)
   -------------------------------------------------------------------------- */

.qa-list {
  display: grid;
  gap: 0.6rem;
  max-width: 52rem;
}

.qa {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  overflow: hidden;
}

.qa summary {
  cursor: pointer;
  padding: 0.9rem 2.6rem 0.9rem 1.1rem;
  font-weight: 650;
  color: var(--ink);
  list-style: none;
  position: relative;
}

.qa summary::-webkit-details-marker {
  display: none;
}

.qa summary::after {
  content: "+";
  position: absolute;
  right: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent-deep);
  font-weight: 700;
}

.qa[open] summary::after {
  content: "\2013";
}

.qa[open] summary {
  border-bottom: 1px solid var(--line);
}

.qa-body {
  padding: 0.9rem 1.1rem 1rem;
}

.qa-body p {
  max-width: 62ch;
}

/* --------------------------------------------------------------------------
   Copy blocks (content.js body + guide sections)
   -------------------------------------------------------------------------- */

.copy-block + .copy-block {
  margin-top: 1.75rem;
}

.copy-block h2 {
  margin-bottom: 0.6rem;
}

.copy-block h3 {
  margin-bottom: 0.3rem;
}

.copy-block p {
  max-width: 70ch;
}

.copy-block p + p {
  margin-top: 0.8rem;
}

.copy-block .lede {
  font-size: 1.0625rem;
}

/* Checklists */

.checklist {
  list-style: none;
  display: grid;
  gap: 0.45rem;
  margin-top: 0.9rem;
}

.checklist-item {
  position: relative;
  padding-left: 1.6rem;
  color: var(--ink-2);
}

.checklist-item::before {
  content: "";
  position: absolute;
  left: 0.2rem;
  top: 0.45em;
  width: 0.45rem;
  height: 0.8rem;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(45deg);
}

.checklist-item strong {
  color: var(--ink);
}

/* Numbered steps */

.numbered {
  list-style: none;
  counter-reset: step;
  display: grid;
  gap: 0.55rem;
  margin-top: 0.9rem;
}

.numbered-item {
  counter-increment: step;
  position: relative;
  padding-left: 2.1rem;
  color: var(--ink-2);
}

.numbered-item::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.28em;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 50%;
  background: var(--accent-wash);
  color: var(--accent-deep);
  font-size: 0.78rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}

/* Prep docket */

.docket {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: 1fr;
}

@media (min-width: 48rem) {
  .docket {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.docket-item {
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--mist);
}

.docket-term {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-deep);
  margin-bottom: 0.35rem;
}

.docket-value {
  font-size: 0.95rem;
}

.docket-value + .checklist {
  margin-top: 0.5rem;
}

/* --------------------------------------------------------------------------
   Action slot (affiliate / informational CTA)
   -------------------------------------------------------------------------- */

.action {
  padding-block: 2.25rem;
  background: var(--accent-wash);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.action-info {
  background: var(--mist);
}

.action-inner,
.action .wrap {
  display: block;
}

.action-kicker {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent-deep);
}

.action-title {
  margin-top: 0.3rem;
  font-size: clamp(1.2rem, 1.05rem + 0.8vw, 1.5rem);
}

.action-text {
  margin-top: 0.45rem;
  max-width: 48rem;
}

.action .button {
  margin-top: 0.9rem;
}

.action .fineprint {
  margin-top: 0.8rem;
}

.action-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  margin-top: 1rem;
}

.link-chip {
  display: inline-block;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper, #fff);
  font-size: 0.9rem;
  line-height: 1.2;
  text-decoration: none;
}


/* --------------------------------------------------------------------------
   Letter nav
   -------------------------------------------------------------------------- */

.letter-nav {
  border-bottom: 1px solid var(--line);
  background: var(--mist);
}

.letter-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  list-style: none;
  padding-block: 0.75rem;
}

.letter-list a {
  display: inline-block;
  min-width: 1.9rem;
  padding: 0.2rem 0.45rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--paper);
  text-align: center;
  font-size: 0.83rem;
  font-weight: 650;
  text-decoration: none;
  color: var(--ink-2);
}

.letter-list a:hover {
  border-color: var(--accent);
  color: var(--accent-deep);
  background: var(--accent-wash);
}

/* --------------------------------------------------------------------------
   Fineprint
   -------------------------------------------------------------------------- */

.fineprint {
  font-size: 0.83rem;
  color: var(--ink-3);
  max-width: 74ch;
}

.note-source {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.docket-note {
  margin-top: 1.25rem;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.colophon {
  margin-top: 3rem;
  padding-block: 2.5rem 2rem;
  background: var(--mist);
  border-top: 1px solid var(--line);
}

.colophon-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}

@media (min-width: 48rem) {
  .colophon-grid {
    grid-template-columns: 2fr 1fr;
  }
}

.colophon-tagline {
  margin-top: 0.6rem;
  max-width: 34rem;
  font-size: 0.94rem;
}

.colophon-nav ul {
  list-style: none;
  display: grid;
  gap: 0.35rem;
}

.colophon-nav a {
  color: var(--ink-2);
  text-decoration: none;
  font-weight: 550;
}

.colophon-nav a:hover {
  color: var(--accent-deep);
  text-decoration: underline;
}

.colophon .fineprint {
  margin-top: 1.1rem;
}

.colophon-copy {
  margin-top: 1.4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

/* --------------------------------------------------------------------------
   Page variants (cosmetic only)
   -------------------------------------------------------------------------- */

.page-home .pagehead {
  padding-block: 3.25rem 2rem;
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
