/* ===================================================================
   VocaGift universal theme layer (Dark <-> Light)

   Loaded by every published page. Dark is the default and is not
   touched: every rule here is scoped under html.light so the existing
   dark design renders byte-identically to before.

   Three page families are covered, because the site has three CSS
   architectures:
     1. landing / occasion pages  -> :root variables + a few hardcoded hex
     2. app.min.css (Tailwind)    -> utility classes, glass-card, inline dark
     3. one-off pages             -> 404 (vars), listen (radial gradient)
   =================================================================== */

html { color-scheme: dark; }
html.light { color-scheme: light; }

/* ── 1. Landing / occasion pages: variable remap ──────────────────
   These pages declare --bg/--card/--line/--fg/--mut/--acc/--acc2 and
   use them for body, cards, borders and muted text. Remapping the
   variables repaints the whole page; the hardcoded colours that do not
   go through variables are handled in the next block. */
html.light {
  --bg: #f6f7fb;
  --card: #ffffff;
  --line: #dfe1ef;
  --fg: #1b1d2e;
  --mut: #5a627a;
  --acc: #5a6ee0;
  --acc2: #7c3aed;
}

html.light body {
  background: #f6f7fb;
  color: #1b1d2e;
}

/* Hardcoded #fff / #0F1524 / #C7D2FE in the occasion template */
html.light .brand,
html.light h1,
html.light .nav-link:hover,
html.light footer a:hover,
html.light .faq summary {
  color: #1b1d2e !important;
}
html.light .lead {
  color: #4a4f77 !important;
}
html.light .tile,
html.light .faq {
  background: #eef0f9 !important;
  border-color: #dfe1ef !important;
}
html.light .tile b,
html.light h2 {
  color: #6d28d9 !important;
}
html.light .related a {
  border-color: #dfe1ef !important;
  color: #4a4f77 !important;
}
html.light .related a:hover {
  border-color: #7c3aed !important;
  color: #7c3aed !important;
}
html.light footer {
  border-color: #dfe1ef !important;
}
/* Language selector on occasion pages is styled inline with dark hex */
html.light header select {
  background: #ffffff !important;
  color: #1b1d2e !important;
  border-color: #dfe1ef !important;
  color-scheme: light !important;
}
html.light header select option {
  background-color: #ffffff !important;
  color: #1b1d2e !important;
}
html.light .brand span {
  background: linear-gradient(135deg, #7c3aed, #db2777);
  -webkit-background-clip: text;
  background-clip: text;
  color: #7c3aed;
}

/* ── 2. app.min.css (Tailwind) pages ──────────────────────────────
   wizard, studio, about, contacts, business, samples, povodi,
   terms, privacy, refunds, my-songs, funnel, feedback.
   These hardcode a dark body colour in an inline <style> and lean on
   white/5, white/10, gray-* and bg-[#070b14] utilities. */
html.light body,
html.light .min-h-screen {
  background-color: #f6f7fb !important;
  color: #1b1d2e !important;
}
html.light header:not(.vg-header),
html.light .glass-card,
html.light .glass-card-active,
html.light #vg-mobile-drawer:not(.vgh-drawer),
html.light .mobile-drawer,
html.light [class*="bg-[#070b14]"],
html.light [class*="bg-[#0b0f19]"],
html.light [class*="bg-[#121826]"] {
  background-color: rgba(255, 255, 255, 0.96) !important;
  border-color: #dfe1ef !important;
}
html.light .text-white,
html.light h1,
html.light h2,
html.light h3 {
  color: #1b1d2e !important;
}
html.light [class*="text-gray-"],
html.light [class*="text-slate-"] {
  color: #596178 !important;
}
html.light [class*="text-purple-"],
html.light [class*="text-pink-"],
html.light [class*="text-indigo-"] {
  color: #7840b8 !important;
}
html.light [class*="text-emerald-"] {
  color: #08744f !important;
}
html.light [class*="text-amber-"] {
  color: #8a5b00 !important;
}
html.light [class*="text-rose-"] {
  color: #b1173f !important;
}
html.light [class*="border-white/"] {
  border-color: #dfe1ef !important;
}
html.light [class*="bg-white/"],
html.light [class*="bg-black/"] {
  background-color: rgba(109, 74, 180, 0.05) !important;
}
html.light .gradient-text {
  background-image: linear-gradient(135deg, #7c3aed, #c72e88 70%, #087db0) !important;
}
/* Solid coloured surfaces keep white labels */
html.light .glow-btn,
html.light a.bg-gradient-to-r,
html.light button.bg-gradient-to-r,
html.light .bg-purple-600,
html.light .bg-purple-500,
html.light .bg-emerald-500,
html.light .bg-emerald-600,
html.light #vg-promo-btn,
html.light #song-submit-btn {
  color: #fff !important;
}
/* my-songs.html uses .glow-btn without shipping the gradient rule that
   index.html defines locally, so the button renders transparent with white
   text in both themes. Supply the brand fill globally. */
.glow-btn {
  background: linear-gradient(135deg, #7c3aed 0%, #ec4899 100%);
  box-shadow: 0 4px 18px rgba(124, 58, 237, 0.32);
}
html.light a.glow-btn {
  background: linear-gradient(135deg, #7c3aed 0%, #ec4899 100%) !important;
  box-shadow: 0 4px 18px rgba(124, 58, 237, 0.32) !important;
}
/* Form controls inherit a dark inline background, which would leave
   dark-on-dark labels if only the text colour were flipped. */
html.light select,
html.light input[type="text"],
html.light input[type="email"],
html.light input[type="number"],
html.light input[type="tel"],
html.light textarea,
html.light #w-style2,
html.light #vg-style,
html.light #vg-style2 {
  background-color: #ffffff !important;
  color: #1b1d2e !important;
  border-color: #dfe1ef !important;
  color-scheme: light !important;
}
html.light select option,
html.light select optgroup,
html.light #w-style2 option,
html.light #vg-style option,
html.light #vg-style2 option {
  background-color: #ffffff !important;
  color: #1b1d2e !important;
}
html.light .opt,
html.light .rel-opt,
html.light .mood-opt,
html.light .style-opt {
  background: #ffffff;
  border-color: #dfe1ef;
  color: #1b1d2e;
}
html.light .opt:hover,
html.light .rel-opt:hover,
html.light .mood-opt:hover,
html.light .style-opt:hover {
  background: #f1f0fb;
  border-color: #a78bfa;
}
html.light .opt.sel,
html.light .rel-opt.sel,
html.light .mood-opt.sel,
html.light .style-opt.sel {
  background: #ede9fe;
  border-color: #7c3aed;
  color: #1b1d2e;
  box-shadow: 0 0 0 1px #c4b5fd inset;
}
html.light .chip-tag:hover {
  color: #1b1d2e;
}

/* ── 3. One-off pages ────────────────────────────────────────────
   404.html already reads var(--bg)/var(--fg)/var(--card)/var(--border);
   listen.html paints a dark radial gradient directly on body and hard-codes
   its own dark card colours, so both surfaces and their inner text need
   explicit light values (the generic [class*="text-"] rules can't reach
   them because the colours are plain hex, not Tailwind utilities). */
html.light body[vgg] { background: #f6f7fb !important; }
html.light.allow-light-anyway body { background: #f6f7fb; }

html.light .player-card {
  background: #ffffff !important;
  border-color: #dfe1ef !important;
  box-shadow: 0 18px 40px rgba(27, 29, 46, 0.09), inset 0 1px 0 #fff !important;
  backdrop-filter: none !important;
}
html.light .disc-details h3 { color: #1b1d2e !important; }
html.light .disc-details p,
html.light .song-meta { color: #596178 !important; }
html.light .badge-quality {
  color: #0b6c8d !important;
  background: rgba(14, 116, 144, 0.10) !important;
  border-color: rgba(14, 116, 144, 0.35) !important;
}
html.light .my-songs-back-link { color: #5b46c9 !important; }
html.light .song-duration,
html.light .disc-details span { color: #596178 !important; }
html.light .lyrics-card {
  background: #ffffff !important;
  border-color: #dfe1ef !important;
  backdrop-filter: none !important;
}
html.light .lyrics-card p,
html.light .lyrics-card div { color: #3b3f56 !important; }
html.light .lyrics-header span[style] { color: #5b46c9 !important; }

html.light .gift-tag {
  color: #a4197a !important;
  background: rgba(236, 72, 153, 0.10) !important;
  border-color: rgba(236, 72, 153, 0.40) !important;
}
html.light .disclosure {
  color: #3b3f56 !important;
  background: rgba(109, 139, 255, 0.08) !important;
  border-color: rgba(109, 139, 255, 0.30) !important;
}
html.light .text-gray-400 { color: #4d5366 !important; }
html.light .text-gray-300 { color: #4a4f66 !important; }
html.light .bg-blue-500\/20 { background-color: rgba(59, 130, 246, 0.14) !important; }
html.light .text-blue-300 { color: #1d4ed8 !important; }
/* listen.html's .song-title is filled with a white→grey gradient via
   background-clip:text and a transparent text fill — an invisible block on a
   light background. This is the only white/clip combination on the site
   (.gradient-text uses the purple→pink ramp and reads fine in both themes). */
html.light .song-title {
  background: none !important;
  -webkit-background-clip: border-box !important;
  background-clip: border-box !important;
  -webkit-text-fill-color: #1b1d2e !important;
  color: #1b1d2e !important;
}
/* listen.html header link + "show/hide" hint are inline-styled with dark-mode
   hex values, so they need element-level overrides in light mode. */
html.light header > a[href="/my-songs.html"],
html.light header > a[href$="/my-songs.html"] {
  color: #3b3f56 !important;
  background: #ffffff !important;
  border-color: #dfe1ef !important;
}
html.light main span[style*="#818cf8"],
html.light span[style*="color: #818cf8"] { color: #5b46c9 !important; }
html.light .glow-orb { opacity: .25 !important; }
/* Page-local nav links hard-code white text with an inline style; the
   inline declaration wins over a class rule, so match the specificity. */
html.light a.nav-link,
html.light a.nav-link[style] {
  color: #3b3f56 !important;
  border-color: #dfe1ef !important;
}
html.light a.nav-link:hover { color: #1b1d2e !important; }
html.light .cta {
  background: linear-gradient(135deg, #6d8bff, #a855f7) !important;
  color: #fff !important;
  box-shadow: 0 8px 22px rgba(109, 74, 180, 0.28) !important;
}

html.light #vg-theme-btn {
  background: rgba(109, 74, 180, 0.08);
  border-color: #dfe1ef;
  color: #1b1d2e;
}

/* ── Toggle button (injected by vg-theme.js) ─────────────────────── */
#vg-theme-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 600 13px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: #d7dbea;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
  align-self: center;
}
#vg-theme-btn:hover {
  border-color: rgba(167, 139, 250, 0.6);
  color: #fff;
}
#vg-theme-btn:focus-visible {
  outline: 2px solid #a78bfa;
  outline-offset: 2px;
}
