/* Shared reading and navigation styles for the Audiology Studio field guide. */
:root {
  --ink: #172e35;
  --slate: #344c52;
  --quiet: #4c6266;
  --accent: #0b665e;
  --deep: #103d40;
  --rule: #d3dedc;
  --soft: #edf5f2;
  --sheet: #fff;
  --page: #f5f7f5;
  --serif: "Noto Serif TC", "Source Han Serif TC", "Songti TC", "PMingLiU", Georgia, serif;
  --sans: "DM Sans", "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", system-ui, sans-serif;
  --number: "IBM Plex Mono", ui-monospace, monospace;
  --shell: min(75rem, calc(100% - clamp(2rem, 7vw, 6rem)));
  background: var(--page);
  color: var(--ink);
  font-family: var(--sans);
}
body { background: var(--page); }
.bar, main { width: var(--shell); }
main { margin-top: clamp(1.4rem, 3vw, 2.6rem); }
main > *, .paper, .lesson > *, .study-table, .rs-columns > * { min-width: 0; }
.narrow, .nx-inner { max-width: 58rem; }
p, dd, li { line-height: 1.8; }
h1, h2, h3 { text-wrap: pretty; }
h2 { font-size: clamp(1.35rem, 1.15rem + 1vw, 1.85rem); line-height: 1.45; }
h3 { font-size: 1.15rem; line-height: 1.55; }
.meta, .muted, .summary, figcaption { color: var(--quiet); }
.eyebrow, .code {
  color: var(--accent);
  font: 650 .76rem/1.5 var(--number);
  letter-spacing: .10em;
}
.eyebrow::before { width: 1.3rem; height: 2px; margin-right: .55rem; }
header { background: var(--sheet); border-top: 4px solid var(--deep); border-bottom: 1px solid var(--rule); }
.bar { min-height: 4.8rem; }
.brand { color: var(--deep); }
.brand:hover { text-decoration: none; }
.brand small { color: var(--quiet); }
header nav { align-items: stretch; justify-content: center; column-gap: clamp(.7rem, 2vw, 2.1rem); }
header nav a {
  color: var(--slate);
  min-height: 44px;
  padding: .25rem .18rem;
  white-space: nowrap;
  font-size: 1rem;
}
header nav a[aria-current] { border-color: var(--accent); color: var(--accent); font-weight: 760; }
#size { border: 1px solid var(--rule); border-radius: .45rem; padding: .54rem .82rem; min-height: 44px; font-size: 1rem; }
:where(a, button, input, select, summary, textarea):focus-visible {
  outline: 3px solid #b56515;
  outline-offset: 3px;
  box-shadow: 0 0 0 3px #fff;
}
button, select, .btn {
  border-radius: .45rem;
  max-width: 100%;
}
.btn {
  min-height: 44px;
  border-color: #b5c9c5;
  color: #184f4e;
  padding: .6rem 1rem;
  line-height: 1.45;
  text-align: center;
}
.btn.dark, button.dark { background: var(--deep); color: #fff; border-color: var(--deep); }
.btn.mint { background: #c9ecd9; border-color: #c9ecd9; color: #113e3b; }
.btn.ghost { color: #fff; background: #183e40; border-color: #81a39e; }
.crumb, .link, .refs a, .hb-case-link a {
  color: var(--accent);
  text-underline-offset: .2em;
}
.crumb { display: inline-flex; align-items: center; min-height: 44px; margin: 0 0 .5rem; text-decoration: underline; }
.subhead { border-top: 2px solid var(--deep); padding-top: clamp(1.15rem, 2.2vw, 2rem); margin: 0 0 1.55rem; }
.subhead h1 { margin: .38em 0 .18em; color: var(--ink); font-size: clamp(1.85rem, 1.1rem + 2.25vw, 3.05rem); line-height: 1.32; letter-spacing: .015em; }
.subhead > p:not(.eyebrow) { max-width: 52em; color: var(--quiet); }
.subhead [lang="en"], .hb-en, .term-en { font-weight: 500; }

.hero, .nx-banner, .v-hero { border-radius: .85rem; background-color: var(--deep); color: white; }
.hero {
  isolation: isolate;
  padding: clamp(2rem, 4.8vw, 4.25rem);
  background-color: #103b3e;
}
.hero::before {
  inset: 0 0 0 46%;
  background: linear-gradient(90deg, #103b3e 0%, transparent 35%), url('/hero.webp') center 48% / cover no-repeat;
}
.hero .eyebrow, .nx-banner .eyebrow, .v-hero .eyebrow { color: #c2e4da; letter-spacing: .15em; }
.hero h1 {
  max-width: 12em;
  margin: .23em 0 .28em;
  font-family: var(--serif);
  font-weight: 750;
  font-size: clamp(2.55rem, 2rem + 3vw, 4.8rem);
  letter-spacing: .035em;
}
.hero p { color: #e6f2ef; line-height: 1.82; }
.hero .stats { margin: 1.35rem 0 1.6rem; flex-wrap: wrap; row-gap: .4rem; }
.stats b { color: #d9f1dc; font-family: var(--number); }
.hero .actions { gap: .65rem; max-width: 55%; }
.grid { gap: clamp(.85rem, 2vw, 1.45rem); }
.sectionhead, .landmarks { margin-top: clamp(1.9rem, 4vw, 3.4rem); }
.sectionhead { align-items: center; margin-bottom: 1rem; }
.sectionhead h2, .landmarks h2 { letter-spacing: .025em; color: var(--ink); }
.progress { min-width: min(11rem, 29%); color: var(--quiet); }
progress { height: .45rem; accent-color: var(--accent); }
.card, .paper, .v-person, .v-group, .rs-paper {
  border: 1px solid var(--rule);
  border-radius: .72rem;
  background-color: var(--sheet);
}
.card, .landmark { transition: border-color .15s, box-shadow .15s; }
.cover { height: clamp(6.5rem, 11vw, 9.5rem); }
.cover .code { top: 1rem; letter-spacing: .16em; }
.cover strong { top: 1.85rem; font-family: var(--serif); font-size: clamp(2.35rem, 4vw, 3.65rem); }
.cardbody h3 { font-size: 1.26rem; color: var(--deep); }
.cardbody { padding: 1.05rem 1.25rem; }
.cardfoot { color: var(--quiet); margin-inline: 1.25rem; }
.cardfoot b { color: var(--accent); }
.landmark-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(13rem, 100%), 1fr)); gap: .75rem; margin-top: .8rem; }
.landmark {
  display: block;
  padding: 1.15rem;
  background: #fff;
  border: 1px solid var(--rule);
  border-top: 3px solid #52877e;
  border-radius: .5rem;
  text-decoration: none;
}
.landmark strong { display: block; color: var(--deep); font-size: 1.07rem; }
.landmark span { display: block; color: var(--quiet); margin-top: .28rem; line-height: 1.65; font-size: .96rem; }
.paper { margin-block: 1rem; padding: clamp(1.05rem, 2.8vw, 2.2rem); }
.paper > h2:first-child, .chapter-block h2, .hb-directory h2 { color: var(--deep); }
.row { min-height: 48px; border-color: var(--rule); line-height: 1.55; }
.row > .code { min-width: 2rem; color: var(--accent); font-size: .86rem; }
.row small { color: var(--quiet); }
.take, .hb-end, .lesson-example, .scope-note, .rs-scope, .rs-next {
  background-color: var(--soft);
  color: #214641;
}
.take, .rs-next { border-left-color: #398477; }
.hb-inlesson { background: var(--soft); border-color: #bdd3ce; }
.hb-steps li::before { color: var(--accent); }
.lesson > div:has(.photo), .lesson-text { color: var(--ink); }
.lesson p, .lesson-text p { line-height: 1.85; }
.lesson-text { max-width: 48rem; }
.study-table th, .study-table td { border-color: var(--rule); padding: .62rem .7rem; }
.study-table thead th, .rs-metrics thead { background: #e8f1ee; color: var(--deep); }
.study-table tbody tr:nth-child(even), .rs-metrics tbody tr:nth-child(even) { background: #f7faf8; }
input[type="search"], .hb-search input, .term-controls input {
  min-height: 48px;
  border: 1px solid #79938d;
  border-radius: .4rem;
}
summary { min-height: 44px; }
summary::marker { color: var(--accent); }
.term-controls button:disabled { color: #62726d; border-style: dashed; background: #f1f4f2; cursor: default; }
.term-group { background: var(--sheet); border-color: var(--rule); }
.term-group[open] { border-top: 3px solid #52877e; }
.rs-tabs a { border-radius: .4rem; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.rs-title, .v-hero, .nx-banner { background-color: var(--deep); }
.rs-standard { background-color: #f2f6f4; }
.nx-banner { border-bottom: 4px solid #a1cabb; }
.nx-range { border-radius: .5rem; }
.nx-range-option { border-radius: .4rem; }
.nx-range-option:has(:checked) { background: #eaf4ef; border-color: #8baea2; }
.nx-option[aria-pressed="false"]:not(:disabled) { background: #fff; }
.nx-option.nx-selected { color: #17423c; border-color: var(--accent); }
.nx-feedback.nx-good { border-left: 4px solid #397d5c; }
.nx-feedback.nx-miss { border-left: 4px solid #a95536; }
.v-hero figcaption { color: white; }
footer {
  box-sizing: border-box;
  width: 100%;
  margin-top: clamp(3rem, 6vw, 5.8rem);
  padding: 2.2rem max(1rem, calc((100% - var(--shell)) / 2)) 2rem;
  background: #133739;
  color: #d3e2dc;
  border-top: 4px solid #80aa9d;
}
.footer-links { gap: 1.25rem 1.7rem; }
.footer-links h2 { color: #fff; margin: 0 0 .5rem; font-size: 1.08rem; }
.footer-links a {
  display: flex; align-items: center; min-height: 44px; padding: .3rem 0;
  color: #e0ece6; font-size: 1rem; text-decoration: underline;
  text-underline-offset: .22em; text-decoration-color: #9bbab1;
}
footer a[aria-current="page"] { color: #d4f0bb; text-decoration-thickness: 2px; }
footer p { border-top: 1px solid #456367; padding-top: 1rem; font-size: .91rem; color: #d3e2dc; }
@media (hover: hover) {
  header nav a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: .3em; }
  .card:hover, .landmark:hover { border-color: #6f9990; box-shadow: 0 3px 14px #19363315; text-decoration: none; }
  .card:hover h3, .landmark:hover strong, a.row:hover b { text-decoration: underline; text-underline-offset: .22em; }
  .btn:hover { text-decoration: underline; text-underline-offset: .22em; }
  .chapter-block a.row:hover, .hb-directory a.row:hover { background: #f3f8f5; text-decoration: none; }
}
@media (max-width: 760px) {
  :root { --shell: calc(100% - 2rem); }
  .hero .actions { max-width: 100%; }
  .hero p { max-width: 65%; }
}
@media (max-width: 680px) {
  .bar { min-height: auto; padding-top: .6rem; gap: .3rem; }
  header nav { justify-content: space-between; gap: .2rem; }
  header nav a { font-size: .9rem; }
  .hero { padding: 1.5rem; }
  .sectionhead { flex-wrap: wrap; }
  .lesson { gap: 1rem; }
  .progress { min-width: 7.5rem; }
}
@media (max-width: 530px) {
  .hero { padding: 1.45rem 1.2rem; }
  .hero::before { inset: 0 0 auto; height: clamp(8.5rem, 38vw, 12rem); opacity: 1;
    background: url('/hero.webp') 52% 46% / cover no-repeat; position: relative;
    display: block; margin: -1.45rem -1.2rem 1.1rem; }
  .hero::after { content: none; }
  .hero h1 { font-size: clamp(2.25rem, 8.5vw, 3.35rem); }
  .hero p { max-width: 100%; }
  .hero .stats { font-size: .88rem; gap: .65rem; margin: 1rem 0 1.2rem; }
  .hero .stats span + span { padding-left: .65rem; }
  .hero .actions { gap: .5rem; }
  .cover { height: 6.8rem; }
  .landmark-grid { grid-template-columns: 1fr; }
  .rs-tabs a { min-height: 44px; }
  .footer-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 375px) {
  .bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .bar .brand { gap: .35rem; font-size: 1.14rem; }
  .bar .brand svg { width: 1.7rem; height: 1.7rem; flex: none; }
  #size { padding: .35rem .55rem; }
  .bar nav { grid-column: 1 / -1; }
  .hero .eyebrow { letter-spacing: .05em; }
  .hero .eyebrow::before { width: .7rem; margin-right: .3rem; }
  .hero::before { height: clamp(90px, 31vw, 116px); }
  .hero h1 { font-size: 1.8rem; }
  header nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 .2rem; }
  header nav a { text-align: center; white-space: normal; }
  .brand { font-size: 1.27rem; }
  .sectionhead { align-items: flex-start; flex-direction: column; }
  .progress { align-self: stretch; }
  .hero .stats { column-gap: .45rem; }
  .hero .stats span + span { padding-left: .45rem; }
}
@media (prefers-reduced-motion: reduce) {
  .card, .landmark { transition: none; }
}
@media print {
  :root, body, .hero { background: white; color: black; }
  .hero::before, .hero::after { content: none; }
  main { width: 100%; }
  .card, .paper, .landmark { box-shadow: none; }
}
