/* =====================================================================
   Святкові теми Норма-4
   body.winter-season + одна з фаз: .holiday-nicholas | .holiday-christmas | .holiday-new-year
   Повсякденний вигляд (body.vice-season) цей файл не зачіпає — він
   підключається лише у святковий період (див. helpers/holiday.php).
   ===================================================================== */

/* ---------- Палітри фаз ---------- */
.holiday-nicholas {
    --h-accent: #f3c969;
    --h-accent-2: #6fb3ff;
    --h-accent-ink: #1a2a4a;
    --h-glow: #f3c96966;
    --h-overlay: linear-gradient(90deg, #07152ee6, #0b2550a6 48%, #0b255014 100%);
    --h-overlay-mobile: linear-gradient(90deg, #07152eeb, #0b2550b8 65%, #0b255080);
    --h-page-tint: radial-gradient(ellipse 900px 600px at 0 28%, #c9dcff2e, transparent 75%), radial-gradient(ellipse 800px 650px at 100% 60%, #ffe7b029, transparent 75%);
    --h-wire: #2c3f63;
}
.holiday-christmas {
    --h-accent: #f0c46a;
    --h-accent-2: #e0474c;
    --h-accent-ink: #3a0d12;
    --h-glow: #f0c46a66;
    --h-overlay: linear-gradient(90deg, #22070ce6, #3d0e16a3 48%, #3d0e1612 100%);
    --h-overlay-mobile: linear-gradient(90deg, #22070ceb, #3d0e16b8 65%, #3d0e1680);
    --h-page-tint: radial-gradient(ellipse 900px 600px at 0 28%, #ffd6d62b, transparent 75%), radial-gradient(ellipse 800px 650px at 100% 60%, #d6f0df2e, transparent 75%);
    --h-wire: #2e4a3c;
}
.holiday-new-year {
    --h-accent: #ffd36e;
    --h-accent-2: #ff6fb5;
    --h-accent-ink: #1b1240;
    --h-glow: #b58cff66;
    --h-overlay: linear-gradient(90deg, #0d0a2ae6, #24175aa6 48%, #24175a14 100%);
    --h-overlay-mobile: linear-gradient(90deg, #0d0a2aeb, #24175ab8 65%, #24175a80);
    --h-page-tint: radial-gradient(ellipse 900px 600px at 0 28%, #e3d6ff33, transparent 75%), radial-gradient(ellipse 800px 650px at 100% 60%, #ffd9ef2e, transparent 75%);
    --h-wire: #3b3560;
}

body.winter-season { background-color: #f6f7fb; background-image: var(--h-page-tint, none); }

/* ---------- Шапка + гірлянда ---------- */
.winter-season #site-header { isolation: isolate; background: #fff; }
.winter-season #site-header::before {
    content: '';
    position: absolute;
    z-index: 1;
    inset: 0;
    background: inherit;
    pointer-events: none;
}
.winter-season #site-header::after { content: none; }
.winter-season #site-header > div:not(.holiday-garland):not(.holiday-countdown) { position: relative; z-index: 2; }

/* Різдво: смужка-вишиванка по низу шапки */
.holiday-christmas #site-header::after {
    content: '';
    position: absolute;
    z-index: 3;
    left: 0;
    right: 0;
    bottom: 0;
    height: 8px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='8' viewBox='0 0 32 8' shape-rendering='crispEdges'%3E%3Cg fill='%23c62f35'%3E%3Crect x='14' y='0' width='4' height='2'/%3E%3Crect x='12' y='2' width='2' height='2'/%3E%3Crect x='18' y='2' width='2' height='2'/%3E%3Crect x='10' y='4' width='2' height='2'/%3E%3Crect x='20' y='4' width='2' height='2'/%3E%3Crect x='12' y='6' width='2' height='2'/%3E%3Crect x='18' y='6' width='2' height='2'/%3E%3Crect x='0' y='2' width='2' height='4'/%3E%3Crect x='30' y='2' width='2' height='4'/%3E%3C/g%3E%3Cg fill='%231f1f24'%3E%3Crect x='14' y='4' width='4' height='2'/%3E%3Crect x='2' y='0' width='2' height='2'/%3E%3Crect x='2' y='6' width='2' height='2'/%3E%3Crect x='28' y='0' width='2' height='2'/%3E%3Crect x='28' y='6' width='2' height='2'/%3E%3C/g%3E%3C/svg%3E") left center / 32px 8px repeat-x;
    pointer-events: none;
}

.holiday-garland {
    position: absolute;
    z-index: 0;
    top: 100%;
    left: 0;
    width: 100%;
    height: 68px;
    overflow: hidden;
    contain: layout;
}
.holiday-garland, .holiday-garland * { pointer-events: none; }
.holiday-garland__wire { position: absolute; top: 0; left: 0; overflow: visible; }
.holiday-garland__wire path { fill: none; stroke: var(--h-wire, #2e4a3c); stroke-width: 1.6; stroke-linecap: round; opacity: .85; }
.holiday-bulb {
    position: absolute;
    top: 18px;
    width: 13px;
    height: 22px;
    border-radius: 45% 45% 48% 48%;
    background: radial-gradient(ellipse at 32% 26%, #ffffffb3, transparent 30%), linear-gradient(90deg, #0004, transparent 38%, #0003), var(--bulb-color);
    box-shadow: inset -1px -2px 3px #0003, 0 1px 2px #0003;
    transform: translateX(-50%) rotate(var(--bulb-tilt));
    transform-origin: 50% -6px;
}
.holiday-bulb::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 3px;
    width: 7px;
    height: 7px;
    border-radius: 2px 2px 0 0;
    background: repeating-linear-gradient(0deg, #263c31 0 1px, #4b6051 1px 2px);
}
.holiday-bulb::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: radial-gradient(ellipse at 45% 45%, #fff9, transparent 65%);
    box-shadow: 0 0 8px 3px var(--bulb-color), 0 0 19px 5px var(--bulb-glow);
    opacity: .12;
    transition: opacity 1.3s ease;
}
.holiday-garland[data-light-phase="0"] .holiday-bulb[data-group="0"]::after,
.holiday-garland[data-light-phase="1"] .holiday-bulb[data-group="1"]::after,
.holiday-garland[data-light-phase="2"] .holiday-bulb[data-group="2"]::after,
.holiday-garland[data-light-phase="3"] .holiday-bulb[data-group="3"]::after { opacity: .95; }
.holiday-garland[data-light-phase="static"] .holiday-bulb::after { opacity: .35; transition: none; }

/* Миколай: на нитці зірочки й подарунки замість лампочок */
.holiday-bulb[data-shape="star"] {
    margin-top: -4px;
    width: 18px;
    height: 18px;
    border-radius: 0;
    background: radial-gradient(circle at 40% 35%, #fff8, transparent 45%), var(--bulb-color);
    clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 94%, 50% 72%, 21% 94%, 32% 57%, 2% 35%, 39% 35%);
    box-shadow: none;
}
.holiday-bulb[data-shape="star"]::before { content: none; }
.holiday-bulb[data-shape="star"]::after { border-radius: 0; box-shadow: none; background: #fff; }
.holiday-garland[data-light-phase] .holiday-bulb[data-shape="star"] { filter: drop-shadow(0 0 0 transparent); transition: filter 1.3s ease; }
.holiday-garland[data-light-phase="0"] .holiday-bulb[data-shape="star"][data-group="0"],
.holiday-garland[data-light-phase="1"] .holiday-bulb[data-shape="star"][data-group="1"],
.holiday-garland[data-light-phase="2"] .holiday-bulb[data-shape="star"][data-group="2"],
.holiday-garland[data-light-phase="3"] .holiday-bulb[data-shape="star"][data-group="3"] { filter: drop-shadow(0 0 5px var(--bulb-color)); }
.holiday-garland .holiday-bulb[data-shape="star"]::after { opacity: 0 !important; }

.holiday-bulb[data-shape="gift"] {
    margin-top: 1px;
    width: 15px;
    height: 13px;
    border-radius: 2px;
    background:
        linear-gradient(90deg, transparent 42%, var(--ribbon, #f3c969) 42% 58%, transparent 58%),
        linear-gradient(0deg, transparent 38%, var(--ribbon, #f3c969) 38% 54%, transparent 54%),
        var(--bulb-color);
    box-shadow: inset -2px -2px 0 #0002, 0 1px 2px #0003;
}
.holiday-bulb[data-shape="gift"]::before {
    top: -6px;
    left: 2px;
    width: 11px;
    height: 7px;
    border-radius: 50% 50% 0 0;
    background: radial-gradient(circle at 25% 80%, transparent 2px, var(--ribbon, #f3c969) 2.5px 4px, transparent 4.5px), radial-gradient(circle at 75% 80%, transparent 2px, var(--ribbon, #f3c969) 2.5px 4px, transparent 4.5px);
}
.holiday-bulb[data-shape="gift"]::after { border-radius: 2px; }

.holiday-bulb[data-shape="ball"] {
    margin-top: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: radial-gradient(circle at 34% 30%, #fffc 0 8%, transparent 32%), radial-gradient(circle at 65% 75%, #0003, transparent 60%), var(--bulb-color);
}
.holiday-bulb[data-shape="ball"]::before { top: -5px; left: 5px; width: 6px; height: 5px; background: linear-gradient(90deg, #b9952f, #f3d98a, #b9952f); }

@media (prefers-reduced-motion: no-preference) {
    .holiday-garland[data-swing="on"] .holiday-bulb { animation: holiday-swing 3.6s ease-in-out infinite alternate; animation-delay: calc(var(--i, 0) * -0.37s); }
}
/* Інтерактив: наведення/дотик до елемента гірлянди */
.holiday-garland .holiday-bulb { pointer-events: auto; cursor: default; touch-action: manipulation; }
.holiday-bulb.is-touched { z-index: 2; }
.holiday-bulb.is-touched::after { opacity: .95 !important; transition: none; }
.holiday-bulb[data-shape].is-touched { filter: drop-shadow(0 0 6px var(--bulb-color)); }
@media (prefers-reduced-motion: no-preference) {
    .holiday-garland .holiday-bulb.is-touched { animation: holiday-touch 1.5s cubic-bezier(.3, .7, .4, 1) both; }
    .holiday-garland .holiday-bulb.is-nudged { animation: holiday-nudge 1.1s ease-out both; }
}
@media (prefers-reduced-motion: reduce) {
    .holiday-garland .holiday-bulb.is-touched { animation: holiday-glow 1.2s ease both; }
}
@keyframes holiday-touch {
    0%   { transform: translateX(-50%) rotate(var(--bulb-tilt)) scale(1); }
    14%  { transform: translateX(-50%) rotate(30deg) scale(1.65); }
    32%  { transform: translateX(-50%) rotate(-24deg) scale(1.6); }
    50%  { transform: translateX(-50%) rotate(16deg) scale(1.5); }
    68%  { transform: translateX(-50%) rotate(-9deg) scale(1.35); }
    84%  { transform: translateX(-50%) rotate(4deg) scale(1.15); }
    100% { transform: translateX(-50%) rotate(var(--bulb-tilt)) scale(1); }
}
@keyframes holiday-nudge {
    0%, 100% { transform: translateX(-50%) rotate(var(--bulb-tilt)); }
    25% { transform: translateX(-50%) rotate(-14deg); }
    55% { transform: translateX(-50%) rotate(9deg); }
    80% { transform: translateX(-50%) rotate(-4deg); }
}
@keyframes holiday-glow { 0%, 100% { opacity: 1; } 30% { opacity: .8; } }

@keyframes holiday-swing { from { transform: translateX(-50%) rotate(calc(var(--bulb-tilt) * -1)); } to { transform: translateX(-50%) rotate(var(--bulb-tilt)); } }

/* ---------- Відлік до Нового року: табличка, що висить по центру під шапкою ---------- */
.holiday-countdown {
    position: absolute;
    z-index: 3;
    top: calc(100% + 12px);
    left: 50%;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 6px 15px 6px 8px;
    border-radius: 999px;
    background: var(--h-accent-ink, #1b1240);
    color: #fff;
    box-shadow: 0 8px 22px -8px #0008, 0 0 22px -6px var(--h-glow), inset 0 0 0 1px color-mix(in srgb, var(--h-accent) 40%, transparent);
    line-height: 1.1;
    white-space: nowrap;
    transform: translateX(-50%);
    transform-origin: 50% -12px;
    pointer-events: none;
}
/* дві нитки, на яких висить табличка */
.holiday-countdown::before,
.holiday-countdown::after {
    content: '';
    position: absolute;
    bottom: 100%;
    width: 1.5px;
    height: 14px;
    background: var(--h-wire, #2e4a3c);
}
.holiday-countdown::before { left: 26px; }
.holiday-countdown::after { right: 26px; }
.holiday-countdown__icon {
    position: relative;
    width: 20px;
    height: 20px;
    flex: none;
    border-radius: 50%;
    background: color-mix(in srgb, var(--h-accent) 22%, transparent);
}
.holiday-countdown__icon::before {
    content: '';
    position: absolute;
    inset: 4px;
    background: var(--h-accent);
    clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 94%, 50% 72%, 21% 94%, 32% 57%, 2% 35%, 39% 35%);
}
.holiday-countdown__label { font-size: 12.5px; font-weight: 500; color: color-mix(in srgb, var(--h-accent) 85%, #fff); }
.holiday-countdown__time { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; padding-left: 9px; border-left: 1px solid #ffffff2e; }
@media (prefers-reduced-motion: no-preference) {
    .holiday-countdown:not(.holiday-countdown--pinned) { animation: holiday-sign 5s ease-in-out infinite; }
    .holiday-countdown.is-final .holiday-countdown__icon::before,
    .holiday-countdown.is-done .holiday-countdown__icon::before { animation: holiday-countdown-spin 3s linear infinite; }
}
@keyframes holiday-sign { 0%, 100% { transform: translateX(-50%) rotate(-1.2deg); } 50% { transform: translateX(-50%) rotate(1.2deg); } }
@keyframes holiday-countdown-spin { to { transform: rotate(1turn); } }
@media (max-width: 480px) {
    .holiday-countdown { gap: 7px; padding: 5px 12px 5px 6px; }
    .holiday-countdown__label { font-size: 11.5px; }
    .holiday-countdown__time { font-size: 12.5px; padding-left: 7px; }
}
@media (max-width: 359px) { .holiday-countdown__icon { display: none; } }

/* Закріплена копія, коли шапка схована під час прокрутки */
.holiday-countdown--pinned {
    position: fixed;
    z-index: 49;
    top: 12px;
    transform: translate(-50%, calc(-100% - 24px));
    transition: transform .45s cubic-bezier(.3, .7, .4, 1);
}
.holiday-countdown--pinned.is-visible { transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .holiday-countdown--pinned { transition: none; } }

/* Внутрішні сторінки: місце під гірлянду й табличку, щоб вони не лягали на «хлібні крихти» */
body.winter-season.holiday-inner { padding-top: 170px; }

/* ---------- Банер на головній ---------- */
.winter-season .hero-overlay { background: var(--h-overlay); }
.winter-season .hero-inner { max-width: 680px; }
.winter-season .hero-title { max-width: 650px; font-weight: 650; line-height: 1.12; letter-spacing: -.025em; }
.winter-season .hero-description { max-width: 560px; }
.winter-season .hero-slider::after {
    content: '';
    position: absolute;
    inset: auto 0 0;
    z-index: 5;
    height: 46px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 46' preserveAspectRatio='none'%3E%3Cpath d='M0 30C120 10 220 14 330 24s210 18 330 2 250-22 360-4 140 14 180 8v36H0Z' fill='%23ffffff' fill-opacity='.18'/%3E%3Cpath d='M0 38c140-16 260-10 380 0s250 8 370-4 290-8 450 6v6H0Z' fill='%23ffffff' fill-opacity='.28'/%3E%3C/svg%3E") center bottom / 100% 100% no-repeat;
    pointer-events: none;
}

.hero-holiday-badge {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 18px;
    padding: 7px 16px 7px 12px;
    border: 1px solid color-mix(in srgb, var(--h-accent) 55%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--h-accent) 14%, #ffffff0d);
    color: var(--h-accent);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .02em;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 0 24px -6px var(--h-glow);
}
.hero-holiday-badge__icon {
    width: 16px;
    height: 16px;
    flex: none;
    background: currentColor;
    clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 94%, 50% 72%, 21% 94%, 32% 57%, 2% 35%, 39% 35%);
}
.holiday-christmas .hero-holiday-badge__icon { clip-path: polygon(50% 0, 58% 42%, 100% 50%, 58% 58%, 50% 100%, 42% 58%, 0 50%, 42% 42%); }
.holiday-new-year .hero-holiday-badge__icon { clip-path: polygon(50% 0, 56% 38%, 85% 15%, 62% 44%, 100% 50%, 62% 56%, 85% 85%, 56% 62%, 50% 100%, 44% 62%, 15% 85%, 38% 56%, 0 50%, 38% 44%, 15% 15%, 44% 38%); }

.winter-season .hero-title {
    background: linear-gradient(100deg, #fff 0 55%, color-mix(in srgb, var(--h-accent) 85%, #fff) 80%, #fff 100%);
    -webkit-background-clip: text;
            background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
    filter: drop-shadow(0 2px 14px #0006);
}
.winter-season .hero-button {
    border-color: color-mix(in srgb, var(--h-accent) 60%, transparent);
    box-shadow: inset 0 1px 0 #ffffff26, 0 6px 26px -6px var(--h-glow);
}
.winter-season .hero-button:hover { background: var(--h-accent); color: var(--h-accent-ink); }
.winter-season .hero-dot.active { background: var(--h-accent); }

.holiday-sky {
    position: absolute;
    inset: 0;
    z-index: 4;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Різдво: Віфлеємська зірка над банером */
.holiday-bethlehem {
    position: absolute;
    z-index: 4;
    top: 46px;
    right: max(6%, calc((100% - 1280px) / 2 + 40px));
    width: 92px;
    height: 92px;
    pointer-events: none;
}
.holiday-bethlehem::before,
.holiday-bethlehem::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, #fff 0 6%, #fff4d0 9%, transparent 12%), #ffe6a0;
    clip-path: polygon(50% 0, 54% 44%, 100% 50%, 54% 56%, 50% 100%, 46% 56%, 0 50%, 46% 44%);
    filter: drop-shadow(0 0 10px #ffd98a);
}
.holiday-bethlehem::after { transform: rotate(45deg) scale(.55); opacity: .85; }
.holiday-bethlehem span {
    position: absolute;
    inset: -40px;
    border-radius: 50%;
    background: radial-gradient(circle, #ffe6a055, transparent 62%);
}
@media (prefers-reduced-motion: no-preference) {
    .holiday-bethlehem span { animation: holiday-pulse 4s ease-in-out infinite; }
    .holiday-bethlehem::after { animation: holiday-twinkle 4s ease-in-out infinite; }
}
@keyframes holiday-pulse { 50% { transform: scale(1.18); opacity: .7; } }
@keyframes holiday-twinkle { 50% { transform: rotate(45deg) scale(.7); opacity: 1; } }

/* ---------- Дрібниці по сайту ---------- */
.winter-season #scrollTopBtn { background: var(--h-accent-ink); color: var(--h-accent); box-shadow: 0 6px 20px -6px var(--h-glow); }
.winter-season ::selection { background: color-mix(in srgb, var(--h-accent) 45%, #fff); color: var(--h-accent-ink); }

@media (max-width: 767px) {
    .winter-season .hero-overlay { background: var(--h-overlay-mobile); }
    .winter-season .hero-bg { background-position: 68% center; }
    .winter-season .hero-title { font-size: clamp(28px, 7.6vw, 34px); }
    .hero-holiday-badge { font-size: 12.5px; margin-bottom: 12px; padding: 6px 12px 6px 10px; }
    .holiday-bethlehem { top: 18px; right: 14px; width: 54px; height: 54px; }
    .holiday-bulb { width: 11px; height: 19px; }
    .holiday-bulb::before { left: 2px; }
    .holiday-bulb[data-shape="star"] { width: 15px; height: 15px; }
    .holiday-bulb[data-shape="gift"] { width: 13px; height: 11px; }
}
@media (prefers-reduced-motion: reduce) { .holiday-bulb::after { transition: none; } }

/* ---------- Ялинка з вогників у футері ----------
   Spiral-light concept: Ana Travas, https://codepen.io/anatravas/pen/LbozBe.
   Independently implemented at footer scale; all styles stay scoped to the tree. */
.holiday-tree-brand { position: relative; min-height: 136px; padding-right: 96px; }
.holiday-tree {
    position: absolute;
    top: 0;
    right: 0;
    width: 82px;
    height: 136px;
    pointer-events: none;
}
.holiday-tree *, .holiday-tree::after { pointer-events: none; }
.holiday-tree::after { content: ''; position: absolute; bottom: 1px; left: 7px; right: 7px; height: 5px; border-radius: 50%; background: radial-gradient(ellipse, #c69b3c26, transparent 70%); }
.holiday-tree__star {
    position: absolute;
    top: 0;
    left: 34px;
    width: 14px;
    height: 14px;
    background: var(--h-accent, #cda03d);
    clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 94%, 50% 72%, 21% 94%, 32% 57%, 2% 35%, 39% 35%);
    filter: drop-shadow(0 0 3px var(--h-glow, #eac76880));
}
.holiday-tree__canopy { position: absolute; inset: 18px 0 10px; perspective: 700px; transform-style: preserve-3d; }
.holiday-tree__spiral { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateY(var(--tree-angle)); }
.holiday-tree__point { position: absolute; top: 0; left: 50%; transform-style: preserve-3d; }
.holiday-tree__light {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--tree-light);
    box-shadow: 0 0 3px var(--tree-light);
    opacity: .9;
    transform: rotateY(calc(0deg - var(--tree-angle)));
}
@media (prefers-reduced-motion: no-preference) {
    .holiday-tree__spiral { animation: holiday-tree-turn var(--tree-speed) linear infinite; animation-play-state: paused; }
    .holiday-tree__light { animation: holiday-tree-face var(--tree-speed) linear infinite; animation-play-state: paused; }
    .holiday-tree[data-motion="running"] :is(.holiday-tree__spiral, .holiday-tree__light) { animation-play-state: running; }
}
@keyframes holiday-tree-turn { from { transform: rotateY(var(--tree-angle)); } to { transform: rotateY(calc(var(--tree-angle) + 1turn)); } }
@keyframes holiday-tree-face { from { transform: rotateY(calc(0deg - var(--tree-angle))); } to { transform: rotateY(calc(0deg - var(--tree-angle) - 1turn)); } }
@media (min-width: 1024px) and (max-width: 1279px) {
    .holiday-tree-brand { min-height: 150px; padding-right: 0; }
    .holiday-tree { top: 52px; transform: scale(.65); transform-origin: top right; }
}
