/* ============================================================================
 * lumen-phase-c.css — Yousef approved all 12 new ideas 2026-06-16.
 *  3. Animated Cross Rising on first load
 *  4. Print-friendly stylesheet
 * 12. Accent color picker
 *  9. Light a Candle Together visualization
 * ========================================================================== */

/* ─── 3. Animated Cross Rising — first load only ─────────────────────────── */
.lumen-cross-rising {
  position: fixed; inset: 0; z-index: 9999;
  display: grid; place-items: center;
  background: linear-gradient(180deg, var(--jp-cream-100) 0%, var(--jp-gold-100) 100%);
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.6s var(--cb-ease);
}
.lumen-cross-rising.is-leaving { opacity: 0; }
.lumen-cross-rising svg {
  width: 120px; height: 120px;
  filter: drop-shadow(0 4px 12px rgba(212, 168, 67, 0.35));
}
.lumen-cross-rising path,
.lumen-cross-rising line {
  fill: none;
  stroke: var(--jp-gold-400, #D4A843);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: lumen-cross-draw 0.6s var(--cb-ease) forwards;
}
.lumen-cross-rising line + line { animation-delay: 0.3s; }
@keyframes lumen-cross-draw {
  to { stroke-dashoffset: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .lumen-cross-rising { display: none; }
}

/* ─── 4. Print-friendly stylesheet ───────────────────────────────────────── */
@media print {
  /* Hide UI chrome */
  .site-header, .site-footer, .nav-radio, .nav-podcast,
  .lumen-marquee-band, .lumen-signature-ribbon, .lumen-grain,
  .lumen-floating-tip, .lumen-sacred-toolbar, .lumen-cross-rising,
  .hfh-filters, button, .lumen-preloader,
  details > summary { display: none !important; }

  /* Open all details on print */
  details { display: block !important; }
  details > * { display: block !important; }

  /* Page setup */
  html, body {
    background: #fff !important; color: #000 !important;
    font-family: 'Cormorant Garamond', Georgia, serif !important;
    font-size: 11pt !important;
    line-height: 1.5 !important;
  }
  .section { max-width: none !important; padding: 0 !important; }
  .section__grid { display: block !important; }
  .section__col--full, .section__col--half, .section__col--third {
    width: 100% !important; max-width: none !important;
    grid-column: span 12 !important;
    margin-bottom: 1em !important;
  }
  h1, h2, h3, h4 { page-break-after: avoid; color: #000 !important; }
  blockquote {
    border-left: 3px solid #8a6f1f !important;
    padding-left: 12pt !important;
    margin: 12pt 0 !important;
    page-break-inside: avoid;
  }
  .scripture-frame, .icon-card__verse, .prayer-card__verse,
  .saint-card__verse, .father-card__quote, .lectio-step,
  .letter-body, .walk-stop { page-break-inside: avoid; }
  .card, .saint-card, .icon-card, .prayer-card, .cat-card,
  .word-card, .father-card, .hfh-card, .walk-stop,
  .altar-card, .lectio-step, .lectio-verse, .story-card {
    border: 1px solid #ddd !important;
    background: #fff !important;
    box-shadow: none !important;
    margin-bottom: 8pt !important;
    page-break-inside: avoid;
  }
  a { color: #000 !important; text-decoration: underline !important; }
  a[href^="http"]:after { content: " (" attr(href) ")"; font-size: 9pt; color: #555 !important; }
  /* Show the verse text from data-section if hidden */
}

/* ─── 12. Accent color picker ────────────────────────────────────────────── */
.lumen-accent-picker {
  position: fixed; bottom: 16px; left: 16px;
  z-index: 200;
  background: var(--jp-cream-100);
  border: 1px solid var(--jp-cream-400);
  border-radius: var(--r-pill, 999px);
  padding: 6px;
  box-shadow: var(--sh-md);
  display: none;
  gap: 6px;
}
.lumen-accent-picker[data-open="true"] { display: flex; }
.lumen-accent-picker__toggle {
  position: fixed; bottom: 16px; left: 16px;
  z-index: 201;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--jp-cream-400);
  background: var(--jp-cream-100);
  box-shadow: var(--sh-sm);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  color: var(--page-accent, var(--jp-gold-400));
  transition: transform var(--dur-fast) var(--cb-ease);
}
.lumen-accent-picker__toggle:hover { transform: scale(1.1); }
.lumen-accent-picker[data-open="true"] ~ .lumen-accent-picker__toggle {
  transform: rotate(45deg);
}
.lumen-accent-picker__swatch {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--cb-ease);
}
.lumen-accent-picker__swatch:hover,
.lumen-accent-picker__swatch.is-active {
  border-color: var(--jp-ink, #2A2D38);
}
.lumen-accent-picker__swatch--gold  { background: #D4A843; }
.lumen-accent-picker__swatch--rose  { background: #DB7A82; }
.lumen-accent-picker__swatch--sage  { background: #87A862; }
.lumen-accent-picker__swatch--sky   { background: #4477A0; }
.lumen-accent-picker__swatch--lav   { background: #B6A4D6; }

/* ─── 9. Light a Candle Together — visualization ─────────────────────────── */
/* Photo-based candles (replaced CSS-drawn body/flame, 2026-09-02): each
   candle button layers two real cinematic photographs (unlit, lit) and
   crossfades between them on click via opacity transition.
   Cross layout added 2026-09-02 (explicit request): 7x7 grid, center 3
   columns + center 3 rows filled = exactly 33 cells, no padding. Each
   candle's grid-row/grid-column is set inline by candle-wall.js
   (CROSS_LAYOUT), so this grid just needs the right shape and square-ish
   cells. */
.candle-wall__scene {
  position: relative;
  max-width: 560px;
  margin: var(--s-5) auto;
  padding: var(--s-5) var(--s-4);
  border-radius: 18px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(232, 192, 103, 0.16) 0%, rgba(232, 192, 103, 0.05) 45%, transparent 75%),
    linear-gradient(180deg, rgba(58, 20, 30, 0.04), rgba(58, 20, 30, 0.08));
}
.candle-wall__dust {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 20% 30%, rgba(232, 192, 103, 0.55), transparent),
    radial-gradient(1.5px 1.5px at 70% 20%, rgba(232, 192, 103, 0.4), transparent),
    radial-gradient(1px 1px at 40% 70%, rgba(232, 192, 103, 0.5), transparent),
    radial-gradient(1.5px 1.5px at 85% 65%, rgba(232, 192, 103, 0.35), transparent),
    radial-gradient(1px 1px at 55% 85%, rgba(232, 192, 103, 0.45), transparent),
    radial-gradient(1.5px 1.5px at 10% 80%, rgba(232, 192, 103, 0.3), transparent);
  animation: candle-dust-drift 14s ease-in-out infinite alternate;
  opacity: 0.8;
}
@keyframes candle-dust-drift {
  0%   { transform: translateY(0) translateX(0); opacity: 0.6; }
  50%  { transform: translateY(-10px) translateX(4px); opacity: 0.9; }
  100% { transform: translateY(-2px) translateX(-4px); opacity: 0.7; }
}
@media (prefers-reduced-motion: reduce) {
  .candle-wall__dust { animation: none; }
}
.candle-wall {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(7, 1fr);
  gap: var(--s-2);
  max-width: 460px;
  margin: 0 auto;
}
@media (max-width: 640px) {
  .candle-wall { max-width: 320px; gap: 4px; }
}
.candle-wall__candle {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  cursor: pointer;
  border: 0;
  background: transparent;
  padding: 0;
  opacity: 0.55;
  transition: opacity 0.4s var(--cb-ease), transform 0.3s var(--cb-ease);
}
.candle-wall__candle.is-lit { opacity: 1; }
.candle-wall__candle:hover { transform: translateY(-4px); }
.candle-wall__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  transition: opacity 0.6s var(--cb-ease);
}
.candle-wall__img--unlit { opacity: 1; }
.candle-wall__img--lit { opacity: 0; }
.candle-wall__candle.is-lit .candle-wall__img--unlit { opacity: 0; }
.candle-wall__candle.is-lit .candle-wall__img--lit { opacity: 1; }

/* Real, moving flame flicker (added 2026-09-02 per feedback: a static
   lit/unlit photo swap was not enough — this must actually move). A
   soft warm glow, positioned over the flame in the photo, jitters in
   opacity/scale/rotation on a loop. Staggered per-candle so all 33
   don't flicker in lockstep. */
.candle-wall__flame-glow {
  position: absolute;
  top: 44%;
  left: 50%;
  width: 34%;
  height: 22%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(ellipse at center,
    rgba(255, 248, 224, 0.95) 0%,
    rgba(247, 217, 130, 0.75) 30%,
    rgba(232, 192, 103, 0.4) 55%,
    rgba(232, 192, 103, 0) 75%);
  filter: blur(2px);
  mix-blend-mode: screen;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s var(--cb-ease);
}
.candle-wall__candle.is-lit .candle-wall__flame-glow {
  opacity: 1;
  animation: candle-flame-flicker 2.2s ease-in-out infinite;
}
.candle-wall__candle:nth-child(6n+1) .candle-wall__flame-glow { animation-duration: 1.9s; animation-delay: -0.3s; }
.candle-wall__candle:nth-child(6n+2) .candle-wall__flame-glow { animation-duration: 2.4s; animation-delay: -1.1s; }
.candle-wall__candle:nth-child(6n+3) .candle-wall__flame-glow { animation-duration: 2.0s; animation-delay: -0.7s; }
.candle-wall__candle:nth-child(6n+4) .candle-wall__flame-glow { animation-duration: 2.6s; animation-delay: -1.6s; }
.candle-wall__candle:nth-child(6n+5) .candle-wall__flame-glow { animation-duration: 2.1s; animation-delay: -0.2s; }
.candle-wall__candle:nth-child(6n+6) .candle-wall__flame-glow { animation-duration: 2.5s; animation-delay: -1.9s; }
@keyframes candle-flame-flicker {
  0%   { transform: translate(-50%, -50%) scale(1)    rotate(0deg);   opacity: 0.82; }
  8%   { transform: translate(-53%, -55%) scale(1.08) rotate(-2deg);  opacity: 1;    }
  17%  { transform: translate(-48%, -47%) scale(0.92) rotate(2deg);   opacity: 0.75; }
  29%  { transform: translate(-51%, -52%) scale(1.05) rotate(-1deg);  opacity: 0.95; }
  38%  { transform: translate(-50%, -48%) scale(0.96) rotate(1deg);   opacity: 0.85; }
  50%  { transform: translate(-54%, -53%) scale(1.1)  rotate(-3deg);  opacity: 1;    }
  63%  { transform: translate(-49%, -50%) scale(0.94) rotate(2deg);   opacity: 0.8;  }
  75%  { transform: translate(-52%, -49%) scale(1.03) rotate(-1deg);  opacity: 0.9;  }
  88%  { transform: translate(-50%, -51%) scale(0.98) rotate(1deg);   opacity: 0.85; }
  100% { transform: translate(-50%, -50%) scale(1)    rotate(0deg);   opacity: 0.82; }
}
.candle-wall__count {
  text-align: center;
  font-family: var(--ff-serif);
  font-style: italic;
  color: var(--jp-ink-soft);
  margin-bottom: var(--s-4);
}
@media (prefers-reduced-motion: reduce) {
  .candle-wall__img { transition: none; }
  .candle-wall__flame-glow { animation: none !important; opacity: 0.9; }
}

/* Verse cards by prayer category, added 2026-09-02 (explicit request):
   "whatever you carry, bring it here" — a small set of KJV verses so the
   visitor immediately understands this room is for prayer. */
.candle-verses__title {
  text-align: center;
  font-family: var(--ff-serif);
  color: var(--jp-ink);
  margin-bottom: var(--s-2);
}
.candle-verses__intro {
  text-align: center;
  font-family: var(--ff-serif);
  font-style: italic;
  color: var(--jp-ink-soft);
  margin-bottom: var(--s-4);
}
.candle-verses {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--s-4);
  margin: 0 auto var(--s-4);
}
.candle-verses__card {
  display: flex;
  flex-direction: column;
}
.candle-verses__category {
  font-family: var(--ff-serif);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--jp-cream-700, #B48748);
  margin: 0 0 var(--s-1);
  text-transform: uppercase;
  font-size: 0.85rem;
}
.candle-verses__card .scripture-frame {
  margin: 0;
  flex: 1;
}

/* Shared prayer-request box, added 2026-09-03 (بند 292, Yousef's explicit request):
   one box beneath all 33 candles together. Real shared D1 storage (see
   assets/js/prayer-requests.js + functions/api/prayer-requests/*), not localStorage --
   this is genuinely shared across visitors, unlike the candle wall itself. Every request
   passes the server-side filter before it can appear here; this CSS only styles what the
   API already decided is safe to render. */
.prayer-box {
  max-width: 640px;
  margin: var(--s-5) auto;
  padding: var(--s-4) var(--s-5);
  background: rgba(232, 192, 103, 0.06);
  border: 1px solid rgba(212, 169, 74, 0.25);
  border-radius: 14px;
}
.prayer-box__title {
  text-align: center;
  font-family: var(--ff-serif);
  color: var(--jp-ink);
  margin: 0 0 var(--s-1);
}
.prayer-box__intro {
  text-align: center;
  font-family: var(--ff-serif);
  font-style: italic;
  color: var(--jp-ink-soft);
  margin: 0 0 var(--s-3);
}
.prayer-box__textarea {
  width: 100%;
  min-height: 5.5em;
  resize: vertical;
  padding: var(--s-3);
  font-family: var(--ff-serif);
  font-size: 1rem;
  color: var(--jp-ink);
  background: #FFFDF8;
  border: 1px solid rgba(212, 169, 74, 0.4);
  border-radius: 8px;
  box-sizing: border-box;
}
.prayer-box__textarea:focus {
  outline: 2px solid rgba(180, 135, 72, 0.5);
  outline-offset: 1px;
}
.prayer-box__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--s-2);
  gap: var(--s-3);
}
.prayer-box__count {
  font-size: 0.8rem;
  color: var(--jp-ink-soft);
}
.prayer-box__submit {
  font-family: var(--ff-serif);
  font-size: 0.95rem;
  padding: 0.55em 1.3em;
  border-radius: 999px;
  border: 1px solid var(--jp-cream-700, #B48748);
  background: var(--jp-cream-700, #B48748);
  color: #FFFDF8;
  cursor: pointer;
  transition: opacity 0.2s var(--cb-ease), transform 0.2s var(--cb-ease);
}
.prayer-box__submit:hover { transform: translateY(-1px); }
.prayer-box__submit:disabled { opacity: 0.6; cursor: default; transform: none; }
.prayer-box__status {
  min-height: 1.2em;
  margin: var(--s-2) 0 0;
  font-size: 0.85rem;
  font-style: italic;
  color: var(--jp-ink-soft);
}
.prayer-box__list {
  margin-top: var(--s-4);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.prayer-box__empty,
.prayer-box__loading {
  text-align: center;
  font-family: var(--ff-serif);
  font-style: italic;
  color: var(--jp-ink-soft);
  margin: 0;
}
.prayer-box__card {
  padding: var(--s-3);
  background: #FFFDF8;
  border: 1px solid rgba(212, 169, 74, 0.2);
  border-radius: 8px;
}
.prayer-box__text {
  margin: 0 0 var(--s-2);
  font-family: var(--ff-serif);
  color: var(--jp-ink);
  white-space: pre-wrap;
  word-break: break-word;
}
.prayer-box__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
}
.prayer-box__time {
  font-size: 0.78rem;
  color: var(--jp-ink-soft);
}
.prayer-box__pray {
  font-family: var(--ff-serif);
  font-size: 0.85rem;
  padding: 0.35em 0.9em;
  border-radius: 999px;
  border: 1px solid rgba(212, 169, 74, 0.5);
  background: transparent;
  color: var(--jp-ink);
  cursor: pointer;
  transition: background 0.2s var(--cb-ease), color 0.2s var(--cb-ease);
}
.prayer-box__pray:hover { background: rgba(232, 192, 103, 0.15); }
.prayer-box__pray.is-active {
  background: var(--jp-cream-700, #B48748);
  border-color: var(--jp-cream-700, #B48748);
  color: #FFFDF8;
  cursor: default;
}
