/* ═══ Электрозима — зимний оверлей elpri-rele.ru ═══
   Включается functions.php по дате (зима 1.12–10.02: body.elpri-winter,
   праздник 10.12–20.01: body.elpri-feast). Только CSS: ни одной строки JS,
   CSP и хеш Метрики не затрагиваются. corporateclean.css не меняется.
   Предпросмотр вне окна (только не-прод): ?elpri_season=winter|feast|off */

/* ── Каркас декоративных слоёв ──
   ВАЖНО: без класса body.elpri-winter декорации скрыты полностью (display:none).
   AJAX-навигация подменяет классы body классами загруженной страницы: если та
   вдруг без зимнего класса, декорации обязаны исчезнуть, а не остаться в потоке. */
.elpri-wcontacts, .elpri-wstars { display: none; }
/* overflow:hidden только у #header (падающий снег). У #header-menu его НЕ ставить:
   выпадающие подменю (li.expanded ul) позиционируются ниже полосы — обрежутся. */
body.elpri-winter #header { position: relative; overflow: hidden; }

/* ── Единственная анимация меню: бегущий ледяной блик по верхней кромке ──
   (верхняя граница #header-menu = нижняя кромка #header). Блик — отдельный
   слой 60% ширины, едет transform'ом; старт и финиш ЗА пределами контейнера
   (overflow:hidden у #header клипает) — цикл бесшовный, без скачков. */
body.elpri-winter #header::after {
	content: '';
	position: absolute; bottom: 0; left: 0; height: 2px; width: 60%;
	background: linear-gradient(100deg,
		transparent 0%, rgba(126,206,255,0) 18%,
		rgba(126,206,255,.75) 42%, rgba(230,247,255,.98) 50%, rgba(126,206,255,.75) 58%,
		rgba(126,206,255,0) 82%, transparent 100%);
	transform: translateX(-130%);
	animation: elpri-iceglide 9s linear infinite;
	will-change: transform;
}
@keyframes elpri-iceglide {
	from { transform: translateX(-130%); }
	to   { transform: translateX(230%); }
}

/* ── Ледяные акценты (взамен #0099CC/#1487d4 в шапке и подвале) ── */
body.elpri-winter #header-menu ul.menu li a:hover,
body.elpri-winter #header-menu ul.menu li a.active { color: #7fd4ff; }
body.elpri-winter #footer a:hover,
body.elpri-winter #footer li a.active:hover,
body.elpri-winter #footer-bottom a:hover { color: #7fd4ff; }

/* ── Снег в шапке: контакты-«плюсы» (фирменные) + мелкие крупинки-точки.
   15 частиц, два размера; всё на transform — пересчёта layout нет. ── */
body.elpri-winter .elpri-wcontacts { display: block; position: absolute; inset: 0; pointer-events: none; }
body.elpri-winter .elpri-wcontacts span {
	position: absolute; top: -12px; width: 7px; height: 7px; opacity: .3;
	background:
		linear-gradient(#bfe6ff, #bfe6ff) center / 100% 1.5px no-repeat,
		linear-gradient(#bfe6ff, #bfe6ff) center / 1.5px 100% no-repeat;
	animation: elpri-contact-fall linear infinite;
}
body.elpri-winter .elpri-wcontacts span:nth-child(3n) {	/* крупинки: точки */
	width: 3px; height: 3px; border-radius: 50%;
	background: #dff1ff; opacity: .55;
}
@keyframes elpri-contact-fall { to { transform: translateY(230px); } }
body.elpri-winter .elpri-wcontacts span:nth-child(1)  { left: 4%;  animation-duration: 15s; animation-delay: -2s; }
body.elpri-winter .elpri-wcontacts span:nth-child(2)  { left: 11%; animation-duration: 19s; animation-delay: -8s; }
body.elpri-winter .elpri-wcontacts span:nth-child(3)  { left: 17%; animation-duration: 12s; animation-delay: -5s; }
body.elpri-winter .elpri-wcontacts span:nth-child(4)  { left: 23%; animation-duration: 17s; animation-delay: -11s; }
body.elpri-winter .elpri-wcontacts span:nth-child(5)  { left: 30%; animation-duration: 13s; animation-delay: -7s; }
body.elpri-winter .elpri-wcontacts span:nth-child(6)  { left: 36%; animation-duration: 20s; animation-delay: -3s; }
body.elpri-winter .elpri-wcontacts span:nth-child(7)  { left: 43%; animation-duration: 14s; animation-delay: -14s; }
body.elpri-winter .elpri-wcontacts span:nth-child(8)  { left: 50%; animation-duration: 18s; animation-delay: -9s; }
body.elpri-winter .elpri-wcontacts span:nth-child(9)  { left: 56%; animation-duration: 11s; animation-delay: -6s; }
body.elpri-winter .elpri-wcontacts span:nth-child(10) { left: 63%; animation-duration: 16s; animation-delay: -12s; }
body.elpri-winter .elpri-wcontacts span:nth-child(11) { left: 69%; animation-duration: 19s; animation-delay: -4s; }
body.elpri-winter .elpri-wcontacts span:nth-child(12) { left: 76%; animation-duration: 12s; animation-delay: -10s; }
body.elpri-winter .elpri-wcontacts span:nth-child(13) { left: 83%; animation-duration: 15s; animation-delay: -16s; }
body.elpri-winter .elpri-wcontacts span:nth-child(14) { left: 89%; animation-duration: 18s; animation-delay: -7s; }
body.elpri-winter .elpri-wcontacts span:nth-child(15) { left: 96%; animation-duration: 13s; animation-delay: -1s; }

/* ── Ледяные звёздочки по тёмному фону шапки ──
   Пул из 14 фиксированных позиций с несинхронными циклами (7–14 с) и коротким
   окном видимости (~15% цикла): каждая вспыхивает в «случайный» момент, гаснет,
   тем временем вспыхивает другая — эффект «загораются и потухают в разных
   местах» без единой строки JS. */
body.elpri-winter .elpri-wstars { display: block; position: absolute; inset: 0; pointer-events: none; }
body.elpri-winter .elpri-wstars span {
	position: absolute; width: 11px; height: 11px; background: #d8efff;
	clip-path: polygon(50% 0%, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0% 50%, 39% 39%);
	opacity: 0;
	filter: drop-shadow(0 0 4px rgba(170, 225, 255, .9));
	animation: elpri-starflash 10s linear infinite;
}
@keyframes elpri-starflash {
	0%   { opacity: 0; transform: scale(.35); }
	4%   { opacity: .9; transform: scale(1); }
	10%  { opacity: .8; transform: scale(1); }
	15%  { opacity: 0; transform: scale(.45); }
	100% { opacity: 0; transform: scale(.35); }
}
body.elpri-winter .elpri-wstars span:nth-child(1)  { left: 6%;  top: 14%; animation-duration: 8.1s;  animation-delay: -0.4s; }
body.elpri-winter .elpri-wstars span:nth-child(2)  { left: 14%; top: 66%; width: 8px;  height: 8px;  animation-duration: 12.3s; animation-delay: -5.1s; }
body.elpri-winter .elpri-wstars span:nth-child(3)  { left: 23%; top: 26%; animation-duration: 9.6s;  animation-delay: -7.8s; }
body.elpri-winter .elpri-wstars span:nth-child(4)  { left: 31%; top: 74%; width: 9px;  height: 9px;  animation-duration: 11.2s; animation-delay: -2.6s; }
body.elpri-winter .elpri-wstars span:nth-child(5)  { left: 39%; top: 10%; width: 8px;  height: 8px;  animation-duration: 13.5s; animation-delay: -9.3s; }
body.elpri-winter .elpri-wstars span:nth-child(6)  { left: 47%; top: 58%; animation-duration: 7.4s;  animation-delay: -3.7s; }
body.elpri-winter .elpri-wstars span:nth-child(7)  { left: 55%; top: 20%; width: 12px; height: 12px; animation-duration: 10.8s; animation-delay: -6.4s; }
body.elpri-winter .elpri-wstars span:nth-child(8)  { left: 63%; top: 70%; width: 8px;  height: 8px;  animation-duration: 12.9s; animation-delay: -1.2s; }
body.elpri-winter .elpri-wstars span:nth-child(9)  { left: 71%; top: 34%; animation-duration: 8.7s;  animation-delay: -8.5s; }
body.elpri-winter .elpri-wstars span:nth-child(10) { left: 78%; top: 12%; width: 9px;  height: 9px;  animation-duration: 11.7s; animation-delay: -4.4s; }
body.elpri-winter .elpri-wstars span:nth-child(11) { left: 85%; top: 62%; animation-duration: 7.9s;  animation-delay: -10.1s; }
body.elpri-winter .elpri-wstars span:nth-child(12) { left: 92%; top: 24%; width: 8px;  height: 8px;  animation-duration: 13.1s; animation-delay: -6.9s; }
body.elpri-winter .elpri-wstars span:nth-child(13) { left: 10%; top: 42%; width: 9px;  height: 9px;  animation-duration: 10.3s; animation-delay: -2.1s; }
body.elpri-winter .elpri-wstars span:nth-child(14) { left: 97%; top: 78%; width: 8px;  height: 8px;  animation-duration: 9.2s;  animation-delay: -0.9s; }

/* ═══ Праздничный слой (body.elpri-feast, 20.12–10.01) ═══ */

/* Снег на логотипе убран (v0.1.362): шапка несёт снегопад,
   вспыхивающие звёзды и ледяную кромку меню */

/* Разноцветная гирлянда на провисающей нити, во всю ширину нижней плашки.
   Нить — растягиваемый SVG (non-scaling-stroke), лампы — HTML-точки в
   процентах поверх неё: круглые при любой ширине, свечение не клипается.
   Волна подсветки — градиент animation-delay вдоль нити. */
body.elpri-feast .elpri-garland {
	position: relative; height: 48px; line-height: 0;
	margin-top: -12px; /* гребень нити вплотную к верхней кромке тёмной плашки (padding-top:12px у #footer-bottom) */
}
body.elpri-feast .elpri-garland svg { position: absolute; inset: 0; width: 100%; height: 100%; }
body.elpri-feast .elpri-garland .g-wire {
	fill: none; stroke: rgba(255,255,255,.38); stroke-width: 1.1; stroke-linecap: round;
}
body.elpri-feast .elpri-garland .g-lamp {
	position: absolute; width: 11px; height: 11px; border-radius: 50%;
	margin: -5.5px 0 0 -5.5px;
	animation: elpri-gcycle 28s linear infinite;
}
/* Хореография 28 с по кругу: 0–25% мягкая волна · 25–43% двойная погоня ·
   46–61% быстрое мерцание · 62–100% ровный отдых. Фаза каждой лампы сдвинута
   вдоль нити (4 с на всю длину) — режимы сменяются бегущей волной. */
@keyframes elpri-gcycle {
	0%        { opacity: .35; }
	12.5%     { opacity: 1; }
	25%       { opacity: .35; }
	29%       { opacity: .4; }
	31%       { opacity: 1; }
	33%       { opacity: .4; }
	37%       { opacity: .45; }
	39%       { opacity: 1; }
	41%       { opacity: .4; }
	46%       { opacity: .5; }
	48%       { opacity: 1; }
	50%       { opacity: .55; }
	52%       { opacity: 1; }
	54%       { opacity: .55; }
	56%       { opacity: .95; }
	58%       { opacity: .6; }
	62%       { opacity: .6; }
	96%       { opacity: .6; }
	100%      { opacity: .35; }
}
body.elpri-feast .g-c1 { background: #ffc46b; box-shadow: 0 0 11px 2px rgba(255,196,107,.8); } /* янтарь */
body.elpri-feast .g-c2 { background: #ff7a6b; box-shadow: 0 0 11px 2px rgba(255,122,107,.8); } /* тёплый красный */
body.elpri-feast .g-c3 { background: #8fe3a0; box-shadow: 0 0 11px 2px rgba(143,227,160,.8); } /* мягкий зелёный */
body.elpri-feast .g-c4 { background: #8fd6ff; box-shadow: 0 0 11px 2px rgba(143,214,255,.8); } /* ледяной, под бренд */
body.elpri-feast .g-c5 { background: #ffe08a; box-shadow: 0 0 11px 2px rgba(255,224,138,.8); } /* золото */
/* на узких экранах лампы реже, чтобы не сливались */
@media (max-width: 760px) {
	body.elpri-feast .elpri-garland .g-lamp:nth-child(even) { display: none; }
}

/* ═══ Доступность ═══ */
@media (prefers-reduced-motion: reduce) {
	body.elpri-winter *, body.elpri-winter *::before, body.elpri-winter *::after,
	body.elpri-feast *, body.elpri-feast *::before, body.elpri-feast *::after {
		animation: none !important;
		transition: none !important;
	}
}
