/* =====================================================================
   Sản Khoa Hà Nội — Design System v2
   Goals: faster reading, stronger SEO signals, LLM-citable structure
   ===================================================================== */

/* -------------------------------------------------------------------
   1. Design tokens
   ------------------------------------------------------------------- */
:root {
  /* Brand */
  --brand-50:  #effaf9;
  --brand-100: #d6f1ee;
  --brand-200: #aee2dd;
  --brand-300: #7accc4;
  --brand-500: #0d6e7a;
  --brand-600: #095a64;
  --brand-700: #07434b;
  --brand-800: #053238;

  /* Accent (warm) — for human touch in a medical site */
  --accent-50:  #fff5ed;
  --accent-100: #ffe5cf;
  --accent-500: #d97742;
  --accent-600: #b85e2c;

  /* Neutral */
  --gray-0:   #ffffff;
  --gray-50:  #fafbfc;
  --gray-100: #f3f5f7;
  --gray-200: #e4e9ec;
  --gray-300: #d2dade;
  --gray-400: #a5b1b8;
  --gray-500: #738089;
  --gray-600: #4d5a62;
  --gray-700: #2e3a42;
  --gray-800: #1a2229;
  --gray-900: #0e151b;

  /* Semantic */
  --success-50:  #e6f7ee;
  --success-500: #1a7a4a;
  --success-700: #0f5a35;
  --warning-50:  #fff8e1;
  --warning-500: #b07310;
  --danger-50:   #fef2f2;
  --danger-500:  #b42318;

  /* Page mapping (light) */
  --bg:        var(--gray-50);
  --surface:   var(--gray-0);
  --surface-2: var(--gray-100);
  --text:      var(--gray-800);
  --text-soft: var(--gray-600);
  --text-mute: var(--gray-500);
  --border:    var(--gray-200);
  --border-strong: var(--gray-300);
  --primary:        var(--brand-500);
  --primary-hover:  var(--brand-600);
  --primary-strong: var(--brand-700);
  --primary-soft:   var(--brand-50);
  --accent:         var(--accent-500);
  --accent-soft:    var(--accent-50);
  --link:           var(--brand-600);
  --link-hover:     var(--brand-700);
  --focus-ring:     0 0 0 3px rgba(13, 110, 122, 0.35);

  /* Typography */
  --font-sans: "Inter", "Be Vietnam Pro", "Segoe UI", -apple-system,
               BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Source Serif 4", "Source Serif Pro", Georgia,
                "Times New Roman", serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Consolas,
               "Liberation Mono", monospace;

  --fs-xs:   0.8125rem;   /* 13px */
  --fs-sm:   0.9375rem;   /* 15px */
  --fs-base: 1.0625rem;   /* 17px — readable for Vietnamese diacritics */
  --fs-md:   1.1875rem;   /* 19px */
  --fs-lg:   1.375rem;    /* 22px */
  --fs-xl:   1.75rem;     /* 28px */
  --fs-2xl:  2.125rem;    /* 34px */
  --fs-3xl:  2.625rem;    /* 42px */

  --lh-tight: 1.25;
  --lh-snug:  1.4;
  --lh-base:  1.7;
  --lh-loose: 1.8;

  /* Layout */
  --content-narrow: 68ch;
  --content-wide:   78rem;
  --content-text:   42rem;
  --sidebar:        18rem;
  --gutter:         clamp(1rem, 4vw, 2.5rem);

  /* Radii / shadows */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(15, 30, 40, 0.04),
               0 1px 3px rgba(15, 30, 40, 0.06);
  --shadow-md: 0 2px 6px rgba(15, 30, 40, 0.05),
               0 8px 20px rgba(15, 30, 40, 0.06);
  --shadow-lg: 0 4px 12px rgba(15, 30, 40, 0.06),
               0 18px 38px rgba(15, 30, 40, 0.10);

  --t-fast: 120ms cubic-bezier(.4,0,.2,1);
  --t-base: 200ms cubic-bezier(.4,0,.2,1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #0d1418;
    --surface:   #131c22;
    --surface-2: #1a242c;
    --text:      #e8eef2;
    --text-soft: #b7c2c9;
    --text-mute: #8896a0;
    --border:    #243038;
    --border-strong: #34424b;
    --primary:        #4ac2c9;
    --primary-hover:  #6fd0d6;
    --primary-strong: #97e0e4;
    --primary-soft:   #0e2a2c;
    --accent:         #ea8a55;
    --accent-soft:    #2a1a10;
    --link:           #6fd0d6;
    --link-hover:     #a8e1e5;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow-md: 0 4px 14px rgba(0,0,0,.45);
    --shadow-lg: 0 12px 36px rgba(0,0,0,.55);
  }
}

/* -------------------------------------------------------------------
   2. Reset + base
   ------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

html:focus-within { scroll-padding-top: 5rem; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: var(--lh-tight);
  color: var(--text);
  letter-spacing: -0.011em;
}

h1 { font-size: var(--fs-2xl); margin: 0 0 0.5em; }
h2 { font-size: var(--fs-xl);  margin: 2em 0 0.6em; line-height: var(--lh-snug); }
h3 { font-size: var(--fs-lg);  margin: 1.6em 0 0.5em; }
h4 { font-size: var(--fs-md);  margin: 1.4em 0 0.4em; }

p, ul, ol, dl, blockquote, table {
  margin: 0 0 1em;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color var(--t-fast);
}
a:hover { color: var(--link-hover); }
a:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 2px;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-size: 0.95em;
}

blockquote {
  border-left: 3px solid var(--primary);
  padding: 0.25rem 0 0.25rem 1.25rem;
  color: var(--text-soft);
  font-style: italic;
}

/* -------------------------------------------------------------------
   3. Accessibility helpers
   ------------------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  position: fixed;
  inset: 0.5rem auto auto 0.5rem;
  width: auto;
  height: auto;
  padding: 0.625rem 1rem;
  background: var(--primary-strong);
  color: #fff;
  text-decoration: none;
  z-index: 9999;
  border-radius: var(--r-sm);
  font-weight: 600;
}
.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;
}

/* -------------------------------------------------------------------
   4. Site chrome — header
   ------------------------------------------------------------------- */
.site-header {
  background: rgba(255,255,255,0.85);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
@media (prefers-color-scheme: dark) {
  .site-header { background: rgba(13, 20, 24, 0.88); }
}

.site-header__inner {
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: 0.75rem var(--gutter);
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--primary-strong);
  font-weight: 700;
  font-size: var(--fs-md);
  line-height: 1;
  white-space: nowrap;
}
.site-brand__mark {
  width: 1.75rem;
  height: 1.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: #fff;
  font-size: 0.95rem;
}

.site-nav {
  display: flex;
  gap: 0.25rem;
  flex: 1;
  flex-wrap: wrap;
}
.site-nav a {
  padding: 0.5rem 0.75rem;
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  font-weight: 500;
  text-decoration: none;
  color: var(--text-soft);
  transition: background var(--t-fast), color var(--t-fast);
}
.site-nav a:hover {
  background: var(--surface-2);
  color: var(--text);
}
.site-nav a[aria-current="page"] {
  color: var(--primary-strong);
  background: var(--primary-soft);
  font-weight: 600;
}

/* mobile nav toggle (progressive enhancement, JS optional) */
.site-nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 0.4rem 0.6rem;
  color: var(--text);
  cursor: pointer;
  font: inherit;
}

/* -------------------------------------------------------------------
   5. Layout containers
   ------------------------------------------------------------------- */
main {
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: 1.25rem var(--gutter) 4rem;
}

.page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1.5rem, 3vw, 2.5rem);
}

@media (min-width: 1024px) {
  .page--with-aside {
    grid-template-columns: minmax(0, 1fr) var(--sidebar);
    align-items: start;
  }
  .page__aside {
    position: sticky;
    top: 5.5rem;
    align-self: start;
  }
}

/* -------------------------------------------------------------------
   6. Breadcrumbs
   ------------------------------------------------------------------- */
.breadcrumbs {
  margin: 0 0 1rem;
}
.breadcrumbs__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.4rem;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--text-mute);
}
.breadcrumbs__item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.breadcrumbs__item + .breadcrumbs__item::before {
  content: "/";
  color: var(--border-strong);
}
.breadcrumbs__item a {
  color: var(--text-mute);
  text-decoration: none;
}
.breadcrumbs__item a:hover { color: var(--primary); }
.breadcrumbs__item--current {
  color: var(--text-soft);
  font-weight: 500;
}

/* -------------------------------------------------------------------
   7. Hero patterns
   ------------------------------------------------------------------- */
.page-hero {
  position: relative;
  padding: clamp(1.25rem, 4vw, 2.5rem) 0 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.page-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--primary);
  margin: 0 0 0.5rem;
}
.page-hero__eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--primary);
}
.page-hero h1 {
  font-size: clamp(1.75rem, 4vw, var(--fs-3xl));
  margin: 0 0 0.75rem;
  color: var(--text);
  max-width: 28ch;
}
.page-hero__lead {
  font-size: var(--fs-md);
  line-height: var(--lh-snug);
  color: var(--text-soft);
  max-width: 60ch;
  margin: 0 0 1rem;
}
.page-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.2rem;
  font-size: var(--fs-xs);
  color: var(--text-mute);
  margin-top: 0.75rem;
}
.page-hero__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.page-hero__meta-item::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.7;
}

.page-hero--landing {
  background: linear-gradient(180deg, var(--primary-soft), transparent 80%);
  border-bottom: none;
  padding-bottom: 2rem;
}

/* -------------------------------------------------------------------
   8. Editorial meta strip (author/date/sources) — E-E-A-T signal
   ------------------------------------------------------------------- */
.editorial-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
  align-items: center;
  padding: 0.625rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: var(--fs-xs);
  color: var(--text-soft);
  margin: 0 0 1.25rem;
}
.editorial-meta__label {
  font-weight: 600;
  color: var(--text);
}
.editorial-meta__item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.editorial-meta__item svg {
  width: 14px; height: 14px;
  color: var(--text-mute);
  flex: none;
}

/* -------------------------------------------------------------------
   9. Buttons
   ------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.625rem 1.1rem;
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--t-fast), color var(--t-fast),
              border-color var(--t-fast), transform var(--t-fast),
              box-shadow var(--t-fast);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.btn--primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #fff;
}
.btn--secondary {
  background: var(--surface);
  color: var(--primary-strong);
  border-color: var(--border-strong);
}
.btn--secondary:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.btn--ghost {
  background: transparent;
  color: var(--text-soft);
  border-color: transparent;
}
.btn--ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}
.btn--large { padding: 0.85rem 1.6rem; font-size: var(--fs-base); }
.btn--sm    { padding: 0.4rem 0.75rem; font-size: var(--fs-xs); }
.btn[aria-disabled="true"],
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* -------------------------------------------------------------------
   10. Key-answer (LLM-citable "TL;DR")
   ------------------------------------------------------------------- */
.key-answer {
  position: relative;
  margin: 0 0 1.5rem;
  padding: 1.1rem 1.25rem 1.1rem 3.25rem;
  background: var(--primary-soft);
  border: 1px solid var(--brand-200);
  border-left: 4px solid var(--primary);
  border-radius: var(--r-md);
  color: var(--text);
}
.key-answer::before {
  content: "✦";
  position: absolute;
  left: 1.1rem;
  top: 1.1rem;
  width: 1.5rem;
  height: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 0.9rem;
  line-height: 1;
}
.key-answer__label {
  display: block;
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary-strong);
  margin-bottom: 0.35rem;
}
.key-answer__body {
  font-size: var(--fs-md);
  line-height: var(--lh-snug);
  margin: 0;
}
.key-answer__body strong { color: var(--text); }

/* -------------------------------------------------------------------
   11. At-a-glance fact cards
   ------------------------------------------------------------------- */
.glance {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
}
.glance__item {
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.glance__label {
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-mute);
}
.glance__value {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.glance__value--small { font-size: var(--fs-sm); }

/* -------------------------------------------------------------------
   12. Article / prose body
   ------------------------------------------------------------------- */
.prose {
  max-width: var(--content-text);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  color: var(--text);
}
.prose--wide { max-width: 56rem; }

.prose h2 {
  font-size: var(--fs-xl);
  margin-top: 2.4em;
  margin-bottom: 0.5em;
  scroll-margin-top: 5rem;
}
.prose h2::before {
  content: "";
  display: block;
  width: 36px;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
  margin-bottom: 0.65rem;
}
.prose h3 {
  font-size: var(--fs-lg);
  margin-top: 1.8em;
  scroll-margin-top: 5rem;
}
.prose h4 {
  font-size: var(--fs-md);
  scroll-margin-top: 5rem;
}
.prose p, .prose ul, .prose ol { margin: 0 0 1em; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin: 0.25em 0; }
.prose li > ul, .prose li > ol { margin: 0.25em 0; }

.prose a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: rgba(13, 110, 122, 0.35);
  text-underline-offset: 0.22em;
}
.prose a:hover { text-decoration-color: currentColor; }

.prose img {
  border-radius: var(--r-md);
  margin: 1.5rem 0;
}

.prose figure {
  margin: 1.5rem 0;
}
.prose figcaption {
  font-size: var(--fs-xs);
  color: var(--text-mute);
  text-align: center;
  margin-top: 0.4rem;
}

/* tables in prose */
.prose table,
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: var(--fs-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.prose th,
.prose td,
.data-table th,
.data-table td {
  padding: 0.65rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.prose th,
.data-table th {
  background: var(--surface-2);
  font-weight: 600;
  color: var(--text);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.prose tbody tr:last-child td,
.data-table tbody tr:last-child td { border-bottom: none; }
.prose tbody tr:nth-child(even),
.data-table tbody tr:nth-child(even) { background: var(--gray-50); }
@media (prefers-color-scheme: dark) {
  .prose tbody tr:nth-child(even),
  .data-table tbody tr:nth-child(even) { background: rgba(255,255,255,0.02); }
}

/* tabular wrapping container */
.table-scroll {
  overflow-x: auto;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  margin: 1.25rem 0;
}
.table-scroll > table {
  margin: 0;
  border: none;
  border-radius: 0;
}

/* inline citations */
.prose [data-cite],
sup.cite {
  font-size: 0.75em;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  vertical-align: super;
  padding: 0 0.15em;
}
.prose [data-cite]:hover,
sup.cite:hover { text-decoration: underline; }

/* -------------------------------------------------------------------
   13. TOC (sticky on desktop)
   ------------------------------------------------------------------- */
.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1rem 1.1rem;
  font-size: var(--fs-sm);
}
.toc__title {
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-mute);
  margin: 0 0 0.6rem;
}
.toc nav ul,
.toc__list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.toc nav ul ul { padding-left: 0.9rem; margin: 0.25rem 0; }
.toc li { margin: 0.2rem 0; }
.toc a {
  text-decoration: none;
  color: var(--text-soft);
  display: block;
  padding: 0.25rem 0.5rem;
  border-radius: var(--r-xs);
  border-left: 2px solid transparent;
  transition: background var(--t-fast), color var(--t-fast),
              border-color var(--t-fast);
}
.toc a:hover {
  background: var(--surface-2);
  color: var(--text);
}
.toc a.is-active {
  color: var(--primary-strong);
  background: var(--primary-soft);
  border-left-color: var(--primary);
  font-weight: 600;
}

/* collapse to inline accordion on narrow screens */
@media (max-width: 1023px) {
  .toc {
    margin-bottom: 1.5rem;
  }
  .toc details > summary {
    cursor: pointer;
    list-style: none;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.4rem;
  }
  .toc details > summary::-webkit-details-marker { display: none; }
  .toc details > summary::after {
    content: " ▾";
    font-size: 0.8em;
    color: var(--text-mute);
  }
  .toc details[open] > summary::after { content: " ▴"; }
}

/* -------------------------------------------------------------------
   14. Clinic profile
   ------------------------------------------------------------------- */
.clinic {
  display: grid;
  gap: 1.5rem;
}
.clinic-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.clinic-hero__img {
  width: 100%;
  height: clamp(180px, 30vw, 280px);
  object-fit: cover;
  display: block;
}
.clinic-hero__placeholder {
  height: 8rem;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.4), transparent 60%),
    linear-gradient(135deg, var(--brand-100), var(--brand-300));
}
.clinic-hero__body {
  padding: clamp(1.25rem, 3vw, 1.75rem);
}
.clinic-hero__eyebrow {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  padding: 0.2rem 0.55rem;
  background: var(--primary-soft);
  border-radius: var(--r-pill);
  margin-bottom: 0.6rem;
}
.clinic-hero__name {
  margin: 0 0 0.6rem;
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: var(--lh-tight);
  color: var(--text);
}
.clinic-hero__summary {
  margin: 0 0 1.1rem;
  color: var(--text-soft);
  font-size: var(--fs-md);
  max-width: 60ch;
}
.clinic-hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.clinic-hero__score {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  background: var(--accent-soft);
  color: var(--accent-600);
  font-weight: 700;
  font-size: var(--fs-sm);
  border-radius: var(--r-pill);
}

/* trust strip */
.trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  padding-top: 0.85rem;
  margin-top: 0.5rem;
  border-top: 1px dashed var(--border);
  font-size: var(--fs-xs);
  color: var(--text-soft);
}
.trust-strip__item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.trust-strip__item::before {
  content: "✓";
  color: var(--success-500);
  font-weight: 700;
}
.trust-strip__item--open::before { content: "●"; }
.trust-strip__item--closed::before { content: "●"; color: var(--danger-500); }

/* -------------------------------------------------------------------
   15. Quick facts
   ------------------------------------------------------------------- */
.quickfacts {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
}
.quickfacts__title {
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-mute);
  margin: 0 0 0.75rem;
}
.quickfacts__list { margin: 0; }
.quickfacts__row {
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: 0.5rem 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-sm);
  align-items: baseline;
}
.quickfacts__row:last-child { border-bottom: none; }
.quickfacts__row dt {
  color: var(--text-mute);
  font-weight: 600;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.quickfacts__row dt svg {
  width: 14px; height: 14px; flex: none;
  color: var(--primary);
}
.quickfacts__row dd { margin: 0; color: var(--text); }

/* hours sub-list */
.hours-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: var(--fs-sm);
}
.hours-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.1rem 0;
}
.hours-list .hours-days { font-weight: 600; color: var(--text); }

/* -------------------------------------------------------------------
   16. Section card (generic container)
   ------------------------------------------------------------------- */
.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: clamp(1.25rem, 3vw, 1.75rem);
  box-shadow: var(--shadow-sm);
}
.section-card + .section-card { margin-top: 1.5rem; }
.section-card__title {
  margin: 0 0 0.75rem;
  font-size: var(--fs-lg);
  color: var(--text);
}

/* -------------------------------------------------------------------
   17. FAQ accordion
   ------------------------------------------------------------------- */
.faq {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: clamp(1.25rem, 3vw, 1.75rem);
  box-shadow: var(--shadow-sm);
}
.faq__title { margin: 0 0 1rem; font-size: var(--fs-lg); }
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 0.4rem 0;
}
.faq-item:last-child { border-bottom: none; }
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 0.65rem 0;
  font-weight: 600;
  font-size: var(--fs-base);
  color: var(--text);
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  position: relative;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "";
  margin-left: auto;
  width: 0.7rem;
  height: 0.7rem;
  border-right: 2px solid var(--primary);
  border-bottom: 2px solid var(--primary);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform var(--t-base);
  flex: none;
  margin-top: 0.45rem;
}
.faq-item[open] summary::after {
  transform: rotate(-135deg) translate(-2px, -2px);
}
.faq-item__body {
  padding: 0 0.25rem 0.9rem;
  color: var(--text-soft);
  font-size: var(--fs-sm);
  line-height: var(--lh-base);
}
.faq-item__body :last-child { margin-bottom: 0; }

/* -------------------------------------------------------------------
   18. Sources / citations
   ------------------------------------------------------------------- */
.sources {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.25rem 1.5rem;
  font-size: var(--fs-sm);
}
.sources__title {
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-mute);
  margin: 0 0 0.65rem;
}
.sources__list {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--text-soft);
}
.sources__list li { margin: 0.3rem 0; }
.sources__date { color: var(--text-mute); font-size: var(--fs-xs); }
.sources__verified {
  margin-top: 0.8rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border);
  font-size: var(--fs-xs);
  color: var(--text-mute);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.sources__verified::before {
  content: "🛡";
  color: var(--success-500);
}

/* -------------------------------------------------------------------
   19. Disclaimer / aside
   ------------------------------------------------------------------- */
.disclaimer {
  margin-top: 2rem;
  padding: 1rem 1.25rem;
  background: var(--surface-2);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  color: var(--text-soft);
}
.disclaimer a {
  color: var(--accent-600);
  font-weight: 600;
}

/* -------------------------------------------------------------------
   20. Cards: clinic / district / service / article
   ------------------------------------------------------------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 1rem;
  margin: 1rem 0 1.5rem;
  padding: 0;
  list-style: none;
}

.clinic-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1.1rem 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: border-color var(--t-base), box-shadow var(--t-base),
              transform var(--t-base);
}
.clinic-card:hover {
  border-color: var(--brand-300);
  box-shadow: var(--shadow-md);
}
.clinic-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}
.clinic-card__name {
  margin: 0;
  font-size: var(--fs-base);
  line-height: 1.3;
}
.clinic-card__name a {
  text-decoration: none;
  color: var(--text);
}
.clinic-card__name a:hover { color: var(--primary); }
.clinic-card__type {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  color: var(--text-mute);
  padding: 0.18rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
}
.clinic-card__summary {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--text-soft);
  flex: 1;
}
.clinic-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.clinic-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.25rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.clinic-card__score {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--accent-600);
}
.clinic-card__actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }

/* badges */
.badge {
  font-size: 0.75rem;
  padding: 0.18rem 0.55rem;
  border-radius: var(--r-pill);
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
}
.badge--district {
  background: #eef6ff;
  color: #1a5fa8;
}
.badge--service {
  background: var(--primary-soft);
  color: var(--primary-strong);
}
@media (prefers-color-scheme: dark) {
  .badge--district { background: #142a44; color: #7eb6ee; }
}

/* district / service overview cards */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
  margin: 1.5rem 0;
}
.tile {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.9rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  text-decoration: none;
  color: var(--text);
  transition: border-color var(--t-base), background var(--t-base),
              transform var(--t-base);
}
.tile:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--text);
}
.tile__name { font-weight: 600; font-size: var(--fs-base); line-height: 1.3; }
.tile__sub  { font-size: var(--fs-xs); color: var(--text-mute); }

/* article cards (guides etc.) */
.article-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1.25rem 1.4rem;
  transition: border-color var(--t-base), box-shadow var(--t-base);
}
.article-card:hover {
  border-color: var(--brand-300);
  box-shadow: var(--shadow-sm);
}
.article-card__eyebrow {
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  margin-bottom: 0.3rem;
}
.article-card__title {
  margin: 0 0 0.4rem;
  font-size: var(--fs-md);
  line-height: 1.3;
}
.article-card__title a {
  text-decoration: none;
  color: var(--text);
}
.article-card__title a:hover { color: var(--primary); }
.article-card__summary {
  margin: 0 0 0.6rem;
  color: var(--text-soft);
  font-size: var(--fs-sm);
}
.article-card__meta {
  display: flex;
  gap: 0.75rem;
  font-size: var(--fs-xs);
  color: var(--text-mute);
}

/* -------------------------------------------------------------------
   21. Filters
   ------------------------------------------------------------------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: flex-end;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: 1rem;
}
.filters__group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 160px;
}
.filters__label {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.filters__select {
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  color: var(--text);
  background: var(--surface);
  font-family: inherit;
}
.filters__select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--focus-ring);
}

.empty-state {
  color: var(--text-mute);
  padding: 2.5rem 1rem;
  text-align: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-md);
  margin: 1rem 0;
}

/* -------------------------------------------------------------------
   22. Price range / call-out block
   ------------------------------------------------------------------- */
.callout {
  background: var(--accent-soft);
  border: 1px solid var(--accent-100);
  border-left: 4px solid var(--accent);
  border-radius: var(--r-md);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}
.callout__title {
  margin: 0 0 0.3rem;
  font-size: var(--fs-sm);
  color: var(--accent-600);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.callout p { margin: 0; }
.callout strong { color: var(--text); }

/* -------------------------------------------------------------------
   23. Map
   ------------------------------------------------------------------- */
.clinic-map {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.clinic-map__trigger {
  position: relative;
  cursor: pointer;
  border: none;
  padding: 0;
  width: 100%;
  background: none;
  display: block;
}
.clinic-map__thumb {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}
.clinic-map__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.35);
  color: #fff;
  font-weight: 600;
}
.clinic-map__link {
  display: block;
  padding: 0.6rem 1rem;
  font-size: var(--fs-sm);
  color: var(--primary);
  background: var(--primary-soft);
}

/* -------------------------------------------------------------------
   24. Stats row (homepage)
   ------------------------------------------------------------------- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
  margin: 1.5rem 0;
  list-style: none;
  padding: 0;
}
.stat {
  text-align: center;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.stat__num {
  display: block;
  font-size: var(--fs-2xl);
  font-weight: 800;
  color: var(--primary-strong);
  line-height: 1;
}
.stat__label {
  display: block;
  font-size: var(--fs-xs);
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
}

/* -------------------------------------------------------------------
   25. Sticky CTA (mobile)
   ------------------------------------------------------------------- */
.clinic-cta-sticky {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 200;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 0.65rem 0.85rem;
  gap: 0.6rem;
  box-shadow: 0 -4px 16px rgba(15,30,40,0.10);
}
.btn--sticky { flex: 1; justify-content: center; }
@media (max-width: 680px) {
  .clinic-cta-sticky { display: flex; }
  main { padding-bottom: 5rem; }
}

/* -------------------------------------------------------------------
   26. Compare tray + table
   ------------------------------------------------------------------- */
.btn--compare {
  border-color: var(--border-strong);
  color: var(--text-soft);
  background: var(--surface);
}
.btn--compare-active {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}
.btn--compare:disabled { opacity: 0.45; cursor: not-allowed; }

.compare-tray {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 300;
  background: var(--surface);
  border-top: 2px solid var(--primary);
  box-shadow: 0 -6px 24px rgba(15,30,40,0.12);
}
.compare-tray__inner {
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: 0.75rem var(--gutter);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.compare-tray__label {
  font-weight: 600;
  font-size: var(--fs-sm);
  color: var(--text-soft);
  white-space: nowrap;
}
.compare-tray__list {
  display: flex;
  gap: 0.4rem;
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
  flex-wrap: wrap;
}
.compare-tray__item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--primary-soft);
  border-radius: var(--r-pill);
  padding: 0.25rem 0.7rem;
  font-size: var(--fs-xs);
  color: var(--primary-strong);
}
.compare-tray__remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-mute);
  font-size: 1rem;
  line-height: 1;
  padding: 0 0.1rem;
}
.compare-tray__remove:hover { color: var(--text); }
.compare-tray__actions { display: flex; gap: 0.4rem; }
body:has(.compare-tray:not([hidden])) main { padding-bottom: 6rem; }

.compare-table-wrap {
  overflow-x: auto;
  margin: 1.5rem 0 2rem;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
}
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
  min-width: 540px;
}
.compare-table thead th {
  background: var(--surface-2);
  padding: 0.85rem 1rem;
  font-size: var(--fs-sm);
  font-weight: 700;
  text-align: center;
  border-bottom: 2px solid var(--border);
}
.compare-table thead th:first-child { text-align: left; }
.compare-table thead th a { text-decoration: none; color: var(--primary-strong); }
.compare-table tbody th {
  padding: 0.6rem 1rem;
  font-weight: 600;
  color: var(--text-mute);
  background: var(--surface);
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.compare-table tbody td {
  padding: 0.65rem 1rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.compare-table tfoot td {
  padding: 0.85rem 1rem;
  text-align: center;
  background: var(--surface-2);
}
.compare-back {
  font-size: var(--fs-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

/* -------------------------------------------------------------------
   27. Footer
   ------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  font-size: var(--fs-sm);
  color: var(--text-soft);
  margin-top: 4rem;
}
.site-footer__inner {
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: 2.5rem var(--gutter) 2rem;
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 2rem;
}
.site-footer__col h2 {
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-mute);
  margin: 0 0 0.85rem;
}
.site-footer__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.site-footer__list a {
  color: var(--text-soft);
  text-decoration: none;
}
.site-footer__list a:hover { color: var(--primary); }
.site-footer__about p {
  margin: 0.4rem 0 0.7rem;
  color: var(--text-soft);
}
.site-footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary-strong);
  font-weight: 700;
  font-size: var(--fs-md);
  text-decoration: none;
}
.site-footer__bottom {
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: 1rem var(--gutter) 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
  align-items: center;
  font-size: var(--fs-xs);
  color: var(--text-mute);
}

@media (max-width: 800px) {
  .site-footer__inner { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
}
@media (max-width: 520px) {
  .site-footer__inner { grid-template-columns: 1fr; }
}

/* -------------------------------------------------------------------
   28. Site search
   ------------------------------------------------------------------- */
.site-search {
  position: relative;
  flex-shrink: 0;
}
.site-search__input {
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  font-size: var(--fs-sm);
  width: 200px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  transition: width var(--t-base), border-color var(--t-base);
}
.site-search__input::placeholder { color: var(--text-mute); }
.site-search__input:focus {
  border-color: var(--primary);
  box-shadow: var(--focus-ring);
  outline: none;
  width: 260px;
}
.site-search__results {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-height: 420px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  z-index: 400;
}
.search-result {
  display: block;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
}
.search-result:last-child { border-bottom: none; }
.search-result:hover,
.search-result:focus {
  background: var(--primary-soft);
  outline: none;
}
.search-result__title {
  display: block;
  font-weight: 600;
  font-size: var(--fs-sm);
}
.search-result__excerpt {
  display: -webkit-box;
  font-size: var(--fs-xs);
  color: var(--text-mute);
  margin-top: 0.2rem;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.search-result--empty,
.search-result--info {
  padding: 1rem;
  color: var(--text-mute);
  font-size: var(--fs-sm);
}

/* -------------------------------------------------------------------
   29. Error / 404
   ------------------------------------------------------------------- */
.error-page {
  text-align: center;
  padding: 4rem 1rem;
}
.error-page h1 {
  font-size: clamp(2rem, 6vw, var(--fs-3xl));
  color: var(--primary-strong);
}
.error-page__actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

/* -------------------------------------------------------------------
   30. Responsive overrides
   ------------------------------------------------------------------- */
@media (max-width: 800px) {
  .site-search__input { width: 140px; }
  .site-search__input:focus { width: 180px; }
  .site-search__results { width: 92vw; right: -1rem; }
  .quickfacts__row { grid-template-columns: 1fr; gap: 0.1rem; }
  .quickfacts__row dt { font-size: var(--fs-xs); }
}
@media (max-width: 640px) {
  .site-search { display: none; }
  .compare-tray__inner { padding: 0.625rem 1rem; }
  .compare-tray__label { flex: 1 0 100%; }
  .clinic-hero__ctas .btn--large { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

/* -------------------------------------------------------------------
   31. Print
   ------------------------------------------------------------------- */
@media print {
  .site-header,
  .site-footer,
  .clinic-cta-sticky,
  .compare-tray,
  .toc,
  .site-search { display: none !important; }
  main { max-width: none; padding: 0; }
  .clinic-hero,
  .quickfacts,
  .faq,
  .section-card,
  .sources {
    box-shadow: none;
    border-color: #ccc;
    page-break-inside: avoid;
  }
  a { color: #000; text-decoration: underline; }
}
