/* The wick stays anchored while the flame moves above it. */
.memorial-candle .candle-flame{transform-box:view-box;transform-origin:44px 53px}
.memorial-candle .candle-halo,.memorial-candle .candle-reflection{opacity:.82}
:is(.light,.memorial-card):nth-child(3n+2){--candle-phase:-1.3s;--candle-period:2.9s}
:is(.light,.memorial-card):nth-child(3n){--candle-phase:-2.2s;--candle-period:2.35s}
@media screen and (prefers-reduced-motion:no-preference){
 .memorial-candle .candle-flame{animation:votive-sway var(--candle-period,2.65s) ease-in-out var(--candle-phase,-.3s) infinite}
 .memorial-candle .candle-halo,.memorial-candle .candle-reflection{animation:votive-light 3.8s ease-in-out var(--candle-phase,-.3s) infinite}
}
@keyframes votive-sway{
 0%,100%{transform:rotate(-4deg) scale(.96,1)}
 22%{transform:rotate(3deg) scale(1.035,.94)}
 47%{transform:rotate(-2deg) scale(.95,1.055)}
 73%{transform:rotate(5deg) scale(1.02,.975)}
}
@keyframes votive-light{0%,100%{opacity:.7}52%{opacity:.97}75%{opacity:.82}}
.memorial-still .memorial-candle *{animation:none}

.memorial-card.memorial-week,.screen .candles .light.memorial-week {
  background: linear-gradient(150deg, #fff9e9, #f2e1b4);
  border: 1px solid #af8f4b;
}
.memorial-week .anniversary-label {
  color: #654b20; font: 700 max(10px,.8em)/1.35 system-ui,sans-serif;
}

.memorial-card.memorial-anniversary,.screen .candles .light.memorial-anniversary {
  position: relative;
  background: radial-gradient(ellipse at 50% 18%, #fff9dc 4%, #ffdf85 52%, #eaae40 100%);
  border: 3px double #805310;
  box-shadow: inset 0 0 0 2px #fff6d1, 0 0 5px #ac751670;
}
.memorial-anniversary .memorial-candle { filter: drop-shadow(0 0 4px #d89939a6); }
.memorial-death-date,.anniversary-label { display: block; grid-column: 1/-1; line-height: 1.35; }
.memorial-death-date { color: #56442e; font-size: max(10px,.78em); text-wrap: balance; }
.memorial-card .memorial-death-date,.memorial-card:has(.memorial-death-date) .memorial-personal { grid-row: auto; }
.memorial-anniversary .anniversary-label {
  justify-self: center; width: fit-content; max-width: 100%; margin: 2px auto;
  padding: 1px .45em; border-radius: 5px; background: #533d22; color: #fff7dd;
  font: 700 max(10px,.8em)/1.4 system-ui,sans-serif;
}
.memorial-anniversary .anniversary-label::before { content: '✦'; margin-inline-end: .3em; color: #efd292; }
@media print {
  .memorial-card.memorial-anniversary { border: 3px double #674920; }
  .memorial-anniversary .anniversary-label { color: #352818; }
}
.memorial-card.memorial-first-month,.screen .candles .light.memorial-first-month {
  background: radial-gradient(ellipse at 50% 8%, #3e6893, #254667 65%, #142b46);
  border: 2px solid #668daf;
  box-shadow: inset 0 0 0 2px #1b2c40, inset 0 0 0 3px #6e6455;
  color: #fff9e9;
}
.memorial-first-month .memorial-candle { filter: drop-shadow(0 0 5px #f5bb526b); }
.memorial-card.memorial-first-month h2,.screen .light.memorial-first-month strong { color: #fffaf0; }
.memorial-first-month :is(.memorial-overline,.memorial-purpose,.memorial-personal,.memorial-tntzbh,.memorial-death-date),
.screen .light.memorial-first-month :is(p,.memorial-blessing) { color: #f0e3ca; }
.memorial-first-month .anniversary-label { width: fit-content; max-width: 100%; margin: 2px auto; padding: 1px .45em; border-radius: 4px; background: #efdbb5; color: #312a20; font: 700 max(10px,.8em)/1.4 system-ui,sans-serif; }
.memorial-card.memorial-daily,.screen .candles .light.memorial-daily {
  color: #fff7ea;
  background: radial-gradient(ellipse at 50% 8%, #984c62, #6b3048 65%, #462238);
  border: 2px solid #bd9275; box-shadow: inset 0 0 0 2px #51303b, inset 0 0 0 3px #986d6c;
}
.memorial-card.memorial-daily h2,.screen .light.memorial-daily strong { color: #fffaf0; }
.memorial-daily :is(.memorial-overline,.memorial-purpose,.memorial-personal,.memorial-tntzbh,.memorial-death-date),
.screen .light.memorial-daily :is(p,.memorial-blessing) { color: #ffdfce; }
.memorial-daily .anniversary-label { width: fit-content; max-width:100%; margin: 2px auto; padding: 1px .45em; border-radius: 4px; background: #f4dccb; color: #492a34; font: 700 max(10px,.8em)/1.4 system-ui,sans-serif; }

.memorial-first-year .anniversary-label { font-weight: 800; }
@media screen {
 .memorial-card.memorial-first-year, .screen .candles .light.memorial-first-year {
  background: linear-gradient(145deg, #275e4b, #133b30);
  border: 1px solid #729b85;
  color: #fff8e9;
 }
 .memorial-card.memorial-first-year h2, .screen .light.memorial-first-year strong,
 .memorial-first-year .anniversary-label { color: #fff8e9; }
 .memorial-first-year :is(.memorial-overline,.memorial-purpose,.memorial-personal,.memorial-tntzbh,.memorial-death-date),
 .screen .light.memorial-first-year :is(p,.memorial-blessing) { color: #e0ebe2; }
}
.memorial-card.memorial-month,.screen .candles .light.memorial-month {
 background:linear-gradient(150deg,#ebf4fd,#c2d9ec);border:1px solid #6d94b1;color:#213f57;
}
.memorial-month .anniversary-label {color:#244f70;font-weight:800}
