/* =========================================================================
   Dr I O Vawda — Specialist Paediatrician, Ladysmith
   Design system: calm cyan + health green, Figtree / Noto Sans, WCAG AAA
   Hand-crafted, dependency-free. Built by Asmal Digital / Dezignit.
   ========================================================================= */

/* ---- Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700;800&family=Noto+Sans:wght@400;500;600;700&display=swap');

/* ---- Tokens ---- */
:root {
  --color-primary: #0891B2;       /* calm cyan */
  --color-primary-dark: #0E7490;
  --color-on-primary: #FFFFFF;
  --color-secondary: #22D3EE;
  --color-accent: #059669;        /* health green (CTA) */
  --color-accent-dark: #047857;
  --color-warm: #F59E0B;          /* warm amber — paediatric touch, used sparingly */
  --color-warm-soft: #FEF3C7;
  --color-background: #ECFEFF;     /* page wash */
  --color-surface: #FFFFFF;
  --color-foreground: #164E63;     /* deep teal ink */
  --color-muted-fg: #4B6B78;
  --color-muted: #E8F1F6;
  --color-border: #A5F3FC;
  --color-border-soft: #D7EEF4;
  --color-destructive: #DC2626;
  --color-ring: #0891B2;

  --font-head: 'Figtree', system-ui, -apple-system, sans-serif;
  --font-body: 'Noto Sans', system-ui, -apple-system, sans-serif;

  --maxw: 1140px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(22,78,99,.06), 0 1px 3px rgba(22,78,99,.08);
  --shadow-md: 0 4px 12px rgba(22,78,99,.08), 0 2px 4px rgba(22,78,99,.06);
  --shadow-lg: 0 18px 40px rgba(8,145,178,.14);
  --space: clamp(3rem, 6vw, 5.5rem);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: 1.0625rem;          /* 17px */
  line-height: 1.65;
  color: var(--color-foreground);
  background: var(--color-background);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: var(--color-primary-dark); text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* ---- Accessibility ---- */
:focus-visible { outline: 3px solid var(--color-ring); outline-offset: 2px; border-radius: 4px; }
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--color-foreground); color: #fff; padding: .75rem 1.25rem; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ---- Typography ---- */
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; line-height: 1.15; color: var(--color-foreground); letter-spacing: -.01em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.45rem); }
.lead { font-size: clamp(1.1rem, 2vw, 1.3rem); color: var(--color-muted-fg); }
.eyebrow { font-family: var(--font-head); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; color: var(--color-primary); }

/* ---- Layout ---- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(1.1rem, 4vw, 2rem); }
.section { padding-block: var(--space); }
.section--muted { background: var(--color-muted); }
.section--tint { background: linear-gradient(180deg, #fff 0%, var(--color-background) 100%); }
.center { text-align: center; }
.measure { max-width: 60ch; }
.center .measure { margin-inline: auto; }
.grid { display: grid; gap: clamp(1.25rem, 3vw, 2rem); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: .55rem; cursor: pointer;
  font-family: var(--font-head); font-weight: 600; font-size: 1rem;
  padding: .85rem 1.5rem; border-radius: 999px; border: 2px solid transparent;
  transition: transform .15s ease, background .2s ease, box-shadow .2s ease;
  min-height: 48px; text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--color-accent); color: #fff; box-shadow: var(--shadow-md); }
.btn--primary:hover { background: var(--color-accent-dark); }
.btn--secondary { background: var(--color-surface); color: var(--color-primary-dark); border-color: var(--color-border); }
.btn--secondary:hover { background: var(--color-muted); }
.btn--ghost { background: transparent; color: var(--color-on-primary); border-color: rgba(255,255,255,.6); }
.btn--ghost:hover { background: rgba(255,255,255,.12); }
.btn svg { width: 20px; height: 20px; }

/* ---- Header ---- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.92); backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--color-border-soft);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 72px; }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--color-foreground); }
.brand__mark {
  width: 42px; height: 42px; border-radius: 12px; flex: none;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  display: grid; place-items: center; color: #fff; box-shadow: var(--shadow-sm);
}
.brand__mark svg { width: 24px; height: 24px; }
.brand__name { font-family: var(--font-head); font-weight: 800; font-size: 1.05rem; line-height: 1.1; }
.brand__name span { display: block; font-weight: 500; font-size: .72rem; letter-spacing: .04em; color: var(--color-muted-fg); text-transform: uppercase; }
.nav__links { display: flex; align-items: center; gap: .35rem; list-style: none; padding: 0; }
.nav__links a { font-family: var(--font-head); font-weight: 600; color: var(--color-foreground); text-decoration: none; padding: .5rem .8rem; border-radius: 8px; }
.nav__links a:hover, .nav__links a[aria-current="page"] { background: var(--color-muted); color: var(--color-primary-dark); }
.nav__cta { margin-left: .4rem; }
.nav__toggle { display: none; background: none; border: 0; cursor: pointer; padding: .5rem; border-radius: 8px; color: var(--color-foreground); }
.nav__toggle svg { width: 28px; height: 28px; }
@media (max-width: 860px) {
  .nav__links {
    position: fixed; inset: 72px 0 auto 0; flex-direction: column; align-items: stretch; gap: .25rem;
    background: #fff; padding: 1rem clamp(1.1rem,4vw,2rem) 1.5rem; border-bottom: 1px solid var(--color-border-soft);
    box-shadow: var(--shadow-lg); transform: translateY(-120%); transition: transform .25s ease; visibility: hidden;
  }
  .nav__links.is-open { transform: translateY(0); visibility: visible; }
  .nav__links a { padding: .8rem 1rem; font-size: 1.1rem; }
  .nav__cta { margin: .5rem 0 0; }
  .nav__toggle { display: inline-grid; place-items: center; }
}

/* ---- Hero ---- */
.hero { position: relative; overflow: hidden; background: linear-gradient(160deg, #CFFAFE 0%, #ECFEFF 55%, #fff 100%); }
.hero__inner { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(2rem,5vw,4rem); align-items: center; padding-block: clamp(3rem,7vw,6rem); }
@media (max-width: 900px) { .hero__inner { grid-template-columns: 1fr; } }
.hero h1 { margin-bottom: 1rem; }
.hero .lead { margin-bottom: 1.75rem; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: .85rem; }
.hero__card {
  background: #fff; border: 1px solid var(--color-border-soft); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: clamp(1.4rem, 3vw, 2rem);
}
.hero__card h3 { display: flex; align-items: center; gap: .5rem; margin-bottom: 1rem; }
.factline { display: flex; gap: .75rem; padding: .6rem 0; border-bottom: 1px dashed var(--color-border-soft); }
.factline:last-child { border-bottom: 0; }
.factline svg { width: 22px; height: 22px; color: var(--color-primary); flex: none; margin-top: 2px; }
.factline strong { display: block; font-family: var(--font-head); }
.factline span { color: var(--color-muted-fg); font-size: .95rem; }

/* ---- Pills / badges ---- */
.pills { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; }
.pill { background: #fff; border: 1px solid var(--color-border); color: var(--color-primary-dark); font-family: var(--font-head); font-weight: 600; font-size: .85rem; padding: .35rem .85rem; border-radius: 999px; }
.pill--warm { background: var(--color-warm-soft); border-color: #FCD34D; color: #92400E; }

/* ---- Cards ---- */
.card { background: var(--color-surface); border: 1px solid var(--color-border-soft); border-radius: var(--radius-lg); padding: clamp(1.3rem, 2.5vw, 1.8rem); box-shadow: var(--shadow-sm); transition: transform .2s ease, box-shadow .2s ease; }
/* Equal-height cards only inside grids; standalone cards size to content */
.grid > .card { height: 100%; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card__icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--color-muted); color: var(--color-primary); margin-bottom: 1rem; }
.card__icon svg { width: 28px; height: 28px; }
.card h3 { margin-bottom: .5rem; }
.card p { color: var(--color-muted-fg); }

/* ---- Page header (interior pages) ---- */
.page-head { background: linear-gradient(160deg, #CFFAFE, #ECFEFF); padding-block: clamp(2.5rem,5vw,4rem); border-bottom: 1px solid var(--color-border-soft); }
.page-head .eyebrow { margin-bottom: .5rem; }

/* ---- Trust strip ---- */
.trust { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(1.5rem, 5vw, 3.5rem); align-items: center; }
.trust__item { text-align: center; }
.trust__num { font-family: var(--font-head); font-weight: 800; font-size: clamp(1.8rem, 4vw, 2.6rem); color: var(--color-primary); line-height: 1; }
.trust__label { color: var(--color-muted-fg); font-size: .95rem; margin-top: .35rem; }

/* ---- Definition rows (patient info) ---- */
.rows { border: 1px solid var(--color-border-soft); border-radius: var(--radius-lg); overflow: hidden; background: #fff; }
.row { display: grid; grid-template-columns: 220px 1fr; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--color-border-soft); }
.row:last-child { border-bottom: 0; }
.row dt { font-family: var(--font-head); font-weight: 700; }
.row dd { color: var(--color-muted-fg); margin: 0; }
@media (max-width: 640px) { .row { grid-template-columns: 1fr; gap: .15rem; } }

/* ---- Lists ---- */
.ticks { list-style: none; padding: 0; display: grid; gap: .7rem; }
.ticks li { display: flex; gap: .65rem; }
.ticks svg { width: 22px; height: 22px; color: var(--color-accent); flex: none; margin-top: 2px; }

/* ---- Contact ---- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem,4vw,2.5rem); align-items: start; }
@media (max-width: 800px) { .contact-grid { grid-template-columns: 1fr; } }
.map-embed { width: 100%; aspect-ratio: 16/11; border: 0; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }

/* ---- CTA band ---- */
.cta-band { background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark)); color: #fff; border-radius: var(--radius-lg); padding: clamp(2rem, 5vw, 3.5rem); text-align: center; box-shadow: var(--shadow-lg); }
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,.9); margin: .75rem auto 1.75rem; max-width: 50ch; }
.cta-band .btn--primary { background: #fff; color: var(--color-primary-dark); }
.cta-band .btn--primary:hover { background: var(--color-warm-soft); }

/* ---- Footer ---- */
.site-footer { background: var(--color-foreground); color: #CFE9F1; padding-block: clamp(2.5rem,5vw,3.5rem) 1.5rem; margin-top: var(--space); }
.site-footer a { color: #CFE9F1; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; } }
.site-footer h4 { color: #fff; font-size: 1rem; margin-bottom: .85rem; }
.site-footer ul { list-style: none; padding: 0; display: grid; gap: .5rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 2rem; padding-top: 1.25rem; font-size: .85rem; color: #9FC7D4; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; }
.footer-brand { display: flex; align-items: center; gap: .6rem; margin-bottom: .75rem; }
.footer-brand .brand__mark { width: 36px; height: 36px; }
.footer-emergency { background: rgba(220,38,38,.14); border: 1px solid rgba(248,113,113,.4); border-radius: 12px; padding: .85rem 1rem; margin-top: 1rem; font-size: .9rem; }
.footer-emergency strong { color: #fff; }

/* ---- Media / images ---- */
.media-wrap { position: relative; }
.media { width: 100%; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); object-fit: cover; display: block; }
.media--portrait { aspect-ratio: 4 / 5; }
.media--wide { aspect-ratio: 16 / 10; }
.placeholder-tag { position: absolute; top: .65rem; left: .65rem; background: rgba(22,78,99,.82); color: #fff; font-family: var(--font-head); font-weight: 600; font-size: .68rem; letter-spacing: .03em; text-transform: uppercase; padding: .25rem .6rem; border-radius: 7px; }

/* ---- Nav CTA: keep button text white (override nav link colour) ---- */
.nav__links .btn--primary,
.nav__links .btn--primary:hover,
.nav__links .btn--primary:focus { color: var(--color-on-primary); }
.nav__links .btn--primary:hover { background: var(--color-accent-dark); }

/* ---- Scroll-reveal animations (only when JS on; respects reduced motion) ---- */
html.js .hero > .container > div > *,
html.js .hero__card,
html.js .page-head .eyebrow,
html.js .page-head h1,
html.js .page-head .lead,
html.js .section .eyebrow,
html.js .section > .container > .center > *,
html.js .card,
html.js .trust__item,
html.js .rows,
html.js .media-wrap,
html.js .cta-band,
html.js .pills,
html.js .ticks {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .65s cubic-bezier(.2,.7,.3,1), transform .65s cubic-bezier(.2,.7,.3,1);
  will-change: opacity, transform;
}
html.js .is-in { opacity: 1 !important; transform: none !important; }
/* Stagger groups of cards / items */
html.js .grid > .card:nth-child(2),
html.js .trust__item:nth-child(2) { transition-delay: .08s; }
html.js .grid > .card:nth-child(3),
html.js .trust__item:nth-child(3) { transition-delay: .16s; }
html.js .grid > .card:nth-child(4),
html.js .trust__item:nth-child(4) { transition-delay: .24s; }
html.js .grid > .card:nth-child(5) { transition-delay: .32s; }
html.js .grid > .card:nth-child(6) { transition-delay: .40s; }

/* Soft entrance for the hero gradient */
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.hero__card { animation: floaty 7s ease-in-out 1.2s infinite; }
.brand__mark { transition: transform .25s ease; }
.brand:hover .brand__mark { transform: rotate(-6deg) scale(1.06); }
.card__icon { transition: transform .25s ease, background .25s ease; }
.card:hover .card__icon { transform: scale(1.08); background: var(--color-border); }

@media (prefers-reduced-motion: reduce) {
  html.js .hero > .container > div > *, html.js .hero__card, html.js .page-head .eyebrow,
  html.js .page-head h1, html.js .page-head .lead, html.js .section .eyebrow,
  html.js .section > .container > .center > *, html.js .card, html.js .trust__item,
  html.js .rows, html.js .media-wrap, html.js .cta-band, html.js .pills, html.js .ticks {
    opacity: 1 !important; transform: none !important; transition: none !important;
  }
  .hero__card { animation: none !important; }
}

/* ---- Reviews section ---- */
.reviews-head { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem 2rem; justify-content: center; }
.rating-badge { display: flex; align-items: center; gap: 1rem; background: #fff; border: 1px solid var(--color-border-soft); border-radius: var(--radius-lg); padding: 1rem 1.4rem; box-shadow: var(--shadow-sm); }
.rating-badge__num { font-family: var(--font-head); font-weight: 800; font-size: 2.6rem; line-height: 1; color: var(--color-foreground); }
.stars { display: inline-flex; gap: 2px; color: var(--color-warm); }
.stars svg { width: 20px; height: 20px; }
.rating-badge small { display: block; color: var(--color-muted-fg); font-size: .9rem; margin-top: .2rem; }
.google-mark { font-family: var(--font-head); font-weight: 700; color: var(--color-muted-fg); font-size: .9rem; }

/* ---- Utilities ---- */
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.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; }
