/* ==========================================================================
   Palette variants — loaded AFTER style.css

   How this works
   --------------
   style.css hardcodes the deep brand blocks (band, trust section, footer,
   location panel) as literal hex values. This file does two things:

     1. Names those values as tokens and rebinds the rules to them, so the
        rendering is byte-identical with no palette selected.
     2. Defines three palettes, each of which only sets token values.

   With no data-palette attribute on <html>, the site looks exactly as it does
   today. Set data-palette="navy" | "aqua" | "sand" to switch.

   The palette selectors are plain attribute selectors, not :root-scoped, so a
   palette can also be applied to any wrapper element. palettes.html uses that
   to show all three on one page.

   Every palette keeps --red-cta and --wa unchanged: the emergency call and
   WhatsApp colours are functional signals, not decoration.
   ========================================================================== */

/* ---------- Tokens for the deep blocks (defaults = today's design) -------- */
:root {
  --deep-a:      #033653;   /* gradient start on band / panels */
  --deep-b:      #075A7B;   /* gradient end */
  --deep-c:      #064E72;   /* gradient end on the trust section */
  --deep-ink:    #062F46;   /* footer */
  --glow:        rgba(138,210,221,.22);   /* radial highlight over deep blocks */
  --on-deep:     #A7E5EC;   /* kickers on deep backgrounds */
  --on-deep-ico: #B7EDF1;   /* icons on deep backgrounds */
  --solid:       #0A2540;   /* solid primary control */
  --solid-hi:    #123B66;   /* its hover */
  --mid:         #05537F;   /* mid-blue hover fill */
  --chip-soft:   #E9F0F6;
  --chip-soft-2: #DDE8F1;
  --chip-soft-3: #EAF3F7;
  --near-white:  #F7FAFB;
  --near-white-2:#F8FBFC;
}

/* ---------- Rebind the hardcoded rules to those tokens ------------------- */
.branch-photo-fallback {
  background:
    radial-gradient(circle at 82% 12%, var(--glow), transparent 32%),
    linear-gradient(145deg, var(--deep-a), var(--deep-b));
}
.location-contact {
  background:
    radial-gradient(circle at 100% 0%, var(--glow), transparent 38%),
    linear-gradient(135deg, var(--deep-a), var(--deep-b));
}
.location-contact-copy .kicker { color: var(--on-deep); }
.location-contact-copy .kicker::before { background: linear-gradient(90deg, var(--on-deep), transparent); }

.section--trust {
  background:
    radial-gradient(circle at 5% 10%, var(--glow), transparent 28%),
    linear-gradient(135deg, var(--deep-a), var(--deep-c));
}
.section--trust .kicker { color: var(--on-deep); }
.section--trust .kicker::before { background: linear-gradient(90deg, var(--on-deep), transparent); }
.section--trust .reason-ico { color: var(--on-deep-ico); }

.band { background: linear-gradient(135deg, var(--deep-a), var(--deep-b)); }
.band::before { background: radial-gradient(circle, var(--glow), transparent 64%); }
.band .btn-wa:hover { background: var(--chip-soft-3); border-color: var(--chip-soft-3); }

.footer { background: var(--deep-ink); }

.header-contact--primary { background: var(--solid); }
.header-contact--primary:hover { background: var(--solid-hi); }

.btn-call:hover { background: var(--mid); border-color: var(--mid); }
.contact-action--wa:hover { background: var(--mid); }

.location-branch-grid .branch-actions .chip:hover { border-color: var(--mid); background: var(--mid); }
:is(.location-branch-grid, .home-branch-grid) .branch-actions .branch-action--map {
  background: var(--chip-soft); color: var(--solid-hi);
}
.location-branch-grid .branch-actions .branch-action--map:hover {
  background: var(--chip-soft-2); color: var(--solid);
}

.findmap-side { background: var(--near-white-2); }
.feature-badge { background: var(--near-white-2); }

.hero { background: linear-gradient(180deg, var(--near-white) 0%, var(--bg) 100%); }
.page-hero {
  background:
    radial-gradient(circle at 90% 10%, var(--glow), transparent 28%),
    linear-gradient(180deg, var(--near-white), var(--bg));
}

/* ==========================================================================
   1 — NAVY & WHITE
   Classic and institutional. The teal is taken out entirely, so the only
   colours are navy, white and the functional red. Reads as the most
   conservative and the most "hospital".
   ========================================================================== */
[data-palette="navy"] {
  --bg:         #FFFFFF;
  --bg-2:       #F3F6FA;
  --surface:    #F8FAFC;
  --surface-2:  #E9EFF6;
  --surface-3:  #D8E3EF;

  --line:       rgba(10, 42, 67, .12);
  --line-2:     rgba(10, 42, 67, .24);

  --text:       #0C2436;
  --text-2:     #3D566B;
  --text-3:     #5F7689;

  --navy:       #0A2A43;
  --cobalt:     #24466B;
  --teal:       #C9D8E6;          /* decorative only; desaturated to steel */
  --accent:     #0A2A43;
  --accent-2:   #0A2A43;
  --tint:       rgba(10, 42, 67, .07);
  --tint-line:  rgba(10, 42, 67, .16);

  --deep-a:      #0A2A43;
  --deep-b:      #17456B;
  --deep-c:      #12354F;
  --deep-ink:    #08223A;
  --glow:        rgba(255,255,255,.10);   /* a clean sheen, not a teal wash */
  --on-deep:     #CBDCEA;
  --on-deep-ico: #E3EDF6;
  --solid:       #0A2A43;
  --solid-hi:    #17456B;
  --mid:         #17456B;
  --chip-soft:   #E9EFF6;
  --chip-soft-2: #D8E3EF;
  --chip-soft-3: #EDF2F8;
  --near-white:  #F5F8FB;
  --near-white-2:#F8FAFC;

  --field-rest:   #B6C8DA;
  --field-active: #0A2A43;

  --shadow-sm: 0 1px 2px rgba(10,42,67,.05), 0 5px 16px rgba(10,42,67,.05);
  --shadow-md: 0 14px 38px rgba(10,42,67,.11);
}

/* ==========================================================================
   2 — ANDAMAN SEA
   Leads with the teal arc from the logo, deepened to #0E6E7E so it clears
   4.5:1 on white and can carry text. Coastal and specific to where the
   clinics actually are, rather than generic medical blue.
   ========================================================================== */
[data-palette="aqua"] {
  --bg:         #FFFFFF;
  --bg-2:       #EFF8FA;
  --surface:    #F5FBFC;
  --surface-2:  #E0F1F4;
  --surface-3:  #CDE8EC;

  --line:       rgba(14, 110, 126, .14);
  --line-2:     rgba(14, 110, 126, .26);

  --text:       #0B2F38;
  --text-2:     #3A5A63;
  --text-3:     #5C7A82;

  --navy:       #0E6E7E;          /* the "primary" role, now teal */
  --cobalt:     #1B7F91;
  --teal:       #8AD2DD;
  --accent:     #0E6E7E;
  --accent-2:   #0E6E7E;
  --tint:       rgba(14, 110, 126, .08);
  --tint-line:  rgba(14, 110, 126, .18);

  --deep-a:      #04414C;
  --deep-b:      #0B7185;
  --deep-c:      #075967;
  --deep-ink:    #04333C;
  --glow:        rgba(167, 229, 236, .30);
  /* #A7E5EC measured 4.05:1 against the lighter gradient stop (#0B7185) — under
     the 4.5 a 11.5px uppercase kicker needs. Lightened until it clears. */
  --on-deep:     #CBF2F7;
  --on-deep-ico: #DCF7FA;
  --solid:       #0E6E7E;
  --solid-hi:    #148496;
  --mid:         #148496;
  --chip-soft:   #E0F1F4;
  --chip-soft-2: #CDE8EC;
  --chip-soft-3: #EAF7F9;
  --near-white:  #F2FAFB;
  --near-white-2:#F5FBFC;

  --field-rest:   #A5D6DE;
  --field-active: #0E6E7E;

  --shadow-sm: 0 1px 2px rgba(4,65,76,.05), 0 5px 16px rgba(4,65,76,.06);
  --shadow-md: 0 14px 38px rgba(4,65,76,.12);
}

/* ==========================================================================
   3 — WARM STONE
   Warm paper instead of clinical white, with deep slate-navy ink and a gold
   highlight. Calmer and more hospitality than hospital — closer to how a
   good hotel talks to travellers, which is who most of these patients are.
   ========================================================================== */
[data-palette="sand"] {
  --bg:         #FCFAF6;
  --bg-2:       #F4F0E8;
  --surface:    #FAF7F1;
  --surface-2:  #EFE9DE;
  --surface-3:  #E2DACC;

  --line:       rgba(60, 50, 35, .14);
  --line-2:     rgba(60, 50, 35, .26);

  --text:       #22201C;
  --text-2:     #4C463E;
  --text-3:     #6B6459;

  --navy:       #14364F;
  --cobalt:     #23506F;
  --teal:       #D6B278;          /* decorative highlight, now warm gold */
  --accent:     #14364F;
  --accent-2:   #14364F;
  --tint:       rgba(20, 54, 79, .07);
  --tint-line:  rgba(20, 54, 79, .17);

  --deep-a:      #1A2E3C;
  --deep-b:      #2E4A5C;
  --deep-c:      #223A4B;
  --deep-ink:    #171F26;
  --glow:        rgba(214, 178, 120, .22);
  --on-deep:     #E8D9BE;
  --on-deep-ico: #F2E7D2;
  --solid:       #14364F;
  --solid-hi:    #23506F;
  --mid:         #23506F;
  --chip-soft:   #EFE9DE;
  --chip-soft-2: #E2DACC;
  --chip-soft-3: #F2EDE4;
  --near-white:  #F8F5EF;
  --near-white-2:#FAF7F1;

  --field-rest:   #D5C9B4;
  --field-active: #14364F;

  --shadow-sm: 0 1px 2px rgba(60,50,35,.05), 0 5px 16px rgba(60,50,35,.06);
  --shadow-md: 0 14px 38px rgba(60,50,35,.13);
}

/* ==========================================================================
   Review-only palette switcher.
   Only rendered when the URL carries ?preview=palettes — it can never appear
   for a real visitor. Delete assets/js/palette.js and this block to remove.
   ========================================================================== */
.palette-switch {
  position: fixed; z-index: 999;
  left: 50%; bottom: 20px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 4px;
  padding: 5px; border-radius: var(--r-pill);
  background: rgba(255,255,255,.97);
  border: 1px solid rgba(10,42,67,.16);
  box-shadow: 0 10px 34px rgba(8,43,62,.20);
}
.palette-switch button {
  min-height: 38px; padding: 0 15px; border-radius: var(--r-pill);
  font-size: .78rem; font-weight: 700; color: #3D566B; white-space: nowrap;
}
.palette-switch button:hover { color: #0C2436; background: rgba(10,42,67,.06); }
.palette-switch button[aria-pressed="true"] { background: #0A2A43; color: #fff; }
@media (max-width: 860px) {
  .palette-switch { bottom: calc(var(--dock-h) + 12px); }
  .palette-switch button { padding: 0 11px; font-size: .72rem; }
}
