/* =====================================================================
   Deep Study Bible — DaisyUI 4 theme
   Two themes: "deepstudy" (light, default) and "deepstudy-dark".
   Token names match DaisyUI 4's CSS-variable contract (oklch values).
   ===================================================================== */

/* ---------- Brand tokens (consumable via inline style) ---------- */
:root {
  --dsb-ink:           #1c1a17;
  --dsb-parchment:     #f6efe1;
  --dsb-parchment-2:   #efe6d2;
  --dsb-bone:          #fbf6ea;
  --dsb-olive:         #4a6b3a;
  --dsb-olive-deep:    #2f4724;
  --dsb-olive-soft:    #e9efdd;
  --dsb-gold:          #b8893a;
  --dsb-gold-deep:     #8a6320;
  --dsb-gold-soft:     #f3e7c9;
  --dsb-wine:          #8a2f2a;
  --dsb-wine-soft:     #f4dcd8;
  --dsb-lapis:         #2c4a7a;
  --dsb-lapis-soft:    #d9e2f0;
  --font-serif: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-sans:  "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono:  "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}
[data-theme="deepstudy-dark"] {
  --dsb-ink:           #f1ead7;
  --dsb-parchment:     #1a1814;
  --dsb-parchment-2:   #23201a;
  --dsb-bone:          #23201a;
  --dsb-olive:         #8aa874;
  --dsb-olive-deep:    #b6cf9f;
  --dsb-olive-soft:    rgba(138,168,116,0.18);
  --dsb-gold:          #d9b366;
  --dsb-gold-deep:     #f0d28a;
  --dsb-gold-soft:     rgba(217,179,102,0.16);
  --dsb-wine:          #c87672;
  --dsb-wine-soft:     rgba(200,118,114,0.18);
  --dsb-lapis:         #6a8cc0;
  --dsb-lapis-soft:    rgba(106,140,192,0.18);
}

/* ---------- Brand utilities ---------- */
.eyebrow {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.font-serif { font-family: var(--font-serif); }
.icon-chip {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ic-olive { background: rgba(74,107,58,0.12);  color: var(--dsb-olive-deep); }
.ic-gold  { background: rgba(184,137,58,0.14); color: var(--dsb-gold-deep); }
.ic-wine  { background: rgba(138,47,42,0.10);  color: var(--dsb-wine); }
.ic-lapis { background: rgba(44,74,122,0.12);  color: var(--dsb-lapis); }
[data-theme="deepstudy-dark"] .ic-olive { background: rgba(138,168,116,0.18); color: var(--dsb-olive-deep); }
[data-theme="deepstudy-dark"] .ic-gold  { background: rgba(217,179,102,0.16); color: var(--dsb-gold-deep); }
[data-theme="deepstudy-dark"] .ic-wine  { background: rgba(200,118,114,0.18); color: var(--dsb-wine); }
[data-theme="deepstudy-dark"] .ic-lapis { background: rgba(106,140,192,0.18); color: var(--dsb-lapis); }

/* Dove logo: PNG is dark-on-transparent. On the dark theme, invert it
   to a warm bone silhouette so it's visible against parchment-dark. */
[data-theme="deepstudy-dark"] img[src*="logo_dove"] {
  filter: brightness(0) invert(0.95) sepia(0.18);
}

/* Card variants for the dashboard */
.card-illuminated {
  background: linear-gradient(180deg, var(--dsb-gold-soft) 0%, #efdcae 100%);
  border: 1px solid rgba(184,137,58,0.25);
}
[data-theme="deepstudy-dark"] .card-illuminated {
  background: linear-gradient(180deg, rgba(217,179,102,0.12) 0%, rgba(217,179,102,0.05) 100%);
  border-color: rgba(217,179,102,0.25);
}

/* ---------- LIGHT — "deepstudy" ---------- */
[data-theme="deepstudy"] {
  color-scheme: light;

  --b1: 95.5% 0.024 80;       /* parchment   #f6efe1 */
  --b2: 92%   0.029 80;       /* parchment-2 #efe6d2 */
  --b3: 87%   0.034 80;       /* parchment-3 #e6dcc4 */
  --bc: 17%   0.012 60;       /* ink         #1c1a17 */

  --n:  22%   0.014 60;       /* ink-soft    #2a2620 */
  --nc: 96%   0.024 80;       /* on-neutral  #fbf6ea (bone) */

  --p:  48%   0.085 130;      /* olive       #4a6b3a */
  --pc: 96%   0.024 80;       /* on-primary  bone */
  --pf: 34%   0.075 130;      /* olive-deep  #2f4724 */

  --s:  64%   0.115 75;       /* gold        #b8893a */
  --sc: 17%   0.012 60;       /* on-secondary ink */
  --sf: 50%   0.105 75;       /* gold-deep   #8a6320 */

  --a:  44%   0.135 25;       /* wine        #8a2f2a */
  --ac: 96%   0.024 80;       /* on-accent   bone */
  --af: 36%   0.130 25;

  --in: 38%   0.090 260;      /* lapis       #2c4a7a */
  --inc:96%   0.024 80;

  --su: 48%   0.080 145;      /* #3f7a4f */
  --suc:96%   0.024 80;
  --wa: 64%   0.115 75;       /* gold reused */
  --wac:17%   0.012 60;
  --er: 44%   0.135 25;       /* wine reused */
  --erc:96%   0.024 80;

  --rounded-box: 1rem;
  --rounded-btn: 0.625rem;
  --rounded-badge: 9999px;

  --animation-btn: 0.2s;
  --animation-input: 0.15s;
  --btn-text-case: none;
  --btn-focus-scale: 0.98;
  --border-btn: 1px;
  --tab-border: 1px;
  --tab-radius: 0.375rem;

  --glass-blur: 12px;
  --glass-opacity: 0.30;
  --glass-border-opacity: 0.10;
  --glass-reflex-degree: 100deg;
  --glass-reflex-opacity: 0.05;
  --glass-text-shadow-opacity: 0;
}

/* ---------- DARK — "deepstudy-dark" (the study lamp) ---------- */
[data-theme="deepstudy-dark"] {
  color-scheme: dark;

  --b1: 16%   0.010 60;       /* page        #1a1814 */
  --b2: 19%   0.012 60;       /* surface     #23201a */
  --b3: 22%   0.013 60;       /* surface-2   #2c281f */
  --bc: 92%   0.030 80;       /* fg          #f1ead7 */

  --n:  19%   0.012 60;
  --nc: 92%   0.030 80;

  --p:  72%   0.075 130;      /* olive lifted #8aa874 */
  --pc: 16%   0.010 60;
  --pf: 80%   0.080 130;      /* olive-deep   #b6cf9f */

  --s:  74%   0.110 75;       /* gold lifted  #d9b366 */
  --sc: 16%   0.010 60;
  --sf: 80%   0.115 75;

  --a:  68%   0.125 25;       /* wine lifted  #c87672 */
  --ac: 16%   0.010 60;
  --af: 74%   0.130 25;

  --in: 62%   0.085 260;      /* lapis lifted #6a8cc0 */
  --inc:16%   0.010 60;

  --su: 64%   0.085 145;
  --suc:16%   0.010 60;
  --wa: 74%   0.110 75;
  --wac:16%   0.010 60;
  --er: 68%   0.125 25;
  --erc:16%   0.010 60;

  --rounded-box: 1rem;
  --rounded-btn: 0.625rem;
  --rounded-badge: 9999px;
  --animation-btn: 0.2s;
  --animation-input: 0.15s;
  --btn-text-case: none;
  --btn-focus-scale: 0.98;
  --border-btn: 1px;
  --tab-border: 1px;
  --tab-radius: 0.375rem;
}

/* ---------- DSB-flavored DaisyUI overrides ----------
   Tighten DaisyUI defaults to match the design system's
   parchment-and-ink personality. Apply within either theme. */

[data-theme^="deepstudy"] .btn {
  font-family: var(--font-sans, 'Inter', sans-serif);
  font-weight: 600;
  letter-spacing: 0;
}
[data-theme^="deepstudy"] .btn-primary:hover { background-color: oklch(var(--pf)); border-color: oklch(var(--pf)); }
[data-theme^="deepstudy"] .btn-secondary:hover { background-color: oklch(var(--sf)); border-color: oklch(var(--sf)); }

[data-theme^="deepstudy"] .card:not([class*="bg-"]) {
  background-color: oklch(var(--b1));
  border: 1px solid color-mix(in oklch, oklch(var(--bc)) 14%, transparent);
  box-shadow: 0 1px 2px rgba(28,26,23,0.06), 0 1px 1px rgba(28,26,23,0.04);
}
[data-theme="deepstudy-dark"] .card:not([class*="bg-"]) {
  background-color: oklch(var(--b2));
  border-color: color-mix(in oklch, oklch(var(--bc)) 12%, transparent);
  box-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

[data-theme^="deepstudy"] h1,
[data-theme^="deepstudy"] h2,
[data-theme^="deepstudy"] h3,
[data-theme^="deepstudy"] .prose h1,
[data-theme^="deepstudy"] .prose h2,
[data-theme^="deepstudy"] .prose h3 {
  font-family: var(--font-serif, 'Cormorant Garamond', Georgia, serif);
  font-weight: 600;
  letter-spacing: -0.005em;
}

[data-theme^="deepstudy"] .badge {
  font-family: var(--font-sans, 'Inter', sans-serif);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.02em;
}

[data-theme^="deepstudy"] .input,
[data-theme^="deepstudy"] .textarea,
[data-theme^="deepstudy"] .select {
  background-color: oklch(var(--b1));
  border: 1px solid color-mix(in oklch, oklch(var(--bc)) 14%, transparent);
}
[data-theme^="deepstudy"] .input:focus,
[data-theme^="deepstudy"] .textarea:focus,
[data-theme^="deepstudy"] .select:focus {
  border-color: oklch(var(--p));
  box-shadow: 0 0 0 3px color-mix(in oklch, oklch(var(--p)) 18%, transparent);
  outline: none;
}

/* Verse-row + scripture utilities (DaisyUI doesn't have these) */
[data-theme^="deepstudy"] .scripture {
  font-family: var(--font-serif, 'Cormorant Garamond', Georgia, serif);
  font-size: 21px;
  line-height: 1.85;
  font-weight: 500;
}
[data-theme^="deepstudy"] .scripture .v-num {
  font-family: var(--font-sans, 'Inter', sans-serif);
  font-weight: 700;
  font-size: 12px;
  color: oklch(var(--p));
  vertical-align: top;
  margin-right: 4px;
  opacity: 0.85;
}

/* Red letter (Jesus's words) — toggled per user preference */
.red-letter-text { color: #b91c1c; }
[data-theme="deepstudy-dark"] .red-letter-text { color: #f87171; }
