/* RS-Songs seasonal theme system — configuration-driven CSS variables.
   Active theme set via documentElement[data-theme] / body[data-theme].
   Extensible IDs (not all implemented): year-round, christmas, valentines,
   mothers-day, fathers-day, birthday, anniversary, thanksgiving, patriotic.
*/

:root,
[data-theme="year-round"] {
  --bg0: #0f1412;
  --bg1: #171e1b;
  --bg2: #222a26;
  --paper: #f3f1ea;
  --ink: #f4efe4;
  --ink-strong: #fffdf8;
  --muted: #b9c0ba;
  --accent: #2f6b52;
  --accent-soft: #d8ebe2;
  --cranberry: #8a4a52;
  --gold: #c4a574;
  --gold-deep: #9a7d4a;
  --line: rgba(244, 239, 228, 0.16);
  --panel: rgba(12, 18, 16, 0.78);
  --danger: #d9897c;
  --ok: #7dcea0;
  --shadow: 0 20px 48px rgba(0, 0, 0, 0.28);
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "Figtree", "Segoe UI", sans-serif;
  --radius: 18px;
  --max: 1080px;
  --control-min: 3.25rem;
  --season-deco: none;
  --hero-wash: radial-gradient(1000px 520px at 85% -5%, rgba(196, 165, 116, 0.12), transparent 55%);
}

/* Warm ivory Christmas gift presentation — restrained, premium, readable */
[data-theme="christmas"] {
  --bg0: #f4efe6;
  --bg1: #efe8db;
  --bg2: #e7dfd0;
  --paper: #faf6ee;
  --ink: #1c2a22;
  --ink-strong: #122018;
  --muted: #4f5f56;
  --accent: #1f4f3a;
  --accent-soft: #d7e8df;
  --cranberry: #8e3d48;
  --gold: #b8924a;
  --gold-deep: #8f6f2f;
  --line: rgba(31, 79, 58, 0.16);
  --panel: rgba(255, 252, 246, 0.92);
  --danger: #a64545;
  --ok: #2f7a52;
  --shadow: 0 18px 40px rgba(28, 42, 34, 0.12);
  --hero-wash:
    radial-gradient(900px 480px at 92% -8%, rgba(184, 146, 74, 0.18), transparent 58%),
    radial-gradient(700px 420px at -8% 18%, rgba(31, 79, 58, 0.10), transparent 52%);
  --season-deco: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160' fill='none'%3E%3Cpath d='M80 12 L104 58 H92 L112 92 H98 L118 128 H42 L62 92 H48 L68 58 H56 Z' fill='%231f4f3a' fill-opacity='0.08'/%3E%3Ccircle cx='80' cy='136' r='6' fill='%238e3d48' fill-opacity='0.18'/%3E%3C/svg%3E");
}

/* Future stubs — inherit year-round until designed */
[data-theme="valentines"],
[data-theme="mothers-day"],
[data-theme="fathers-day"],
[data-theme="birthday"],
[data-theme="anniversary"],
[data-theme="thanksgiving"],
[data-theme="patriotic"] {
  /* intentionally inherit :root / year-round until owner authorizes design */
}

body {
  color: var(--ink);
  background:
    var(--hero-wash),
    linear-gradient(180deg, var(--bg0), var(--bg1) 42%, var(--bg2));
  background-attachment: fixed;
}

body.theme-christmas::before,
body[data-theme="christmas"]::before {
  content: "";
  position: fixed;
  inset: auto auto 0 0;
  width: 180px;
  height: 180px;
  background-image: var(--season-deco);
  background-repeat: no-repeat;
  background-position: left bottom;
  pointer-events: none;
  opacity: 1;
  z-index: 0;
}

body.theme-christmas::after,
body[data-theme="christmas"]::after {
  content: "";
  position: fixed;
  inset: 0 0 auto auto;
  width: 160px;
  height: 160px;
  background-image: var(--season-deco);
  background-repeat: no-repeat;
  background-position: right top;
  transform: scaleX(-1);
  pointer-events: none;
  opacity: 0.9;
  z-index: 0;
}

.wrap,
.player-shell,
.site-header,
main,
.admin-shell {
  position: relative;
  z-index: 1;
}

/* Accessibility / senior-friendly controls */
.btn {
  min-height: 3rem;
  padding: 0.9rem 1.35rem;
  font-size: 1.05rem;
}
.icon-btn {
  width: var(--control-min);
  height: var(--control-min);
  font-size: 1.35rem;
}
.nav a {
  font-size: 1.02rem;
  padding: 0.35rem 0.15rem;
}
.lyric-line {
  font-size: 1.12rem;
  line-height: 1.45;
  color: color-mix(in srgb, var(--ink) 72%, transparent);
}
.lyric-line.nearby {
  color: color-mix(in srgb, var(--ink) 88%, transparent);
}
.lyric-line.active {
  background: color-mix(in srgb, var(--accent-soft) 80%, transparent);
  color: var(--ink-strong);
  border-left: 3px solid var(--cranberry);
}
[data-theme="christmas"] .lyrics {
  color: var(--ink);
}
[data-theme="christmas"] .lyric-line {
  color: rgba(28, 42, 34, 0.72);
}
[data-theme="christmas"] .lyric-line.nearby {
  color: rgba(28, 42, 34, 0.88);
}
[data-theme="christmas"] .lyric-line.active {
  color: #122018;
}

[data-theme="christmas"] .panel,
[data-theme="christmas"] .sample,
[data-theme="christmas"] .admin-card,
[data-theme="christmas"] .form-card {
  background: var(--panel);
  border-color: var(--line);
  color: var(--ink);
}

[data-theme="christmas"] .btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: #1a1406;
}
[data-theme="christmas"] .btn-ghost {
  border-color: color-mix(in srgb, var(--accent) 28%, transparent);
  color: var(--ink);
}
[data-theme="christmas"] .brand,
[data-theme="christmas"] .hero h1,
[data-theme="christmas"] .player-title,
[data-theme="christmas"] .section h2 {
  color: var(--ink-strong);
}
[data-theme="christmas"] .tag,
[data-theme="christmas"] .price strong,
[data-theme="christmas"] a {
  color: var(--cranberry);
}
[data-theme="christmas"] a:hover {
  color: var(--accent);
}
[data-theme="christmas"] .gift-banner {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--gold) 45%, transparent);
  background: color-mix(in srgb, var(--accent-soft) 55%, var(--paper));
}

/* Digital gift card (screen + print) */
.gift-card {
  margin: 1.25rem 0;
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent-soft) 40%, var(--paper)), var(--paper));
  display: grid;
  gap: 0.85rem;
}
.gift-card h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.55rem;
  color: var(--ink-strong);
}
.gift-card .gift-card-meta {
  color: var(--muted);
  font-size: 1rem;
}
.gift-card-qr {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}
.gift-card-qr img {
  width: 128px;
  height: 128px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
}
.gift-card .print-hint {
  font-size: 0.92rem;
  color: var(--muted);
}

@media print {
  body::before,
  body::after { display: none !important; }
  body {
    background: #fff !important;
    color: #111 !important;
  }
  .site-header,
  .nav,
  .controls,
  .actions,
  .lyrics,
  .notice,
  #loading,
  #error { display: none !important; }
  .gift-card {
    border: 2px solid #1f4f3a;
    box-shadow: none;
    break-inside: avoid;
  }
  .player-shell { width: 100%; max-width: none; }
}

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

/* Admin stays mostly functional */
.admin-shell {
  --season-deco: none;
}
body.admin-surface::before,
body.admin-surface::after {
  opacity: 0.25;
}
