/* SSNHL Program site. Palette follows the AHS SSNHL flyer, slides and handout. */
@font-face {
  font-family: "Public Sans";
  src: url("/assets/fonts/public-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Public Sans";
  src: url("/assets/fonts/public-sans-latin-wght-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --navy: #1f3a5c;
  --blue: #2c77bc;
  --blue-ink: #1f63a3;
  --blue-tint: #eef4fa;
  --blue-soft: #cfe1f3;
  --green: #3a9a5f;
  --green-ink: #2a7046;
  --green-soft: #9fd8b4;
  --green-tint: #edf6f0;
  --red: #b42318;
  --red-tint: #fdf0ee;
  --red-line: #efc1bb;
  --amber: #a5480b;
  --amber-tint: #fdf4e8;
  --orange: #e8731a;
  --ink: #17212c;
  --muted: #56626e;
  --rule: #dbe2e9;
  --rule-strong: #b9c5d1;
  --node: #f5f7fa;
  --connector: #8a97a6;
  --font: "Public Sans", Arial, "Helvetica Neue", Helvetica, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
}

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

strong { font-weight: 650; }

a { color: var(--blue-ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--navy); text-decoration-thickness: 2px; }

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

h1, h2, h3, h4 { line-height: 1.2; color: var(--navy); margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; text-wrap: balance; }

p { margin: 0 0 1em; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute; left: 16px; top: -48px;
  background: var(--navy); color: #fff;
  padding: 8px 14px; z-index: 10;
}
.skip-link:focus { top: 12px; color: #fff; }

/* ---------- Header ---------- */
.site-header { border-bottom: 3px solid var(--blue); }
.site-header .inner {
  max-width: 1200px; margin: 0 auto; padding: 16px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: inline-flex; flex-shrink: 0; }
.brand img { height: 50px; width: auto; display: block; }
.program { text-align: right; line-height: 1.35; }
.program .dept { display: block; color: var(--blue-ink); font-weight: 700; }
.program .name { display: block; color: var(--muted); font-size: .875rem; }

/* ---------- Layout ---------- */
.layout {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 52px;
  padding: 40px 24px 72px;
}

/* ---------- Sidebar ---------- */
.sidebar { position: sticky; top: 24px; align-self: start; font-size: .95rem; }
.nav-toggle { display: none; }

.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav a {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border-radius: 4px;
  color: var(--ink); text-decoration: none; font-weight: 600;
}
.site-nav a:hover { background: var(--blue-tint); color: var(--navy); }
.site-nav a[aria-current="page"] { background: var(--blue-tint); color: var(--navy); font-weight: 700; }
.site-nav ul ul { margin: 2px 0 6px 10px; padding-left: 8px; border-left: 1px solid var(--rule); }
.site-nav ul ul a { font-weight: 400; font-size: .92rem; padding: 6px 10px; }
.site-nav .ext { color: var(--muted); }

.tag {
  font-size: .66rem; font-weight: 700; letter-spacing: .03em; line-height: 1;
  color: var(--red); border: 1px solid var(--red-line); border-radius: 3px;
  padding: 3px 4px 2px;
}

.fax-card { margin-top: 28px; padding: 18px 10px 0; border-top: 1px solid var(--rule); }
.fax-card .label { margin: 0; color: var(--muted); font-size: .875rem; font-weight: 600; }
.fax-card .fax { margin: 2px 0 8px; color: var(--navy); font-size: 1.6rem; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.fax-card .small { margin: 0; color: var(--muted); font-size: .85rem; line-height: 1.5; }

/* ---------- Generic content ---------- */
main { min-width: 0; }
.section { margin-top: 64px; }
.section-head h2,
.section > h2 { font-size: 1.6rem; margin-bottom: .6em; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px; border-radius: 4px;
  font-weight: 650; text-decoration: none; line-height: 1.2;
  border: 1px solid transparent;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--blue-ink); color: #fff; }
.btn-primary:hover { background: var(--navy); color: #fff; }
.btn-light { background: #fff; color: var(--navy); }
.btn-light:hover { background: var(--blue-tint); color: var(--navy); }
.btn-secondary { background: #fff; color: var(--navy); border-color: var(--rule-strong); }
.btn-secondary:hover { border-color: var(--navy); color: var(--navy); }

/* ---------- Hero ---------- */
.hero { background: var(--navy); color: #fff; padding: 48px 48px 44px; }
.hero .eyebrow { margin: 0 0 18px; font-size: .95rem; font-weight: 600; color: var(--green-soft); }
.hero h1 { color: #fff; font-size: clamp(2rem, 3.8vw, 2.9rem); line-height: 1.12; letter-spacing: -.02em; margin-bottom: .55em; }
.hero h1 span { display: block; font-weight: 400; }
.hero .lead { font-size: 1.125rem; color: #dbe6f1; max-width: 60ch; margin-bottom: 28px; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; }
.hero-fax { color: #c6d6e8; }
.hero-fax strong { color: #fff; font-size: 1.3rem; font-weight: 700; margin-left: 4px; font-variant-numeric: tabular-nums; }

/* ---------- How to refer ---------- */
.steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px;
}
.step { border-top: 2px solid var(--rule-strong); padding-top: 18px; }
.step .num { display: block; font-size: 2.4rem; font-weight: 700; line-height: 1; color: var(--green); margin-bottom: 14px; }
.step h3 { font-size: 1.2rem; margin-bottom: .45em; }
.step p { margin: 0; }
.step .fax-big { font-size: 1.6rem; font-weight: 700; color: var(--blue-ink); margin: 0 0 6px; font-variant-numeric: tabular-nums; }

.criteria { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 40px; }
.panel { border-radius: 6px; padding: 22px 26px; }
.panel h3 { font-size: 1.1rem; margin-bottom: .7em; }
.panel ul { margin: 0; padding: 0; list-style: none; }
.panel li { position: relative; padding-left: 20px; }
.panel li + li { margin-top: .45em; }
.panel li::before { content: ""; position: absolute; left: 0; top: .6em; width: 7px; height: 7px; }
.panel-yes { background: var(--green-tint); }
.panel-yes h3 { color: var(--green-ink); }
.panel-yes li::before { background: var(--green); }
.panel-no { background: var(--red-tint); }
.panel-no h3 { color: var(--red); }
.panel-no li::before { background: var(--red); }

.callout { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--rule); max-width: 72ch; }
.callout h3 { font-size: 1.1rem; }
.callout .note { margin: 0; color: var(--muted); font-style: italic; }

/* ---------- Pathways ---------- */
.jump { display: flex; flex-wrap: wrap; gap: 6px 24px; margin: 0 0 8px; font-weight: 600; }

.pathway { margin-top: 48px; }
.pathway-head { border-bottom: 2px solid var(--blue); padding-bottom: 12px; margin-bottom: 24px; }
.pathway-head h3 { font-size: 1.4rem; margin-bottom: .15em; color: var(--blue-ink); }
.pathway-head p { margin: 0; color: var(--muted); }

.red-flags {
  background: var(--red-tint); border: 1px solid var(--red-line); border-radius: 6px;
  padding: 14px 20px; margin-bottom: 22px;
}
.red-flags h4 { margin: 0 0 4px; color: var(--red); font-size: 1.05rem; }
.red-flags p { margin: 0; color: #7a1d14; }

/* Flowchart */
.flow { container: flow / inline-size; font-size: 1rem; }
.branch { min-width: 0; display: flex; flex-direction: column; align-items: center; }
/* only branches that split again are containers, so a leaf's own width never triggers the query */
.branch-split { container: split / inline-size; }

.node { border: 1px solid var(--rule); border-radius: 6px; background: var(--node); padding: 14px 18px; }
.branch > .node { align-self: stretch; }
.node-start { background: var(--navy); border-color: var(--navy); color: #e3ecf6; text-align: center; }
.node-start strong { display: block; color: #fff; font-size: 1.12rem; font-weight: 700; margin-bottom: 2px; }
.node-decision { background: var(--blue-tint); border: 1.5px solid var(--blue); text-align: center; }
.node-decision strong { display: block; color: var(--navy); font-size: 1.12rem; font-weight: 700; }
.node-decision.pill { width: fit-content; max-width: 100%; margin: 0 auto; border-radius: 999px; padding: 11px 30px; }
.node-muted { background: #eef1f5; text-align: center; display: flex; align-items: center; justify-content: center; }
.node-return { position: relative; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 96px; }
.node-return strong { color: var(--navy); font-size: 1.1rem; font-weight: 700; }
.return-note { display: none; margin: 6px 0 0; font-size: .9rem; color: var(--muted); }

.node ol { margin: 0; padding-left: 1.4em; }
.node li + li { margin-top: .6em; }

.down {
  display: block; position: relative;
  width: 2px; height: 18px; margin: 0 auto 8px;
  background: var(--connector);
}
.down::after {
  content: ""; position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%);
  border-left: 5px solid transparent; border-right: 5px solid transparent;
  border-top: 6px solid var(--connector);
}

.chip {
  position: relative; z-index: 1;
  display: inline-block; padding: 3px 16px; border-radius: 999px;
  font-size: .8rem; line-height: 18px; font-weight: 700; color: #fff;
}
.chip-yes { background: var(--green); }
.chip-no { background: #5f6b7a; }

.branches {
  --gap: 20px;
  --a: .5;
  position: relative;
  align-self: stretch;
  display: grid;
  grid-template-columns: calc((100% - var(--gap)) * var(--a)) calc((100% - var(--gap)) * (1 - var(--a)));
  column-gap: var(--gap);
  margin-top: 18px;
}
/* horizontal bar joining the two branch chips */
.branches::before {
  content: ""; position: absolute; top: 11px;
  left: calc((100% - var(--gap)) * var(--a) / 2);
  right: calc((100% - var(--gap)) * (1 - var(--a)) / 2);
  border-top: 2px solid var(--connector);
}
/* stub from the decision above down to the bar */
.branches::after {
  content: ""; position: absolute; top: -18px; left: 50%;
  height: 30px; border-left: 2px solid var(--connector); transform: translateX(-1px);
}

/* "Complete audiogram" loops back to the decision on its left */
.branches > .branch > .node-return::before {
  content: ""; position: absolute; right: 100%; top: 50%;
  width: calc(var(--gap) - 2px); border-top: 2px solid var(--connector);
}
.branches > .branch > .node-return::after {
  content: ""; position: absolute; top: 50%; right: calc(100% + var(--gap) - 8px); transform: translateY(-50%);
  border-top: 5px solid transparent; border-bottom: 5px solid transparent;
  border-right: 6px solid var(--connector);
}

@container flow (max-width: 680px) {
  .flow > .branches { grid-template-columns: minmax(0, 1fr); row-gap: 22px; margin-top: 14px; }
  .flow > .branches::before,
  .flow > .branches::after,
  .flow > .branches > .branch > .node-return::before,
  .flow > .branches > .branch > .node-return::after { display: none; }
  .flow > .branches > .branch { align-items: stretch; padding-left: 14px; border-left: 1px solid var(--rule-strong); }
  .flow > .branches > .branch > .chip { align-self: flex-start; margin-bottom: 8px; }
  .flow > .branches > .branch > .down { display: none; }
  .return-note { display: block; }
}

@container split (max-width: 440px) {
  .branch-split > .branches { grid-template-columns: minmax(0, 1fr); row-gap: 16px; margin-top: 14px; }
  .branch-split > .branches::before,
  .branch-split > .branches::after { display: none; }
  .branch-split > .branches > .branch { align-items: stretch; padding-left: 12px; border-left: 1px solid var(--rule-strong); }
  .branch-split > .branches > .branch > .chip { align-self: flex-start; margin-bottom: 8px; }
  .branch-split > .branches > .branch > .down { display: none; }
}

/* Connect Care steps */
.cc-steps { list-style: none; margin: 0; padding: 0; }
.cc-steps > li + li { margin-top: 30px; }
.cc-step-text { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.cc-step-text p { margin: 0; font-size: 1.08rem; }
.cc-num {
  flex-shrink: 0; width: 38px; height: 38px; border-radius: 50%;
  background: var(--blue-ink); color: #fff; font-weight: 700; font-size: 1.1rem;
  display: inline-flex; align-items: center; justify-content: center;
}
.shot { position: relative; margin: 0 0 0 52px; max-width: 100%; border: 1px solid var(--rule); border-radius: 4px; overflow: hidden; width: fit-content; }
.shot img { display: block; width: 100%; height: auto; }
.shot-1 { max-width: 680px; }
.shot-2 { max-width: 560px; }
.shot-3 { max-width: 100%; }
.hl { position: absolute; border: 3px solid var(--orange); border-radius: 4px; pointer-events: none; }
.cc-detail { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 28px; align-items: center; margin-left: 52px; }
.cc-detail .shot { margin-left: 0; }
.cc-fields { margin: 0; }
.cc-fields div { padding: 12px 0; border-bottom: 1px solid var(--rule); }
.cc-fields div:first-child { border-top: 1px solid var(--rule); }
.cc-fields dt { display: flex; align-items: center; gap: 8px; font-size: .875rem; font-weight: 600; color: var(--muted); }
/* small outline swatch that matches the highlight boxes on the screenshot */
.cc-fields dt::before { content: ""; width: 12px; height: 12px; border: 2px solid var(--orange); border-radius: 2px; flex-shrink: 0; }
.cc-fields dd { margin: 3px 0 0 20px; font-weight: 650; color: var(--navy); }

/* ---------- Inner pages ---------- */
.page-head { padding-bottom: 28px; border-bottom: 1px solid var(--rule); }
.page-head .kicker { margin: 0 0 .5em; color: var(--blue-ink); font-weight: 600; }
.page-head h1 { font-size: clamp(1.8rem, 3.2vw, 2.4rem); letter-spacing: -.02em; }
.page-head .lead { color: var(--muted); font-size: 1.1rem; max-width: 64ch; }
.page-head .actions { display: flex; flex-wrap: wrap; gap: 10px; }

.keypoints { background: var(--blue-tint); border-radius: 6px; padding: 22px 26px; margin-top: 32px; }
.keypoints h2 { font-size: 1.15rem; margin-bottom: .6em; }
.keypoints ul { margin: 0; padding: 0; list-style: none; }
.keypoints li { position: relative; padding-left: 20px; }
.keypoints li + li { margin-top: .4em; }
.keypoints li::before { content: ""; position: absolute; left: 1px; top: .6em; width: 7px; height: 7px; background: var(--green); }
.keypoints .urgent { color: var(--red); font-weight: 700; }

.toc { margin-top: 32px; }
.toc h2 { font-size: .95rem; color: var(--muted); font-weight: 600; letter-spacing: 0; margin-bottom: .6em; }
.toc ol { margin: 0; padding: 0; list-style: none; columns: 3 200px; column-gap: 32px; }
.toc li { break-inside: avoid; padding: 3px 0; }

.prose { margin-top: 8px; }
.prose section { padding-top: 36px; }
.prose h2 {
  font-size: 1.35rem; color: var(--blue-ink);
  padding-bottom: 6px; border-bottom: 2px solid var(--green); margin-bottom: .7em;
}
.prose h3 { font-size: 1.08rem; margin: 1.3em 0 .4em; }
.prose p, .prose li { max-width: 70ch; }
.prose ul { padding-left: 0; list-style: none; }
.prose ul li { position: relative; padding-left: 20px; }
.prose ul li + li { margin-top: .4em; }
.prose ul li::before { content: ""; position: absolute; left: 1px; top: .6em; width: 7px; height: 7px; background: var(--green); }
.prose ol { padding-left: 1.5em; }
.prose ol li + li { margin-top: .55em; }
.prose ol li::marker { color: var(--blue-ink); font-weight: 700; }
.prose ol ol { margin-top: .45em; }

.warn { background: var(--amber-tint); border-radius: 6px; padding: 14px 20px; }
.warn strong { color: var(--amber); }

.alert-911 { background: var(--red-tint); border: 1px solid var(--red-line); border-radius: 6px; padding: 20px 26px; margin-top: 40px; }
.prose .alert-911 h2 { color: var(--red); border: 0; padding: 0; margin-bottom: .35em; }
.alert-911 p { margin: 0; }

/* Documents */
.doc-list { margin-top: 8px; }
.doc-card {
  display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 24px;
  padding: 32px 0; border-bottom: 1px solid var(--rule);
}
.doc-icon {
  width: 52px; height: 66px; border-radius: 3px;
  background: var(--red-tint); border: 1px solid var(--red-line); color: var(--red);
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 9px;
  font-weight: 700; font-size: .78rem; letter-spacing: .03em;
}
.doc-card h2 { font-size: 1.3rem; margin-bottom: .35em; }
.doc-card p { max-width: 68ch; }
.doc-card .meta { color: var(--muted); font-size: .9rem; }
.doc-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 2px solid var(--green); }
.site-footer .inner { max-width: 1200px; margin: 0 auto; padding: 20px 24px 32px; font-size: .9rem; color: var(--muted); }
.site-footer .footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 24px; }
.site-footer p { margin: 0 0 .4em; }
.site-footer strong { color: var(--blue-ink); font-weight: 700; }
.site-footer .footer-fax { color: var(--ink); font-weight: 600; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .steps { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .step { display: grid; grid-template-columns: 48px minmax(0, 1fr); column-gap: 12px; }
  .step .num { grid-row: span 3; margin: 0; }
  .cc-detail { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 16px 16px 56px; }
  .sidebar { position: static; }
  .fax-card { display: none; }

  .js .nav-toggle {
    display: flex; width: 100%; align-items: center; justify-content: space-between;
    padding: 12px 14px; border: 1px solid var(--rule-strong); border-radius: 4px;
    background: #fff; color: var(--navy);
    font: inherit; font-weight: 650; cursor: pointer;
  }
  .nav-toggle .bars { display: inline-block; width: 18px; height: 2px; background: currentColor; position: relative; }
  .nav-toggle .bars::before,
  .nav-toggle .bars::after { content: ""; position: absolute; left: 0; width: 18px; height: 2px; background: currentColor; }
  .nav-toggle .bars::before { top: -6px; }
  .nav-toggle .bars::after { top: 6px; }
  .js .site-nav { display: none; margin-top: 6px; padding: 6px; border: 1px solid var(--rule); border-radius: 4px; }
  .js .site-nav.open { display: block; }

  .site-header .inner { padding: 12px 16px; }
  .brand img { height: 40px; }
  .program .dept { font-size: .95rem; }
  .program .name { font-size: .8rem; }

  .hero { padding: 32px 22px; margin: 0 -16px; }
  .section { margin-top: 48px; }
  .criteria { grid-template-columns: minmax(0, 1fr); margin-top: 32px; }
  .panel { padding: 20px 20px; }
  .shot, .cc-detail { margin-left: 0; }
  .site-footer .inner { padding: 18px 16px 28px; }
}

@media (max-width: 520px) {
  .program .name { display: none; }
  .doc-card { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .doc-icon { width: 40px; height: 50px; padding-bottom: 6px; font-size: .7rem; }
}

@media print {
  .sidebar, .skip-link, .jump { display: none; }
  .layout { display: block; padding: 0; }
}
