/* =============================================================
   Motyw sezonowy: Boże Narodzenie (GOK „Perła”).
   Plik generowany (motywy-sezonowe/generuj.py) – nie edytować ręcznie.
   Ładowany przez header.php TYLKO wtedy, gdy motyw jest aktywny (assets/includes/motyw.php).
   Zasady: zero zmian w treści i układzie (dekoracje są nakładkami, bez przesunięć),
   bez obrazków z sieci (SVG w pliku), animacja tylko w banerze strony głównej,
   wyłączona przy „ogranicz ruch” w systemie, przy „Wysokim kontraście” i przyciskiem pauzy.
   ============================================================= */

/* 1. Wstęga pod menu – na każdej podstronie. Nakładka, nie zmienia wysokości nagłówka. */
.site-header header {
  position: relative;
}
.site-header header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(-1 * 14px);
  height: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='14' viewBox='0 0 56 14'%3E%3Crect y='6.5' width='56' height='1' fill='%23C4A15C' opacity='.55'/%3E%3Cpolygon points='14.0,1.0 15.3,4.0 18.2,2.8 17.0,5.7 20.0,7.0 17.0,8.3 18.2,11.2 15.3,10.0 14.0,13.0 12.7,10.0 9.8,11.2 11.0,8.3 8.0,7.0 11.0,5.7 9.8,2.8 12.7,4.0' fill='%23C4A15C'/%3E%3Ccircle cx='14' cy='7' r='1.3' fill='%23fff'/%3E%3Ccircle cx='35' cy='7' r='1.8' fill='%23C4A15C'/%3E%3Ccircle cx='43' cy='7' r='1' fill='%23C4A15C'/%3E%3Ccircle cx='27' cy='7' r='1' fill='%23C4A15C'/%3E%3C/svg%3E") repeat-x center / 56px 14px;
  pointer-events: none;
}
/* Przy otwartym menu na telefonie wstęga nie jest potrzebna. */
.site-header.menu-open header::after {
  display: none;
}

/* 2. Delikatnie spadające elementy w banerze strony głównej (dwie warstwy = głębia). */
.home {
  overflow: hidden;
}
.home > .wrapper {
  position: relative;
  z-index: 2;
}
.home::before,
.home::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -400px;
  bottom: 0;
  z-index: 1;
  pointer-events: none;
  background-repeat: repeat;
  background-size: 400px 400px;
  will-change: transform;
}
.home::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400' viewBox='0 0 400 400'%3E%3Ccircle cx='132' cy='66' r='1.5' fill='%23fff' opacity='0.37'/%3E%3Ccircle cx='214' cy='148' r='1.0' fill='%23fff' opacity='0.48'/%3E%3Ccircle cx='22' cy='175' r='1.1' fill='%23fff' opacity='0.37'/%3E%3Ccircle cx='171' cy='326' r='1.1' fill='%23fff' opacity='0.41'/%3E%3Ccircle cx='249' cy='372' r='1.5' fill='%23fff' opacity='0.45'/%3E%3Ccircle cx='383' cy='26' r='1.7' fill='%23fff' opacity='0.42'/%3E%3Ccircle cx='63' cy='53' r='1.2' fill='%23fff' opacity='0.55'/%3E%3Ccircle cx='77' cy='231' r='1.5' fill='%23fff' opacity='0.44'/%3E%3Ccircle cx='218' cy='32' r='1.0' fill='%23fff' opacity='0.40'/%3E%3Ccircle cx='269' cy='172' r='1.3' fill='%23fff' opacity='0.50'/%3E%3Ccircle cx='182' cy='123' r='1.6' fill='%23fff' opacity='0.52'/%3E%3Ccircle cx='102' cy='229' r='1.4' fill='%23fff' opacity='0.57'/%3E%3Ccircle cx='288' cy='119' r='1.8' fill='%23fff' opacity='0.38'/%3E%3Ccircle cx='169' cy='299' r='1.1' fill='%23fff' opacity='0.47'/%3E%3Ccircle cx='23' cy='265' r='1.6' fill='%23fff' opacity='0.49'/%3E%3Ccircle cx='344' cy='128' r='1.6' fill='%23fff' opacity='0.50'/%3E%3Ccircle cx='231' cy='183' r='1.7' fill='%23fff' opacity='0.59'/%3E%3Ccircle cx='190' cy='263' r='1.0' fill='%23fff' opacity='0.53'/%3E%3Ccircle cx='256' cy='389' r='1.7' fill='%23fff' opacity='0.42'/%3E%3Ccircle cx='156' cy='265' r='1.0' fill='%23fff' opacity='0.47'/%3E%3Ccircle cx='73' cy='53' r='1.0' fill='%23fff' opacity='0.54'/%3E%3Ccircle cx='58' cy='103' r='1.3' fill='%23fff' opacity='0.57'/%3E%3Ccircle cx='39' cy='180' r='1.4' fill='%23fff' opacity='0.57'/%3E%3Ccircle cx='323' cy='340' r='1.2' fill='%23fff' opacity='0.45'/%3E%3Ccircle cx='146' cy='348' r='1.8' fill='%23fff' opacity='0.39'/%3E%3Ccircle cx='76' cy='97' r='1.2' fill='%23fff' opacity='0.47'/%3E%3C/svg%3E");
  animation: gok-motyw-opad 38s linear infinite;
}
.home::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400' viewBox='0 0 400 400'%3E%3Ccircle cx='234' cy='109' r='1.8' fill='%23fff' opacity='0.68'/%3E%3Ccircle cx='150' cy='225' r='2.9' fill='%23fff' opacity='0.76'/%3E%3Ccircle cx='206' cy='245' r='2.6' fill='%23fff' opacity='0.57'/%3E%3Ccircle cx='353' cy='308' r='2.8' fill='%23fff' opacity='0.79'/%3E%3Ccircle cx='159' cy='161' r='1.9' fill='%23fff' opacity='0.74'/%3E%3Ccircle cx='32' cy='34' r='2.1' fill='%23fff' opacity='0.60'/%3E%3Ccircle cx='139' cy='28' r='1.8' fill='%23fff' opacity='0.60'/%3E%3Ccircle cx='47' cy='148' r='1.8' fill='%23fff' opacity='0.81'/%3E%3Ccircle cx='244' cy='65' r='2.1' fill='%23fff' opacity='0.65'/%3E%3Ccircle cx='148' cy='55' r='2.8' fill='%23fff' opacity='0.85'/%3E%3Ccircle cx='187' cy='194' r='1.9' fill='%23fff' opacity='0.58'/%3E%3Ccircle cx='140' cy='110' r='2.8' fill='%23fff' opacity='0.60'/%3E%3C/svg%3E");
  animation: gok-motyw-opad 24s linear infinite;
}
@keyframes gok-motyw-opad {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(0, 400px, 0); }
}

/* 3. Życzenia (tekst z panelu redakcji) – przy dolnej krawędzi banera, bez przesuwania napisu. */
.motyw-zyczenia {
  position: absolute;
  left: 50%;
  bottom: clamp(1rem, 4vh, 2.25rem);
  z-index: 2;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 7rem);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: clamp(0.875rem, 1.6vw, 1.0625rem);
  font-weight: 500;
  letter-spacing: 0.01em;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75);
}
.motyw-zyczenia::before,
.motyw-zyczenia::after {
  content: "";
  flex: 0 0 16px;
  height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpolygon points='8.0,1.0 9.5,4.4 12.9,3.1 11.6,6.5 15.0,8.0 11.6,9.5 12.9,12.9 9.5,11.6 8.0,15.0 6.5,11.6 3.1,12.9 4.4,9.5 1.0,8.0 4.4,6.5 3.1,3.1 6.5,4.4' fill='%23C4A15C'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* 4. Przycisk pauzy (WCAG 2.2.2) – prawy dolny róg banera. */
.motyw-pauza {
  position: absolute;
  right: max(12px, env(safe-area-inset-right, 0px));
  bottom: 12px;
  z-index: 3;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  background: rgba(2, 9, 43, 0.55);
  color: #fff;
  font-size: 0.9rem;
  cursor: pointer;
}
.motyw-pauza:hover {
  background: rgba(2, 9, 43, 0.8);
}
.motyw-pauza:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}
html.motyw-stop .home::before,
html.motyw-stop .home::after {
  animation-play-state: paused;
}

/* 4a. Scena sezonowa (sanie / dynie / króliczki) – elementy dokłada motyw.js, tylko na stronie głównej.
   Nakładka bez wpływu na układ; czytniki ekranu jej nie widzą (aria-hidden). */
.motyw-scena {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}
html.motyw-stop .motyw-scena *,
html.motyw-stop .motyw-scena *::after {
  animation-play-state: paused !important;
}

/* Kolor sezonowy paska nad menu i podkreślenia aktywnej pozycji (biały tekst: kontrast 6,7:1, WCAG AA). */
.top-menu {
  background-color: #B3202A;
}
nav .nav-list li a.active {
  color: #B3202A;
  border-bottom-color: #B3202A;
}
html.high-contrast .top-menu {
  background-color: #000;
}

/* Sanie z reniferami przelatują nad napisem co ok. 40 s (lot 22 s, potem przerwa). */
.motyw-sanie {
  position: absolute;
  top: calc(var(--header-h) + 3%);
  left: 0;
  width: 320px;
  height: 80px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='80' viewBox='0 0 320 80'%3E%3Ccircle cx='4' cy='52' r='1.2' fill='%23F3D894' opacity='0.35'/%3E%3Ccircle cx='12' cy='48' r='1.5' fill='%23F3D894' opacity='0.5'/%3E%3Ccircle cx='20' cy='55' r='1.1' fill='%23F3D894' opacity='0.4'/%3E%3Ccircle cx='28' cy='49' r='1.8' fill='%23F3D894' opacity='0.7'/%3E%3Ccircle cx='6' cy='44' r='1' fill='%23F3D894' opacity='0.3'/%3E%3Cpath d='M40 40 h62 q12 0 14 -14 l4 2 q-2 26 -22 28 h-54 q-8 0 -8 -8 z' fill='%23F3D894'/%3E%3Cpath d='M34 66 h84 q10 0 12 -9' stroke='%23F3D894' stroke-width='3' fill='none' stroke-linecap='round'/%3E%3Cpath d='M52 56 v10 M96 56 v10' stroke='%23F3D894' stroke-width='2.5'/%3E%3Ccircle cx='52' cy='28' r='11' fill='%23F3D894'/%3E%3Cpath d='M70 40 q0 -16 9 -18 q9 2 9 18 z' fill='%23F3D894'/%3E%3Ccircle cx='79' cy='17' r='5.5' fill='%23F3D894'/%3E%3Cpath d='M74 14 q5 -10 12 -2 l2 3 z' fill='%23F3D894'/%3E%3Cpath d='M112 34 Q170 28 196 37 M112 35 Q230 26 268 37' stroke='%23F3D894' stroke-width='1.2' fill='none' opacity='.8'/%3E%3Cellipse cx='180' cy='45' rx='22' ry='9' fill='%23F3D894'/%3E%3Cpath d='M194 41 L205 27 L211 30 L200 47 Z' fill='%23F3D894'/%3E%3Cellipse cx='211' cy='27' rx='8' ry='4.2' fill='%23F3D894' transform='rotate(12 211 27)'/%3E%3Cpath d='M206 24 L200 10 M202 15 L195 12 M201 12 L204 5 M209 24 L210 11 M210 15 L216 10' stroke='%23F3D894' stroke-width='2' stroke-linecap='round' fill='none'/%3E%3Cpath d='M194 50 L208 57 M190 51 L202 62 M165 50 L151 54 M169 51 L157 61' stroke='%23F3D894' stroke-width='3.2' stroke-linecap='round' fill='none'/%3E%3Cpath d='M159 42 l-6 -4 l2 6z' fill='%23F3D894'/%3E%3Cellipse cx='252' cy='45' rx='22' ry='9' fill='%23F3D894'/%3E%3Cpath d='M266 41 L277 27 L283 30 L272 47 Z' fill='%23F3D894'/%3E%3Cellipse cx='283' cy='27' rx='8' ry='4.2' fill='%23F3D894' transform='rotate(12 283 27)'/%3E%3Cpath d='M278 24 L272 10 M274 15 L267 12 M273 12 L276 5 M281 24 L282 11 M282 15 L288 10' stroke='%23F3D894' stroke-width='2' stroke-linecap='round' fill='none'/%3E%3Cpath d='M266 50 L280 57 M262 51 L274 62 M237 50 L223 54 M241 51 L229 61' stroke='%23F3D894' stroke-width='3.2' stroke-linecap='round' fill='none'/%3E%3Cpath d='M231 42 l-6 -4 l2 6z' fill='%23F3D894'/%3E%3C/svg%3E") no-repeat center / contain;
  filter: drop-shadow(0 0 6px rgba(243, 216, 148, 0.45));
  transform: translate3d(-340px, 40px, 0);
  animation: gok-sanie 40s linear 2s infinite;
}
@keyframes gok-sanie {
  0%   { transform: translate3d(-340px, 40px, 0); }
  55%  { transform: translate3d(calc(100vw + 20px), -10px, 0); }
  100% { transform: translate3d(calc(100vw + 20px), -10px, 0); }
}
@media (max-width: 600px) {
  .motyw-sanie { width: 200px; height: 50px; }
}
@media (prefers-reduced-motion: reduce) {
  .motyw-sanie { animation: none; left: auto; right: 4%; transform: none; }
}


/* 5. Stopka – ta sama wstęga nad stopką. */
footer {
  position: relative;
}
footer::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='14' viewBox='0 0 56 14'%3E%3Crect y='6.5' width='56' height='1' fill='%23C4A15C' opacity='.55'/%3E%3Cpolygon points='14.0,1.0 15.3,4.0 18.2,2.8 17.0,5.7 20.0,7.0 17.0,8.3 18.2,11.2 15.3,10.0 14.0,13.0 12.7,10.0 9.8,11.2 11.0,8.3 8.0,7.0 11.0,5.7 9.8,2.8 12.7,4.0' fill='%23C4A15C'/%3E%3Ccircle cx='14' cy='7' r='1.3' fill='%23fff'/%3E%3Ccircle cx='35' cy='7' r='1.8' fill='%23C4A15C'/%3E%3Ccircle cx='43' cy='7' r='1' fill='%23C4A15C'/%3E%3Ccircle cx='27' cy='7' r='1' fill='%23C4A15C'/%3E%3C/svg%3E") repeat-x center / 56px 14px;
  opacity: 0.9;
  pointer-events: none;
}

/* Telefon: życzenia nad przyciskiem pauzy, mniej elementów w tle. */
@media (max-width: 600px) {
  /* Miejsce na życzenia i pauzę zarezerwowane w CSS (ładuje się przed pierwszym wyświetleniem),
     więc napis nigdy nie nachodzi na przyciski i nic nie „skacze”. */
  .home {
    padding-bottom: 8.5rem;
  }
  .motyw-zyczenia {
    width: calc(100% - 2rem);
    max-width: none;
    bottom: 68px;
    justify-content: center;
  }
  .motyw-zyczenia::before,
  .motyw-zyczenia::after {
    display: none;
  }
  .home::before {
    display: none;
  }
}

/* System użytkownika prosi o ograniczenie ruchu: dekoracje stoją w miejscu, bez przycisku. */
@media (prefers-reduced-motion: reduce) {
  .home::before,
  .home::after {
    animation: none;
  }
  .motyw-pauza {
    display: none;
  }
  .motyw-scena *::after {
    animation: none;
  }
}

/* Panel dostępności „Wysoki kontrast” = strona bez żadnych dekoracji. */
html.high-contrast .site-header header::after,
html.high-contrast footer::before,
html.high-contrast .home::before,
html.high-contrast .home::after,
html.high-contrast .motyw-zyczenia::before,
html.high-contrast .motyw-zyczenia::after,
html.high-contrast .motyw-pauza,
html.high-contrast .motyw-scena {
  display: none;
}

/* Wydruk bez ozdób. */
@media print {
  .site-header header::after,
  footer::before,
  .home::before,
  .home::after,
  .motyw-scena,
  .motyw-pauza {
    display: none !important;
  }
}
