/* =========================================================
   Lirel.ch  «Ein Licht anzünden»: Gedenklicht auf der Startseite (licht.js)
   Hell und warm: Creme, Taupe, Kerzenschein (--glow) hier etwas grosszügiger. Kein Dunkelmodus.
   ========================================================= */

/* ---------- Sektion ---------- */
.lichter {
  position: relative; isolation: isolate; overflow: hidden;
  background:
    radial-gradient(60% 55% at 50% 100%, rgb(226 172 104 / 0.22), rgb(226 172 104 / 0) 70%),
    radial-gradient(40% 50% at 100% 0%, rgb(226 172 104 / 0.12), rgb(226 172 104 / 0) 70%),
    var(--bg);
}
.lichter-inner { display: grid; justify-items: center; text-align: center; gap: clamp(18px, 2.6vw, 28px); max-width: 980px; }
.lichter-head { display: grid; justify-items: center; gap: 12px; }
.lichter-head .bi svg { width: 34px; height: 34px; color: var(--accent); }
.lichter-head h2 { max-width: 18ch; }
.lichter-head p { color: var(--ink); font-size: 1.05rem; line-height: 1.65; max-width: 44ch; }

/* ---------- Lichtermeer: viele kleine, weich leuchtende Punkte (Positionen aus licht.js) ---------- */
.lichtermeer {
  position: relative; width: 100%; height: clamp(250px, 42vh, 380px);
  border-radius: var(--r-card); overflow: hidden;
  background:
    radial-gradient(70% 60% at 50% 60%, rgb(226 172 104 / 0.2), rgb(226 172 104 / 0) 75%),
    linear-gradient(180deg, #f3ebe0 0%, #e9ddcd 100%);
  box-shadow: inset 0 0 0 1px var(--line), 0 18px 40px -30px rgb(74 58 46 / 0.45);
}
.lichtermeer.leer { height: clamp(150px, 24vh, 200px); }
.lichtermeer.leer::after {
  /* ganz ohne Lichter: nur ein ruhiger, warmer Schein in der Mitte */
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(35% 45% at 50% 55%, rgb(226 172 104 / 0.18), rgb(226 172 104 / 0) 70%);
}
.licht {
  position: absolute; left: var(--x); top: var(--y); width: var(--s); height: var(--s);
  margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2); border-radius: 50%;
  background: radial-gradient(circle, #fff8e8 0%, #f5d59a 30%, rgb(226 172 104 / 0.55) 58%, rgb(226 172 104 / 0) 100%);
  box-shadow: 0 0 10px 1px rgb(226 172 104 / 0.35);
  opacity: 0.85; will-change: opacity, transform;
  animation: licht-glimmen var(--t, 5s) ease-in-out var(--d, 0s) infinite alternate;
}
/* Das eigene Licht: grösser, heller, glimmt sanft auf */
.licht.mein {
  --s: 46px; z-index: 2;
  background: radial-gradient(circle, #fffcf4 0%, #f8dfae 26%, rgb(226 172 104 / 0.75) 48%, rgb(226 172 104 / 0) 72%);
  box-shadow: 0 0 44px 12px rgb(226 172 104 / 0.38), 0 0 90px 30px rgb(226 172 104 / 0.16);
  opacity: 1; transform: scale(1);
  animation: licht-auf 2.6s var(--ease) both, licht-glimmen-mein 6s ease-in-out 2.6s infinite alternate;
}
.licht.mein.still { animation: licht-glimmen-mein 6s ease-in-out infinite alternate; }
@keyframes licht-glimmen { from { opacity: 0.5; transform: scale(0.92); } to { opacity: 1; transform: scale(1.06); } }
@keyframes licht-glimmen-mein { from { opacity: 0.86; transform: scale(0.97); } to { opacity: 1; transform: scale(1.04); } }
@keyframes licht-auf { from { opacity: 0; transform: scale(0.2); } 60% { opacity: 1; transform: scale(1.12); } to { opacity: 1; transform: scale(1); } }

/* Kurzer warmer Schein, der nach dem Anzünden über die Sektion läuft */
.lichter::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0;
  background: linear-gradient(100deg, rgb(226 172 104 / 0) 25%, rgb(226 172 104 / 0.28) 50%, rgb(226 172 104 / 0) 75%);
  transform: translateX(-100%);
}
.lichter.schein::after { animation: licht-schein 2.4s var(--ease) forwards; }
@keyframes licht-schein { 0% { opacity: 0; transform: translateX(-100%); } 20% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateX(100%); } }

/* ---------- Texte und Handlung ---------- */
.lichter-text { display: grid; gap: 8px; min-height: 1.6em; }
.lichter-stand { color: var(--muted); font-size: 0.98rem; }
.lichter-stand:empty { display: none; }
.lichter-meins { font-family: var(--font-display); font-size: clamp(1.4rem, 2.4vw, 1.9rem); line-height: 1.3; color: var(--ink); }
.lichter-meins.neu { animation: licht-text 1.4s var(--ease) both; }
@keyframes licht-text { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.lichter-cta { display: grid; justify-items: center; gap: 14px; width: 100%; }
.lichter-cta .btn { min-width: min(100%, 300px); }
.lichter-link { color: var(--muted); font-size: 0.95rem; text-decoration: underline; text-underline-offset: 3px; display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; }
.lichter-link:hover { color: var(--ink); }
.lichter-note { color: var(--muted); font-size: 0.9rem; min-height: 1.4em; }
.lichter-note:empty { display: none; }

/* ---------- Sheet (Handy) / Dialog (Desktop) ---------- */
.licht-dlg {
  border: 0; padding: 0; margin: auto; max-height: calc(100% - 24px);
  width: min(100% - 32px, 440px); max-width: none;
  background: var(--surface); color: var(--ink); border-radius: var(--r-card); box-shadow: var(--shadow);
}
.licht-dlg::backdrop { background: rgb(52 45 40 / 0.38); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.licht-dlg[open] { animation: licht-dlg-in 0.45s var(--ease) both; }
@keyframes licht-dlg-in { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
.licht-form { display: grid; gap: 12px; padding: 26px 24px 22px; text-align: center; justify-items: center; }
.licht-form .bi svg { width: 32px; height: 32px; color: var(--accent); }
.licht-form h3 { font-family: var(--font-display); font-weight: 500; font-size: 1.7rem; line-height: 1.15; letter-spacing: -0.005em; max-width: 16ch; }
.licht-form label { font-size: 0.86rem; font-weight: 700; letter-spacing: 0.04em; color: var(--muted); margin-top: 6px; justify-self: start; }
.licht-form input {
  width: 100%; min-height: 54px; padding: 0 16px; font: inherit; font-size: 1.05rem; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-input);
}
.licht-form input:focus { outline: 2px solid var(--accent); outline-offset: 2px; border-color: var(--accent); }
.licht-hint { font-size: 0.86rem; color: var(--muted); line-height: 1.5; max-width: 36ch; }
.licht-form .btn { width: 100%; margin-top: 6px; }
.licht-close {
  background: none; border: 0; cursor: pointer; min-height: 48px; padding: 0 16px; border-radius: 999px;
  color: var(--muted); font-weight: 700; font-size: 0.95rem;
}
.licht-close:hover { color: var(--ink); }
@media (max-width: 760px) {
  /* Bottom-Sheet: unten angedockt, volle Breite, oben gerundet */
  .licht-dlg {
    margin: auto 0 0; width: 100%; max-height: calc(100% - 40px);
    border-radius: 20px 20px 0 0; box-shadow: 0 -20px 50px -30px rgb(52 45 40 / 0.6);
  }
  .licht-form { padding: 14px 20px calc(20px + env(safe-area-inset-bottom, 0px)); }
  .licht-form::before { content: ""; width: 44px; height: 4px; border-radius: 2px; background: var(--line); margin-bottom: 6px; }
  .licht-form h3 { font-size: 1.55rem; }
  .lichtermeer { height: clamp(250px, 48vh, 340px); }
}

/* ---------- Bewegung reduzieren: alles statisch, nichts glimmt ---------- */
@media (prefers-reduced-motion: reduce) {
  .licht, .licht.mein, .licht.mein.still { animation: none; opacity: 0.9; transform: none; }
  .licht.mein { opacity: 1; }
  .lichter.schein::after { animation: none; opacity: 0; }
  .lichter-meins.neu { animation: none; }
  .licht-dlg[open] { animation: none; }
}
