/* ============================================================
   Morris Heart Associates — shared stylesheet

   Palette (source of truth: official logo, see docs/branding.md)
     --brand-primary    #0055A5
     --brand-secondary  #00A261   (restrained use only)
     --brand-deep       #003660
     --ink              #243747
     --surface          #FFFFFF
     --surface-alt      #F3F6F9

   Auxiliary tones — all derived from --ink, --brand-deep, or
   --surface (white) via an alpha channel, and documented in
   docs/branding.md:
     --ink-muted     rgba(36, 55, 71, 0.72)  muted body / caption text
     --line          rgba(36, 55, 71, 0.16)  hairline borders
     --line-strong   rgba(36, 55, 71, 0.30)  control borders
     --tint-ink      rgba(36, 55, 71, 0.06)  hover / subtle fills
     --tint-deep     rgba(0, 54, 96, 0.06)   section bands, icon chips
     --footer-muted  rgba(255, 255, 255, 0.72)  muted text on --brand-deep
   ============================================================ */

:root {
  --brand-primary: #0055A5;
  --brand-secondary: #00A261;
  --brand-deep: #003660;
  --ink: #243747;
  --surface-alt: #F3F6F9;
  --surface: #FFFFFF;

  --ink-muted: rgba(36, 55, 71, 0.72);
  --line: rgba(36, 55, 71, 0.16);
  --line-strong: rgba(36, 55, 71, 0.30);
  --tint-ink: rgba(36, 55, 71, 0.06);
  --tint-deep: rgba(0, 54, 96, 0.06);
  --footer-muted: rgba(255, 255, 255, 0.72);
}

/* ---------- Base ---------- */

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

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

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--surface);
}

img,
svg {
  max-width: 100%;
}

h1,
h2,
h3 {
  line-height: 1.25;
  margin: 0 0 0.75rem;
}

h1 {
  font-size: clamp(2rem, 1.55rem + 2.2vw, 3rem);
  font-weight: 700;
  color: var(--brand-deep);
  letter-spacing: -0.01em;
}

h2 {
  font-size: clamp(1.45rem, 1.25rem + 1vw, 1.875rem);
  font-weight: 700;
  color: var(--brand-deep);
}

h3 {
  font-size: 1.0625rem;
  color: var(--brand-deep);
}

a {
  color: var(--brand-primary);
}

::selection {
  background: rgba(0, 85, 165, 0.25);
}

.wrap {
  width: min(100% - 2.5rem, 1120px);
  margin-inline: auto;
}

.lead {
  margin: 0 0 2rem;
  max-width: 60ch;
  color: var(--ink-muted);
  font-size: 1.0625rem;
}

/* Visible keyboard focus everywhere. */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

.site-footer a:focus-visible {
  outline-color: var(--surface);
}

/* Skip link. */
.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 100;
  transform: translateY(-150%);
  padding: 0.75rem 1rem;
  background: var(--surface);
  color: var(--brand-deep);
  border: 1px solid var(--line-strong);
  text-decoration: none;
}

.skip-link:focus {
  transform: none;
}

/* Clearly-marked pending items (never presented as factual). */
.pending {
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  padding: 0.7rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: var(--surface);
}

.btn-primary:hover {
  background: var(--brand-deep);
  border-color: var(--brand-deep);
}

.btn-outline {
  background: var(--surface);
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

.btn-outline:hover {
  background: var(--tint-deep);
}

/* ---------- A. Header & navigation ---------- */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 30;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.75rem;
  position: relative;
}

.brand {
  display: inline-block;
  line-height: 0;
}

.brand-logo {
  display: block;
  height: 38px;
  width: auto;
  max-width: 100%;
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  cursor: pointer;
}

.nav-toggle:hover {
  background: var(--tint-ink);
}

.nav-toggle-icon {
  color: var(--brand-primary);
}

/* Mobile: collapsed menu, revealed by the toggle. */
.site-nav {
  display: none;
}

.site-nav.is-open {
  display: block;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 0;
  box-shadow: 0 8px 16px rgba(36, 55, 71, 0.12);
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav li a {
  display: block;
  padding: 0.8rem 1.25rem;
  border-top: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}

.site-nav li a:hover {
  background: var(--tint-ink);
  color: var(--brand-deep);
}

/* Current page (secondary pages; set via aria-current in script.js). */
.site-nav li a[aria-current="page"] {
  color: var(--brand-primary);
  font-weight: 600;
}

/* ---------- B. Hero ---------- */

.hero {
  border-bottom: 1px solid var(--line);
}

.hero-grid {
  display: grid;
  gap: 2rem;
  padding-block: 3rem;
}

.hero-eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-primary);
}

.hero-sub {
  margin: 1rem 0 1.75rem;
  max-width: 46ch;
  font-size: 1.125rem;
  color: var(--ink-muted);
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-logo {
  padding: 1.5rem;
  background: var(--tint-deep);
  border: 1px solid var(--line);
}

.hero-logo img {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
  margin-inline: auto;
}

/* ---------- Sections ---------- */

.section {
  padding-block: 3.25rem;
}

.section h2 {
  margin-bottom: 0.5rem;
}

.band {
  background: var(--tint-deep);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

/* ---------- C. Patient quick access ---------- */

.qa-grid {
  display: grid;
  gap: 1rem;
}

.qa-card {
  display: block;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
}

.qa-card:hover {
  border-color: var(--brand-primary);
  background: var(--tint-ink);
}

.qa-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--brand-primary);
  background: var(--tint-deep);
}

.qa-title {
  display: block;
  margin: 0.75rem 0 0.25rem;
  font-weight: 600;
  color: var(--brand-deep);
}

.qa-text {
  display: block;
  font-size: 0.9375rem;
  color: var(--ink-muted);
}

/* ---------- D. About ---------- */

.about-grid {
  display: grid;
  gap: 2rem;
}

.about-copy p {
  margin: 0 0 1rem;
}

.about-values {
  list-style: none;
  margin: 0;
  padding: 0;
}

.about-values li {
  position: relative;
  padding: 0.5rem 0 0.5rem 1.25rem;
  border-bottom: 1px solid var(--line);
}

.about-values li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.85rem;
  bottom: 0.85rem;
  width: 3px;
  background: var(--brand-secondary);
}

.about-values strong {
  color: var(--brand-deep);
}

/* ---------- E. Services ---------- */

.svc-grid {
  display: grid;
  gap: 1rem;
}

.svc-item {
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--brand-primary);
}

.svc-item h3 {
  margin-bottom: 0.5rem;
}

.svc-item p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--ink-muted);
}

/* ---------- F. Physicians ---------- */

.physician-grid {
  display: grid;
  gap: 1rem;
}

.physician-card {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
}

.physician-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 180px;
  aspect-ratio: 4 / 5;
  margin-bottom: 1rem;
  overflow: hidden;
  color: var(--brand-primary);
  background: var(--tint-deep);
}

.physician-avatar > svg {
  width: 40%;
  height: auto;
}

.physician-avatar img,
.profile-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.physician-name {
  margin: 0 0 0.25rem;
  font-size: 1.125rem;
}

.physician-role {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--brand-primary);
}

.physician-bio {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--ink-muted);
}

.physician-languages {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  color: var(--ink-muted);
}

/* ---------- F2. Physician roster links & profile pages ---------- */

.physician-card-link {
  text-decoration: none;
}

.physician-card-link:hover {
  border-color: var(--brand-primary);
  background: var(--tint-ink);
}

.physician-card-cta {
  margin-top: auto;
  padding-top: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--brand-primary);
}

.physician-card-cta::after {
  content: " →";
}

.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  font-weight: 600;
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Breadcrumb */

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  font-size: 0.875rem;
  color: var(--ink-muted);
}

.breadcrumb li + li::before {
  content: "/";
  margin-right: 0.5rem;
  color: var(--line-strong);
}

.breadcrumb a {
  color: var(--brand-primary);
}

.breadcrumb [aria-current="page"] {
  color: var(--ink);
}

/* Profile header: fixed-proportion photo container, name, specialty */

.profile-grid {
  display: grid;
  gap: 1.5rem;
  align-items: start;
}

.profile-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 280px;
  aspect-ratio: 4 / 5;
  background: var(--tint-deep);
  border: 1px solid var(--line);
  color: var(--brand-primary);
}

.profile-photo svg {
  width: 40%;
  height: auto;
}

.profile-photo {
  overflow: hidden;
}

.profile-specialty {
  margin: 0 0 0.25rem;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--brand-primary);
}

.profile-secondary {
  margin: 0 0 1.5rem;
  color: var(--ink-muted);
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.profile-bio p {
  margin: 0;
  max-width: 70ch;
}

/* Profile detail blocks (two per row on wide screens) */

.detail-grid {
  display: grid;
  gap: 1rem;
}

.detail-grid .loc-block h3 {
  margin-bottom: 1rem;
}

.detail-grid .theme-list {
  margin-bottom: 0;
}

/* Previous / next physician pager (keeps visitors inside the directory) */

.profile-pager {
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.pager-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.5rem;
}

.pager-link {
  display: flex;
  flex-direction: column;
  max-width: 24rem;
  text-decoration: none;
  color: var(--ink);
}

.pager-link:hover .pager-name {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pager-next {
  margin-left: auto;
  text-align: right;
}

.pager-label {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.pager-name {
  font-weight: 600;
  color: var(--brand-deep);
}

/* ---------- G. Recruitment ---------- */

.theme-list {
  list-style: none;
  margin: 0 0 1.75rem;
  padding: 0;
  max-width: 42rem;
}

.theme-list li {
  position: relative;
  padding: 0.4rem 0 0.4rem 1.5rem;
}

.theme-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.95rem;
  width: 0.75rem;
  height: 3px;
  background: var(--brand-secondary);
}

.theme-list strong {
  color: var(--brand-deep);
}

.careers-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.careers-note {
  margin: 0;
  max-width: 46ch;
  font-size: 0.9375rem;
  color: var(--ink-muted);
}

/* ---------- H. Locations & contact ---------- */

.loc-grid {
  display: grid;
  gap: 1rem;
}

.loc-block {
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
}

.loc-block h3 {
  margin-bottom: 0.75rem;
  font-size: 1.125rem;
}

.contact-list {
  margin: 0;
}

.contact-list > div {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
}

.contact-list > div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.contact-list dt {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.contact-list dd {
  margin: 0;
  color: var(--ink);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Location cards (directory and homepage) */

.loc-cards {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

.loc-card {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
}

.loc-card-name {
  margin-bottom: 0.5rem;
  font-size: 1.125rem;
  color: var(--brand-deep);
}

.loc-card-address {
  margin-bottom: 0.75rem;
  font-style: normal;
  color: var(--ink-muted);
}

.loc-card-phone {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  font-weight: 600;
}

.loc-card-phone a,
.phone-large a {
  color: var(--brand-primary);
  text-decoration: none;
}

.loc-card-phone a:hover,
.phone-large a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.loc-card-link {
  margin-top: auto;
  font-weight: 600;
  color: var(--brand-primary);
}

.loc-all {
  margin: 1.5rem 0 0;
}

/* Location detail page */

.location-eyebrow {
  margin: 0 0 0.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand-secondary);
}

.location-facts {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.loc-address {
  margin-bottom: 1rem;
  font-style: normal;
  font-size: 1.0625rem;
}

.phone-large {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.3;
}

.map-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--surface-alt);
  border: 1px solid var(--line);
}

.map-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.map-note {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  color: var(--ink-muted);
}

@media (min-width: 640px) {
  .loc-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .location-facts {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .map-frame {
    aspect-ratio: 16 / 9;
  }
}

@media (min-width: 1024px) {
  .loc-cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---------- I. Footer ---------- */

.site-footer {
  background: var(--brand-deep);
  color: var(--surface);
}

.footer-grid {
  display: grid;
  gap: 2rem;
  padding-block: 2.75rem;
}

.footer-name {
  margin: 0 0 0.25rem;
  font-size: 1.125rem;
  font-weight: 700;
}

.footer-tag {
  margin: 0;
  color: var(--footer-muted);
}

.footer-col h3 {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--footer-muted);
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-col li {
  margin-bottom: 0.5rem;
}

.footer-col a {
  color: var(--surface);
  text-decoration: none;
}

.footer-col a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-phones li {
  margin-bottom: 0.75rem;
}

.footer-offices {
  font-size: 0.875rem;
  color: var(--footer-muted);
}

.footer-bottom {
  padding-block: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.emergency {
  margin: 0 0 0.5rem;
}

.copyright {
  margin: 0;
  font-size: 0.875rem;
  color: var(--footer-muted);
}

/* ---------- Motion (only when the user allows it) ---------- */

@media (prefers-reduced-motion: no-preference) {
  .qa-card,
  .btn,
  .physician-card-link,
  .site-nav li a {
    transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
  }
}

/* ---------- Responsive layout (mobile-first) ---------- */

@media (min-width: 560px) {
  .qa-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .svc-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-list > div {
    display: grid;
    grid-template-columns: 10rem 1fr;
    column-gap: 1rem;
    align-items: baseline;
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 720px) {
  .loc-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .brand-logo {
    height: 48px;
  }

  .hero-grid {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: center;
    padding-block: 4rem;
  }

  .about-grid {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: start;
  }

  .physician-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .profile-grid {
    grid-template-columns: 260px 1fr;
    gap: 3rem;
  }

  .detail-grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

@media (min-width: 1024px) {
  .qa-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .svc-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }
}

/* ---------- Patient education library ---------- */

.edu-page-header .lead {
  max-width: 62ch;
}

.section.edu-intro {
  padding-bottom: 0;
}

.edu-eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand-primary);
}

.edu-page-header h1,
.edu-intro h1 {
  margin: 0 0 0.75rem;
  color: var(--brand-deep);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.2;
}

.edu-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  margin: 1.5rem 0 1rem;
  padding: 0;
  list-style: none;
  font-size: 0.9rem;
  color: var(--ink-muted);
}

.edu-breadcrumb li + li::before {
  content: "/";
  margin-right: 0.5rem;
  color: var(--ink-muted);
}

.edu-breadcrumb a {
  color: var(--brand-primary);
}

.edu-notice,
.edu-review-note {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border-left: 4px solid var(--brand-primary);
  background: var(--surface-alt);
  font-size: 0.95rem;
}

.edu-review-note {
  border-left-color: var(--line-strong);
  color: var(--ink-muted);
}

.edu-article,
.edu-page {
  max-width: 760px;
  padding-bottom: 2rem;
}

.edu-section {
  margin-top: 2rem;
}

.edu-section h2,
.edu-page h2,
.edu-diagram h3 {
  color: var(--brand-deep);
  line-height: 1.3;
}

.edu-section h2 {
  font-size: 1.4rem;
  margin: 0 0 0.75rem;
}

.edu-section ul,
.edu-takeaways ul {
  padding-left: 1.25rem;
}

.edu-emergency {
  margin: 1.25rem 0;
  padding: 1rem 1.25rem;
  border: 2px solid var(--brand-deep);
  border-radius: 6px;
  background: var(--surface);
}

.edu-emergency-title {
  margin: 0 0 0.5rem;
  color: var(--brand-deep);
}

.edu-emergency ul {
  margin: 0 0 0.5rem;
  padding-left: 1.25rem;
}

.edu-diagram {
  margin: 1.75rem 0;
  padding: 1.25rem;
  background: var(--surface-alt);
  border-radius: 6px;
}

.edu-diagram h3 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}

.edu-flow {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.75rem;
}

.edu-flow li {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.edu-flow li p {
  margin: 0;
}

.edu-flow-num {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--brand-primary);
  color: var(--surface);
  font-weight: 600;
}

.edu-table-wrap {
  overflow-x: auto;
}

.edu-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}

.edu-table th,
.edu-table td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.edu-caption {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
  color: var(--ink-muted);
}

.edu-faq {
  margin: 0 0 0.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.edu-faq summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--brand-deep);
}

.edu-faq p {
  margin: 0.5rem 0 0;
}

.edu-faq summary:focus-visible,
.edu-card:focus-visible,
.edu-list-title a:focus-visible,
.edu-breadcrumb a:focus-visible,
.edu-back a:focus-visible,
.edu-related a:focus-visible,
.edu-featured a:focus-visible {
  outline: 3px solid var(--brand-primary);
  outline-offset: 2px;
}

.edu-sources ul {
  padding-left: 1.25rem;
}

.edu-back {
  margin-top: 2rem;
}

.edu-back a,
.edu-related a,
.edu-featured a,
.edu-list-title a,
.edu-faq a {
  color: var(--brand-primary);
}

.print-only,
.print-url {
  display: none;
}

.edu-card-grid,
.edu-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  display: grid;
  gap: 1rem;
}

.edu-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
}

.edu-card:hover {
  border-color: var(--brand-primary);
}

.edu-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--brand-deep);
}

.edu-card-text {
  margin-top: 0.4rem;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

.edu-card-count {
  margin-top: auto;
  padding-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--brand-primary);
}

.edu-list-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

.edu-list-title {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
}

.edu-list-title a {
  text-decoration: none;
}

.edu-list-item p {
  margin: 0;
  color: var(--ink-muted);
}

.edu-featured {
  padding-left: 1.25rem;
  margin: 1rem 0 0;
  columns: 1;
}

.edu-featured li {
  margin-bottom: 0.5rem;
}

.edu-featured a {
  color: var(--brand-primary);
  font-weight: 600;
}

.edu-faq-list {
  margin-top: 1.25rem;
  max-width: 760px;
}

@media (min-width: 640px) {
  .edu-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .edu-featured {
    columns: 2;
  }
}

@media (min-width: 1024px) {
  .edu-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .edu-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: no-preference) {
  .edu-card {
    transition: border-color 0.15s ease;
  }
}

/* ---------- Clinical services (Phase 10) ---------- */

a.svc-item.svc-link {
  display: block;
  color: var(--ink);
  text-decoration: none;
}

a.svc-item.svc-link:hover {
  background: var(--tint-ink);
  border-color: var(--brand-primary);
}

a.svc-item.svc-link:hover h3 {
  color: var(--brand-primary);
}

.svc-all {
  margin: 1.5rem 0 0;
}

.svc-page,
.svc-directory-page {
  max-width: 760px;
}

.svc-header {
  margin-bottom: 1rem;
}

.svc-header h1 {
  margin-bottom: 0.75rem;
}

.svc-notice {
  margin: 1rem 0 1.5rem;
  padding: 0.75rem 1rem;
  border-left: 4px solid var(--brand-primary);
  background: var(--surface-alt);
  font-size: 0.95rem;
}

.svc-section {
  margin-top: 2rem;
}

.svc-section h2 {
  font-size: 1.35rem;
  margin-bottom: 0.75rem;
}

.svc-section p,
.svc-section ul:not(.svc-directory):not(.svc-links) {
  margin: 0 0 0.9rem;
}

.svc-section ul:not(.svc-directory):not(.svc-links) {
  padding-left: 1.25rem;
}

.svc-legacy {
  font-weight: 600;
  color: var(--brand-deep);
}

.svc-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
}

.svc-links a {
  color: var(--brand-primary);
  text-decoration-thickness: 1px;
}

.svc-contact {
  padding: 1.25rem;
  border: 1px solid var(--line);
  background: var(--surface-alt);
}

.svc-back {
  margin-top: 2rem;
}

.svc-directory {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: grid;
  gap: 1rem;
}

.svc-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-top: 3px solid var(--brand-primary);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
}

.svc-card:hover {
  background: var(--tint-ink);
}

.svc-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--brand-deep);
  overflow-wrap: anywhere;
}

.svc-card-text {
  margin-top: 0.5rem;
  font-size: 0.9375rem;
  color: var(--ink-muted);
}

.svc-card:focus-visible,
a.svc-item.svc-link:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

@media (min-width: 640px) {
  .svc-directory {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .svc-directory {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: no-preference) {
  .svc-card,
  a.svc-item.svc-link {
    transition: background-color 120ms ease, border-color 120ms ease;
  }
}

/* ---------- Phase 11.1: compact header, search panel, desktop nav breakpoint ---------- */

html {
  scroll-padding-top: calc(var(--header-h, 5.5rem) + 0.75rem);
}

.site-header {
  position: sticky;
  top: 0;
  box-shadow: 0 1px 0 var(--line), 0 6px 14px -10px rgba(0, 54, 96, 0.35);
}

.header-search-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  margin-left: auto;
  color: var(--brand-primary);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  cursor: pointer;
}

.header-search-toggle:hover,
.header-search-toggle[aria-expanded="true"] {
  background: var(--tint-ink);
}

.header-search-panel {
  background: var(--surface-alt);
  border-top: 1px solid var(--line);
  padding-block: 0.9rem;
}

.header-search-form label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--brand-deep);
}

.header-search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.header-search-row input[type="search"] {
  flex: 1 1 16rem;
  min-width: 0;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
}

.header-search-row .btn {
  min-height: 44px;
}

.header-search-close {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.5rem 0.9rem;
  font: inherit;
  font-weight: 600;
  color: var(--brand-deep);
  background: var(--surface);
  border: 1px solid var(--brand-deep);
  cursor: pointer;
}

.header-search-close:hover {
  background: var(--tint-ink);
}

.header-search-toggle:focus-visible,
.header-search-close:focus-visible,
.header-search-row input:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

/* Desktop navigation: one line, no wrapping, from 1120px. Below this the menu button is used. */
@media (min-width: 1120px) {
  .nav-toggle {
    display: none;
  }

  .site-nav,
  .site-nav.is-open {
    position: static;
    display: block;
    order: 1;
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
  }

  .header-search-toggle {
    order: 2;
    margin-left: 0;
  }

  .site-nav ul {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 0.25rem 1.1rem;
  }

  .site-nav li {
    flex: none;
    white-space: nowrap;
  }

  .site-nav li a {
    padding: 0.5rem 0;
    border: 0;
    color: var(--brand-deep);
    white-space: nowrap;
  }

  .site-nav li a:hover {
    background: transparent;
    color: var(--brand-primary);
    text-decoration: underline;
    text-underline-offset: 4px;
  }

  .site-nav li a[aria-current="page"] {
    color: var(--brand-primary);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 4px;
  }
}

.hero {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-alt) 100%);
}

@media print {
  .site-header {
    position: static;
    box-shadow: none;
  }

  .header-search-toggle,
  .header-search-panel,
  .nav-toggle,
  .site-nav {
    display: none !important;
  }
}

/* ---------- Phase 11: external testing directory ---------- */

.testing-tag {
  display: inline-block;
  margin: 0 0 1rem;
  padding: 0.25rem 0.6rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--brand-deep);
  background: var(--tint-deep);
  border-left: 3px solid var(--brand-secondary);
}

.testing-notice {
  padding: 0.9rem 1rem;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand-primary);
}

.testing-block {
  margin-top: 2.25rem;
}

.testing-block h2 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.testing-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

.testing-card {
  padding: 1.1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 2px 6px -4px rgba(0, 54, 96, 0.25);
}

.testing-card h3 {
  margin-bottom: 0.4rem;
}

.testing-card p {
  margin: 0 0 0.5rem;
}

.testing-card-meta,
.testing-muted {
  font-size: 0.9375rem;
  color: var(--ink-muted);
}

.testing-list {
  padding-left: 1.25rem;
}

.testing-list li {
  margin-bottom: 0.4rem;
}

.testing-address {
  font-size: 1.0625rem;
}

.testing-distinguish ul {
  padding-left: 1.25rem;
}

.testing-back {
  margin-top: 2.5rem;
  font-size: 0.9375rem;
}

@media (min-width: 720px) {
  .testing-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media print {
  .testing-card,
  .testing-notice {
    box-shadow: none;
  }

  .testing-back {
    display: none;
  }
}

/* ---------- Phase 11: unlinked staff tools and receiver ---------- */

.staff-notice,
.rx-help,
.rx-error {
  padding: 0.9rem 1rem;
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--brand-deep);
  background: var(--surface-alt);
}

.rx-error {
  border-left-color: #8A1C1C;
}

.staff-env {
  padding: 0.75rem 1rem;
  background: #FFF4D6;
  border: 1px solid #8A6100;
  color: #3D2B00;
}

.staff-env-static {
  font-size: 0.9375rem;
  color: var(--ink-muted);
}

.staff-form {
  margin-top: 1.5rem;
}

.staff-fieldset {
  margin: 0;
  padding: 1.25rem;
  border: 1px solid var(--line-strong);
  background: var(--surface);
}

.staff-fieldset legend {
  padding: 0 0.4rem;
  font-weight: 700;
  color: var(--brand-deep);
}

.staff-field {
  margin-bottom: 1.1rem;
}

.staff-field label,
.staff-label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.staff-req {
  font-weight: 400;
  color: var(--ink-muted);
}

.staff-field select,
.staff-field input,
.staff-link {
  width: 100%;
  max-width: 34rem;
  padding: 0.55rem 0.65rem;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
}

.staff-link {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.875rem;
}

.staff-help {
  margin: 0.35rem 0 0;
  font-size: 0.9375rem;
  color: var(--ink-muted);
}

.staff-row {
  display: grid;
  gap: 1rem;
}

.staff-actions,
.rx-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1rem 0;
}

.staff-errors {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  color: #5A1212;
  background: #FBEAEA;
  border: 1px solid #8A1C1C;
}

.staff-status {
  margin: 0.75rem 0;
  font-weight: 600;
  color: var(--brand-deep);
}

.staff-output {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.staff-preview {
  display: grid;
  gap: 0.5rem 1rem;
  margin: 0 0 1.25rem;
  grid-template-columns: 1fr;
}

.staff-preview dt {
  font-weight: 700;
  color: var(--brand-deep);
}

.staff-preview dd {
  margin: 0 0 0.5rem;
}

@media (min-width: 640px) {
  .staff-preview {
    grid-template-columns: 14rem 1fr;
  }
}

.staff-qr-sheet {
  max-width: 22rem;
  margin: 0 0 1rem;
  padding: 1.25rem;
  text-align: center;
  background: #FFFFFF;
  border: 1px solid var(--line-strong);
}

.staff-qr-heading {
  margin: 0 0 0.75rem;
  font-weight: 700;
  color: var(--brand-deep);
}

.staff-qr svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 20rem;
  margin: 0 auto;
}

.staff-qr-caption {
  margin: 0.75rem 0 0;
  font-size: 0.9375rem;
  color: var(--ink);
}

.rx-list {
  display: grid;
  gap: 0.9rem;
  margin: 0 0 1.25rem;
}

.rx-list div {
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}

.rx-list dt {
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand-deep);
}

.rx-list dd {
  margin: 0.2rem 0 0;
  font-size: 1.0625rem;
}

.rx-help {
  margin-top: 1.5rem;
  font-size: 0.9375rem;
}

.rx-help p {
  margin: 0 0 0.6rem;
}

.staff-tool-list {
  list-style: none;
  padding: 0;
}

.staff-tool-list li {
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 2px 6px -4px rgba(0, 54, 96, 0.25);
}

.staff-tool-list p {
  margin: 0.4rem 0 0;
}

.section-block {
  margin-top: 1.5rem;
}

@media print {
  .staff-page .staff-form,
  .staff-page .staff-notice,
  .staff-page .staff-env,
  .staff-page .staff-env-static,
  .staff-page .staff-status,
  .staff-page .staff-errors,
  .staff-page h1,
  .staff-page .staff-actions,
  .staff-page .staff-output > h2,
  .staff-page .staff-output > .staff-help,
  .staff-page .staff-output > .staff-label,
  .staff-page .staff-output > .staff-link,
  .staff-page .testing-back,
  .staff-page .breadcrumb,
  .rx-page .rx-actions,
  .rx-page .testing-back {
    display: none !important;
  }

  .staff-qr-sheet {
    border: 0;
    max-width: none;
  }

  .staff-qr svg {
    max-width: 4.5in;
  }
}

.staff-output:focus,
.staff-errors:focus,
.rx-error:focus,
.rx-details:focus {
  outline: 2px solid var(--brand-primary);
  outline-offset: 3px;
}

/* ---------- Phase 11: site-wide search ---------- */

.search-form {
  margin: 0 0 1.5rem;
}

.search-form label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 600;
}

.search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-width: 40rem;
}

.search-row input[type="search"] {
  flex: 1 1 14rem;
  min-width: 0;
  padding: 0.6rem 0.75rem;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
}

.search-help,
.search-status {
  margin: 0.5rem 0 1rem;
  font-size: 0.9375rem;
  color: var(--ink-muted);
}

.search-status {
  font-weight: 600;
  color: var(--brand-deep);
}

.search-results {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
  max-width: 48rem;
}

.search-result {
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}

.search-result a {
  font-weight: 600;
  font-size: 1.0625rem;
}

.search-result-type {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.1rem 0.5rem;
  font-size: 0.8125rem;
  color: var(--brand-deep);
  background: var(--tint-deep);
  border: 1px solid var(--line);
}

.search-result p {
  margin: 0.35rem 0 0;
  font-size: 0.9375rem;
  color: var(--ink-muted);
}

.search-directory {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.search-directory h2 {
  font-size: 1.125rem;
}

.search-directory ul {
  padding-left: 1.25rem;
}

@media print {
  .search-form,
  .search-directory {
    display: none;
  }
}

/* ---------- Phase 11.1: facility map layout ---------- */

.testing-location {
  display: grid;
  gap: 1.5rem;
}

.testing-location-map {
  min-width: 0;
}

@media (min-width: 900px) {
  .testing-location {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    align-items: start;
  }

  .testing-location-map .map-frame {
    aspect-ratio: 4 / 3;
  }
}

/* ---------- Phase 11.2: education landing closing notice ---------- */

.edu-closing {
  padding-block: 2rem 3rem;
  border-top: 1px solid var(--line);
}

.edu-closing p {
  margin: 0;
  max-width: 72ch;
  font-size: 0.9375rem;
  color: var(--ink-muted);
}

/* ---------- Patient Resources submenu (Phase 11.5) ---------- */

.nav-group {
  position: relative;
}

.nav-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  padding: 0.8rem 1.25rem;
  font: inherit;
  color: var(--ink);
  background: none;
  border: 0;
  border-top: 1px solid var(--line);
  text-align: left;
  cursor: pointer;
}

.nav-group-toggle:hover {
  background: var(--tint-ink);
  color: var(--brand-deep);
}

.nav-group-toggle[aria-expanded="true"] {
  color: var(--brand-primary);
  font-weight: 600;
}

.nav-group-icon {
  flex: none;
  transition: transform 120ms ease;
}

.nav-group-toggle[aria-expanded="true"] .nav-group-icon {
  transform: rotate(180deg);
}

.nav-sub {
  list-style: none;
  margin: 0;
  padding: 0 0 0 1rem;
}

.nav-sub[hidden] {
  display: none;
}

.nav-sub li a {
  padding-left: 1.25rem;
}

@media (min-width: 1120px) {
  .nav-group-toggle {
    width: auto;
    padding: 0.5rem 0;
    border: 0;
    color: var(--brand-deep);
    white-space: nowrap;
  }

  .nav-group-toggle:hover {
    background: transparent;
    color: var(--brand-primary);
    text-decoration: underline;
    text-underline-offset: 4px;
  }

  .nav-group-toggle[aria-expanded="true"] {
    color: var(--brand-primary);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 4px;
  }

  .site-nav .nav-sub {
    display: block;
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    z-index: 40;
    min-width: 15rem;
    padding: 0.25rem 0;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: 0 8px 16px rgba(36, 55, 71, 0.12);
  }

  .site-nav .nav-sub[hidden] {
    display: none;
  }

  .site-nav .nav-sub li {
    white-space: nowrap;
  }

  .site-nav .nav-sub li a {
    padding: 0.6rem 1rem;
    border-top: 0;
  }
}
