/* ===================== */
/* 1. VARIABLES          */
/* ===================== */
:root {
  --bg-body: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --bg-container: #ffffff;
  --bg-header: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
  --bg-filters: #f8f9fa;
  --text-main: #2d3748;
  --text-muted: #495057;
  --border: #dee2e6;
  --accent: #667eea;
  --highlight-bg: #fff3cd;
  --highlight-text: #856404;
  --card-hover: #f0f4ff;
  --tab-inactive: rgba(255,255,255,0.2);
  --tab-active: rgba(255,255,255,0.95);
  --tab-active-text: #1e3a5f;

  /* ✨ Espaciado de línea — controlado desde el panel de ajustes */
  --line-height-content: 1.5;
}

[data-theme="dark"] {
  --bg-body: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  --bg-container: #1e293b;
  --bg-header: linear-gradient(135deg, #020617 0%, #0f172a 100%);
  --bg-filters: #334155;
  --text-main: #f1f5f9;
  --text-muted: #cbd5e0;
  --border: #4a5568;
  --accent: #a5b4fc;
  --highlight-bg: #854d0e;
  --highlight-text: #fef3c7;
  --card-hover: #2d3a4f;
  --tab-inactive: rgba(255,255,255,0.1);
  --tab-active: rgba(255,255,255,0.15);
  --tab-active-text: #e2e8f0;
}

/* ===================== */
/* 2. RESET Y BASE       */
/* ===================== */
* { 
  margin: 0; 
  padding: 0; 
  box-sizing: border-box; 
}

body {
  font-family: 'Georgia', 'Noto Sans KR', serif;
  background: var(--bg-body);
  background-attachment: fixed;
  min-height: 100vh;
  padding: 20px;
  color: var(--text-main);
  transition: all 0.3s ease;
}

.container {
  max-width: 850px;
  margin: 0 auto;
  background: var(--bg-container);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

/* ===================== */
/* 7. CONTENIDO          */
/* ===================== */
.content { 
  padding: 32px; 
  font-size: 1.1rem;

  /* ✨ Ya no tiene line-height fijo — lo controla la variable */
  line-height: var(--line-height-content, 1.5);
}

.verse { 
  margin-bottom: 16px; 
  text-align: justify;

  /* ✨ Hereda y aplica la variable con transición suave */
  line-height: var(--line-height-content, 1.5);
  transition: line-height 0.25s ease;
}

.verse-number { 
  font-weight: bold; 
  color: var(--accent); 
  margin-right: 8px; 
  font-size: 0.9rem; 
}

.reference {
  padding: 0 32px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-main);
  opacity: 0;
  transition: opacity 0.3s;
}

.reference.visible {
  opacity: 1;
  padding-top: 20px;
}

/* Loading & Error */
.loading, .placeholder {
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
}

.error {
  text-align: center;
  color: #e53e3e;
}

/* ===================== */
/* TAMAÑO DE FUENTE      */
/* ===================== */
#content,
#content .verse,
#content .comp-cell,
#content .search-result-text,
#content p {
  font-size: var(--font-reading, 1.1rem) !important;
}

#content .verse-number {
  font-size: calc(var(--font-reading, 1.1rem) * 0.82) !important;
}

/* ===================== */
/* ESPACIADO DE LÍNEA    */
/* ===================== */
#content .verse,
#content .verse-text,
#content p:not(.placeholder):not(.error):not(.loading),
#content .comp-verse-text,
#content .search-result-text {
  line-height: var(--line-height-content, 1.5) !important;
  transition: line-height 0.25s ease;
}
