/* =========================================================
   Dr John Mackintosh — Respiratory Physician, Brisbane
   Design tokens for a warm, approachable patient-facing feel:
   calming medical teal + soft green, warm off-white grounds,
   soft rounded "soft-UI" cards with gentle shadows, and
   Lexend (reading-ease optimised) for headings paired with
   Source Sans 3 for body — a pairing suited to healthcare
   and accessibility (patients reading about a diagnosis
   benefit from lower visual/reading strain).
   ========================================================= */

:root {
  --ink: #1c2e2a;
  --ink-soft: #55685f;
  --accent: #0f8a7a;
  --accent-dark: #0b6b5f;
  --accent-soft: #e6f4f1;
  --paper: #fdfbf7;
  --panel: #eff6f3;
  --line: #dde6e1;
  --line-soft: #e9f1ed;
  --focus: #c05621;
  --max: 1120px;
  --measure: 42em;
  --radius: 20px;
  --shadow-soft: 0 8px 24px -12px rgba(28, 46, 42, 0.16);
  --shadow-lift: 0 16px 40px -16px rgba(28, 46, 42, 0.22);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-soft);
  font-family: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: "Lexend", "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.3rem, 1.7rem + 2.6vw, 3.6rem); font-weight: 600; letter-spacing: -0.015em; margin: 0 0 0.35em; }
h2 { font-size: clamp(1.6rem, 1.4rem + 1vw, 2.2rem); line-height: 1.25; margin: 1.3em 0 0.6em; }
h3 { font-size: 1.18rem; line-height: 1.35; margin: 1.4em 0 0.5em; font-weight: 600; }

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

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-dark); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

::selection { background: var(--accent-soft); color: var(--ink); }

.container { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 10px 18px;
  z-index: 100;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ---------- Header / nav — light, warm and welcoming ---------- */
header.site-header {
  background: rgba(253, 251, 247, 0.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
  position: sticky;
  top: 0;
  z-index: 20;
  transition: box-shadow 0.3s ease;
}
header.site-header.is-scrolled {
  box-shadow: 0 2px 20px -10px rgba(28, 46, 42, 0.25);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
  gap: 16px;
  min-height: 46px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.brand-mark {
  height: 42px;
  width: auto;
  flex: none;
  display: block;
}
.brand-text { line-height: 1.25; }
.brand-name {
  font-family: "Lexend", sans-serif;
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--ink);
}
.brand-role { font-size: 0.75rem; color: var(--ink-soft); }

nav.main-nav ul {
  list-style: none;
  display: flex;
  gap: 24px;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
  align-items: center;
}
nav.main-nav a {
  position: relative;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 2px;
}
nav.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 3px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transition: right 0.25s ease;
}
nav.main-nav a:hover,
nav.main-nav a[aria-current="page"] {
  color: var(--accent-dark);
}
nav.main-nav a:hover::after,
nav.main-nav a[aria-current="page"]::after {
  right: 0;
}
.nav-toggle {
  display: none;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 10px;
}

@media (max-width: 860px) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 0.9rem;
    cursor: pointer;
  }
  nav.main-nav {
    display: none;
    width: 100%;
  }
  nav.main-nav.open { display: block; }
  .site-header .container { flex-wrap: wrap; }
  nav.main-nav ul { flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px 0 14px; }
}

/* ---------- Hero — warm, personal "meet your doctor" layout ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 60px 0 64px;
  background:
    radial-gradient(560px 420px at 88% -10%, var(--accent-soft), transparent 70%),
    var(--paper);
}
.hero .container {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
  text-align: left;
}
.hero .container > * { min-width: 0; }
.hero-portrait { max-width: 320px; justify-self: end; position: relative; }
@media (max-width: 780px) {
  .hero .container { grid-template-columns: 1fr; text-align: center; }
  .hero-portrait { order: -1; max-width: 240px; margin: 0 auto 8px; justify-self: stretch; }
  .hero p.lede { margin-left: auto; margin-right: auto; }
}
.eyebrow {
  display: inline-block;
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.01em;
  padding: 5px 14px;
  border-radius: 980px;
  margin: 0 0 16px;
}
.hero p.lede {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 42em;
}
.credential-line {
  color: var(--ink);
  font-weight: 600;
  margin-bottom: 10px;
}

/* Watermark accent retired */
.watermark-word { display: none; }
.page-intro { position: relative; background: linear-gradient(180deg, var(--accent-soft), transparent 65%); }
.page-intro > .container:not(.two-col) { text-align: center; }
.page-intro > .container:not(.two-col) .lede { margin-left: auto; margin-right: auto; }
.page-intro > .container:not(.two-col) .btn-row { justify-content: center; }

.hero-portrait::before {
  content: "";
  position: absolute;
  inset: -16px;
  background: linear-gradient(155deg, var(--accent-soft), #fff);
  border-radius: 32px;
  z-index: 0;
}
.hero-portrait img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  border-radius: 22px;
  display: block;
  box-shadow: var(--shadow-lift);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff !important;
  padding: 13px 26px;
  border-radius: 980px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  border: 1px solid var(--accent);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.btn.secondary {
  background: #fff;
  color: var(--ink) !important;
  border: 1px solid var(--line);
  box-shadow: none;
}
.btn.secondary:hover { border-color: var(--accent); color: var(--accent-dark) !important; transform: translateY(-1px); }
.btn-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 26px; }

/* ---------- Sections ---------- */
section.block { padding: 60px 0; }
section.block.panel { background: var(--panel); }
.section-head { max-width: 700px; margin: 0 auto 8px; text-align: center; }
.section-head p { margin-left: auto; margin-right: auto; }

/* ---------- Expertise cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
  margin-top: 32px;
}
.card {
  background: #fff;
  border-radius: var(--radius);
  padding: 28px;
  text-align: left;
  box-shadow: var(--shadow-soft);
  border-top: 3px solid var(--accent);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }
.card a.card-link {
  display: inline-block;
  margin-top: 10px;
  font-weight: 600;
}

/* ---------- Stat blocks ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 20px;
  text-align: left;
}
.stat-grid.tight { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.stat {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 22px 24px;
}
.stat .num {
  display: block;
  font-family: "Lexend", sans-serif;
  font-weight: 600;
  font-size: clamp(1.9rem, 1.6rem + 1.2vw, 2.6rem);
  line-height: 1;
  color: var(--accent-dark);
  letter-spacing: -0.01em;
}
.stat .num .unit { font-size: 0.55em; font-weight: 600; color: var(--accent); margin-left: 2px; }
.stat .label {
  display: block;
  margin-top: 10px;
  font-size: 0.9rem;
  color: var(--ink-soft);
  max-width: 18em;
}

/* ---------- Two column ---------- */
.two-col {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  text-align: left;
}
.two-col > * { min-width: 0; }
.two-col img { max-width: 340px; height: auto; justify-self: end; border-radius: var(--radius); box-shadow: var(--shadow-soft); }
@media (max-width: 780px) { .two-col { grid-template-columns: 1fr; } }

/* ---------- Timeline / position list ---------- */
.timeline { list-style: none; margin: 0; padding: 0; text-align: left; }
.timeline li {
  border-left: 2px solid var(--line);
  padding: 0 0 24px 22px;
  position: relative;
  max-width: none;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}
.timeline .when {
  font-size: 0.85rem;
  color: var(--accent-dark);
  font-weight: 600;
  display: block;
  margin-bottom: 2px;
}
.timeline .what { font-weight: 600; color: var(--ink); }
.timeline .where { color: var(--ink-soft); font-size: 0.95rem; }

/* ---------- Publication list ---------- */
.pub-list { list-style: none; margin: 0; padding: 0; text-align: left; }
.pub-list li {
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
  max-width: none;
  font-size: 0.97rem;
}
.pub-list li:first-child { padding-top: 0; }
.pub-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-radius: 4px;
  padding: 2px 7px;
  margin-right: 8px;
  vertical-align: middle;
}

/* ---------- Imaging figures ---------- */
.imaging-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 22px;
  margin-top: 20px;
  text-align: left;
}
.imaging-grid figure {
  margin: 0;
  background: #fff;
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow-soft);
}
.imaging-grid img { width: 100%; height: auto; display: block; border-radius: 12px; }
.imaging-grid figcaption {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.imaging-grid figcaption strong { color: var(--ink); display: block; margin-bottom: 2px; }

/* ---------- Video embed ---------- */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 20px;
  text-align: left;
}
.video-embed {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--ink);
  box-shadow: var(--shadow-soft);
}
.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.video-caption {
  margin-top: 10px;
  font-size: 0.92rem;
  color: var(--ink-soft);
}
.video-caption strong { color: var(--ink); }

/* ---------- FAQ — soft rounded, inviting to open ---------- */
.faq { text-align: left; }
.faq details {
  background: #fff;
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-soft);
}
.faq summary {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink);
  cursor: pointer;
}
.faq details[open] summary { margin-bottom: 12px; color: var(--accent-dark); }

/* ---------- Callout ---------- */
.callout {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 24px 28px;
  text-align: left;
}
.callout p:last-child { margin-bottom: 0; }

/* ---------- Referral / contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 22px;
  margin-top: 12px;
  text-align: left;
}
.contact-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 24px 26px;
  box-shadow: var(--shadow-soft);
}
.contact-card h3 { margin-top: 0; font-size: 1.05rem; }
.contact-card p { margin-bottom: 6px; font-size: 0.97rem; }
.contact-card .label { color: var(--ink-soft); font-size: 0.85rem; }

table.referral-checklist {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  text-align: left;
}
table.referral-checklist th,
table.referral-checklist td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.95rem;
}
table.referral-checklist th { color: var(--ink); }


/* ---------- Footer — warm and calm, not corporate-dark ---------- */
footer.site-footer {
  background: var(--ink);
  color: #cfe0da;
  padding: 48px 0 26px;
  margin-top: 0;
  font-size: 0.88rem;
  text-align: left;
}
footer.site-footer a { color: #e3f0eb; }
footer.site-footer a:hover { color: #fff; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 32px;
}
@media (max-width: 780px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-grid h4 {
  color: #fff;
  font-family: "Lexend", sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 0 0 14px;
}
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 8px; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.14);
  margin-top: 32px;
  padding-top: 18px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.8rem;
  color: #9fb5ac;
}

/* ---------- Ask-us form ---------- */
.ask-form-notice {
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 18px;
  margin: 20px 0;
  font-size: 0.92rem;
  color: var(--ink);
}
.ask-form-notice strong { color: var(--accent-dark); }
.ask-form { max-width: 560px; }
.ask-form label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
  margin-bottom: 6px;
}
.ask-form .field { margin-bottom: 18px; }
.ask-form input[type="text"],
.ask-form input[type="email"],
.ask-form textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
.ask-form textarea { resize: vertical; min-height: 120px; }
.ask-form input:focus-visible, .ask-form textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.ask-form-status { margin-top: 12px; font-size: 0.88rem; color: var(--ink-soft); }

/* ---------- Utility ---------- */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
