/* ==========================================================================
   Festliches Design „Advent und Winter“ (src/layout/festlich.php), nur 1.12. bis 6.1.
   <html class="fest">: Lichterkette unter dem Kopf, Gruß, goldene Akzente. <html class="schnee">: Schneefall
   (public/assets/js/festlich.js zeichnet in canvas.fest-schnee). Grün der Marke bleibt, Gold kommt dazu.
   ========================================================================== */

:root {
  --rf-fest-gold: #8a6416;          /* Text auf Weiß: Kontrast über 4,5 */
  --rf-fest-gold-hell: #d9a440;     /* Flächen, Lämpchen */
  --rf-fest-rot: #c0453a;
  --rf-fest-tanne: #3f8f5f;
  --rf-fest-schnee: 150, 172, 192;  /* RGB der Flocken im hellen Modus */
}
[data-theme="dark"] {
  --rf-fest-gold: #e0b85c;
  --rf-fest-gold-hell: #e8c66a;
  --rf-fest-schnee: 255, 255, 255;
}

/* ── Knöpfe (wie .theme-toggle) ───────────────────────────────────────── */
.fest-knopf {
  width: 43px; height: 43px; border-radius: 999px;
  display: none; place-items: center; flex: none; padding: 0;
  border: 1px solid var(--line, var(--rf-rand)); color: var(--text-2, var(--rf-text-2)); background: var(--surface, var(--rf-flaeche));
  cursor: pointer; transition: border-color .3s ease, color .3s ease, background .3s ease;
}
.fest-knopf--fest, .fest .fest-knopf--schnee { display: grid; }   /* Schnee-Knopf nur, wenn festlich an */
.fest-knopf:hover { border-color: var(--rf-fest-gold-hell); color: var(--rf-fest-gold); }
.fest-knopf[aria-pressed="true"] { color: var(--rf-fest-gold); border-color: color-mix(in srgb, var(--rf-fest-gold-hell) 70%, transparent); }
.fest-knopf:focus-visible { outline: 2px solid var(--rf-fest-gold-hell); outline-offset: 2px; }
.fest-knopf svg { width: 18px; height: 18px; }
/* Desktop-Kopf wie #themeToggle: unter 1240 px nur im Menü */
@media (max-width: 1240px) { .header-actions .fest-knopf--kopf { display: none !important; } }
.mnf-row .fest-knoepfe { display: flex; gap: 8px; }
.mnf-row .fest-knopf { width: 38px; height: 38px; }

/* ── Lichterkette unter dem Kopf ──────────────────────────────────────── */
.rf-lichter { display: none; }
.fest .rf-lichter {
  display: block; position: absolute; left: 0; right: 0; bottom: -9px; height: 14px; pointer-events: none;
  /* Draht: flache Bögen */
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='14'%3E%3Cpath d='M0 2 Q16 9 32 2 T64 2' fill='none' stroke='%237c8a80' stroke-width='0.8' stroke-opacity='0.55'/%3E%3C/svg%3E") repeat-x 0 0 / 64px 14px;
}
.rf-lichter i {
  position: absolute; inset: 0;
  background-repeat: repeat-x; background-size: 128px 14px;
  animation: rf-funkeln 3.2s ease-in-out infinite;
}
/* zwei Lagen, gegenläufig: abwechselnd Gold/Rot und Tanne/Warmweiß */
.rf-lichter i:first-child {
  background-image: radial-gradient(circle at 16px 7.5px, var(--rf-fest-gold-hell) 2.4px, transparent 2.9px),
                    radial-gradient(circle at 80px 7.5px, var(--rf-fest-rot) 2.4px, transparent 2.9px);
}
.rf-lichter i:last-child {
  background-image: radial-gradient(circle at 48px 7.5px, var(--rf-fest-tanne) 2.4px, transparent 2.9px),
                    radial-gradient(circle at 112px 7.5px, #f3dfa6 2.4px, transparent 2.9px);
  animation-delay: -1.6s;
}
@keyframes rf-funkeln { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .rf-lichter i { animation: none; opacity: .85; } }
.site-header.is-scrolled .rf-lichter { bottom: -8px; }

/* ── Gruß (Startseite) ─────────────────────────────────────────────────── */
.fest-gruss { display: none; }
.fest .fest-gruss {
  display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap;
  margin: 18px auto 0; max-width: 40em; font-size: 14.5px; line-height: 1.5; color: var(--rf-text-2);
}
.fest-gruss b { color: var(--rf-fest-gold); font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.fest-gruss b svg { width: 15px; height: 15px; }
/* Angemeldet: der Tagesgruß in der Pille wird festlich */
.fest-an { display: none; }
.fest .fest-an { display: inline; }
.fest .fest-aus { display: none; }
.fest .pr-pille .fest-an { color: var(--rf-fest-gold); }

/* ── Schnee ────────────────────────────────────────────────────────────── */
.fest-schnee {
  position: fixed; inset: 0; width: 100vw; height: 100vh;
  pointer-events: none; z-index: 95;   /* über dem Inhalt, unter Kopf (100), Banner und Dialogen */
  opacity: 0; transition: opacity .8s ease;
}
.fest.schnee .fest-schnee { opacity: 1; }
@media print { .fest-schnee, .rf-lichter { display: none !important; } }

/* ── Fußzeile (nur über diese Datei, footer.php bleibt unverändert) ───────
   Schneedecke ganz unten, darauf ein paar Tannen in den Ecken (sehr blass, hinter dem Text), goldener Stern am Logo */
.fest .site-footer::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 16px; pointer-events: none; z-index: 1;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='14'%3E%3Cpath d='M0 14V8Q9 2 21 6.5T44 5.5Q57 0 70 6t26-2Q109 1 120 8v6z' fill='%23ffffff' stroke='%2396acc0' stroke-opacity='.45' stroke-width='.8'/%3E%3C/svg%3E") repeat-x 0 100% / 120px 16px;
}
[data-theme="dark"].fest .site-footer::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='14'%3E%3Cpath d='M0 14V8Q9 2 21 6.5T44 5.5Q57 0 70 6t26-2Q109 1 120 8v6z' fill='%23dfe7ee' fill-opacity='.85'/%3E%3C/svg%3E");
}
.fest .site-footer::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 84px; pointer-events: none; z-index: 0;
  opacity: .13;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='84' fill='%233f8f5f'%3E%3Cpath d='M28 6l16 24h-8l14 20h-8l14 22H6l14-22h-8l14-20h-8z'/%3E%3Cpath d='M70 34l11 16h-6l10 14h-6l10 14H51l10-14h-6l10-14h-6z'/%3E%3Crect x='25' y='72' width='6' height='12'/%3E%3Crect x='67' y='78' width='5' height='6'/%3E%3C/svg%3E") left 20px bottom 7px / 120px 84px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='84' fill='%233f8f5f'%3E%3Cpath d='M40 40l10 14h-5l9 13h-5l9 13H22l9-13h-5l9-13h-5z'/%3E%3Cpath d='M98 2l18 26h-9l16 22h-9l16 24H66l16-24h-9l16-22h-9z'/%3E%3Crect x='37' y='78' width='5' height='6'/%3E%3Crect x='95' y='72' width='7' height='12'/%3E%3C/svg%3E") right 16px bottom 7px / 150px 84px no-repeat;
}
[data-theme="dark"].fest .site-footer::after { opacity: .2; }
.fest .site-footer > .container { position: relative; z-index: 2; }
@media (max-width: 640px) { .fest .site-footer::after { height: 60px; background-size: 86px 60px, 107px 60px; } }

.fest .foot-brand .brand::after {
  content: ""; width: 13px; height: 13px; margin-left: -2px; align-self: flex-start;
  background: var(--rf-fest-gold-hell);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.5l2.6 6.1 6.6.6-5 4.4 1.5 6.5L12 16.7l-5.7 3.4 1.5-6.5-5-4.4 6.6-.6z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.5l2.6 6.1 6.6.6-5 4.4 1.5 6.5L12 16.7l-5.7 3.4 1.5-6.5-5-4.4 6.6-.6z'/%3E%3C/svg%3E") center / contain no-repeat;
}
@media print { .fest .site-footer::before, .fest .site-footer::after, .fest .foot-brand .brand::after { display: none; } }

/* ── Anmelden und Registrieren: leise festlich ───────────────────────────
   Seiten /registrieren, /login: kein Schnee (html.fest-leise), Schnee-Knopf ausgeblendet.
   Anmeldefenster (.login-drawer, jede festliche Seite): Lichterkette am oberen Rand, goldener Stern am Logo.
   Registrierungskarte (.kz .kz-karte): Schneehaube auf der Oberkante. */
.fest-leise .fest-knopf--schnee, .fest-leise .fest-schnee { display: none !important; }

.fest .login-drawer::before,
.fest .login-drawer::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 14px; pointer-events: none; z-index: 2;
  background-repeat: repeat-x; background-size: 128px 14px;
  animation: rf-funkeln 3.2s ease-in-out infinite;
}
.fest .login-drawer::before {
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='14'%3E%3Cpath d='M0 2 Q16 9 32 2 T64 2' fill='none' stroke='%237c8a80' stroke-width='0.8' stroke-opacity='0.55'/%3E%3C/svg%3E"),
    radial-gradient(circle at 16px 7.5px, var(--rf-fest-gold-hell) 2.4px, transparent 2.9px),
    radial-gradient(circle at 80px 7.5px, var(--rf-fest-rot) 2.4px, transparent 2.9px);
  background-size: 64px 14px, 128px 14px, 128px 14px;
  animation: none;
}
.fest .login-drawer::after {
  background-image:
    radial-gradient(circle at 48px 7.5px, var(--rf-fest-tanne) 2.4px, transparent 2.9px),
    radial-gradient(circle at 112px 7.5px, #f3dfa6 2.4px, transparent 2.9px);
  animation-delay: -1.6s;
}
@media (prefers-reduced-motion: reduce) { .fest .login-drawer::after { animation: none; opacity: .85; } }
.fest .drawer-logo-container { position: relative; }
.fest .drawer-logo-container::after {
  content: ""; position: absolute; top: -4px; left: calc(50% + 22px); width: 14px; height: 14px;
  background: var(--rf-fest-gold-hell);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.5l2.6 6.1 6.6.6-5 4.4 1.5 6.5L12 16.7l-5.7 3.4 1.5-6.5-5-4.4 6.6-.6z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.5l2.6 6.1 6.6.6-5 4.4 1.5 6.5L12 16.7l-5.7 3.4 1.5-6.5-5-4.4 6.6-.6z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.fest .kz .kz-karte { position: relative; }
.fest .kz .kz-karte::before {
  content: ""; position: absolute; left: 26px; right: 26px; top: -9px; height: 14px; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='14'%3E%3Cpath d='M0 14V8Q9 2 21 6.5T44 5.5Q57 0 70 6t26-2Q109 1 120 8v6z' fill='%23ffffff' stroke='%2396acc0' stroke-opacity='.45' stroke-width='.8'/%3E%3C/svg%3E") repeat-x 0 100% / 120px 14px;
  -webkit-mask: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
          mask: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
[data-theme="dark"].fest .kz .kz-karte::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='14'%3E%3Cpath d='M0 14V8Q9 2 21 6.5T44 5.5Q57 0 70 6t26-2Q109 1 120 8v6z' fill='%23dfe7ee' fill-opacity='.85'/%3E%3C/svg%3E");
}

/* ── Aufklapp-Fenster: Benachrichtigungen, Profil, Serie; Handy-Menü ─────
   Schneehaube auf der Oberkante, kleiner goldener Stern hinter der Überschrift, Glocken-Leerzustand in Gold,
   im Handy-Menü blasse Tannen unten rechts. Inhalte und Bedienung bleiben unverändert. */
:root { --rf-fest-stern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.5l2.6 6.1 6.6.6-5 4.4 1.5 6.5L12 16.7l-5.7 3.4 1.5-6.5-5-4.4 6.6-.6z'/%3E%3C/svg%3E"); }

.fest .hdr-pop::after,
.fest .stk-pop::after {
  content: ""; position: absolute; left: 18px; right: 18px; top: -8px; height: 12px; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='14'%3E%3Cpath d='M0 14V8Q9 2 21 6.5T44 5.5Q57 0 70 6t26-2Q109 1 120 8v6z' fill='%23ffffff' stroke='%2396acc0' stroke-opacity='.45' stroke-width='.8'/%3E%3C/svg%3E") repeat-x 0 100% / 103px 12px;
  -webkit-mask: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
          mask: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
}
[data-theme="dark"].fest .hdr-pop::after,
[data-theme="dark"].fest .stk-pop::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='14'%3E%3Cpath d='M0 14V8Q9 2 21 6.5T44 5.5Q57 0 70 6t26-2Q109 1 120 8v6z' fill='%23dfe7ee' fill-opacity='.85'/%3E%3C/svg%3E");
}

.fest .notif-head b::after,
.fest .pf-name::after,
.fest .stk-pop-title::after {
  content: ""; display: inline-block; width: 11px; height: 11px; margin-left: 6px; vertical-align: 1px;
  background: var(--rf-fest-gold-hell);
  -webkit-mask: var(--rf-fest-stern) center / contain no-repeat;
          mask: var(--rf-fest-stern) center / contain no-repeat;
}
.fest .notif-empty-ic { background: color-mix(in srgb, var(--rf-fest-gold-hell) 18%, transparent); color: var(--rf-fest-gold); }

.fest .mobile-nav-footer {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='84' fill='%233f8f5f' fill-opacity='.13'%3E%3Cpath d='M40 40l10 14h-5l9 13h-5l9 13H22l9-13h-5l9-13h-5z'/%3E%3Cpath d='M98 2l18 26h-9l16 22h-9l16 24H66l16-24h-9l16-22h-9z'/%3E%3Crect x='37' y='78' width='5' height='6'/%3E%3Crect x='95' y='72' width='7' height='12'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 6px bottom 0; background-size: 120px 67px;
}
[data-theme="dark"].fest .mobile-nav-footer {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='84' fill='%233f8f5f' fill-opacity='.22'%3E%3Cpath d='M40 40l10 14h-5l9 13h-5l9 13H22l9-13h-5l9-13h-5z'/%3E%3Cpath d='M98 2l18 26h-9l16 22h-9l16 24H66l16-24h-9l16-22h-9z'/%3E%3Crect x='37' y='78' width='5' height='6'/%3E%3Crect x='95' y='72' width='7' height='12'/%3E%3C/svg%3E");
}

/* ── Weihnachtsmütze auf dem Logo (Kopf und Fußzeile) ─────────────────────
   Sitzt auf .brand (das Logo-Kästchen .brand-mark schneidet mit overflow:hidden ab), schräg auf der oberen linken Ecke. */
:root { --rf-fest-muetze: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 34'%3E%3Cpath d='M5 25Q11 6 29 5.5q8 .5 7 8.5l-3.2-.6Q28.5 12 26.5 25z' fill='%23d23b33'/%3E%3Cpath d='M17 24q2-11 10-15.5' fill='none' stroke='%23a82a24' stroke-width='1.4' stroke-linecap='round' opacity='.55'/%3E%3Crect x='1.5' y='22.5' width='28' height='8.5' rx='4.25' fill='%23fff' stroke='%23d9e0e6' stroke-width='.8'/%3E%3Ccircle cx='35' cy='15' r='4.2' fill='%23fff' stroke='%23d9e0e6' stroke-width='.8'/%3E%3C/svg%3E"); }
.fest .site-header .brand, .fest .foot-brand .brand { position: relative; }
.fest .site-header .brand::before,
.fest .foot-brand .brand::before {
  content: ""; position: absolute; pointer-events: none; z-index: 2;
  background: var(--rf-fest-muetze) center / contain no-repeat;
  /* Grundneigung um den eigenen Fuß, davor die Logo-Bewegung um die Mitte des Logos (beim Hover rotate(-6deg) scale(1.05)
     wie .brand:hover .brand-mark in kopfzeile.css). Gleiche Funktionsliste in beiden Zuständen, damit der Übergang sauber ist.
     --m: Logo-Mitte, --f: Fuß der Mütze, beide in Koordinaten der Mütze */
  transform-origin: 0 0;
  transform: translate(var(--mx), var(--my)) rotate(0deg) scale(1) translate(calc(-1 * var(--mx)), calc(-1 * var(--my)))
             translate(var(--fx), var(--fy)) rotate(-16deg) translate(calc(-1 * var(--fx)), calc(-1 * var(--fy)));
  transition: transform .4s var(--ease, ease);
  filter: drop-shadow(0 1px 1px rgb(0 0 0 / .18));
}
.fest .site-header .brand::before { width: 32px; height: 27px; left: -9px; top: -15px; --mx: 29px; --my: 35px; --fx: 9.6px; --fy: 21.6px; }
.fest .foot-brand .brand::before { width: 32px; height: 27px; left: -9px; top: -15px; --mx: 29px; --my: 35px; --fx: 9.6px; --fy: 21.6px; }   /* Logo ist auch hier 40 px (kopfzeile.css setzt es mit !important) */
.fest .site-header .brand:hover::before,
.fest .foot-brand .brand:hover::before {
  transform: translate(var(--mx), var(--my)) rotate(-6deg) scale(1.05) translate(calc(-1 * var(--mx)), calc(-1 * var(--my)))
             translate(var(--fx), var(--fy)) rotate(-16deg) translate(calc(-1 * var(--fx)), calc(-1 * var(--fy)));
}
@media (prefers-reduced-motion: reduce) { .fest .site-header .brand::before, .fest .foot-brand .brand::before { transition: none; } }
@media print { .fest .site-header .brand::before, .fest .foot-brand .brand::before { display: none; } }
