/* Праздничное оформление сайта (src/Site/Themes.php выбирает тему по дате).
   Подключается только в окне праздника, поверх site.css. Без скриптов: CSP style-src 'self'.
   Палитра — та же, что у пакетов тем приложения (public/themes/*.json, varsLight/varsDark): Хэллоуин — глубокая фиолетовая ночь
   и тыквенный оранжевый; Новый год — полночный синий, золото и иней. */

/* ---------- Хэллоуин ---------- */
.hol-halloween {
  --accent: #c2560a;
  --accent-hover: #ab4a07;
  --accent-fg: #ffffff;
  --accent-soft: rgba(230, 110, 20, .11);
  --accent-line: rgba(217, 89, 11, .40);
  --accent-text: #a84a08;
  --glow: rgba(150, 90, 230, .20);
  --hol-glow-2: rgba(255, 140, 40, .16);
  --bg: #f7f4fa;
  --line-soft: #ebe5f1;
}
@media (prefers-color-scheme: dark) {
  .hol-halloween {
    --bg: #0f0a16;
    --s1: #17101f;
    --s2: #1d1627;
    --s3: #271e33;
    --line: #2a2136;
    --line-soft: #1f1829;
    --accent: #ff8a2a;
    --accent-hover: #ffa052;
    --accent-fg: #160d05;
    --accent-soft: rgba(255, 138, 43, .14);
    --accent-line: rgba(255, 138, 43, .45);
    --accent-text: #ffad66;
    --glow: rgba(140, 80, 230, .26);
    --hol-glow-2: rgba(255, 130, 30, .12);
  }
}

/* ---------- Новый год ---------- */
.hol-newyear {
  --accent: #23408e;
  --accent-hover: #1b3477;
  --accent-fg: #ffffff;
  --accent-soft: rgba(35, 64, 142, .09);
  --accent-line: rgba(35, 64, 142, .38);
  --accent-text: #1f3a82;
  --glow: rgba(90, 140, 255, .20);
  --hol-glow-2: rgba(240, 192, 85, .20);
  --hol-gold: #b07d14;
  --bg: #f3f6fb;
  --line-soft: #e4eaf3;
}
@media (prefers-color-scheme: dark) {
  .hol-newyear {
    --bg: #0a0f1f;
    --s1: #10172d;
    --s2: #131c33;
    --s3: #1a2541;
    --line: #1d2945;
    --line-soft: #141d33;
    --accent: #f2c14e;
    --accent-hover: #ffd77e;
    --accent-fg: #0a1020;
    --accent-soft: rgba(242, 199, 92, .13);
    --accent-line: rgba(242, 199, 92, .42);
    --accent-text: #f6d27c;
    --glow: rgba(80, 130, 255, .24);
    --hol-glow-2: rgba(242, 199, 92, .10);
    --hol-gold: #f2c75c;
  }
}

/* Свечение первого экрана — в два цвета праздника. */
.hol .hero::before {
  background:
    radial-gradient(ellipse 45% 50% at 30% 28%, var(--glow), transparent 70%),
    radial-gradient(ellipse 40% 45% at 72% 34%, var(--hol-glow-2), transparent 70%);
}

/* Значок приложения на первом экране: тыква у угла / снежная шапка */
.hol .hero-icon::after { content: ""; position: absolute; pointer-events: none; background: center / contain no-repeat; }
.hol-halloween .hero-icon::after { right: -26px; bottom: -6px; width: 58px; height: 58px; background-image: url("holiday/hal-pumpkin-ic.svg"); filter: drop-shadow(0 6px 10px rgba(240, 110, 20, .35)); transform: rotate(8deg); }
.hol-newyear .hero-icon::after { left: 8px; top: 3px; width: 112px; height: 40px; background-image: url("holiday/ny-cap.svg"); }

/* Поздравление над заголовком */
.hol-greet {
  display: flex; justify-content: center; align-items: center; gap: 8px; margin: 0 0 14px;
  font-size: 13.5px; font-weight: 650; letter-spacing: .02em; color: var(--fg2);
}
.hol-greet::before { content: ""; width: 20px; height: 20px; background: center / contain no-repeat; flex: none; }
.hol-halloween .hol-greet::before { background-image: url("holiday/hal-pumpkin-ic.svg"); }
.hol-newyear .hol-greet::before { background-image: url("holiday/ny-flake-ic.svg"); }

/* Угол каждой страницы: паутина / шары на ниточках. Только украшение — клики проходят насквозь. */
.hol main { position: relative; }
.hol main::before {
  content: ""; position: absolute; top: 0; pointer-events: none; z-index: 0;
  background: top left / contain no-repeat;
}
.hol-halloween main::before { left: 0; width: 200px; height: 230px; background-image: url("holiday/hal-web.svg"); }
.hol-newyear main::before { right: 0; width: 220px; height: 220px; background-image: url("holiday/ny-ornaments.svg"); background-position: top right; transform-origin: top center; }
.hol main > * { position: relative; z-index: 1; }

/* Первый экран: летучие мыши / снег */
.hol .hero::after {
  content: ""; position: absolute; pointer-events: none; z-index: 0;
  background: center / contain no-repeat;
}
.hol-halloween .hero::after { top: 70px; right: max(24px, calc(50% - 600px)); width: 300px; height: 168px; background-image: url("holiday/hal-bats.svg"); opacity: .9; animation: hol-float 7s ease-in-out infinite; }
.hol-newyear .hero::after { inset: -60px 0 auto; height: 620px; background: url("holiday/ny-snow.svg") 0 0 / 640px 420px repeat; opacity: .55; animation: hol-snow 40s linear infinite; mask-image: linear-gradient(#000 40%, transparent); -webkit-mask-image: linear-gradient(#000 40%, transparent); }
@media (prefers-color-scheme: light) {
  .hol-newyear .hero::after { opacity: .9; filter: brightness(.72) saturate(1.6); }
}

/* Гирлянда под шапкой */
.hol-newyear .top::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -22px; height: 26px; pointer-events: none;
  background: url("holiday/ny-garland.svg") 0 0 / 240px 34px repeat-x;
  animation: hol-twinkle 3.2s ease-in-out infinite alternate;
}

/* Тыквы у финального призыва */
.hol-halloween .final { position: relative; }
.hol-halloween .final::after {
  content: ""; position: absolute; left: max(16px, calc(50% - 560px)); bottom: -36px; width: 200px; height: 118px;
  background: url("holiday/hal-pumpkins.svg") center / contain no-repeat; pointer-events: none;
}
.hol-newyear .final::after {
  content: ""; position: absolute; right: max(16px, calc(50% - 560px)); top: 60px; width: 180px; height: 180px;
  background: url("holiday/ny-ornaments.svg") center / contain no-repeat; pointer-events: none; opacity: .9;
}
.hol-newyear .final { position: relative; }

/* Кнопки — с праздничным отливом */
.hol-halloween .btn:not(.btn-ghost):not(.btn-off):not(.btn-danger) { background: linear-gradient(135deg, #ff9a3c, var(--accent) 60%); box-shadow: 0 6px 18px rgba(230, 100, 20, .25); }
.hol-newyear .btn:not(.btn-ghost):not(.btn-off):not(.btn-danger) { box-shadow: 0 6px 18px rgba(35, 64, 142, .22); }
@media (prefers-color-scheme: dark) {
  .hol-newyear .btn:not(.btn-ghost):not(.btn-off):not(.btn-danger) { background: linear-gradient(135deg, #ffe39a, var(--accent) 65%); box-shadow: 0 6px 20px rgba(242, 199, 92, .22); }
}
.hol-newyear .kicker, .hol-newyear .eyebrow { color: var(--accent-text); }

@keyframes hol-float { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-10px) rotate(-1.5deg); } }
@keyframes hol-snow { from { background-position: 0 0; } to { background-position: 80px 420px; } }
@keyframes hol-twinkle { from { filter: brightness(.9) saturate(.9); } to { filter: brightness(1.25) saturate(1.2); } }

@media (max-width: 720px) {
  .hol-halloween main::before { width: 120px; height: 140px; }
  .hol-newyear main::before { width: 120px; height: 120px; }
  .hol-halloween .hero::after { width: 160px; height: 90px; top: 30px; }
  .hol .final::after { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hol .hero::after, .hol-newyear .top::after { animation: none; }
}
@media print { .hol main::before, .hol .hero::after, .hol .final::after, .hol-newyear .top::after { display: none; } }
