/* =====================================================================
   Weihnachtsdeko Startseite – dezent
   Wird nur aktiv, wenn assets/weihnachten.js die Klasse
   "advent" auf <html> setzt (ca. 20. November bis 6. Jänner).
   Reine Dekoration: aria-hidden, keine Klicks, respektiert
   "Bewegung reduzieren".
   ===================================================================== */

/* ---------- 1) Lichterketten ----------
   Kopfzeile: die Kette ist ein eigener Streifen am unteren Rand der
   Kopfzeile (im Fluss, nicht darüber gelegt) – sie bekommt also
   eigenen Platz und verdeckt weder Menü noch Inhalt darunter.
   Fußzeile: die Kette hängt im oberen Innenabstand, wo kein Text steht. */
.xmas-lichterkette {
  position: relative;
  height: 34px;
  pointer-events: none;
  overflow: hidden;
}
.site-header > .xmas-lichterkette { z-index: 1; }
html.advent .site-footer { position: relative; }
.site-footer > .xmas-lichterkette {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
}
.xmas-lichterkette svg.xmas-kabel {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.xmas-lichterkette .xmas-birnen {
  position: absolute;
  inset: 0;
}
.xmas-birne {
  position: absolute;
  width: 8px;
  height: 13px;
  margin-left: -4px;
  border-radius: 50% 50% 50% 50% / 38% 38% 62% 62%;
  background: radial-gradient(circle at 35% 65%, rgba(255, 255, 255, 0.75) 0 18%, transparent 40%), var(--c, #F6C453);
  box-shadow: 0 0 8px 3px var(--g, rgba(246, 196, 83, 0.55));
  animation: xmas-funkeln 3.2s ease-in-out infinite;
  animation-delay: var(--d, 0s);
}
.xmas-birne::before { /* Fassung */
  content: '';
  position: absolute;
  left: 1.5px;
  top: -3px;
  width: 5px;
  height: 4px;
  border-radius: 1px;
  background: #3B2A18;
}
.xmas-birne.c1 { --c: #F4B92E; --g: rgba(246, 196, 83, 0.7); }
.xmas-birne.c2 { --c: #E0372A; --g: rgba(224, 55, 42, 0.6); }
.xmas-birne.c3 { --c: #3FAE5A; --g: rgba(63, 174, 90, 0.6); }
.xmas-birne.c4 { --c: #3D7FD1; --g: rgba(61, 127, 209, 0.6); }

@keyframes xmas-funkeln {
  0%, 100% { opacity: 1;    filter: brightness(1.05); }
  50%      { opacity: 0.45; filter: brightness(0.8); box-shadow: 0 0 2px 0 var(--g); }
}

/* ---------- 2) Hängende Sterne und Kugeln im Hero ---------- */
.xmas-hero-deko {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}
.xmas-haenger {
  position: absolute;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform-origin: top center;
  animation: xmas-pendeln 6s ease-in-out infinite;
  animation-delay: var(--d, 0s);
}
.xmas-haenger .faden {
  width: 1px;
  height: var(--len, 60px);
  background: linear-gradient(180deg, rgba(91, 74, 51, 0.15), rgba(91, 74, 51, 0.5));
}
.xmas-haenger svg {
  display: block;
  filter: drop-shadow(0 3px 6px rgba(43, 31, 18, 0.18));
}
@keyframes xmas-pendeln {
  0%, 100% { transform: rotate(-2.5deg); }
  50%      { transform: rotate(2.5deg); }
}

/* Feiner Lichtschimmer hinter dem Titel */
.xmas-schimmer {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #FFF6D8;
  box-shadow: 0 0 8px 3px rgba(255, 230, 160, 0.65);
  animation: xmas-glitzer 4.5s ease-in-out infinite;
  animation-delay: var(--d, 0s);
  opacity: 0;
}
@keyframes xmas-glitzer {
  0%, 100% { opacity: 0;   transform: scale(0.4); }
  45%, 55% { opacity: 0.9; transform: scale(1); }
}

/* ---------- 3) Kleiner Tannenzweig neben dem Eyebrow ---------- */
.xmas-zweig {
  display: inline-block;
  width: 22px;
  height: 22px;
  margin-left: 0.35em;
  vertical-align: -5px;
}

/* Hero-Inhalt bleibt über der Deko */
html.advent .hero-ursula .container,
html.advent .hero-ursula .hero-ursula-photo { position: relative; z-index: 2; }

/* ---------- Anpassungen ---------- */
@media (max-width: 700px) {
  .xmas-lichterkette { height: 28px; }
  .xmas-haenger.nur-breit { display: none; }
  .xmas-haenger { transform: scale(0.8); }
}

@media (prefers-reduced-motion: reduce) {
  .xmas-flocke,
  .xmas-birne,
  .xmas-haenger,
  .xmas-schimmer { animation: none !important; }
  .xmas-schimmer { opacity: 0.6; transform: none; }
}

@media print {
  .xmas-lichterkette, .xmas-hero-deko, .xmas-zweig, .xmas-schneekugel,
  .xmas-schneefall, .xmas-ecke { display: none !important; }
}

/* ---------- 4) Schneekugel mit Igel ----------
   Unterseiten: klein auf dem runden Notruf-Knopf (rechts unten).
   Startseite: groß und dauerhaft sichtbar rechts unten, mit Tannenbaum,
   Igel mit Zipfelmütze und "Frohe Weihnachten" am Sockel. Darin rieselt
   ununterbrochen Schnee; ein Klick schüttelt die Kugel. */
.xmas-schneekugel {
  --fall: 52px;
  position: fixed;
  right: 25px;            /* mittig über dem 54px-Knopf (right: 24px) */
  bottom: 72px;           /* sitzt auf der Oberkante des Knopfs */
  width: 52px;
  height: 60px;
  z-index: 201;
  pointer-events: none;
  filter: drop-shadow(0 4px 8px rgba(43, 31, 18, 0.25));
}
.xmas-schneekugel svg.kugel-bild {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
/* Schneeflocken: im Glas eingeschlossen (Kreis wie im SVG) */
.xmas-schneekugel .glas-schnee {
  position: absolute;
  left: 5.77%;
  top: 3.33%;
  width: 88.46%;
  height: 76.67%;
  border-radius: 50%;
  overflow: hidden;
}
.xmas-flocke {
  position: absolute;
  top: -6px;
  width: var(--s, 3px);
  height: var(--s, 3px);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 2px rgba(255, 255, 255, 0.9);
  opacity: 0.95;
  animation: xmas-rieseln var(--t, 4s) linear infinite;
  animation-delay: var(--d, 0s);
}
@keyframes xmas-rieseln {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(3px, calc(var(--fall) * 0.25)); }
  50%  { transform: translate(-2px, calc(var(--fall) * 0.5)); }
  75%  { transform: translate(2px, calc(var(--fall) * 0.75)); }
  100% { transform: translate(-1px, var(--fall)); }
}
/* Kleine Kugel nur dort, wo der runde Notruf-Knopf zu sehen ist */
@media (max-width: 940px) {
  .xmas-schneekugel:not(.xmas-schneekugel--gross):not(.xmas-notrufkugel) { display: none; }
}

/* Große Kugel auf der Startseite: durchscheinend, damit Text dahinter
   immer lesbar bleibt, und ohne Klicks abzufangen (Links darunter
   bleiben anklickbar). */
.xmas-schneekugel--gross {
  --fall: 134px;
  right: 22px;
  bottom: 22px;
  width: 150px;
  height: 173px;
  z-index: 380;
  opacity: 0.4;
  pointer-events: none;
  filter: none;
  transform-origin: 50% 90%;
  animation: xmas-kugel-wiegen 7s ease-in-out infinite;
}
.xmas-schneekugel--gross .xmas-flocke { top: -8px; }
@keyframes xmas-kugel-wiegen {
  0%, 100% { transform: rotate(-1.5deg); }
  50%      { transform: rotate(1.5deg); }
}

/* Igel läuft durch die Igelpforte: erst klein hinten im Torbogen,
   dann tritt er heraus nach vorne und spaziert nach links durch den Schnee */
.xmas-schneekugel .igel-lauf {
  animation: xmas-igel-weg 12s linear infinite;
}
.xmas-schneekugel .igel-hinten {
  animation: xmas-igel-weg 12s linear infinite, xmas-igel-hinten 12s linear infinite;
}
.xmas-schneekugel .igel-vorne {
  animation: xmas-igel-weg 12s linear infinite, xmas-igel-vorne 12s linear infinite;
}
.xmas-schneekugel .igel-wackeln {
  animation: xmas-igel-tippeln 0.5s ease-in-out infinite alternate;
}
@keyframes xmas-igel-weg {
  0%   { transform: translate(35px, 37.6px) scale(-0.17, 0.17); }
  14%  { transform: translate(35px, 37.6px) scale(-0.17, 0.17); }
  24%  { transform: translate(34.4px, 38.8px) scale(-0.25, 0.25); }
  34%  { transform: translate(32.5px, 40.6px) scale(-0.36, 0.36); }
  74%  { transform: translate(19px, 41.4px) scale(-0.42, 0.42); }
  84%, 100% { transform: translate(15px, 41.4px) scale(-0.42, 0.42); }
}
@keyframes xmas-igel-hinten {
  0%        { opacity: 0; }
  7%, 23.9% { opacity: 1; }
  24%, 100% { opacity: 0; }
}
@keyframes xmas-igel-vorne {
  0%, 23.9% { opacity: 0; }
  24%, 76%  { opacity: 1; }
  84%, 100% { opacity: 0; }
}
@keyframes xmas-igel-tippeln {
  from { transform: translateY(0); }
  to   { transform: translateY(-0.8px); }
}
/* Handy/Tablet: kleiner, oberhalb der roten Notruf-Leiste */
@media (max-width: 940px) {
  .xmas-schneekugel--gross {
    --fall: 70px;
    right: 10px;
    bottom: calc(58px + env(safe-area-inset-bottom, 0px) + 10px);
    width: 78px;
    height: 90px;
  }
}
/* Startseite: Kugel oben rechts in der Kopfzeile – im Fluss neben
   Notruf-Knopf und Menü, voll sichtbar (verdeckt dort keinen Text) */
.xmas-schneekugel--gross.xmas-kopfkugel {
  --fall: 52px;
  position: relative;
  right: auto;
  bottom: auto;
  display: block;
  flex: 0 0 auto;
  width: 56px;
  height: 65px;
  margin-block: -6px;
  z-index: auto;
  opacity: 1;
  filter: drop-shadow(0 3px 5px rgba(43, 31, 18, 0.22));
}
.xmas-kopfkugel .xmas-flocke { top: -6px; }
@media (max-width: 940px) {
  .xmas-schneekugel--gross.xmas-kopfkugel {
    --fall: 36px;
    right: auto;
    bottom: auto;
    width: 40px;
    height: 46px;
    margin-block: -4px;
  }
  .xmas-kopfkugel .xmas-flocke { top: -4px; }
}
@media (max-width: 360px) {
  .xmas-schneekugel--gross.xmas-kopfkugel { --fall: 30px; width: 34px; height: 39px; }
}
/* Kleine Schneekugeln links und rechts in der roten Notruf-Leiste
   (Handy/Tablet). Sie stehen im Fluss der Leiste neben dem Schriftzug
   und ragen oben leicht über die Leiste hinaus. */
.xmas-schneekugel.xmas-notrufkugel {
  --fall: 34px;
  position: relative;
  right: auto;
  bottom: auto;
  display: block;
  flex: 0 0 auto;
  width: 34px;
  height: 39px;
  margin-block: -10px -4px;
  z-index: auto;
  filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.85)) drop-shadow(0 2px 3px rgba(43, 31, 18, 0.35));
}
.xmas-notrufkugel .xmas-flocke { top: -4px; }
.xmas-notrufkugel--rechts .igel-lauf,
.xmas-notrufkugel--rechts .igel-wackeln { animation-delay: -6s; }
@media (max-width: 360px) {
  .xmas-schneekugel.xmas-notrufkugel { --fall: 28px; width: 28px; height: 32px; }
}
/* Hinter geöffneten Dialogen tritt die Kugel zurück */
body.ws-modal-open .xmas-schneekugel,
body.has-video-modal-open .xmas-schneekugel,
body.has-zoom-open .xmas-schneekugel { display: none; }

/* ---------- 5) Schneefall im oberen Bereich der Startseite ----------
   Leise, durchscheinend und ohne Klicks abzufangen. Er bleibt oben
   (scrollt mit weg) und blendet nach unten weich aus, damit er beim
   Lesen der Inhalte nicht ablenkt. */
.xmas-schneefall {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--h, 100vh);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 60%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 0%, #000 60%, transparent 100%);
  z-index: 150;
  pointer-events: none;
  overflow: hidden;
}
.xmas-sf {
  position: absolute;
  top: -24px;
  width: var(--s, 5px);
  height: var(--s, 5px);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 3px 1px rgba(120, 150, 180, 0.45);
  opacity: var(--o, 0.8);
  animation: xmas-schneefall var(--t, 16s) linear infinite;
  animation-delay: var(--d, 0s);
  will-change: transform;
}
.xmas-sf--stern {
  width: auto;
  height: auto;
  background: none;
  box-shadow: none;
  border-radius: 0;
  font-size: var(--s, 14px);
  line-height: 1;
  color: #fff;
  text-shadow: 0 0 3px rgba(90, 125, 160, 0.75), 0 0 1px rgba(60, 90, 120, 0.6);
}
@keyframes xmas-schneefall {
  0%   { transform: translate(0, 0) rotate(0deg); }
  50%  { transform: translate(var(--x, 30px), calc(var(--h, 100vh) * 0.5)) rotate(180deg); }
  100% { transform: translate(0, calc(var(--h, 100vh) + 40px)) rotate(360deg); }
}

/* ---------- 6) Tannenzweige in den Ecken der Bereiche (Startseite) ---------- */
.xmas-ecke-host { position: relative; }
.xmas-ecke {
  position: absolute;
  top: 0;
  width: 132px;
  height: 95px;
  pointer-events: none;
  z-index: 1;
  filter: drop-shadow(0 3px 4px rgba(43, 31, 18, 0.22));
}
.xmas-ecke svg { display: block; width: 100%; height: 100%; }
.xmas-ecke.links { left: 0; }
.xmas-ecke.rechts { right: 0; transform: scaleX(-1); }
@media (max-width: 1100px) {
  .xmas-ecke { width: 92px; height: 66px; }
}
@media (max-width: 700px) {
  .xmas-ecke { width: 64px; height: 46px; }
}

@media (prefers-reduced-motion: reduce) {
  /* Ruhige Variante: Flocken liegen still verteilt im Glas,
     kein Schneefall über der Seite, keine Bewegung der Kugel */
  .xmas-flocke { top: var(--y, 50%); }
  .xmas-schneekugel--gross { animation: none !important; }
  .xmas-schneefall { display: none; }
  /* Igel sitzt ruhig vor der Igelpforte */
  .xmas-schneekugel .igel-lauf,
  .xmas-schneekugel .igel-wackeln { animation: none !important; }
  .xmas-schneekugel .igel-hinten { opacity: 0; }
  .xmas-schneekugel .igel-vorne { transform: translate(22px, 41.2px) scale(-0.4, 0.4); }
}
