/* =========================================================================
   Umhlanga Dog & Cat Parlour — shared styles
   Design language: "Bath time" — bubble blue ground, navy ink, towel-blue
   brand, tangerine "tennis ball" accent. Bricolage Grotesque + Nunito Sans.

   Token roles are kept strictly separate to avoid the known bugs:
   - --on-brand / --accent-on-dark  : text sitting ON saturated/dark bands.
     These stay fixed in BOTH themes (not swapped with surface colours).
   - --surface / --ink              : card fill + text on the page's own
     swappable ground. These DO flip in dark mode.
   Never reuse a surface token for text-on-band, or vice versa.
   ========================================================================= */

:root {
  --ground: #F2F8FB;
  --surface: #FFFFFF;
  --surface-2: #E9F2F8;   /* subtle alt card fill on the light ground */
  --ink: #13283A;
  --muted: #4C6275;
  --brand: #17598C;        /* CTA fill — white text ok */
  --brand-hover: #12476F;
  --brand-text: #17598C;   /* brand as small text on the ground */
  --ball: #FF9A3D;         /* tangerine fill — DARK ink on it, never white */
  --ink-on-fill: #13283A;  /* text on tangerine — fixed both themes */
  --ball-text: #A34A00;    /* tangerine as small text on the ground */
  --on-brand: #FFFFFF;     /* text on brand/dark bands — fixed both themes */
  --accent-on-dark: #FFB878; /* tangerine light text on dark bands — fixed */
  --band: #0F2233;         /* always-dark header/hero/footer/CTA/panel band */
  --band-2: #16344C;       /* raised block INSIDE a dark band (not a light card) */
  --border: #D4E3EC;
  --border-on-dark: rgba(255,255,255,0.16);
  --shadow: 0 6px 24px rgba(19,40,58,0.10);
  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 1080px;
  --font-head: 'Bricolage Grotesque', system-ui, -apple-system, Segoe UI, sans-serif;
  --font-body: 'Nunito Sans', system-ui, -apple-system, Segoe UI, sans-serif;
}

html[data-theme="dark"] {
  --ground: #0E1822;
  --surface: #172633;
  --surface-2: #1E3041;
  --ink: #EAF3F8;
  --muted: #9FB6C6;
  --brand: #2C77B0;
  --brand-hover: #3A88C4;
  --brand-text: #9CCBEE;
  --ball-text: #FFB878;
  --band: #08111A;
  --band-2: #122234;
  --border: #243A4C;
  --border-on-dark: rgba(255,255,255,0.14);
  --shadow: 0 6px 24px rgba(0,0,0,0.45);
}

/* ---- reset-ish ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--ground);
  overflow-wrap: break-word;
  word-wrap: break-word;
}
h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink);
  margin: 0 0 0.5em;
  overflow-wrap: break-word;
}
h1 { font-size: clamp(2rem, 6vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.2rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1rem; }
a { color: var(--brand-text); }
img { max-width: 100%; height: auto; display: block; }
:focus-visible { outline: 3px solid var(--ball); outline-offset: 2px; border-radius: 4px; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--band); color: var(--on-brand); padding: .75rem 1rem; border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

/* =========================================================================
   Buttons
   ========================================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--font-body); font-weight: 700; font-size: 1rem;
  padding: .8rem 1.3rem; border-radius: 999px; border: 2px solid transparent;
  cursor: pointer; text-decoration: none; text-align: center;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .05s ease;
  max-width: 100%; overflow-wrap: break-word; white-space: normal;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #FFFFFF; border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: #FFFFFF; }
.btn-accent { background: var(--ball); color: var(--ink-on-fill); border-color: var(--ball); }
.btn-accent:hover { background: #FF8A1F; border-color: #FF8A1F; color: var(--ink-on-fill); }
.btn-ghost { background: transparent; color: var(--brand-text); border-color: var(--brand); }
.btn-ghost:hover { background: var(--brand); color: #FFFFFF; }
.btn-block { width: 100%; }
.btn-lg { font-size: 1.1rem; padding: .95rem 1.6rem; }

/* =========================================================================
   Header
   ========================================================================= */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--band); color: var(--on-brand);
  border-bottom: 1px solid var(--border-on-dark);
}
.site-header .container {
  display: flex; align-items: center; gap: 1rem; min-height: 64px; padding-top: .5rem; padding-bottom: .5rem;
}
.brand-lockup { display: flex; flex-direction: column; text-decoration: none; min-width: 0; margin-right: auto; }
.brand-name { font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; color: var(--on-brand); line-height: 1.1; }
.brand-sub { font-size: .78rem; color: var(--accent-on-dark); font-weight: 600; }
.site-header .brand-lockup:hover .brand-name { text-decoration: underline; }

.main-nav { display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; }
.main-nav a {
  color: var(--on-brand); text-decoration: none; font-weight: 600; font-size: .95rem;
  padding: .45rem .6rem; border-radius: var(--radius-sm); white-space: nowrap;
}
.main-nav a:hover { background: rgba(255,255,255,0.12); color: var(--on-brand); }
.main-nav a[aria-current="page"] { color: var(--accent-on-dark); }
.main-nav a[aria-current="page"]:hover { color: var(--accent-on-dark); }

.header-actions { display: flex; align-items: center; gap: .5rem; }
/* header CTA uses explicit colours so band link rules never override it */
.header-cta.btn-accent { color: var(--ink-on-fill); }

/* Theme toggle */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; flex: none; border-radius: 999px;
  background: rgba(255,255,255,0.10); color: var(--on-brand);
  border: 1px solid var(--border-on-dark); cursor: pointer; padding: 0;
}
.theme-toggle:hover { background: rgba(255,255,255,0.20); color: var(--on-brand); }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* =========================================================================
   Generic sections / cards
   ========================================================================= */
.section { padding: 3.25rem 0; }
.section-tight { padding: 2.25rem 0; }
.section h2 { margin-bottom: .35em; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 60ch; }
.eyebrow {
  display: inline-block; font-family: var(--font-head); font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; font-size: .8rem;
  color: var(--ball-text); margin-bottom: .5rem;
}

.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid > * { min-width: 0; } /* prevent blow-out at narrow widths */

.card {
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem; box-shadow: var(--shadow); min-width: 0;
}
.card h3 { color: var(--ink); }
.card p:last-child { margin-bottom: 0; }

.chip {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--ball); color: var(--ink-on-fill);
  font-weight: 700; font-size: .82rem; padding: .3rem .7rem; border-radius: 999px;
  border: 1px solid transparent;
}
.chip-soft {
  background: var(--surface-2); color: var(--ink); border: 1px solid var(--border);
  font-weight: 600;
}
.chip-confirm { background: var(--ball); color: var(--ink-on-fill); }

/* definition list used for NAP */
dl.nap { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: .4rem 1rem; }
dl.nap dt { font-weight: 700; color: var(--muted); }
dl.nap dd { margin: 0; color: var(--ink); overflow-wrap: break-word; }

.note {
  font-size: .92rem; color: var(--muted); font-style: italic;
}
.attribution { font-size: .85rem; color: var(--muted); }

/* =========================================================================
   Hero (always-dark band)
   ========================================================================= */
.hero { background: var(--band); color: var(--on-brand); overflow: hidden; }
.hero .container { display: grid; grid-template-columns: 1.1fr 1fr; gap: 2rem; align-items: center; padding-top: 3rem; padding-bottom: 3rem; }
.hero-media img { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; object-fit: cover; }
.hero-figure { margin: 0; }
.hero-figure figcaption { font-size: .78rem; color: var(--accent-on-dark); margin-top: .5rem; }
.hero .cta-row { margin-top: 1.5rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: .75rem; }

/* =========================================================================
   ALWAYS-DARK BAND RULES
   Any element inside .band / .hero / .site-footer / .panel-dark is sitting on
   a dark ground. Force EVERY text role (h1-h4, p, li, a, dt, dd, notes,
   chips, buttons) to the on-dark tokens so nothing inherits an invisible
   light-mode colour, and so no page-level link/button rule overrides them.
   No light .card is allowed inside these bands — use .block-dark instead.
   ========================================================================= */
.band { background: var(--band); color: var(--on-brand); }
.hero, .band, .site-footer, .panel-dark {
  color: var(--on-brand);
}
.hero h1, .hero h2, .hero h3, .hero h4, .hero p, .hero li, .hero dd,
.band h1, .band h2, .band h3, .band h4, .band p, .band li, .band dd,
.site-footer h1, .site-footer h2, .site-footer h3, .site-footer h4,
.site-footer p, .site-footer li, .site-footer dd,
.panel-dark h1, .panel-dark h2, .panel-dark h3, .panel-dark h4,
.panel-dark p, .panel-dark li, .panel-dark dd {
  color: var(--on-brand);
}
.hero dl.nap dt, .band dl.nap dt, .site-footer dl.nap dt, .panel-dark dl.nap dt { color: var(--accent-on-dark); }
.hero dl.nap dd, .band dl.nap dd, .site-footer dl.nap dd, .panel-dark dl.nap dd { color: var(--on-brand); }
.hero .lead, .band .lead, .site-footer .lead, .panel-dark .lead { color: #D7E6F0; }
.hero .note, .band .note, .site-footer .note, .panel-dark .note { color: var(--accent-on-dark); }
.hero .eyebrow, .band .eyebrow, .site-footer .eyebrow, .panel-dark .eyebrow { color: var(--accent-on-dark); }
.hero .attribution, .band .attribution, .site-footer .attribution, .panel-dark .attribution { color: #BBD0DE; }

/* links inside dark bands */
.hero a:not(.btn), .band a:not(.btn), .site-footer a:not(.btn), .panel-dark a:not(.btn) {
  color: var(--accent-on-dark); text-decoration: underline;
}
.hero a:not(.btn):hover, .band a:not(.btn):hover,
.site-footer a:not(.btn):hover, .panel-dark a:not(.btn):hover { color: #FFD0A3; }

/* Buttons inside dark bands: re-assert explicit text colours so the band
   link-colour rule above can NEVER override button text. */
.hero .btn-primary, .band .btn-primary, .site-footer .btn-primary, .panel-dark .btn-primary { color: #FFFFFF; }
.hero .btn-accent, .band .btn-accent, .site-footer .btn-accent, .panel-dark .btn-accent { color: var(--ink-on-fill); text-decoration: none; }
.hero .btn-ghost, .band .btn-ghost, .site-footer .btn-ghost, .panel-dark .btn-ghost {
  color: #FFFFFF; border-color: #FFFFFF; text-decoration: none;
}
.hero .btn-ghost:hover, .band .btn-ghost:hover, .site-footer .btn-ghost:hover, .panel-dark .btn-ghost:hover {
  background: #FFFFFF; color: var(--band);
}
/* chips inside dark bands keep tangerine fill + dark ink */
.hero .chip, .band .chip, .site-footer .chip, .panel-dark .chip { color: var(--ink-on-fill); }
.hero .chip-soft, .band .chip-soft, .panel-dark .chip-soft {
  background: var(--band-2); color: var(--on-brand); border-color: var(--border-on-dark);
}

/* raised block INSIDE a dark band — NOT a light card */
.block-dark {
  background: var(--band-2); color: var(--on-brand);
  border: 1px solid var(--border-on-dark); border-radius: var(--radius);
  padding: 1.5rem; min-width: 0;
}
.block-dark h3 { color: var(--on-brand); }

/* =========================================================================
   Proof strip
   ========================================================================= */
.proof-strip { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.proof-strip .container { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 1rem; padding-top: 1.5rem; padding-bottom: 1.5rem; }
.proof-item { text-align: center; min-width: 0; }
.proof-item .big { font-family: var(--font-head); font-weight: 700; font-size: 1.5rem; color: var(--brand-text); display: block; }
.proof-item .label { font-size: .85rem; color: var(--muted); }

/* =========================================================================
   Species / feature cards with media
   ========================================================================= */
.media-card { padding: 0; overflow: hidden; }
.media-card img { width: 100%; height: 220px; object-fit: cover; }
.media-card .media-body { padding: 1.3rem 1.5rem 1.5rem; }

/* =========================================================================
   Footer
   ========================================================================= */
.site-footer { background: var(--band); color: var(--on-brand); padding: 2.75rem 0 2rem; margin-top: 1rem; }
.site-footer .footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
.site-footer h3 { font-size: 1rem; text-transform: uppercase; letter-spacing: .05em; color: var(--accent-on-dark); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer ul li { margin-bottom: .4rem; }
.footer-bottom { border-top: 1px solid var(--border-on-dark); margin-top: 2rem; padding-top: 1.25rem; font-size: .85rem; color: #BBD0DE; }
.footer-bottom .demo-note { color: var(--accent-on-dark); }

/* =========================================================================
   Map
   ========================================================================= */
.map-embed { position: relative; width: 100%; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--border); }
.map-embed iframe { display: block; width: 100%; height: 420px; border: 0; }

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 900px) {
  .hero .container { grid-template-columns: 1fr; }
  .hero-media { order: -1; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .proof-strip .container { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .site-footer .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .site-footer .footer-grid { grid-template-columns: 1fr; }
}
/* 320px safety: hide header CTA + subtitle, wrap everything, full-width buttons */
@media (max-width: 480px) {
  body { font-size: 1rem; }
  .brand-sub { display: none; }
  .header-cta { display: none; }
  .main-nav a { padding: .4rem .45rem; font-size: .88rem; }
  .cta-row .btn { width: 100%; }
  .btn-lg { font-size: 1rem; padding: .85rem 1rem; }
  .proof-strip .container { grid-template-columns: 1fr 1fr; }
  dl.nap { grid-template-columns: 1fr; gap: .15rem; }
  dl.nap dt { margin-top: .5rem; }
}
@media (max-width: 360px) {
  .main-nav { gap: 0; }
  .main-nav a { padding: .4rem .35rem; font-size: .82rem; }
}

/* =========================================================================
   Spa Day Planner (signature feature)
   ========================================================================= */
.planner { display: grid; grid-template-columns: 1.3fr 1fr; gap: 2rem; align-items: start; }
.planner-steps { min-width: 0; }
.planner-step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem 1.5rem; margin-bottom: 1.25rem; box-shadow: var(--shadow); }
.planner-step > legend, .planner-step .step-title {
  font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; color: var(--ink);
  padding: 0; margin: 0 0 .25rem; display: flex; align-items: baseline; gap: .5rem;
}
.planner-step .step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.6rem; height: 1.6rem; flex: none; border-radius: 999px;
  background: var(--ball); color: var(--ink-on-fill); font-size: .9rem; font-weight: 700;
}
.planner-step .step-help { color: var(--muted); font-size: .95rem; margin: .1rem 0 1rem; }
.planner-step.is-hidden { display: none; }

/* option buttons (aria-pressed) */
.option-grid { display: flex; flex-wrap: wrap; gap: .6rem; }
.option-btn {
  font-family: var(--font-body); font-weight: 600; font-size: .98rem;
  background: var(--surface-2); color: var(--ink);
  border: 2px solid var(--border); border-radius: var(--radius-sm);
  padding: .6rem .9rem; cursor: pointer; min-width: 0; text-align: left;
  transition: border-color .12s ease, background-color .12s ease, color .12s ease;
}
.option-btn:hover { border-color: var(--brand); }
.option-btn[aria-pressed="true"] {
  background: var(--brand); color: #FFFFFF; border-color: var(--brand);
}
.option-btn .opt-help { display: block; font-weight: 400; font-size: .8rem; color: var(--muted); margin-top: .15rem; }
.option-btn[aria-pressed="true"] .opt-help { color: #FFFFFF; }

.field { margin-top: 1rem; }
.field.is-hidden { display: none; }
.field label { display: block; font-weight: 700; margin-bottom: .35rem; color: var(--ink); }
.field input[type="text"], .field input[type="date"] {
  width: 100%; max-width: 100%; font-family: var(--font-body); font-size: 1rem;
  padding: .7rem .8rem; border: 2px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
}
.field input:focus { border-color: var(--brand); outline: none; }
.field .field-help { color: var(--muted); font-size: .88rem; margin-top: .3rem; }

/* ===== Intake card: ALWAYS-DARK summary panel (.panel-dark) ===== */
.planner-summary { position: sticky; top: 84px; min-width: 0; }
.panel-dark {
  background: var(--band); color: var(--on-brand);
  border: 1px solid var(--border-on-dark); border-radius: var(--radius);
  padding: 1.6rem; box-shadow: var(--shadow);
}
.panel-dark .intake-line { font-size: 1.08rem; line-height: 1.55; margin-bottom: 1rem; }
.panel-dark .intake-line .ph { color: var(--accent-on-dark); }
.before-list { margin: 0 0 1.25rem; padding-left: 1.1rem; }
.before-list li { margin-bottom: .4rem; }
.panel-dark .msg-box {
  background: var(--band-2); color: var(--on-brand);
  border: 1px solid var(--border-on-dark); border-radius: var(--radius-sm);
  padding: .9rem 1rem; font-size: .95rem; white-space: pre-wrap; margin-bottom: 1rem;
}
.panel-dark .send-row { display: flex; flex-direction: column; gap: .6rem; }
.panel-dark .send-row .btn { width: 100%; }
.copy-status { font-size: .88rem; color: var(--accent-on-dark); min-height: 1.2em; margin: .25rem 0 0; }

@media (max-width: 900px) {
  .planner { grid-template-columns: 1fr; }
  .planner-summary { position: static; top: auto; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* QA: on phones the nav drops to its own row so the brand name never breaks mid-word */
@media (max-width: 700px) {
  .site-header .container { flex-wrap: wrap; row-gap: .25rem; }
  .brand-lockup { flex: 1 1 0; }
  .brand-name { overflow-wrap: normal; word-break: normal; }
  .main-nav { order: 3; flex: 1 0 100%; margin-bottom: .25rem; }
}
