/* ============================================================
   KA Group - Main stylesheet
   Brand-aligned: Fraunces + Mulish, KA Blue + Cream, secondary
   Sand / Sage / Clay per the brand sheet.
   ============================================================ */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
img, svg { display: block; max-width: 100%; }
button { cursor: pointer; font: inherit; }
input, select, textarea { font: inherit; }

/* ---------- Tokens (brand sheet palette) ---------- */
:root {
  /* Surfaces */
  --c-bg:            #FAF6EF;  /* Cream */
  --c-bg-card:       #FFFFFF;
  --c-bg-soft:       #F1ECE2;  /* Muted cream variant for blocks */
  --c-bg-sand:       #E8D7BE;  /* Sand - human warmth */

  /* Text */
  --c-text:          #2A2A2A;  /* Ink */
  --c-text-2:        #5C6470;  /* Slate */
  --c-text-3:        #98A0A8;

  /* Lines & borders */
  --c-border:        #E5DFD4;  /* Line */
  --c-border-strong: #C9C2B4;

  /* Brand accent */
  --c-accent:        #226CCB;  /* KA Blue */
  --c-accent-dark:   #174E94;  /* Blue Deep */
  --c-accent-soft:   #D9E7F7;  /* Blue Soft */

  /* Secondary palette */
  --c-clay:          #C48A6A;
  --c-sage:          #7FA88E;

  /* Feedback */
  --c-success-bg:    #E8F0EA;
  --c-success-text:  #3D5A48;
  --c-warn-bg:       #FBEFD7;
  --c-warn-text:     #6B4520;

  /* Typography */
  --font-serif: 'Fraunces', 'Charter', Georgia, serif;
  --font-sans:  'Mulish', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* Geometry */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;

  --shadow-sm: 0 1px 2px rgba(42, 42, 42, 0.04);
  --shadow-md: 0 4px 16px rgba(42, 42, 42, 0.06);
  --shadow-lg: 0 12px 32px rgba(42, 42, 42, 0.08);

  --t-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-med:  240ms cubic-bezier(0.4, 0, 0.2, 1);

  --container: 1120px;
  --pad: 1.25rem;
}

/* ---------- Base ---------- */
html { font-size: 17px; }
body {
  font-family: var(--font-sans);
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--c-text);
}
h1 { font-size: clamp(2rem, 4vw + 1rem, 3.5rem); font-variation-settings: 'opsz' 144; }
h2 { font-size: clamp(1.625rem, 1.5vw + 1rem, 2.25rem); font-variation-settings: 'opsz' 100; }
h3 { font-size: 1.25rem; font-variation-settings: 'opsz' 36; }
h4 { font-size: 1.0625rem; font-family: var(--font-sans); font-weight: 700; letter-spacing: -0.005em; }

em { font-style: italic; color: var(--c-accent-dark); font-weight: 400; }

p { line-height: 1.65; }
.lead { font-size: 1.15rem; color: var(--c-text-2); line-height: 1.6; max-width: 58ch; }

a { color: var(--c-accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color var(--t-fast); }
a:hover { color: var(--c-accent-dark); }
a:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 3px; border-radius: 2px; }

::selection { background: var(--c-accent); color: white; }

/* ---------- Layout helpers ---------- */
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--pad); }
.section { padding: 4rem 0; }
.section-tight { padding: 2.5rem 0; }
.eyebrow { font-size: 0.75rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--c-accent); font-weight: 700; display: block; margin-bottom: 0.875rem; }

/* ---------- Skip link ---------- */
.skip-link { position: absolute; top: -100px; left: 1rem; background: var(--c-text); color: var(--c-bg); padding: 0.625rem 1rem; border-radius: var(--r-sm); text-decoration: none; z-index: 100; transition: top var(--t-fast); }
.skip-link:focus { top: 1rem; color: var(--c-bg); }

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--c-border);
  background: rgba(250, 246, 239, 0.92);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  position: sticky; top: 0; z-index: 50;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 0.875rem 0; gap: 1rem; }
.logo { display: inline-flex; align-items: center; text-decoration: none; }
.logo-img { height: 40px; width: auto; display: block; }

.nav { display: flex; gap: 2.25rem; align-items: center; }
.nav a {
  color: var(--c-text-2);
  text-decoration: none;
  font-size: 0.9375rem;
  padding: 0.375rem 0;
  position: relative;
  transition: color var(--t-fast);
}
.nav a::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: -2px;
  height: 1.5px; background: var(--c-accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--t-med);
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--c-text); }
.nav a[aria-current="page"]::after, .nav a:hover::after { transform: scaleX(1); }

.menu-toggle {
  display: none;
  width: 40px; height: 40px;
  background: transparent;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-sm);
  align-items: center; justify-content: center;
  transition: background var(--t-fast);
}
.menu-toggle:hover { background: var(--c-bg-soft); }
.menu-toggle svg { width: 20px; height: 20px; }

/* ---------- Hero ---------- */
.hero { 
  padding: 5rem 0 3.5rem; 
  position: relative; 
  background-image: url('assets/hero-image.png');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  min-height: 600px;
  display: flex;
  align-items: center;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(34, 108, 203, 0.65) 0%, rgba(127, 168, 142, 0.45) 50%, rgba(250, 246, 239, 0.3) 100%);
  pointer-events: none;
}
.hero-content {
  position: relative;
  z-index: 1;
}
.hero h1 { max-width: 22ch; margin-top: 0.5rem; color: #FFFFFF; }
.hero .lead { margin-top: 1.25rem; color: rgba(255, 255, 255, 0.95); }
.hero .eyebrow { color: #D9E7F7; }
/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin: 3rem 0 0; }
.stat {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--r-md);
  padding: 1.5rem 1.5rem 1.25rem;
  backdrop-filter: blur(10px);
}
.stat-num {
  font-family: var(--font-serif);
  font-size: 2.75rem;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variation-settings: 'opsz' 144;
  color: var(--c-text);
  font-feature-settings: 'tnum';
}
.stat-label { font-size: 0.875rem; color: var(--c-text-2); margin-top: 0.625rem; }

/* ---------- Clinic cards ---------- */
.section-heading { display: flex; flex-direction: column; margin-bottom: 2rem; gap: 0.5rem; }
.section-heading > div { display: flex; flex-direction: column; gap: 0.5rem; }
.section-heading p { color: var(--c-text-2); max-width: 60ch; font-size: 0.9375rem; margin-top: 0.5rem; }

.clinic-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
.clinic-card {
  background: var(--c-bg-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 1.75rem;
  transition: transform var(--t-med), box-shadow var(--t-med), border-color var(--t-med);
  display: flex; flex-direction: column;
}
.clinic-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--c-border-strong);
}
.clinic-card h3 { font-size: 1.375rem; margin-bottom: 0.125rem; font-weight: 400; }
.clinic-location {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 300;
  font-size: 1rem;
  color: var(--c-clay);
  margin-bottom: 1.125rem;
  font-variation-settings: 'opsz' 24;
}
.clinic-row { display: flex; gap: 0.75rem; align-items: flex-start; margin: 0.5rem 0; font-size: 0.9375rem; line-height: 1.5; }
.clinic-row svg { width: 18px; height: 18px; color: var(--c-text-2); flex-shrink: 0; margin-top: 2px; stroke-width: 1.5; }
.clinic-row a { color: var(--c-text); text-decoration: none; border-bottom: 1px dotted var(--c-border-strong); font-feature-settings: 'tnum'; }
.clinic-row a:hover { color: var(--c-accent); border-bottom-color: var(--c-accent); }
.clinic-actions { display: flex; gap: 0.5rem; margin-top: auto; padding-top: 1.25rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6875rem 1.125rem;
  border-radius: var(--r-sm);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast), border-color var(--t-fast);
  border: 1px solid transparent;
  font-family: inherit;
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; stroke-width: 1.75; }
.btn-primary { background: var(--c-accent); color: white; }
.btn-primary:hover { background: var(--c-accent-dark); color: white; transform: translateY(-1px); }
.btn-secondary { background: var(--c-accent-soft); color: var(--c-accent-dark); flex: 1; font-weight: 700; }
.btn-secondary:hover { background: var(--c-accent); color: white; }
.btn-outline { background: transparent; color: var(--c-text); border-color: var(--c-border-strong); }
.btn-outline:hover { background: var(--c-bg-soft); border-color: var(--c-text-2); }
.btn-large { padding: 0.875rem 1.5rem; font-size: 1rem; }

/* ---------- CTA banner (Sand surface, "human warmth") ---------- */
.cta-banner {
  margin-top: 3rem;
  background: var(--c-bg-sand);
  border-radius: var(--r-lg);
  padding: 2rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.cta-banner-text h3 { font-family: var(--font-serif); font-size: 1.5rem; font-weight: 400; margin-bottom: 0.25rem; color: var(--c-text); }
.cta-banner-text p { color: var(--c-text); font-size: 0.95rem; }

/* ---------- About page specifics ---------- */
.page-header {
  padding: 4rem 0 3rem;
  border-bottom: 1px solid var(--c-border);
  margin-bottom: 3rem;
}
.page-header h1 { max-width: 24ch; margin-top: 0.5rem; }
.page-header .lead { margin-top: 1.25rem; }

.prose { max-width: 65ch; }
.prose p { margin-bottom: 1.25rem; color: var(--c-text); line-height: 1.7; }
.prose p:last-child { margin-bottom: 0; }
.prose h2 { margin-bottom: 1rem; }
.prose ul { padding-left: 1.25rem; margin-bottom: 1.25rem; line-height: 1.7; }
.prose li { margin-bottom: 0.375rem; }

.approach-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-top: 1rem; }
.approach-item {
  background: var(--c-bg-soft);
  padding: 1.5rem;
  border-radius: var(--r-md);
  display: flex; gap: 1rem;
}
.approach-item svg { width: 24px; height: 24px; color: var(--c-accent); flex-shrink: 0; margin-top: 2px; stroke-width: 1.5; }
.approach-item h3 { font-family: var(--font-sans); font-size: 1rem; font-weight: 700; margin-bottom: 0.25rem; letter-spacing: -0.005em; }
.approach-item p { font-size: 0.9375rem; color: var(--c-text-2); line-height: 1.55; }

.team-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.doctor-card {
  background: var(--c-bg-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 1.25rem;
  display: flex; gap: 1rem;
  align-items: center;
}
.avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--c-accent-soft);
  color: var(--c-accent-dark);
  display: grid; place-items: center;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.9375rem;
  flex-shrink: 0;
  letter-spacing: 0.01em;
}
.doctor-name { font-weight: 700; font-size: 0.9375rem; }
.doctor-spec { font-size: 0.8125rem; color: var(--c-text-2); margin-top: 0.125rem; }
.doctor-clinic {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 300;
  font-size: 0.875rem;
  color: var(--c-clay);
  margin-top: 0.375rem;
  font-variation-settings: 'opsz' 24;
}

.legal-box {
  background: var(--c-bg-soft);
  border-radius: var(--r-md);
  padding: 1.5rem 1.75rem;
  max-width: 580px;
}
.legal-table { width: 100%; font-size: 0.9375rem; border-collapse: collapse; }
.legal-table td { padding: 0.375rem 0; vertical-align: top; line-height: 1.5; font-feature-settings: 'tnum'; }
.legal-table td:first-child { color: var(--c-text-2); width: 38%; }
.legal-table thead td, .legal-table th { font-weight: 700; padding-bottom: 0.5rem; text-align: left; }

/* ---------- Contact page ---------- */
.urgent-note {
  display: flex; gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--c-warn-bg);
  border-radius: var(--r-md);
  margin-bottom: 2.5rem;
  border-left: 3px solid var(--c-warn-text);
}
.urgent-note svg { width: 20px; height: 20px; color: var(--c-warn-text); flex-shrink: 0; margin-top: 2px; stroke-width: 1.5; }
.urgent-note p { font-size: 0.9375rem; color: var(--c-warn-text); line-height: 1.55; }
.urgent-note a { color: var(--c-warn-text); text-decoration: underline; font-weight: 700; }

.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-bottom: 2.5rem; align-items: start; }
.contact-info { background: var(--c-bg-soft); border-radius: var(--r-md); padding: 1.75rem; }
.contact-info h2 { font-size: 1.25rem; margin-bottom: 1.5rem; }
.info-row { display: flex; gap: 0.75rem; align-items: flex-start; margin-bottom: 1.25rem; font-size: 0.9375rem; line-height: 1.55; }
.info-row svg { width: 18px; height: 18px; color: var(--c-accent); flex-shrink: 0; margin-top: 3px; stroke-width: 1.5; }
.info-label { display: block; font-weight: 700; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--c-text-2); margin-bottom: 0.125rem; }
.form-card { background: var(--c-bg-card); border: 1px solid var(--c-border); border-radius: var(--r-md); padding: 1.75rem; }
.form-field { margin-bottom: 1rem; }
.form-field label { display: block; font-size: 0.875rem; color: var(--c-text); margin-bottom: 0.375rem; font-weight: 500; }
.form-field input, .form-field select, .form-field textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  background: var(--c-bg);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-sm);
  color: var(--c-text);
  font-size: 0.9375rem;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  outline: none;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px var(--c-accent-soft);
}
.form-field textarea { min-height: 130px; resize: vertical; font-family: inherit; }
.consent { display: flex; gap: 0.625rem; align-items: flex-start; font-size: 0.875rem; color: var(--c-text-2); margin: 1.25rem 0 1rem; line-height: 1.5; }
.consent input[type="checkbox"] { margin-top: 3px; flex-shrink: 0; accent-color: var(--c-accent); }
.form-status { display: none; padding: 0.75rem 1rem; border-radius: var(--r-sm); font-size: 0.875rem; margin-top: 1rem; }
.form-status.success { display: block; background: var(--c-success-bg); color: var(--c-success-text); border-left: 3px solid var(--c-sage); }
.form-status.error { display: block; background: #FBE4E4; color: #8B2424; border-left: 3px solid #8B2424; }


/* ---------- Footer (Blue Deep knockout) ---------- */
.site-footer {
  background: var(--c-accent-dark);
  color: #E7EDF5;
  padding: 3rem 0 2rem;
  margin-top: 4rem;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2.5rem; margin-bottom: 2rem; }
.footer-brand p { color: rgba(231, 237, 245, 0.75); font-size: 0.875rem; line-height: 1.6; max-width: 36ch; margin-top: 1rem; }
.footer-col h4 { font-family: var(--font-sans); font-weight: 700; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.18em; color: rgba(231, 237, 245, 0.6); margin-bottom: 1rem; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.5rem; }
.footer-col a { color: rgba(231, 237, 245, 0.9); text-decoration: none; font-size: 0.875rem; transition: color var(--t-fast); }
.footer-col a:hover { color: white; }
.site-footer .logo-img { height: 48px; }
.footer-bottom {
  padding-top: 1.5rem;
  border-top: 1px solid rgba(231, 237, 245, 0.15);
  font-size: 0.8125rem;
  color: rgba(231, 237, 245, 0.6);
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}

/* ---------- Cookie banner ---------- */
.cookie-banner {
  position: fixed;
  bottom: 1.25rem; left: 1.25rem; right: 1.25rem;
  max-width: 560px;
  margin: 0 auto;
  background: var(--c-text);
  color: var(--c-bg);
  padding: 1.25rem 1.5rem;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  z-index: 60;
  display: none;
  align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
}
.cookie-banner.is-visible { display: flex; }
.cookie-banner p { font-size: 0.875rem; line-height: 1.5; flex: 1; min-width: 240px; }
.cookie-banner a { color: var(--c-bg); }
.cookie-banner .btn { padding: 0.5rem 0.875rem; font-size: 0.8125rem; }
.cookie-banner .btn-primary { background: var(--c-accent); color: white; }
.cookie-banner .btn-primary:hover { background: var(--c-accent-dark); color: white; }
.cookie-banner .btn-outline { color: var(--c-bg); border-color: rgba(250, 246, 239, 0.3); }
.cookie-banner .btn-outline:hover { background: rgba(250, 246, 239, 0.1); }
.cookie-actions { display: flex; gap: 0.5rem; }

/* ---------- Mobile menu drawer ---------- */
.mobile-drawer {
  display: none;
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 86%; max-width: 360px;
  background: var(--c-bg-card);
  z-index: 70;
  padding: 1.5rem;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform var(--t-med);
}
.mobile-drawer.is-open { display: flex; transform: translateX(0); }
.drawer-close { align-self: flex-end; width: 40px; height: 40px; background: transparent; border: 1px solid var(--c-border); border-radius: var(--r-sm); display: grid; place-items: center; }
.drawer-close svg { width: 20px; height: 20px; }
.drawer-nav { display: flex; flex-direction: column; gap: 0.25rem; margin-top: 2rem; }
.drawer-nav a { color: var(--c-text); text-decoration: none; font-family: var(--font-serif); font-size: 1.5rem; padding: 0.75rem 0; border-bottom: 1px solid var(--c-border); font-weight: 400; }
.drawer-nav a[aria-current="page"] { color: var(--c-accent); }
.drawer-backdrop { display: none; position: fixed; inset: 0; background: rgba(42, 42, 42, 0.5); z-index: 65; }
.drawer-backdrop.is-open { display: block; }
body.has-drawer-open { overflow: hidden; }

/* ---------- Mobile responsive ---------- */
@media (max-width: 800px) {
  html { font-size: 16px; }
  :root { --pad: 1rem; }
  .nav { display: none; }
  .menu-toggle { display: flex; }
  .logo-img { height: 34px; }

  .hero { padding: 2.5rem 0 1.5rem; min-height: 500px; }

  .stats { gap: 0.625rem; margin-top: 2rem; }
  .stat { padding: 1.125rem 0.875rem; }
  .stat-num { font-size: 2rem; }
  .stat-label { font-size: 0.75rem; margin-top: 0.375rem; }

  .section { padding: 2.5rem 0; }
  .section-heading { margin-bottom: 1.5rem; }

  .clinic-grid { grid-template-columns: 1fr; gap: 0.875rem; }
  .clinic-card { padding: 1.375rem; }
  .clinic-card h3 { font-size: 1.25rem; }

  .approach-grid { grid-template-columns: 1fr; }
  .team-grid { grid-template-columns: 1fr; }

  .contact-grid { grid-template-columns: 1fr; gap: 0.875rem; }

  .cta-banner { padding: 1.5rem; flex-direction: column; align-items: flex-start; text-align: left; }
  .cta-banner .btn { width: 100%; }

  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer-bottom { flex-direction: column; gap: 0.5rem; }
  .site-footer .logo-img { height: 42px; }

  .cookie-banner { left: 0.75rem; right: 0.75rem; bottom: 0.75rem; padding: 1rem 1.125rem; }
  .cookie-banner p { min-width: 100%; }
  .cookie-actions { width: 100%; }
  .cookie-actions .btn { flex: 1; }
}

/* ---------- Print ---------- */
@media print {
  .site-header, .site-footer, .cookie-banner, .mobile-drawer, .drawer-backdrop, .menu-toggle, .cta-banner, .clinic-actions { display: none !important; }
  body { background: white; color: black; }
  a { color: black; }
}

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

/* ---------- Page-load reveal ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.hero h1, .hero .lead, .stats, .section { animation: fadeUp 600ms cubic-bezier(0.2, 0.8, 0.2, 1) backwards; }
.hero h1 { animation-delay: 60ms; }
.hero .lead { animation-delay: 140ms; }
.stats { animation-delay: 220ms; }
.section:nth-of-type(1) { animation-delay: 300ms; }
