/* ============================================================
   Hepatitis B Care BC — shared stylesheet
   Design: clean, editorial, clinical. Restrained palette,
   hairline rules, sidebar navigation, generous whitespace.
   ============================================================ */

:root {
  /* Neutrals */
  --bg:        #f5f7fa;
  --surface:   #ffffff;
  --ink:       #10203a;   /* headings */
  --body:      #384657;   /* body text */
  --muted:     #64748b;
  --line:      #e3e8ef;
  --line-soft: #eef1f6;

  /* Brand */
  --navy:      #0e2338;
  --navy-2:    #16324e;
  --accent:    #0f6ca3;   /* medical blue */
  --accent-ink:#0a527d;
  --accent-soft:#e9f2f8;

  /* Status */
  --good:      #0f7a55; --good-soft:#e8f5ef;
  --warn:      #9a6600; --warn-soft:#fbf3e2;
  --danger:    #b23a30; --danger-soft:#fbeceb;

  --radius:    10px;
  --shadow:    0 1px 2px rgba(16,32,58,.05), 0 1px 3px rgba(16,32,58,.04);
  --maxw:      1180px;
  --header-h:  62px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 14px);   /* keeps anchors below the sticky header */
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--body);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[id] { scroll-margin-top: calc(var(--header-h) + 14px); }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-ink); text-decoration: underline; }

/* ---------- Top bar ---------- */
.topbar {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 200;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand .mark {
  width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0;
  background: linear-gradient(145deg, var(--navy), var(--accent));
  color: #fff; font-weight: 800; font-size: .82rem; letter-spacing: .02em;
  display: flex; align-items: center; justify-content: center;
}
.brand .name { color: var(--ink); font-weight: 700; font-size: 1.02rem; letter-spacing: -.01em; }
.brand .name span { color: var(--muted); font-weight: 500; }

.topnav { display: flex; align-items: center; gap: 4px; }
.topnav a {
  color: var(--body); font-size: .9rem; font-weight: 600;
  padding: 8px 14px; border-radius: 7px;
}
.topnav a:hover { background: var(--line-soft); color: var(--ink); text-decoration: none; }
.topnav a.on { color: var(--accent-ink); background: var(--accent-soft); }

/* ---------- Notice strip (provider) ---------- */
.notice {
  background: var(--warn-soft);
  border-bottom: 1px solid #f0e2c4;
  color: #7a5200;
  font-size: .78rem; line-height: 1.45;
  padding: 9px 24px; text-align: center;
}
.notice strong { font-weight: 700; }

/* ---------- Layout with sidebar ---------- */
.layout {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 244px 1fr;
  gap: 40px;
  padding: 34px 24px 64px;
  align-items: start;
}

.sidebar { position: sticky; top: calc(var(--header-h) + 24px); }
.sidebar .side-label {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .09em;
  color: var(--muted); font-weight: 700; padding: 0 12px 8px;
}
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a {
  color: var(--body); font-size: .92rem; font-weight: 500;
  padding: 9px 12px; border-radius: 8px; border-left: 3px solid transparent;
}
.sidebar nav a:hover { background: var(--line-soft); color: var(--ink); text-decoration: none; }
.sidebar nav a.on {
  background: var(--accent-soft); color: var(--accent-ink);
  font-weight: 700; border-left-color: var(--accent);
}
.sidebar .side-tool {
  margin-top: 14px; display: block; text-align: center;
  background: var(--navy); color: #fff; font-weight: 600; font-size: .85rem;
  padding: 10px 12px; border-radius: 8px;
}
.sidebar .side-tool:hover { background: var(--navy-2); text-decoration: none; }

/* ---------- Page content ---------- */
.content { min-width: 0; max-width: 760px; }

.pagehead { margin-bottom: 26px; }
.eyebrow {
  display: inline-block; font-size: .72rem; text-transform: uppercase;
  letter-spacing: .1em; font-weight: 700; color: var(--accent);
  margin-bottom: 10px;
}
.pagehead h1 {
  font-size: 2rem; line-height: 1.15; color: var(--ink);
  font-weight: 800; letter-spacing: -.02em; margin-bottom: 10px;
}
.pagehead .standfirst { font-size: 1.08rem; color: var(--muted); max-width: 640px; }

/* Prose blocks */
.prose h2 {
  font-size: 1.3rem; color: var(--ink); font-weight: 700; letter-spacing: -.01em;
  margin: 34px 0 12px; padding-top: 6px;
}
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1.05rem; color: var(--navy-2); font-weight: 700; margin: 22px 0 6px; }
.prose h4 { font-size: .92rem; color: var(--ink); font-weight: 700; margin: 16px 0 4px; }
.prose p { margin-bottom: 14px; }
.prose ul, .prose ol { margin: 6px 0 16px 20px; }
.prose li { margin-bottom: 8px; }
.prose strong { color: var(--ink); font-weight: 650; }
.prose hr { border: none; border-top: 1px solid var(--line); margin: 28px 0; }

/* Surface card */
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow);
  margin-bottom: 20px;
}

/* Callouts */
.callout {
  border: 1px solid var(--line); border-left: 3px solid var(--accent);
  background: var(--surface); border-radius: 8px;
  padding: 14px 18px; margin: 16px 0; font-size: .96rem;
}
.callout.info   { border-left-color: var(--accent); background: var(--accent-soft); }
.callout.good   { border-left-color: var(--good);   background: var(--good-soft); }
.callout.warn   { border-left-color: var(--warn);   background: var(--warn-soft); }
.callout.danger { border-left-color: var(--danger); background: var(--danger-soft); }
.callout .k { font-weight: 700; color: var(--ink); }

/* Key-figure strip */
.figrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px,1fr)); gap: 14px; margin: 18px 0; }
.figrow .fig { border: 1px solid var(--line); border-radius: 9px; padding: 16px 18px; background: var(--surface); }
.figrow .fig .big { font-size: 1.45rem; font-weight: 800; color: var(--ink); letter-spacing: -.01em; }
.figrow .fig .cap { font-size: .86rem; color: var(--muted); margin-top: 2px; }

/* Tables */
.tbl-wrap { overflow-x: auto; margin: 14px 0 18px; border: 1px solid var(--line); border-radius: 9px; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th, table.data td { padding: 10px 13px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
table.data th { background: #f3f6f9; color: var(--ink); font-weight: 700; }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr:hover td { background: #fafbfc; }

/* FAQ */
details.faq { border: 1px solid var(--line); border-radius: 9px; background: var(--surface); margin-bottom: 10px; }
details.faq + details.faq { }
details.faq summary {
  cursor: pointer; padding: 15px 18px; font-weight: 650; color: var(--ink);
  list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 14px;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: '+'; color: var(--accent); font-size: 1.35rem; font-weight: 400; line-height: 1; }
details.faq[open] summary::after { content: '\2013'; }
details.faq summary:hover { color: var(--accent-ink); }
details.faq .faq-body { padding: 0 18px 16px; color: var(--body); }
details.faq[open] summary { border-bottom: 1px solid var(--line-soft); margin-bottom: 12px; }

/* Nav cards (hub pages) */
.cardgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 16px; margin: 8px 0 4px; }
.navcard {
  display: block; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
  transition: border-color .15s, transform .15s;
}
.navcard:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.navcard .nc-title { color: var(--ink); font-weight: 700; font-size: 1.05rem; margin-bottom: 5px; }
.navcard .nc-desc { color: var(--muted); font-size: .9rem; }
.navcard .nc-go { color: var(--accent); font-size: .85rem; font-weight: 700; margin-top: 10px; display: inline-block; }

/* Buttons / links */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: #fff; font-weight: 650; font-size: .95rem;
  padding: 12px 22px; border-radius: 8px;
}
.btn:hover { background: var(--accent-ink); color: #fff; text-decoration: none; }
.btn.dark { background: var(--navy); }
.btn.dark:hover { background: var(--navy-2); }

/* Feature strip for the tool */
.toolband {
  background: var(--navy); color: #fff; border-radius: 12px;
  padding: 26px 28px; margin-bottom: 24px;
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
}
.toolband .tb-txt { flex: 1 1 300px; }
.toolband h2 { color: #fff; font-size: 1.3rem; font-weight: 700; margin: 0 0 6px; }
.toolband p { color: #c7d6e6; margin: 0; font-size: .96rem; }
.toolband .btn { background: var(--accent); }
.toolband .btn:hover { background: #1580bd; }

/* Page prev/next */
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 36px; border-top: 1px solid var(--line); padding-top: 20px; }
.pager a { font-weight: 600; font-size: .92rem; }
.pager .nxt { margin-left: auto; }

/* Referral directory */
.region { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 16px; overflow: hidden; background: var(--surface); }
.region > .rhead { background: #f3f6f9; padding: 12px 18px; font-weight: 700; color: var(--ink); font-size: 1rem; border-bottom: 1px solid var(--line); }
.region > .rbody { padding: 4px 18px 12px; }
.entry { padding: 14px 0; border-bottom: 1px dashed var(--line); }
.entry:last-child { border-bottom: none; }
.entry .en-name { font-weight: 700; color: var(--navy-2); }
.entry .en-meta { font-size: .86rem; color: var(--muted); margin-top: 3px; line-height: 1.6; }
.ph { color: #9aa7b5; font-style: italic; }
.editnote { border: 1px dashed #b8c2ce; background: #f8fafc; border-radius: 9px; padding: 12px 16px; font-size: .85rem; color: #566575; margin-bottom: 18px; }

/* ---------- Footer ---------- */
.sitefoot {
  background: var(--navy); color: #93a7bd; font-size: .82rem; line-height: 1.7;
  padding: 26px 24px; text-align: center;
}
.sitefoot a { color: #b9cde1; }
.sitefoot .fnav { margin-top: 6px; }
.sitefoot .fnav a { margin: 0 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; gap: 20px; }
  .sidebar { position: static; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .sidebar nav a { border-left: none; border: 1px solid var(--line); border-radius: 20px; padding: 7px 13px; font-size: .85rem; }
  .sidebar nav a.on { border-color: var(--accent); }
  .sidebar .side-tool { margin-top: 8px; }
  .content { max-width: none; }
  .pagehead h1 { font-size: 1.6rem; }
  .topnav a { padding: 8px 10px; font-size: .85rem; }
  .brand .name span { display: none; }
}
