/* Water damage answers: calm, light, readable help-center style.
   Rules: 20px body text, line-height 1.7, ~70 character text column,
   no dark backgrounds anywhere, text in very dark navy (never #000), forced light theme. */

@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("fonts/atkinson-hyperlegible-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: italic; font-weight: 700; font-display: swap;
  src: url("fonts/atkinson-hyperlegible-latin-700-italic.woff2") format("woff2"); }

:root {
  color-scheme: light only;
  --ink: #1b2a3a;          /* body text: very dark navy */
  --ink-soft: #3f5266;     /* secondary text, 7.9:1 on white */
  --bg: #ffffff;
  --tint: #f3f7fb;         /* very light blue-gray panels */
  --tint-2: #e7eff8;       /* table heads, chips */
  --line: #cfdbe7;
  --brand: #1f5f99;        /* calm blue, 6.6:1 on white */
  --brand-dark: #174b7a;
  --call: #f6b544;         /* warm amber button, navy text 8:1 */
  --call-hover: #f2a526;
  --call-tint: #fff6e3;
  --call-line: #f1cf8c;
  --radius: 10px;
  --measure: 40rem;        /* ~70 characters at 20px */
  --font: "Atkinson Hyperlegible", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 1.25rem; line-height: 1.7;
  overflow-wrap: break-word;
}
img, svg, picture { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--brand-dark); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; border-radius: 3px; }
h1, h2, h3 { line-height: 1.25; color: var(--ink); margin: 1.6em 0 0.5em; font-weight: 700; }
h1 { font-size: clamp(1.9rem, 1.3rem + 2.4vw, 2.6rem); margin-top: 0.4em; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.5rem, 1.25rem + 1vw, 1.8rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.4em; margin: 0 0 1em; }
li { margin: 0.3em 0; }
strong { font-weight: 700; }
.i { width: 1.1em; height: 1.1em; display: inline-block; vertical-align: -0.15em; flex: none; }

.wrap { max-width: 72rem; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--bg); color: var(--brand); padding: 8px 14px; z-index: 50; }
.skip:focus { left: 8px; top: 8px; }

/* ---- header ---- */
.callstrip { background: var(--call-tint); border-bottom: 1px solid var(--call-line); font-size: 1rem; line-height: 1.4; }
.callstrip .wrap { display: flex; justify-content: center; align-items: center; gap: 0.4em; padding-top: 6px; padding-bottom: 6px; flex-wrap: wrap; }
.cs-text { color: var(--ink); }
.cs-num { font-weight: 700; color: var(--ink); text-decoration: none; display: inline-flex; gap: 0.3em; align-items: center; }
.cs-num:hover { color: var(--ink); text-decoration: underline; }

.site-header { background: var(--bg); border-bottom: 1px solid var(--line); position: relative; z-index: 20; }
.hdr { display: flex; align-items: center; gap: 12px; min-height: 56px; }
.brand { min-width: 0; display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.1rem; line-height: 1.2; }
.brand:hover { color: var(--brand); }
.logo-mark { width: 32px; height: 32px; }
.topics { margin-left: auto; position: relative; font-size: 1.05rem; }
.topics summary { cursor: pointer; list-style: none; white-space: nowrap; display: inline-flex; align-items: center; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); background: var(--tint); font-weight: 700; }
.topics summary::-webkit-details-marker { display: none; }
.topics summary::after { content: ""; display: inline-block; margin-left: 8px; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-3px) rotate(45deg); }
.topics[open] summary::after { transform: translateY(1px) rotate(-135deg); }
.topics nav { position: absolute; right: 0; top: calc(100% + 8px); width: min(22rem, calc(100vw - 32px)); background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(27, 42, 58, 0.12); max-height: 70vh; overflow: auto; }
.topics ul { list-style: none; margin: 0; padding: 6px; }
.topics li { margin: 0; }
.topics a { display: block; padding: 8px 12px; border-radius: 6px; text-decoration: none; color: var(--ink); line-height: 1.35; }
.topics a:hover { background: var(--tint); color: var(--brand); }
.topics .all a { color: var(--brand); font-weight: 700; }
.hdr-call { display: none; }

@media (min-width: 768px) {
  .site-header { position: sticky; top: 0; }
  .hdr-call { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; background: var(--call); color: var(--ink); font-weight: 700; text-decoration: none; font-size: 1.05rem; white-space: nowrap; }
  .hdr-call:hover { background: var(--call-hover); color: var(--ink); }
  .topics { margin-left: auto; }
  .callstrip { display: none; }
}

/* ---- breadcrumbs, byline ---- */
.crumbs { font-size: 1rem; margin-top: 18px; color: var(--ink-soft); }
.crumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.crumbs li { margin: 0; }
.crumbs li + li::before { content: "\203A"; margin: 0 6px 0 2px; color: var(--ink-soft); }
.crumbs li[aria-current] { color: var(--ink-soft); min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.byline { font-size: 1rem; color: var(--ink-soft); display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0 0 18px; line-height: 1.5; }

/* compact-top layout trial (opt-in per article via content JSON "layout": "compact-top"):
   a tiny muted meta line under the quick answer box, and the byline reappearing, smaller, near Sources. */
.meta-line { font-size: 0.85rem; color: var(--ink-soft); margin: 0 0 20px; line-height: 1.5; }
.about-line { margin: 20px 0 0; }
.about-line .byline { display: block; font-size: 0.9rem; margin: 0; }

/* ---- article ---- */
.article { max-width: var(--measure); margin: 0 auto 40px; }
.hero { margin: 0 0 24px; }
.hero img, .inline-fig img { border-radius: var(--radius); width: 100%; background: var(--tint); }
.hero-banner img { aspect-ratio: 21 / 9; object-fit: cover; object-position: center; height: auto; }
figcaption { font-size: 0.95rem; color: var(--ink-soft); margin-top: 8px; line-height: 1.5; }
figcaption .credit { display: block; }
figure { margin: 24px 0; }

.quick-answer { background: var(--tint); border: 1px solid var(--line); border-left: 6px solid var(--brand); border-radius: var(--radius); padding: 18px 22px; margin: 0 0 24px; }
.quick-answer p:last-child { margin-bottom: 0; }
.qa-jump { margin: 10px 0 0; font-size: 1rem; }
.qa-jump a { text-decoration-thickness: 1px; }
.qa-label { font-size: 0.95rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--brand); margin: 0 0 6px; }
.takeaways { border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 22px 10px; margin: 0 0 24px; background: var(--bg); }
.takeaways h2 { font-size: 1.3rem; margin: 14px 0 8px; }
.takeaways ul { padding-left: 1.2em; }

.toc { background: var(--tint); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 22px; margin: 0 0 28px; font-size: 1.1rem; }
.toc summary { cursor: pointer; font-weight: 700; }
.toc ol { margin: 10px 0 4px; }
.toc li { margin: 0.25em 0; }

.article section > h2 { scroll-margin-top: 80px; }
.article [id] { scroll-margin-top: 80px; }

.table-wrap { overflow-x: auto; margin: 0 0 1.2em; border: 1px solid var(--line); border-radius: var(--radius); -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: 1.05rem; line-height: 1.5; min-width: 30rem; }
caption { text-align: left; font-weight: 700; padding: 12px 14px 4px; }
th, td { padding: 10px 14px; text-align: left; vertical-align: top; border-top: 1px solid var(--line); }
thead th { background: var(--tint-2); border-top: 0; }
tbody tr:nth-child(even) td { background: #f8fafd; }

@media (max-width: 640px) {
  /* Stack tables into readable cards instead of a side-scrolling strip. */
  .table-wrap { overflow-x: visible; border: 0; border-radius: 0; }
  .table-wrap table { min-width: 0; width: 100%; border: 1px solid var(--line); border-radius: var(--radius); }
  .table-wrap caption { border: 1px solid var(--line); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; }
  .table-wrap thead {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
  .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; width: 100%; }
  .table-wrap tr { border-top: 1px solid var(--line); padding: 10px 14px; }
  .table-wrap tr:first-child { border-top: 0; }
  .table-wrap tbody tr:nth-child(even) td { background: transparent; }
  .table-wrap td { padding: 6px 0; border-top: 0; }
  .table-wrap td[data-label]::before {
    content: attr(data-label); display: block; font-weight: 700; color: var(--ink);
    font-size: 0.85em; margin-bottom: 2px;
  }
}

.cta-full { background: var(--call-tint); border: 1px solid var(--call-line); border-radius: var(--radius); padding: 22px 24px; margin: 32px 0; text-align: center; }
.cta-full h2 { margin-top: 0; font-size: 1.5rem; }
.cta-small { font-size: 1rem; margin: 12px 0 0; }
.btn-call { display: inline-flex; align-items: center; justify-content: center; gap: 10px; background: var(--call); color: var(--ink); font-weight: 700; font-size: 1.3rem; text-decoration: none; padding: 14px 26px; border-radius: 999px; border: 1px solid #e39a1c; min-height: 52px; max-width: 100%; }
.btn-call:hover { background: var(--call-hover); color: var(--ink); }

.video .yt { position: relative; aspect-ratio: 16 / 9; background: var(--tint-2); border-radius: var(--radius); overflow: hidden; }
.video .yt img { width: 100%; height: 100%; object-fit: cover; }
.video .yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt-play { position: absolute; inset: 0; margin: auto; width: 84px; height: 60px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.yt-play svg { width: 84px; height: 60px; filter: drop-shadow(0 2px 6px rgba(27, 42, 58, 0.25)); }
.yt-play:hover rect { fill: var(--brand-dark); }

.when-to-call { background: var(--tint); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 22px 8px; margin: 32px 0; }
.when-to-call h2 { margin-top: 18px; }
.faq-item h3 { font-size: 1.2rem; margin: 1.2em 0 0.3em; }
.sources ol { font-size: 1.05rem; }
.sources li { margin: 0.4em 0; }
.related ul { list-style: none; padding: 0; display: grid; gap: 12px; }
.related li { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; background: var(--bg); }
.related li a { font-weight: 700; text-decoration: none; display: block; line-height: 1.35; }
.related li a:hover { text-decoration: underline; }
.related li span { display: block; font-size: 0.95rem; color: var(--ink-soft); margin-top: 4px; }
.hub-link { font-weight: 700; margin-top: 18px; }

/* ---- home, category, pages ---- */
.home .intro, .catpage > h1, .catpage > .lead, .page { max-width: var(--measure); }
.home .intro { margin: 0 auto; padding: 24px 0 8px; text-align: left; }
.home section, .catpage section { max-width: 60rem; margin-left: auto; margin-right: auto; }
.home > section:not(.intro), .home > aside { max-width: 60rem; margin-left: auto; margin-right: auto; }
.catpage > * { max-width: 60rem; margin-left: auto; margin-right: auto; }
.page { margin: 0 auto 48px; }
.lead { font-size: 1.3rem; color: var(--ink-soft); }
.emergency { background: var(--call-tint); border: 1px solid var(--call-line); border-radius: var(--radius); padding: 8px 24px 24px; margin: 24px auto; }
.emergency h2 { margin-top: 16px; }
.em-steps li { margin: 0.5em 0; }
.cards { list-style: none; padding: 0; display: grid; gap: 16px; }
.card { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg); display: grid; }
.card picture img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--tint); }
.card > div { padding: 14px 18px 16px; }
.card a { font-weight: 700; text-decoration: none; line-height: 1.35; display: block; margin-bottom: 6px; }
.card a:hover { text-decoration: underline; }
.card p { font-size: 1.05rem; line-height: 1.55; margin: 0 0 8px; color: var(--ink); }
.meta { font-size: 0.95rem; color: var(--ink-soft); }
.cat-grid { list-style: none; padding: 0; display: grid; gap: 14px; }
.cat-grid li { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; background: var(--tint); }
.cat-grid a { font-weight: 700; text-decoration: none; font-size: 1.2rem; }
.cat-grid a:hover { text-decoration: underline; }
.cat-grid p { font-size: 1.05rem; margin: 6px 0; line-height: 1.5; }
.simple li { margin: 0.45em 0; }
.pager { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; margin: 24px auto; font-weight: 700; }
.page-updated { font-size: 1rem; color: var(--ink-soft); }
.hub-feature { background: var(--tint); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 22px 10px; }

@media (min-width: 640px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .related ul { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .cards { grid-template-columns: repeat(3, 1fr); }
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---- footer ---- */
.site-footer { background: var(--tint); border-top: 1px solid var(--line); margin-top: 40px; padding: 28px 0 24px; font-size: 1rem; line-height: 1.6; }
.f-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.f-call { margin: 0; font-weight: 700; }
.f-call a { color: var(--ink); }
.f-note { color: var(--ink-soft); max-width: 50rem; margin: 16px 0; }
.f-links { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 0 0 12px; }
.f-links li { margin: 0; }
.f-copy { color: var(--ink-soft); margin: 0; }

/* ---- mobile sticky call bar ---- */
.callbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, 0.97); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(27, 42, 58, 0.08); }
.callbar a { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; border-radius: 999px; background: var(--call); border: 1px solid #e39a1c; color: var(--ink); font-weight: 700; font-size: 1.2rem; text-decoration: none; }
body { padding-bottom: 76px; }
@media (min-width: 768px) {
  .callbar { display: none; }
  body { padding-bottom: 0; }
}

@media print {
  .callstrip, .site-header, .callbar, .site-footer, .toc, .cta-full, .video { display: none !important; }
  body { font-size: 12pt; padding: 0; }
}
