/* Tipografía suave y estilos del prose para renderizar markdown de notas */

/* Suaviza el flash de tema */
html { color-scheme: light; }
html.dark { color-scheme: dark; }

[contenteditable="true"] {
  outline: 2px dashed rgba(30, 58, 138, 0.25);
  outline-offset: 3px;
  border-radius: 4px;
  transition: outline-color .15s;
}
[contenteditable="true"]:focus {
  outline: 2px solid #1e3a8a;
}
html.dark [contenteditable="true"] {
  outline-color: rgba(96, 165, 250, 0.35);
}
html.dark [contenteditable="true"]:focus {
  outline-color: #60a5fa;
}

/* ============= PROSE (markdown) — light ============= */
.prose {
  color: #334155;
  font-size: 0.95rem;
  line-height: 1.6;
}
.prose > * + * { margin-top: .75em; }
.prose p { margin: .5em 0; }
.prose strong { color: #1e3a8a; font-weight: 600; }
.prose em { font-style: italic; color: #475569; }
.prose ul { list-style: disc; padding-left: 1.25rem; }
.prose ol { list-style: decimal; padding-left: 1.25rem; }
.prose li { margin: .15em 0; }
.prose code {
  background: #f1f5f9;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  font-size: 0.9em;
  color: #ef4444;
}
.prose h1, .prose h2, .prose h3, .prose h4 {
  color: #1e3a8a;
  font-weight: 700;
  margin-top: 1em;
  margin-bottom: .3em;
}
.prose h3 { font-size: 1rem; }
.prose h4 { font-size: 0.95rem; }
.prose blockquote {
  border-left: 3px solid #f59e0b;
  background: #fffbeb;
  padding: .5em .75em;
  border-radius: 6px;
  color: #78350f;
  font-style: italic;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin: .5em 0;
  display: block;
  overflow-x: auto;
}
.prose th, .prose td {
  border: 1px solid #e2e8f0;
  padding: 6px 10px;
  text-align: left;
  vertical-align: top;
}
.prose th {
  background: #1e3a8a;
  color: #fff;
  font-weight: 600;
}
.prose tr:nth-child(even) td { background: #f8fafc; }
.prose a { color: #1e3a8a; text-decoration: underline; }
.prose hr { border: 0; border-top: 1px solid #e2e8f0; margin: 1em 0; }

/* ============= PROSE — dark ============= */
html.dark .prose {
  color: #cbd5e1;
}
html.dark .prose strong { color: #93c5fd; }
html.dark .prose em { color: #94a3b8; }
html.dark .prose code {
  background: #0f172a;
  color: #f87171;
}
html.dark .prose h1,
html.dark .prose h2,
html.dark .prose h3,
html.dark .prose h4 {
  color: #93c5fd;
}
html.dark .prose blockquote {
  border-left-color: #b45309;
  background: rgba(180, 83, 9, 0.15);
  color: #fbbf24;
}
html.dark .prose th, html.dark .prose td { border-color: #334155; }
html.dark .prose th { background: #0f172a; color: #e2e8f0; }
html.dark .prose tr:nth-child(even) td { background: rgba(30, 41, 59, 0.5); }
html.dark .prose a { color: #93c5fd; }
html.dark .prose hr { border-top-color: #334155; }

/* En pantallas chicas */
@media (max-width: 640px) {
  table { font-size: 0.85rem; }
}

/* Placeholder para contenteditable vacío */
[contenteditable="true"]:empty:before {
  content: attr(placeholder);
  color: #94a3b8;
}

/* Slider de velocidad de audio */
.speed-slider {
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  outline: none;
}
.speed-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fbbf24;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.speed-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fbbf24;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.speed-slider::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
}
.speed-slider::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
}

/* ============= MODO INMERSIÓN ============= */
/* El español queda borroneado; se revela con hover, tap, o click (toggle .revealed) */
body.immersion .es-hideable {
  filter: blur(6px);
  cursor: pointer;
  transition: filter .18s ease;
  user-select: none;
}
body.immersion .es-hideable:hover,
body.immersion .es-hideable:focus,
body.immersion .es-hideable:active,
body.immersion .es-hideable.revealed {
  filter: none;
  user-select: text;
}
/* En pantallas táctiles, un tap arma el reveal permanente vía JS */

