/* ── Rewire Theme Token Overrides ── */
/* Dark = current default (already in :root on each page) */

/* System / Warm Midnight — vars now live in rewire.html scoped block.
   Keep only nav overrides here for marketing pages if needed. */

/* System mode: lifted slate nav */
[data-theme="system"] nav {
  background: rgba(34,32,48,0.97) !important;
  border-bottom: 1px solid rgba(180,170,210,0.2) !important;
}

/* Light / Warm Parchment — vars now live in rewire.html scoped block.
   Keep only nav overrides here for marketing pages if needed. */

/* Light mode: nav backdrop */
[data-theme="light"] nav {
  background: rgba(240,235,227,0.97) !important;
  border-bottom: 1px solid rgba(154,96,32,0.18) !important;
  box-shadow: 0 2px 12px rgba(154,96,32,0.07);
}

/* Light mode: body text override (some pages hardcode color) */
[data-theme="light"] body {
  color: var(--body);
}

[data-theme="light"] .nav-login,
[data-theme="light"] a[style*="color:rgba(122"] {
  color: var(--steel) !important;
}

/* ── Theme Toggle Pill (floating) ── */
.rw-theme-toggle {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  background: rgba(20,15,8,0.82);
  border: 1px solid rgba(200,135,58,0.22);
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 24px rgba(0,0,0,0.35);
}

/* Warm Parchment — light pill to match light bg */
[data-theme="light"] .rw-theme-toggle {
  background: rgba(255,253,249,0.92);
  border-color: rgba(100,90,140,0.2);
  box-shadow: 0 4px 20px rgba(100,90,140,0.15);
}

/* Lifted Slate — medium pill */
[data-theme="system"] .rw-theme-toggle {
  background: rgba(34,32,48,0.88);
  border-color: rgba(180,170,210,0.22);
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}

.rw-theme-btn {
  font-family: 'Syne', sans-serif;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: transparent;
  color: var(--muted);
  transition: background 0.18s, color 0.18s;
  white-space: nowrap;
  line-height: 1;
}

.rw-theme-btn:hover {
  color: var(--cream);
}

.rw-theme-btn.rw-theme-active {
  background: var(--gold);
  color: #fff;
  font-weight: 600;
}

[data-theme="light"] .rw-theme-btn {
  color: var(--muted);
}
[data-theme="light"] .rw-theme-btn:hover {
  color: var(--body);
}
[data-theme="light"] .rw-theme-btn.rw-theme-active {
  background: var(--gold);
  color: #fff;
}

[data-theme="system"] .rw-theme-btn {
  color: var(--muted);
}
[data-theme="system"] .rw-theme-btn:hover {
  color: var(--cream);
}
[data-theme="system"] .rw-theme-btn.rw-theme-active {
  background: var(--gold);
  color: #fff;
  font-weight: 600;
}

@media (max-width: 768px) {
  /* Toggle docks at very bottom, centered */
  .rw-theme-toggle {
    bottom: 0 !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    border-radius: 0 0 14px 14px;
    border-top: none;
    padding: 5px 6px 6px;
  }
  /* Push sticky bars up so they clear the toggle pill (~36px) */
  #sticky-bar,
  #stickyCTA,
  [id*="sticky"][style*="position:fixed"],
  [id*="sticky"][style*="position: fixed"] {
    bottom: 36px !important;
  }
}

@media (max-width: 520px) {
  .rw-theme-btn {
    padding: 0.24rem 0.5rem;
    font-size: 0.62rem;
  }
}

/* ══════════════════════════════════════════════
   Light mode overrides — index.html elements
   ══════════════════════════════════════════════ */

/* Section backgrounds that use dark rgba */
[data-theme="light"] [style*="background:rgba(122,154,181,0.08)"],
[data-theme="light"] [style*="background: rgba(122,154,181,0.08)"] {
  background: rgba(61,107,138,0.07) !important;
  border-color: rgba(61,107,138,0.3) !important;
}
[data-theme="light"] [style*="background:rgba(122,154,181,0.18)"],
[data-theme="light"] [style*="background: rgba(122,154,181,0.18)"] {
  background: rgba(61,107,138,0.15) !important;
}

/* Therapist / provider link text */
[data-theme="light"] [style*="color:#7a9ab5"] {
  color: var(--steel) !important;
}
[data-theme="light"] [style*="color: #7a9ab5"] {
  color: var(--steel) !important;
}
[data-theme="light"] [style*="border-color:rgba(122,154,181"] {
  border-color: rgba(61,107,138,0.4) !important;
}

/* Gold text (hardcoded dark-mode gold → light-mode gold) */
[data-theme="light"] [style*="color:#c8873a"],
[data-theme="light"] [style*="color: #c8873a"] {
  color: var(--gold) !important;
}

/* Gold backgrounds (buttons, CTAs) */
[data-theme="light"] [style*="background:#c8873a"],
[data-theme="light"] [style*="background: #c8873a"] {
  background: var(--gold) !important;
}

/* Input text that's hardcoded near-white */
[data-theme="light"] [style*="color:#e8ddd0"],
[data-theme="light"] [style*="color: #e8ddd0"] {
  color: var(--body) !important;
}

/* Muted small text hardcoded dark-mode values */
[data-theme="light"] [style*="color:#5a4a35"],
[data-theme="light"] [style*="color: #5a4a35"] {
  color: var(--muted) !important;
}
[data-theme="light"] [style*="color:#3a2e22"],
[data-theme="light"] [style*="color: #3a2e22"] {
  color: var(--body) !important;
}
[data-theme="light"] [style*="color:rgba(220,195,150"],
[data-theme="light"] [style*="color: rgba(220,195,150"] {
  color: var(--body) !important;
}

/* Dark CTA button text on gold background */
[data-theme="light"] [style*="color:#0e0905"] {
  color: #fff !important;
}

/* Card/feature block backgrounds (dark semi-transparent) */
[data-theme="light"] [style*="background:rgba(184,150,110,0.06)"],
[data-theme="light"] [style*="background: rgba(184,150,110,0.06)"],
[data-theme="light"] [style*="background:rgba(200,135,58,0.05)"],
[data-theme="light"] [style*="background: rgba(200,135,58,0.05)"] {
  background: rgba(168,107,36,0.06) !important;
}

/* Borders that use dark-mode gold rgba */
[data-theme="light"] [style*="border:1px solid rgba(200,135,58"],
[data-theme="light"] [style*="border: 1px solid rgba(200,135,58"],
[data-theme="light"] [style*="border-color:rgba(200,135,58"],
[data-theme="light"] [style*="border-color: rgba(200,135,58"] {
  border-color: rgba(168,107,36,0.3) !important;
}

/* ZIP input field text */
[data-theme="light"] #zipSearchHome {
  color: var(--body) !important;
}
[data-theme="light"] #zipSearchHome::placeholder {
  color: var(--muted) !important;
  opacity: 0.7;
}

/* Headphones notice */
[data-theme="light"] [style*="color:rgba(220,195,150,0.85)"] {
  color: var(--body) !important;
}

/* ══════════════════════════════════════════════
   Light mode — index.html layout contrast fixes
   ══════════════════════════════════════════════ */

/* Nav: visible warm bar with bottom border */
[data-theme="light"] nav {
  background: rgba(237,228,212,0.97) !important;
  border-bottom: 1px solid rgba(168,107,36,0.18) !important;
  box-shadow: 0 2px 12px rgba(168,107,36,0.07);
}

/* Nav logo: remove screen blend (designed for dark bg) */
[data-theme="light"] .nav-logo img {
  mix-blend-mode: normal !important;
  filter: none !important;
}

/* Sticky CTA bottom bar: warm parchment gradient, not black */
[data-theme="light"] #stickyCTA {
  background: linear-gradient(to top, rgba(237,228,212,0.99) 65%, transparent) !important;
}
[data-theme="light"] #stickyCTA * {
  color: var(--body);
}

/* Section alternating backgrounds — subtle warmth variation */
[data-theme="light"] .slide-1,
[data-theme="light"] .slide-3,
[data-theme="light"] .slide-5,
[data-theme="light"] .slide-7,
[data-theme="light"] .slide-9 {
  background: radial-gradient(ellipse 80% 60% at 50% 30%, rgba(168,107,36,0.07), transparent 70%), #f5efe4 !important;
}
[data-theme="light"] .slide-2,
[data-theme="light"] .slide-4,
[data-theme="light"] .slide-6,
[data-theme="light"] .slide-8 {
  background: radial-gradient(ellipse 70% 50% at 50% 50%, rgba(168,107,36,0.05), transparent 70%), #ede4d4 !important;
}

/* Section text contrast */
[data-theme="light"] .section-label {
  color: var(--muted) !important;
}
[data-theme="light"] .section-h {
  color: var(--body) !important;
}
[data-theme="light"] .section-h em {
  color: var(--gold) !important;
}
[data-theme="light"] .section-body {
  color: var(--body) !important;
  opacity: 0.85;
}
