/* «Зимова тема» (1.12–14.01; js/theme.js sets html[data-season="winter"]): cold accents in the frame of the portal —
   state bar, header with a garland, menu, tabs, login panel — in the light and the dark theme. Documents, blanks,
   orders and anything published are not touched: no colour variable changes on the page itself. */

/* The snow canvas (js/winter.js): over the page, under the menus, lists and dialogs; never takes clicks */
.snowfall { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 20; }

/* The ❄ snow button and the menu switch exist in the season only */
.btn.snowbtn { font-size: 17px; line-height: 1; color: var(--ink-3); }
.btn.snowbtn[aria-pressed="true"] { color: #2f7fbf; background: rgba(47, 127, 191, 0.1); }
/* On the login page the theme button sits in the corner: the snow button goes just left of it */
.login .rpanel .btn.themebtn.snowbtn { right: 60px; }
.whomenu .winico { width: 17px; text-align: center; color: #2f7fbf; flex: none; }
.whomenu .wintag { margin-left: auto; font-size: 12px; color: var(--ink-3); }
.whomenu [data-winter-toggle][aria-checked="true"] .wintag { color: #2f7fbf; font-weight: 600; }

html[data-season="winter"] {
  --winter-ice: #2f7fbf;
  --winter-ice-2: #8cc4ec;
  --winter-frost: #eef6fc;
  --winter-night: #0b2545;
  --winter-night-2: #144a7a;
}
html[data-season="winter"][data-theme="dark"] {
  --winter-ice: #7fbde9;
  --winter-ice-2: #4d86b8;
  --winter-frost: #152131;
  --winter-night: #06101d;
  --winter-night-2: #0f2a47;
}

/* State bar: a winter night */
html[data-season="winter"] .statebar {
  background: linear-gradient(90deg, var(--winter-night), var(--winter-night-2) 50%, var(--winter-night));
}

/* Header: frost from the top, an icy line and a garland of small lights under it */
html[data-season="winter"] .header {
  position: relative;
  background: linear-gradient(180deg, var(--winter-frost), var(--paper) 85%);
  box-shadow: inset 0 -3px 0 var(--winter-ice);
}
html[data-season="winter"] .header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -7px; height: 8px; pointer-events: none; z-index: 2;
  background:
    radial-gradient(circle at 12px 4px, #e24c4c 0 2.6px, transparent 3.2px) 0 0 / 96px 8px repeat-x,
    radial-gradient(circle at 36px 4px, #f2c14e 0 2.6px, transparent 3.2px) 0 0 / 96px 8px repeat-x,
    radial-gradient(circle at 60px 4px, #4cb86b 0 2.6px, transparent 3.2px) 0 0 / 96px 8px repeat-x,
    radial-gradient(circle at 84px 4px, #5aa7e6 0 2.6px, transparent 3.2px) 0 0 / 96px 8px repeat-x;
  filter: drop-shadow(0 0 2px rgba(255, 230, 160, 0.55));
  animation: winter-twinkle 2.8s ease-in-out infinite alternate;
}
@keyframes winter-twinkle { from { opacity: .7; } to { opacity: 1; } }
html[data-season="winter"] .brand .t2::after { content: " ❄"; color: var(--winter-ice); font-size: .8em; }
html[data-season="winter"] .avatar { box-shadow: 0 0 0 2px var(--winter-ice-2); }

/* Menu and tabs: icy accents instead of gold */
html[data-season="winter"] .side a.on { border-left-color: var(--winter-ice); }
html[data-season="winter"] .side a.on svg { color: var(--winter-ice); }
html[data-season="winter"] .tabs a.on, html[data-season="winter"] .tabs button.on { border-bottom-color: var(--winter-ice); }
html[data-season="winter"] .footer { border-top-color: var(--winter-ice-2); }

/* Login: the left panel as a winter night with a light snowy hem */
html[data-season="winter"] .login .left {
  background: linear-gradient(160deg, var(--winter-night-2), var(--winter-night) 70%);
}

@media (prefers-reduced-motion: reduce) {
  html[data-season="winter"] .header::after { animation: none; }
}
@media (max-width: 640px) {
  html[data-season="winter"] .brand .t2::after { content: ""; }
}
@media print {
  .snowfall, html[data-season="winter"] .header::after { display: none !important; }
}
