/* ==========================================================================
   Sushastho (সুস্বাস্থ্য) — Public stylesheet
   Mobile-first, accessible (WCAG 2.1 AA), bilingual (Bangla / English).
   Brand colours are also exposed as CSS custom properties from the layout,
   so the admin panel's colour settings keep working.
   ========================================================================== */

/* ---------- 1. Design tokens ---------------------------------------------- */
:root {
  --brand-primary: #0F766E;
  --brand-primary-dark: #115E59;
  --brand-primary-soft: #F0FDFA;
  --brand-secondary: #0369A1;
  --brand-secondary-soft: #F0F9FF;

  --surface-canvas: #F8FAFC;
  --surface-card: #FFFFFF;
  --surface-border: #E2E8F0;
  --surface-border-strong: #CBD5E1;
  --surface-muted: #F1F5F9;

  --ink-primary: #0F172A;
  --ink-secondary: #334155;
  --ink-muted: #475569;

  --disclaimer-bg: #FFFBEB;
  --disclaimer-border: #F59E0B;
  --disclaimer-ink: #92400E;
  --danger-bg: #FEF2F2;
  --danger-border: #FECACA;
  --danger-ink: #991B1B;
  --success-bg: #ECFDF5;
  --success-border: #A7F3D0;
  --success-ink: #065F46;

  --footer-bg: #0F172A;
  --footer-ink: #CBD5E1;
  --footer-accent: #5EEAD4;

  --radius-lg: 18px;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 12px 28px -8px rgba(15, 23, 42, 0.12), 0 4px 10px -4px rgba(15, 23, 42, 0.06);

  --space-section: clamp(40px, 6vw, 64px);
  --header-h: 68px;

  --font-body: 'Noto Sans Bengali', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Hind Siliguri', 'Noto Sans Bengali', system-ui, -apple-system, sans-serif;

  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* Light tints follow the admin-chosen brand colours where the browser supports color-mix() */
@supports (color: color-mix(in srgb, red 50%, white)) {
  :root {
    --brand-primary-soft: color-mix(in srgb, var(--brand-primary) 8%, #fff);
    --brand-secondary-soft: color-mix(in srgb, var(--brand-secondary) 7%, #fff);
  }
}

/* ---------- 2. Base ------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--surface-canvas);
  color: var(--ink-primary);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

:lang(bn) { line-height: 1.82; }

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--ink-primary);
  line-height: 1.3;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0 0 1em; }

a {
  color: var(--brand-primary);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}
a:hover { color: var(--brand-primary-dark); }

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

ul, ol { margin: 0; }

button, input, select, textarea { font: inherit; }

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

::selection { background: #99F6E4; color: var(--ink-primary); }

/* Hidden from view, still read by screen readers */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Honeypot field for the newsletter form: must stay invisible to people */
.hp-field {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  opacity: 0;
  pointer-events: none;
  border: 0;
  padding: 0;
}

.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 18px;
}

/* Skip link (keyboard users jump past the header) */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 9999;
  background: var(--brand-primary);
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { left: 12px; color: #fff; }

/* ---------- 3. Emergency bar --------------------------------------------- */
.emergency-bar {
  background: var(--footer-bg);
  color: #E2E8F0;
  font-size: 13px;
  padding: 8px 0;
}
.emergency-bar__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  align-items: center;
  justify-content: space-between;
}
.emergency-bar__text { margin: 0; }
.emergency-bar__sep { margin: 0 6px; opacity: .6; }
.emergency-bar__link {
  color: var(--footer-accent);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.emergency-bar__link:hover { text-decoration: underline; }

/* ---------- 4. Site header & navigation ---------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--surface-border);
}
.header-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: 62px;
  align-items: center;
  column-gap: 10px;
  row-gap: 0;
}

.brand {
  grid-column: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
  color: var(--ink-primary);
}
.brand img {
  height: 38px;
  width: 38px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.14);
}
.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}
.brand-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 20px;
  color: var(--ink-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-tagline {
  display: none;
  font-size: 12.5px;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 13px;
  border-radius: var(--radius-sm);
  color: var(--ink-secondary);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.nav-link:hover,
.nav-link.active {
  background: var(--brand-primary-soft);
  color: var(--brand-primary);
}

.header-actions {
  grid-column: 2;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.lang-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1.5px solid var(--brand-primary);
  color: var(--brand-primary);
  font-weight: 700;
  font-size: 13.5px;
  line-height: 1;
  text-decoration: none;
  background: #fff;
  white-space: nowrap;
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.lang-switch:hover {
  background: var(--brand-primary);
  color: #fff;
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1.5px solid var(--surface-border-strong);
  background: #fff;
  border-radius: var(--radius-sm);
  color: var(--ink-primary);
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
}
.menu-toggle:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}
.menu-toggle svg {
  display: block;
}
.menu-toggle .icon-close {
  display: none;
}
.menu-toggle[aria-expanded="true"],
.menu-toggle.is-open {
  background: var(--brand-primary-soft);
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}
.menu-toggle[aria-expanded="true"] .icon-menu,
.menu-toggle.is-open .icon-menu {
  display: none;
}
.menu-toggle[aria-expanded="true"] .icon-close,
.menu-toggle.is-open .icon-close {
  display: block;
}

.nav-primary {
  grid-column: 1 / -1;
  display: none;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  padding: 10px 0 16px;
  border-top: 1px solid var(--surface-border);
}
.nav-primary.is-open { display: flex; }
.nav-primary .nav-link {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  font-size: 16px;
}

@media (max-width: 360px) {
  .brand { gap: 8px; }
  .brand img { width: 34px; height: 34px; }
  .brand-name { font-size: 18px; }
  .lang-switch { padding: 5px 10px; font-size: 13px; }
}

@media (min-width: 640px) {
  .header-inner { grid-template-rows: var(--header-h); column-gap: 16px; }
  .brand img { width: 44px; height: 44px; }
  .brand-name { font-size: 21px; }
  .brand-tagline { display: block; }
  .lang-switch { min-height: 42px; padding: 6px 14px; font-size: 14px; }
  .menu-toggle { width: 42px; height: 42px; }
}

@media (min-width: 900px) {
  .header-inner {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    min-height: var(--header-h);
    gap: 16px;
  }
  .brand { flex: 0 1 auto; }
  .brand-tagline { display: none; }
  .nav-primary {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    gap: 2px;
    width: auto;
    flex-shrink: 0;
    padding: 0;
    border-top: none;
  }
  .nav-primary .nav-link {
    width: auto;
    min-height: 44px;
    padding: 8px 11px;
    font-size: 15px;
  }
  .header-actions { order: 2; }
  .menu-toggle { display: none !important; }
}

@media (min-width: 1100px) {
  .brand-tagline { display: block; }
  .nav-primary { gap: 4px; }
  .nav-primary .nav-link { padding: 8px 13px; }
}

/* ---------- 5. Buttons --------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 10px;
  border: 1.5px solid transparent;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), transform .1s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: not-allowed; }

.btn-primary { background: var(--brand-primary); color: #fff; }
.btn-primary:hover { background: var(--brand-primary-dark); color: #fff; }

.btn-secondary { background: var(--brand-secondary); color: #fff; }
.btn-secondary:hover { background: #075985; color: #fff; }

.btn-outline {
  background: #fff;
  color: var(--brand-primary);
  border-color: var(--brand-primary);
}
.btn-outline:hover {
  background: var(--brand-primary-soft);
  color: var(--brand-primary-dark);
}

.btn-sm {
  min-height: 40px;
  padding: 6px 14px;
  font-size: 14px;
}

/* ---------- 6. Hero ------------------------------------------------------- */
.hero {
  background: linear-gradient(135deg, var(--brand-primary-soft) 0%, var(--brand-secondary-soft) 100%);
  border-bottom: 1px solid var(--surface-border);
  padding: 40px 0 48px;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  align-items: center;
}
.hero-copy { min-width: 0; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  color: var(--brand-primary);
  border: 1px solid #CCFBF1;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 14px;
}
.hero h1 {
  font-size: clamp(28px, 4.2vw, 44px);
  line-height: 1.22;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}
.hero-sub {
  font-size: 17px;
  color: var(--ink-secondary);
  max-width: 650px;
  margin: 0 0 24px;
}
.hero-search {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 640px;
  background: #fff;
  padding: 6px;
  border-radius: 12px;
  border: 1.5px solid var(--surface-border-strong);
  box-shadow: var(--shadow-sm);
  margin: 0;
}
.hero-search:focus-within { border-color: var(--brand-primary); }
.hero-search input[type="search"],
.hero-search input[type="text"] {
  flex: 1 1 220px;
  min-width: 0;
  border: none;
  padding: 10px 14px;
  font-size: 15px;
  background: transparent;
  color: var(--ink-primary);
  -webkit-appearance: none;
  appearance: none;
}
.hero-search input::placeholder { color: #64748B; }
.hero-search input:focus { outline: none; }
.hero-search .btn { flex: 0 0 auto; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}
.hero-media {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow-md);
  background: #fff;
}
.hero-media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

@media (min-width: 900px) {
  .hero { padding: 64px 0 72px; }
  .hero-grid.has-media {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 44px;
  }
}

/* ---------- 7. Stats band ------------------------------------------------- */
.stats-band {
  background: #fff;
  border-bottom: 1px solid var(--surface-border);
  padding: 24px 0;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.stat-box {
  background: var(--brand-primary-soft);
  border: 1px solid #CCFBF1;
  border-radius: var(--radius);
  padding: 18px 16px;
  text-align: center;
}
.stat-value {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--brand-primary);
}
.stat-label {
  font-size: 14px;
  color: var(--ink-secondary);
  margin-top: 4px;
}
@media (min-width: 900px) {
  .stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
}

/* ---------- 8. Sections, headings and grids ------------------------------ */
.section { padding: var(--space-section) 0; }
.section-alt {
  background: #fff;
  border-top: 1px solid var(--surface-border);
  border-bottom: 1px solid var(--surface-border);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 26px;
}
.section-head > div { min-width: 0; }
.section-head h2 {
  font-size: clamp(22px, 3vw, 30px);
  margin-bottom: 4px;
}
.section-head p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 15px;
}

.section-cta {
  text-align: center;
  margin: 28px 0 0;
}

.subsection-title {
  font-size: 20px;
  margin: 0 0 16px;
}

.block-gap { margin-bottom: 40px; }

.empty-note {
  background: #fff;
  border: 1px dashed var(--surface-border-strong);
  border-radius: var(--radius);
  padding: 22px 18px;
  text-align: center;
  color: var(--ink-muted);
  margin: 0;
}

.grid {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- 9. Cards ------------------------------------------------------ */
.card {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease);
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--surface-border-strong);
}
.card-img-link {
  display: block;
  line-height: 0;
}
.card-img {
  aspect-ratio: 16 / 9;
  width: 100%;
  object-fit: cover;
  background: var(--brand-primary-soft);
}
.card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: var(--ink-muted);
  margin: 0 0 10px;
}
.card-title {
  font-size: 19px;
  line-height: 1.4;
  margin: 0 0 10px;
}
.card-title a {
  color: var(--ink-primary);
  text-decoration: none;
}
.card-title a:hover { color: var(--brand-primary); text-decoration: underline; }
.card-excerpt {
  color: var(--ink-secondary);
  font-size: 15px;
  margin: 0 0 16px;
  flex: 1;
}
.card-foot {
  padding-top: 12px;
  border-top: 1px solid var(--surface-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--ink-muted);
  gap: 6px 8px;
}
.card-foot time { white-space: nowrap; }

/* ---------- 10. Topic cards ----------------------------------------------- */
.topic-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink-primary);
  box-shadow: var(--shadow-sm);
  transition: border-color .15s var(--ease), transform .15s var(--ease), box-shadow .15s var(--ease);
}
.topic-card:hover {
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  color: var(--ink-primary);
}
.topic-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 18px;
  line-height: 1.35;
}
.topic-card-link {
  color: inherit;
  text-decoration: none;
}
.topic-card-link::after {
  content: '';
  position: absolute;
  inset: 0;
}
.topic-card-link:hover { color: var(--brand-primary); }
.topic-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.topic-desc {
  font-size: 14px;
  color: var(--ink-muted);
  margin: 0;
  flex: 1;
}
.topic-count {
  margin-top: auto;
  font-size: 13px;
  font-weight: 700;
  color: var(--brand-primary);
}

/* ---------- 11. Badges, pills and tags ----------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}
.badge-teal {
  background: var(--brand-primary-soft);
  color: var(--brand-primary);
  border: 1px solid #CCFBF1;
}
.badge-blue {
  background: var(--brand-secondary-soft);
  color: var(--brand-secondary);
  border: 1px solid #BAE6FD;
}
.badge-verified {
  background: var(--success-bg);
  color: var(--success-ink);
  border: 1px solid var(--success-border);
}
.badge-amber {
  background: var(--disclaimer-bg);
  color: var(--disclaimer-ink);
  border: 1px solid #FDE68A;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
  list-style: none;
  padding: 0;
}
.pill-list--tags { margin-bottom: 22px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 40px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--surface-border-strong);
  background: #fff;
  color: var(--ink-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
}
.pill:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}
.pill.active,
.pill[aria-current="page"] {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
}
.pill--small {
  min-height: 34px;
  padding: 4px 12px;
  font-size: 13px;
}
.pill-count {
  font-weight: 500;
  opacity: .85;
}
.tag-list { margin-top: 18px; }

/* ---------- 12. Alerts, disclaimers and callouts ------------------------- */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin: 0 0 18px;
  font-size: 15px;
  border: 1px solid transparent;
}
.alert-success { background: var(--success-bg); border-color: var(--success-border); color: var(--success-ink); }
.alert-error   { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger-ink); }
.alert-info    { background: var(--brand-secondary-soft); border-color: #BAE6FD; color: #075985; }
.alert-warn    { background: var(--disclaimer-bg); border-color: #FDE68A; color: var(--disclaimer-ink); }

.flash-stack:empty { display: none; }
.flash-stack { padding-top: 14px; }
.flash-stack .alert { margin-bottom: 12px; }

.medical-disclaimer {
  background: var(--disclaimer-bg);
  border: 1px solid #FCD34D;
  border-left: 5px solid var(--disclaimer-border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  color: var(--disclaimer-ink);
  font-size: 14px;
  margin: 20px 0;
}
.medical-disclaimer strong {
  display: block;
  margin-bottom: 4px;
  font-size: 15px;
}

.review-box {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  font-size: 14px;
  color: var(--success-ink);
  margin: 18px 0;
}

.callout {
  padding: 15px 18px;
  border-radius: var(--radius-sm);
  margin: 18px 0;
  font-size: 15px;
  border: 1px solid var(--surface-border);
}
.callout > :last-child { margin-bottom: 0; }
.callout-tip  { background: var(--success-bg); border-color: var(--success-border); color: var(--success-ink); }
.callout-warn { background: var(--disclaimer-bg); border-color: #FCD34D; color: var(--disclaimer-ink); }
.callout-info { background: var(--brand-secondary-soft); border-color: #BAE6FD; color: #075985; }

/* ---------- 13. Library page and breadcrumbs ------------------------------ */
.breadcrumbs {
  font-size: 14px;
  color: var(--ink-muted);
  margin-bottom: 18px;
}
.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.breadcrumbs li + li::before {
  content: '/';
  margin-right: 8px;
  color: #94A3B8;
}
.breadcrumbs a {
  color: var(--ink-muted);
  text-decoration: none;
}
.breadcrumbs a:hover {
  color: var(--brand-primary);
  text-decoration: underline;
}
.breadcrumbs [aria-current="page"] { color: var(--ink-secondary); font-weight: 600; }

.library-section { padding-top: 28px; }
.page-head { margin-bottom: 22px; }
.page-head h1 {
  font-size: clamp(26px, 3.6vw, 36px);
  margin-bottom: 8px;
}
.page-intro {
  color: var(--ink-muted);
  max-width: 680px;
  margin: 0;
}
.library-search { margin-bottom: 18px; }
.results-line {
  font-size: 15px;
  color: var(--ink-muted);
  margin: 0 0 16px;
}
.results-line a { font-weight: 600; }

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 32px;
}
.pagination-status {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  font-weight: 700;
  color: var(--ink-secondary);
  font-variant-numeric: tabular-nums;
}

/* ---------- 14. Article page ---------------------------------------------- */
.article-section { padding-top: 32px; }

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
}
.article-main { min-width: 0; }
.article-header { margin-bottom: 8px; }
.article-title {
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}
.article-lede {
  font-size: 18px;
  line-height: 1.65;
  color: var(--ink-secondary);
  margin: 0 0 14px;
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 14px;
  color: var(--ink-muted);
  margin: 0 0 18px;
}
.article-figure {
  margin: 0 0 24px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--surface-border);
  background: #fff;
}
.article-figure img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.article-figure figcaption {
  font-size: 13px;
  color: var(--ink-muted);
  padding: 10px 14px;
}

.prose {
  font-size: 17px;
  color: var(--ink-primary);
  overflow-wrap: anywhere;
}
.prose h2 {
  font-size: 24px;
  margin: 32px 0 12px;
  scroll-margin-top: 90px;
}
.prose h3 {
  font-size: 20px;
  margin: 24px 0 10px;
  scroll-margin-top: 90px;
}
.prose p { margin: 0 0 16px; }
.prose ul,
.prose ol {
  margin: 0 0 18px;
  padding-left: 24px;
}
.prose li { margin-bottom: 8px; }
.prose li::marker { color: var(--brand-primary); }
.prose blockquote {
  margin: 20px 0;
  padding: 14px 18px;
  background: var(--brand-primary-soft);
  border-left: 4px solid var(--brand-primary);
  border-radius: 0 8px 8px 0;
}
.prose img {
  border-radius: var(--radius-sm);
  margin: 20px 0;
}
.prose table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 15px;
}
.prose th,
.prose td {
  border: 1px solid var(--surface-border);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}
.prose th { background: var(--surface-muted); }

.references {
  margin-top: 32px;
  padding: 20px 22px;
  background: #fff;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
}
.references h2 {
  font-size: 20px;
  margin-bottom: 6px;
}
.references-note {
  font-size: 14px;
  color: var(--ink-muted);
  margin-bottom: 12px;
}
.references ol {
  padding-left: 22px;
  font-size: 15px;
}
.references li { margin-bottom: 10px; }
.ref-publisher {
  color: var(--ink-muted);
  font-size: 14px;
}

.share-box {
  margin: 28px 0;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
}
.share-title {
  font-weight: 700;
  font-size: 15px;
  margin: 0 0 10px;
  color: var(--ink-secondary);
}
.share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.article-aside {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}
.sidebar-card {
  background: #fff;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  padding: 20px;
}
.sidebar-title {
  font-size: 16px;
  margin: 0 0 12px;
}
.toc-list {
  list-style: decimal;
  padding-left: 22px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toc-list a {
  text-decoration: none;
  font-size: 14px;
  color: var(--ink-secondary);
}
.toc-list a:hover {
  color: var(--brand-primary);
  text-decoration: underline;
}
.sidebar-helpline p {
  font-size: 14px;
  color: var(--ink-secondary);
}
.sidebar-helpline .btn { margin-top: 6px; }

@media (min-width: 960px) {
  .article-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: start;
  }
  .article-aside {
    position: sticky;
    top: calc(var(--header-h) + 20px);
  }
  .toc {
    max-height: calc(100vh - var(--header-h) - 60px);
    overflow-y: auto;
  }
}

.related {
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--surface-border);
}
.related > h2 {
  font-size: 24px;
  margin-bottom: 18px;
}

/* ---------- 15. Forms ----------------------------------------------------- */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--ink-primary);
}
.form-control {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1.5px solid var(--surface-border-strong);
  border-radius: var(--radius-sm);
  font-size: 16px;
  color: var(--ink-primary);
  background: #fff;
  -webkit-appearance: none;
  appearance: none;
}
.form-control::placeholder { color: #64748B; }
.form-control:focus {
  border-color: var(--brand-primary);
  outline: 2px solid rgba(15, 118, 110, 0.2);
  outline-offset: 0;
}
textarea.form-control {
  min-height: 130px;
  resize: vertical;
}

/* ---------- 16. Newsletter ------------------------------------------------ */
.newsletter-box {
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 32px 24px;
}
.newsletter-box h2 {
  color: #fff;
  font-size: clamp(22px, 3vw, 28px);
  margin-bottom: 8px;
}
.newsletter-box p {
  color: rgba(255, 255, 255, 0.92);
  margin: 0 0 18px;
  max-width: 580px;
}
.newsletter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 540px;
  margin: 0;
}
.newsletter-form input[type="email"] {
  flex: 1 1 240px;
  min-width: 0;
  min-height: 46px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 2px solid transparent;
  font-size: 16px;
  color: var(--ink-primary);
  -webkit-appearance: none;
  appearance: none;
}
.newsletter-form input[type="email"]:focus {
  outline: 3px solid #5EEAD4;
  outline-offset: 2px;
}
.newsletter-form button {
  min-height: 46px;
  padding: 10px 22px;
  border-radius: 10px;
  border: none;
  background: var(--footer-bg);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
}
.newsletter-form button:hover { background: #1E293B; }
.newsletter-form button:disabled { opacity: .7; cursor: wait; }
.newsletter-note {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  margin: 12px 0 0;
}
.newsletter-box .newsletter-note { max-width: 580px; }

/* ---------- 17. Footer ---------------------------------------------------- */
.site-footer {
  background: var(--footer-bg);
  color: var(--footer-ink);
  padding: 48px 0 28px;
  margin-top: 48px;
}
.footer-grid {
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 640px) {
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-col--brand { grid-column: 1 / -1; }
}
@media (min-width: 900px) {
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1.2fr; }
}
.footer-col { min-width: 0; }
.footer-heading {
  color: #fff;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 14px;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  text-decoration: none;
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 18px;
}
.footer-brand img {
  height: 40px;
  width: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.footer-about {
  font-size: 14px;
  color: var(--footer-ink);
  margin: 0;
  max-width: 420px;
}
.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
}
.footer-emergency {
  color: var(--footer-accent);
  font-weight: 600;
}
.site-footer a {
  color: var(--footer-ink);
  text-decoration: none;
}
.site-footer a:hover {
  color: var(--footer-accent);
  text-decoration: underline;
}
.site-footer :focus-visible { outline-color: var(--footer-accent); }

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
}
.social-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #1E293B;
  border: 1px solid #334155;
  color: #E2E8F0 !important;
  font-weight: 700;
  text-decoration: none;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), transform .15s var(--ease);
}
.social-icon-btn:hover {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #FFFFFF !important;
  text-decoration: none;
  transform: translateY(-2px);
}
.social-icon-btn svg {
  width: 19px;
  height: 19px;
  display: block;
}

.footer-bottom {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid #1E293B;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: #94A3B8;
}
.footer-bottom__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}
.footer-bottom a { color: #CBD5E1; }

/* ---------- 18. Motion preferences --------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
  .card:hover,
  .topic-card:hover,
  .btn:active,
  .social-icon-btn:hover { transform: none !important; }
}

/* ---------- 19. Print ----------------------------------------------------- */
@media print {
  body { background: #fff; color: #000; font-size: 12pt; }
  .emergency-bar,
  .site-header,
  .site-footer,
  .article-aside,
  .share-box,
  .related,
  .hero-search,
  .newsletter-box,
  .skip-link,
  .pagination { display: none !important; }
  .section { padding: 0; }
  .container { max-width: none; padding: 0; }
  .article-layout { display: block; }
  a { color: #000; text-decoration: underline; }
  .prose a[href]::after { content: " (" attr(href) ")"; font-size: 85%; }
  .card, .references, .medical-disclaimer { box-shadow: none; break-inside: avoid; }
}
