/**
 * Kingdom — Sunlit tokens + component overrides.
 * Dark: default inline :root per page (omit html[data-theme]).
 * Sunlit: html[data-theme="sunlit"] — warm ivory / parchment, calm contrast.
 */

body.jg-kingdom-page > .wrap {
  position: relative;
  z-index: 1;
}

html[data-theme="sunlit"] {
  color-scheme: light;

  --bg: #f2ebe2;
  --bg-elevated: #faf6ef;
  --surface: #fffdf9;
  --line: rgba(82, 72, 58, 0.14);
  --text: #1c1b18;
  --muted: #5a544a;
  --muted-deep: #6b6558;
  --accent: #8b7348;
  --accent-soft: rgba(212, 184, 150, 0.28);
  --accent-muted: rgba(110, 95, 60, 0.72);
  --complete: #5a8f62;
  --complete-soft: rgba(120, 170, 130, 0.18);
  --radius: 16px;
  --radius-lg: 22px;
}

/* Shared chrome when the theme toggle is present */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.top-bar-end {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.lesson-top-end {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* index: CTA text must stay dark on warm gold in Sunlit */
html[data-theme="sunlit"] .cta {
  color: #1a1814;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset, 0 8px 28px rgba(139, 115, 72, 0.18);
}

html[data-theme="sunlit"] .cta:hover {
  box-shadow: 0 10px 32px rgba(139, 115, 72, 0.22);
}

/* —— app.html —— */
html[data-theme="sunlit"] body.kingdom-app {
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 125% 75% at 50% -18%, rgba(255, 215, 180, 0.42), transparent 54%),
    radial-gradient(ellipse 90% 60% at 100% 100%, rgba(170, 188, 215, 0.14), transparent 48%),
    radial-gradient(ellipse 70% 55% at 0% 75%, rgba(220, 200, 175, 0.12), transparent 46%);
  background-attachment: fixed;
}

html[data-theme="sunlit"] .progress-card {
  background: rgba(255, 253, 248, 0.92);
  border-color: var(--line);
  box-shadow: 0 12px 40px rgba(42, 38, 32, 0.06);
}

html[data-theme="sunlit"] #df-progress-card[data-today-complete="true"] {
  box-shadow: 0 0 0 1px rgba(120, 170, 130, 0.2), 0 12px 36px rgba(42, 90, 55, 0.08);
}

html[data-theme="sunlit"] .progress-stat {
  background: rgba(255, 252, 247, 0.9);
  border-color: rgba(82, 72, 58, 0.08);
}

html[data-theme="sunlit"] .today-panel {
  background: linear-gradient(165deg, rgba(255, 248, 236, 0.95) 0%, rgba(250, 244, 234, 0.98) 45%, #fffdf9 100%);
  border: 1px solid rgba(139, 115, 72, 0.15);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.85) inset, 0 16px 42px rgba(42, 38, 32, 0.06);
}

html[data-theme="sunlit"] .today-date {
  color: var(--text);
}

html[data-theme="sunlit"] .atmo-block {
  border-color: rgba(139, 115, 72, 0.15);
  background: rgba(255, 252, 245, 0.75);
}

html[data-theme="sunlit"] .btn-atmo {
  color: var(--text);
  background: rgba(255, 255, 255, 0.65);
  border-color: rgba(139, 115, 72, 0.22);
}

html[data-theme="sunlit"] .btn-atmo:hover:not(:disabled) {
  background: rgba(255, 252, 247, 0.95);
  border-color: rgba(139, 115, 72, 0.35);
}

html[data-theme="sunlit"] #df-error {
  background: rgba(200, 100, 100, 0.1);
  border-color: rgba(180, 80, 80, 0.25);
  color: #7a2828;
}

html[data-theme="sunlit"] .flow-card {
  background: linear-gradient(180deg, #fffdfb 0%, #faf6ef 55%, #f5f0e8 100%);
  border-color: var(--line);
  box-shadow: 0 18px 48px rgba(42, 38, 32, 0.05);
}

html[data-theme="sunlit"] .flow-card--complete {
  border-color: rgba(120, 170, 130, 0.28);
  box-shadow: 0 0 0 1px rgba(120, 170, 130, 0.08), 0 20px 44px rgba(60, 100, 70, 0.08);
}

html[data-theme="sunlit"] .flow-card h1 {
  color: var(--text);
}

html[data-theme="sunlit"] .verse-ref {
  color: var(--text);
}

html[data-theme="sunlit"] .verse-text {
  color: #2a2824;
}

html[data-theme="sunlit"] .body-text {
  color: #3d3a35;
}

html[data-theme="sunlit"] .reflection-box {
  background: linear-gradient(90deg, rgba(212, 184, 150, 0.18) 0%, rgba(255, 252, 247, 0.4) 100%);
  border-left-color: rgba(139, 115, 72, 0.45);
}

html[data-theme="sunlit"] .reflection-box .body-text {
  color: #35322e;
}

html[data-theme="sunlit"] .actions {
  border-top-color: var(--line);
}

html[data-theme="sunlit"] .complete-foot {
  background: rgba(120, 170, 130, 0.12);
  border-color: rgba(90, 143, 98, 0.22);
}

html[data-theme="sunlit"] .complete-sentiment {
  color: #2f4a32;
}

html[data-theme="sunlit"] .flow-card--complete .btn-complete {
  color: #1a2e1c;
}

/* —— lessons.html —— */
html[data-theme="sunlit"] .lesson-video-frame {
  background: #1a1a1a;
}

html[data-theme="sunlit"] .lesson-quiz-option--correct {
  border-color: rgba(90, 150, 110, 0.45);
  background: rgba(120, 170, 130, 0.12);
}

html[data-theme="sunlit"] .lesson-quiz-option--incorrect {
  border-color: rgba(190, 100, 100, 0.35);
  background: rgba(200, 120, 120, 0.08);
}

html[data-theme="sunlit"] .lesson-quiz-feedback--ok {
  background: rgba(120, 170, 130, 0.12);
}

html[data-theme="sunlit"] .lesson-quiz-feedback--miss {
  background: rgba(200, 130, 130, 0.1);
}

/* Segmented control — warm neutral (loads after jg-theme-controls on Kingdom pages only) */
html[data-theme="sunlit"] .jg-theme-switch__btn[aria-pressed="true"] {
  background: rgba(139, 115, 72, 0.22);
  color: var(--text);
  box-shadow: 0 1px 10px rgba(90, 75, 55, 0.1);
}

html[data-theme="sunlit"] .lesson-guided {
  border-left-color: rgba(139, 115, 72, 0.22);
  background: linear-gradient(90deg, rgba(212, 184, 150, 0.14) 0%, transparent 72%);
}
