/* ==========================================================================
   The Communication Clinic — stylesheet
   Hand-written, dependency-free. Designed to meet WCAG 2.2 Level AA.
   Sections: 1 Tokens · 2 Reset · 3 Layout · 4 Header · 5 Hero · 6 Components
             7 Pages · 8 Forms · 9 Footer · 10 Cookie banner · 11 Utilities
             12 Motion / print / forced-colours
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. DESIGN TOKENS
   Every colour pair below has been contrast-checked against WCAG 2.2:
   body text >= 4.5:1, large text and UI borders >= 3:1.
   -------------------------------------------------------------------------- */
:root {
  /* Brand — deep clinical teal, carried over from the original site's blue */
  --brand-900: #05323A;
  --brand-800: #084853;
  --brand-700: #0B5D6B;   /* primary. 7.98:1 on white */
  --brand-600: #0E7285;
  --brand-100: #E3F1F3;
  --brand-050: #F3F9FA;

  /* Warm secondary — used for emphasis and the primary call to action */
  --warm-800: #8C3410;
  --warm-700: #A63D13;    /* 5.71:1 on white */
  --warm-100: #FCEDE6;

  /* Neutrals */
  --ink:      #10242A;    /* 15.9:1 on white  — headings + body copy */
  --ink-soft: #445A61;    /* 6.79:1 on white  — secondary copy */
  --line:     #C9D8DC;    /* decorative + non-text borders */
  --line-strong: #7C949B; /* 3.2:1 on white — input borders (UI contrast) */
  --surface:  #FFFFFF;
  --surface-alt: #F5F8F9;

  /* Status */
  --ok-bg:   #E6F4EA;
  --ok-ink:  #14532D;
  --warn-bg: #FEF6E7;
  --warn-ink: #6B4708;

  /* Typography — system stack: zero network requests, zero tracking */
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  --step--1: clamp(0.875rem, 0.85rem + 0.12vw, 0.9375rem);
  --step-0:  clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --step-1:  clamp(1.2rem, 1.13rem + 0.35vw, 1.4rem);
  --step-2:  clamp(1.45rem, 1.32rem + 0.65vw, 1.85rem);
  --step-3:  clamp(1.8rem, 1.55rem + 1.2vw, 2.6rem);
  --step-4:  clamp(2.1rem, 1.6rem + 2.4vw, 3.5rem);

  /* Space + shape */
  --gutter: clamp(1rem, 0.6rem + 2vw, 2rem);
  --measure: 68ch;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(16, 36, 42, 0.06),
               0 4px 12px rgba(16, 36, 42, 0.06);
  --shadow-md: 0 8px 28px rgba(16, 36, 42, 0.10);
  --focus: 3px solid var(--warm-700);
}

/* --------------------------------------------------------------------------
   2. RESET / BASE
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--ink);
  background: var(--surface);
  /* Text spacing per WCAG 1.4.12 remains adjustable — no fixed heights used. */
}

h1, h2, h3, h4 {
  line-height: 1.2;
  margin: 0 0 0.5em;
  color: var(--brand-900);
  text-wrap: balance;
  font-weight: 700;
}
h1 { font-size: var(--step-4); letter-spacing: -0.02em; }
h2 { font-size: var(--step-3); letter-spacing: -0.015em; }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }

p, li { max-width: var(--measure); }
p { margin: 0 0 1em; }

img, svg, iframe { max-width: 100%; height: auto; display: block; }

a {
  color: var(--brand-700);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 0.08em;
}
a:hover { color: var(--brand-900); }

/* Visible focus for every interactive element (WCAG 2.4.7 / 2.4.11) */
:focus-visible {
  outline: var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Skip link — first thing a keyboard or screen-reader user meets */
.skip-link {
  position: absolute;
  left: 0; top: 0;
  transform: translateY(-120%);
  z-index: 999;
  background: var(--brand-900);
  color: #fff;
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { transform: translateY(0); color: #fff; }

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

/* --------------------------------------------------------------------------
   3. LAYOUT
   -------------------------------------------------------------------------- */
.container {
  width: min(100% - (var(--gutter) * 2), 1140px);
  margin-inline: auto;
}
.container--narrow { width: min(100% - (var(--gutter) * 2), 760px); }

section { padding-block: clamp(2.5rem, 1.5rem + 4vw, 5rem); }
.section--alt { background: var(--surface-alt); }
.section--brand { background: var(--brand-050); }

.grid { display: grid; gap: clamp(1.25rem, 1rem + 1.5vw, 2rem); }
@media (min-width: 720px) {
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
}

.section-head { max-width: var(--measure); margin-bottom: 2rem; }
.section-head p { color: var(--ink-soft); font-size: var(--step-1); }

.eyebrow {
  display: inline-block;
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--brand-700);
  margin-bottom: 0.6rem;
}

/* --------------------------------------------------------------------------
   4. HEADER / NAVIGATION
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 72px;
}
.brand { display: inline-flex; align-items: center; gap: 0.7rem; text-decoration: none; }
.brand img { width: 122px; height: 42px; }
.brand__text { font-weight: 700; color: var(--brand-900); font-size: 1.05rem; line-height: 1.15; }
.brand__text span { display: block; font-weight: 500; font-size: 0.75rem; color: var(--ink-soft); letter-spacing: 0.02em; }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--brand-700);
  color: #fff;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.9rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  min-height: 44px;              /* WCAG 2.5.8 target size */
}
.nav-toggle__bars { display: block; width: 18px; height: 2px; background: #fff; position: relative; }
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: ""; position: absolute; left: 0; width: 18px; height: 2px; background: #fff;
}
.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after  { top: 6px; }

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.25rem;
  align-items: center;
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  color: var(--ink);
}
.site-nav a:hover { background: var(--brand-100); color: var(--brand-900); }
.site-nav a[aria-current="page"] {
  color: var(--brand-800);
  background: var(--brand-100);
  box-shadow: inset 0 -3px 0 var(--brand-700);
}
.site-nav .btn { margin-left: 0.4rem; }

@media (max-width: 899px) {
  .site-nav {
    position: absolute;
    inset-inline: 0;
    top: 100%;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    padding: 0.75rem var(--gutter) 1.25rem;
  }
  .site-nav[hidden] { display: none; }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 0.15rem; }
  .site-nav a { justify-content: flex-start; }
  .site-nav .btn { margin-left: 0; margin-top: 0.5rem; justify-content: center; }
}
@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .site-nav[hidden] { display: block; }   /* JS hides it; ignore on desktop */
}

/* --------------------------------------------------------------------------
   5. MASTHEAD BANNER + HERO
   -------------------------------------------------------------------------- */
/* The banner photograph carried over from the original site.
   NOTE: no text is placed on top of it. The old site laid its headline and its
   "clinic closed" notice over this same photo behind a 53%-transparent pink
   overlay, which measured 2.93:1 — below the 3:1 WCAG minimum, and in fact
   unmeasurable, because the effective background changed with every viewport
   size. Keeping the photo purely as imagery removes that failure entirely. */
.masthead {
  display: block;
  border-bottom: 1px solid var(--line);
  background: var(--brand-050);
}
.masthead img {
  display: block;
  width: 100%;
  height: clamp(150px, 22vw, 280px);
  object-fit: cover;
  object-position: center 40%;
}

.hero {
  background:
    radial-gradient(60rem 30rem at 82% -12%, var(--brand-100), transparent 62%),
    linear-gradient(180deg, var(--brand-050), #fff 78%);
  padding-block: clamp(3rem, 2rem + 6vw, 6.5rem);
  border-bottom: 1px solid var(--line);
}
.hero__grid { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 900px) { .hero__grid { grid-template-columns: 1.15fr 0.85fr; } }
.hero p.lede { font-size: var(--step-1); color: var(--ink-soft); max-width: 46ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }

.hero__card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: clamp(1.25rem, 1rem + 1vw, 1.75rem);
}
.hero__card h2 { font-size: var(--step-1); }
.hero__card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.hero__card li { display: flex; gap: 0.6rem; align-items: flex-start; font-size: var(--step--1); }
.tick { flex: 0 0 auto; color: var(--brand-700); }

.trust-strip {
  display: flex; flex-wrap: wrap; align-items: center; gap: clamp(1rem, 3vw, 2.5rem);
  padding-block: 1.5rem;
}
.trust-strip img { filter: grayscale(1); opacity: 0.85; max-height: 46px; width: auto; }
.trust-strip a:hover img, .trust-strip a:focus-visible img { filter: none; opacity: 1; }
.trust-strip p { font-weight: 600; color: var(--ink-soft); margin: 0; font-size: var(--step--1); }

/* --------------------------------------------------------------------------
   6. COMPONENTS
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 46px;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  border: 2px solid transparent;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--warm-700); color: #fff; }      /* 5.71:1 */
.btn--primary:hover { background: var(--warm-800); color: #fff; }
.btn--secondary { background: var(--brand-700); color: #fff; }   /* 7.98:1 */
.btn--secondary:hover { background: var(--brand-900); color: #fff; }
.btn--ghost { background: #fff; color: var(--brand-800); border-color: var(--brand-700); }
.btn--ghost:hover { background: var(--brand-100); color: var(--brand-900); }
.btn--block { width: 100%; }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 1rem + 1vw, 1.75rem);
  box-shadow: var(--shadow-sm);
  height: 100%;
}
.card h3 { font-size: var(--step-1); }
.card p:last-child { margin-bottom: 0; }
.card__icon {
  display: inline-grid;
  place-items: center;
  width: 48px; height: 48px;
  border-radius: 12px;
  background: var(--brand-100);
  color: var(--brand-800);
  margin-bottom: 1rem;
}
.card--link { transition: box-shadow 0.15s ease, transform 0.15s ease; }
.card--link:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.price-list { display: grid; gap: 1rem; }
.price {
  display: grid;
  gap: 0.5rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.1rem, 1rem + 0.8vw, 1.6rem);
  background: #fff;
}
@media (min-width: 780px) { .price { grid-template-columns: 1fr auto; } }
.price h3 { margin-bottom: 0.35rem; }
.price p { margin-bottom: 0; }
.price__fee {
  align-self: start;
  font-size: var(--step-2);
  font-weight: 700;
  color: var(--brand-800);
  white-space: nowrap;
}
.price__fee small { display: block; font-size: 0.8rem; font-weight: 600; color: var(--ink-soft); }

.pill-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.6rem; }
.pill-list li {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--brand-900);
  max-width: none;
}

blockquote.quote {
  margin: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 5px solid var(--brand-700);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 1rem + 1vw, 1.75rem);
  box-shadow: var(--shadow-sm);
  height: 100%;
}
blockquote.quote p { font-size: var(--step-0); }
blockquote.quote footer { color: var(--ink-soft); font-weight: 600; font-size: var(--step--1); }

.notice {
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  border: 1px solid var(--line);
  background: var(--warn-bg);
  color: var(--warn-ink);
}
.notice strong { color: inherit; }
.notice p:last-child { margin-bottom: 0; }
.notice a { color: inherit; }

.callout {
  background: var(--brand-800);
  color: #fff;
  border-radius: var(--radius);
  padding: clamp(1.5rem, 1.2rem + 2vw, 2.75rem);
  text-align: center;
}
.callout h2, .callout p { color: #fff; }
.callout p { margin-inline: auto; }
.callout .btn--ghost { background: transparent; color: #fff; border-color: #fff; }
.callout .btn--ghost:hover { background: #fff; color: var(--brand-900); }
.callout :focus-visible { outline-color: #fff; }

/* Accordion (FAQ) — native <details>, works without JavaScript */
.faq { display: grid; gap: 0.75rem; }
.faq details {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}
.faq summary {
  cursor: pointer;
  padding: 1rem 1.25rem;
  font-weight: 700;
  color: var(--brand-900);
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.5rem; color: var(--brand-700); line-height: 1; }
.faq details[open] summary { background: var(--brand-050); }
.faq details[open] summary::after { content: "\2212"; }
.faq .faq__body { padding: 0.25rem 1.25rem 1.25rem; }
.faq .faq__body p:last-child { margin-bottom: 0; }

/* Breadcrumbs */
.crumbs { font-size: var(--step--1); color: var(--ink-soft); padding-top: 1.25rem; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; padding: 0; }
.crumbs li + li::before { content: "/"; margin-right: 0.4rem; color: var(--line-strong); }

.page-head {
  background: var(--brand-050);
  border-bottom: 1px solid var(--line);
  padding-block: clamp(2rem, 1.5rem + 3vw, 3.5rem);
}
.page-head p { font-size: var(--step-1); color: var(--ink-soft); margin-bottom: 0; }

/* Long-form legal copy */
.prose h2 { font-size: var(--step-2); margin-top: 2.25rem; }
.prose h3 { font-size: var(--step-1); margin-top: 1.75rem; }
.prose ul, .prose ol { padding-left: 1.35rem; }
.prose li { margin-bottom: 0.4rem; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.25rem 0; font-size: var(--step--1); }
.prose th, .prose td { border: 1px solid var(--line); padding: 0.7rem 0.85rem; text-align: left; vertical-align: top; }
.prose th { background: var(--brand-050); }
.prose .updated { color: var(--ink-soft); font-size: var(--step--1); }

/* --------------------------------------------------------------------------
   8. FORMS
   -------------------------------------------------------------------------- */
.form-grid { display: grid; gap: 1.1rem; }
.field label { display: block; font-weight: 700; margin-bottom: 0.35rem; }
.field .hint { display: block; font-size: var(--step--1); color: var(--ink-soft); margin-bottom: 0.4rem; }
.field input, .field textarea, .field select {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #fff;
  padding: 0.7rem 0.85rem;
  border: 2px solid var(--line-strong);   /* 3:1 against white — WCAG 1.4.11 */
  border-radius: var(--radius-sm);
  min-height: 46px;
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus-visible, .field textarea:focus-visible { border-color: var(--brand-700); }
.field .error { color: var(--warm-800); font-weight: 600; font-size: var(--step--1); }
/* Honeypot: hidden from sighted users AND from assistive tech (tabindex -1 in HTML) */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { border-radius: var(--radius-sm); padding: 0.85rem 1rem; font-weight: 600; }
.form-status--ok { background: var(--ok-bg); color: var(--ok-ink); }
.form-status--err { background: var(--warm-100); color: var(--warm-800); }

/* --------------------------------------------------------------------------
   9. FOOTER
   -------------------------------------------------------------------------- */
.site-footer { background: var(--brand-900); color: #E7F1F3; padding-block: 3rem 1.5rem; margin-top: 0; }
.site-footer h2 { color: #fff; font-size: 1rem; text-transform: uppercase; letter-spacing: 0.08em; }
.site-footer a { color: #CFE6EA; }
.site-footer a:hover { color: #fff; }
.site-footer :focus-visible { outline-color: #fff; }
.footer-grid { display: grid; gap: 2rem; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.site-footer address { font-style: normal; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; justify-content: space-between;
  font-size: var(--step--1);
}
.footer-bottom p { margin: 0; max-width: none; }

/* --------------------------------------------------------------------------
   10. COOKIE CONSENT (PECR reg. 6 — no non-essential cookies before consent)
   -------------------------------------------------------------------------- */
.cookie-banner {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 200;
  background: #fff;
  border-top: 3px solid var(--brand-700);
  box-shadow: 0 -8px 28px rgba(16, 36, 42, 0.16);
  padding: 1.25rem var(--gutter);
}
.cookie-banner[hidden] { display: none; }
.cookie-banner__inner {
  width: min(100% , 1140px);
  margin-inline: auto;
  display: grid; gap: 1rem; align-items: center;
}
@media (min-width: 860px) { .cookie-banner__inner { grid-template-columns: 1fr auto; } }
.cookie-banner p { margin: 0; font-size: var(--step--1); }
.cookie-banner__actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
/* Accept and Reject are visually equal — no "nudge" design */
.cookie-banner__actions .btn { min-width: 132px; }

/* --------------------------------------------------------------------------
   11. UTILITIES
   -------------------------------------------------------------------------- */
.stack > * + * { margin-top: 1rem; }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-2 { margin-top: 2rem; }
.no-max { max-width: none; }
.mx-auto { margin-inline: auto; }
.portrait {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  width: 100%;
  max-width: 320px;
}
.to-top {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 90;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--brand-800); color: #fff;
  text-decoration: none;
  box-shadow: var(--shadow-md);
  opacity: 0; visibility: hidden; transition: opacity 0.2s ease;
}
.to-top.is-visible { opacity: 1; visibility: visible; }
.to-top:hover { background: var(--brand-900); color: #fff; }

/* --------------------------------------------------------------------------
   12. MOTION, PRINT, FORCED COLOURS
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .btn:hover, .card--link:hover { transform: none; }
}

@media (forced-colors: active) {
  .btn, .card, .price, .faq details { border: 1px solid CanvasText; }
  .trust-strip img { filter: none; }
}

@media print {
  .site-header, .cookie-banner, .to-top, .hero__actions, .btn { display: none !important; }
  body { color: #000; font-size: 11pt; }
  a::after { content: " (" attr(href) ")"; font-size: 9pt; word-break: break-all; }
  a[href^="#"]::after { content: ""; }
}
