/* ==========================================================================
   TAGEBUCH EINES SPANISCHLEHRERS — ESTÁNDAR CANÓNICO V2 (LESER)
   Ricardo Ruiz · Spanisch Privatunterricht Köln Neumarkt · Clemensstraße 39
   Lectura Mobile-First, Estado por Defecto Solo Español y Tap-to-Reveal
   ========================================================================== */

:root {
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: 'Playfair Display', Georgia, Cambria, "Times New Roman", Times, serif;

  --color-bg-light: #FAF8F5;
  --color-surface-card: #FFFFFF;
  --color-surface-dark: #18181B;
  
  --color-text-main: #1D1D1F;
  --color-text-muted: #57534E;
  --color-text-subtle: #A8A29E;
  --color-text-shadow: #78716C;

  --color-accent: #C2410C; /* Terracota canónica de autor */
  --color-accent-hover: #9A3412;
  --color-accent-soft: rgba(194, 65, 12, 0.08);
  --color-border: #E7E5E4;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg-light);
  color: var(--color-text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.25;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container-editorial {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ==========================================================================
   2. CABECERA & BARRA SUPERIOR FIJA
   ========================================================================== */
.leser-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background-color: rgba(250, 248, 245, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  padding: 0.65rem 1.25rem;
}

.leser-nav-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.nav-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-text-main);
  padding: 0.5rem 0.25rem;
  transition: color 0.2s ease;
}

.nav-back-link:hover {
  color: var(--color-accent);
}

/* Conmutador Mobile-First Accesible (mínimo 48x48 px de área táctil) */
.reading-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 48px;
  min-width: 48px;
  padding: 0.5rem 1.1rem;
  background-color: #FFFFFF;
  border: 1.5px solid var(--color-border);
  border-radius: 9999px;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-main);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.reading-toggle-btn:hover {
  border-color: var(--color-accent);
  box-shadow: 0 2px 8px rgba(194, 65, 12, 0.15);
  transform: translateY(-1px);
}

.reading-toggle-btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

body.modo-asistido .reading-toggle-btn {
  background-color: #FFF7ED;
  border-color: var(--color-accent);
  color: var(--color-accent-hover);
  box-shadow: inset 0 1px 2px rgba(194, 65, 12, 0.1), 0 2px 6px rgba(194, 65, 12, 0.15);
}

.mode-indicator {
  font-size: 1.15rem;
  line-height: 1;
  display: inline-block;
}

.mode-text {
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
}

/* ==========================================================================
   3. CONTENIDO PRINCIPAL Y CABECERA DEL RELATO
   ========================================================================== */
.leser-main {
  padding-top: 6.5rem;
  padding-bottom: 5rem;
}

.article-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 2.75rem;
}

.article-badge {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--color-accent);
  background-color: #FFF7ED;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  border: 1px solid #FFEDD5;
  margin-bottom: 1.25rem;
}

.article-title-es {
  font-family: var(--font-serif);
  font-size: 2.15rem;
  line-height: 1.22;
  color: var(--color-text-main);
  margin-bottom: 0.75rem;
}

@media (min-width: 768px) {
  .article-title-es {
    font-size: 2.85rem;
  }
}

.article-title-de {
  font-size: 1.0625rem;
  font-style: italic;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.article-meta-line {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--color-text-subtle);
  font-weight: 600;
}

.meta-separator {
  color: var(--color-border);
}

/* Reproductor Durmiente (Innegociable display: none !important) */
.audio-player-wrapper.audio-pending {
  display: none !important;
}

/* Portada Editorial */
.article-cover {
  max-width: 820px;
  margin: 0 auto 3rem;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background-color: #E7E5E4;
}

.article-cover img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* Aviso didáctico cuando el modo asistido está activado */
.assisted-mode-hint {
  display: none;
  text-align: center;
  margin: -1rem auto 2.25rem;
  max-width: 580px;
  padding: 0.65rem 1.15rem;
  background: #FFF7ED;
  border: 1px dashed #FDBA74;
  border-radius: 8px;
  font-size: 0.8125rem;
  color: #9A3412;
  font-weight: 500;
}

body.modo-asistido .assisted-mode-hint {
  display: block;
}

/* ==========================================================================
   4. SISTEMA EDITORIAL BILINGÜE: TAP-TO-REVEAL Y ESTADOS (BLUEPRINT V2)
   ========================================================================== */
.story-container {
  max-width: 68ch;
  margin: 0 auto;
}

.story-block {
  margin-bottom: 1.75rem;
  border-radius: 8px;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.story-block .text-es {
  font-family: var(--font-sans);
  font-size: 1.125rem;
  line-height: 1.85;
  color: var(--color-text-main);
  display: block;
}

/* Letra Capitular */
.story-block.has-dropcap .text-es::first-letter {
  font-family: var(--font-serif);
  font-size: 3.75rem;
  float: left;
  line-height: 0.8;
  padding-top: 0.25rem;
  padding-right: 0.65rem;
  padding-bottom: 0.1rem;
  color: var(--color-accent);
  font-weight: 700;
}

/* ----------------------------------------------------
   REGLA CANÓNICA 1: Estado por defecto (Solo Español)
   El alemán está 100% oculto
   ---------------------------------------------------- */
body:not(.modo-asistido) .text-de {
  display: none !important;
}

/* ----------------------------------------------------
   REGLA CANÓNICA 2: Modo asistido en reposo (Alemán en sombra)
   ---------------------------------------------------- */
body.modo-asistido .story-block {
  cursor: pointer;
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

body.modo-asistido .story-block:hover {
  background-color: rgba(0, 0, 0, 0.015);
}

body.modo-asistido .text-de {
  display: block;
  font-size: 0.9375rem;
  line-height: 1.6;
  font-style: italic;
  color: var(--color-text-shadow);
  opacity: 0.15;
  margin-top: 0.45rem;
  padding-top: 0.45rem;
  border-top: 1px dashed rgba(0, 0, 0, 0.08);
  transition: opacity 0.25s ease, color 0.25s ease;
  user-select: none;
}

/* ----------------------------------------------------
   REGLA CANÓNICA 3: Toque individual (Tap-to-Reveal)
   ---------------------------------------------------- */
body.modo-asistido .story-block.is-revealed {
  background-color: rgba(194, 65, 12, 0.035);
  box-shadow: inset 3.5px 0 0 #C2410C;
}

body.modo-asistido .story-block.is-revealed .text-de {
  opacity: 1.0;
  color: #44403C;
  user-select: text;
}

/* ==========================================================================
   5. RADAR LINGÜÍSTICO & DECODIFICACIÓN (5 TARJETAS)
   ========================================================================== */
.decodificacion-section {
  margin-top: 4.5rem;
  padding-top: 3.5rem;
  border-top: 1px solid var(--color-border);
}

.decodificacion-header {
  text-align: center;
  max-width: 65ch;
  margin: 0 auto 2.5rem;
}

.decodificacion-badge {
  font-size: 0.6875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--color-accent);
  display: inline-block;
  margin-bottom: 0.75rem;
}

.decodificacion-title {
  font-family: var(--font-serif);
  font-size: 1.95rem;
  color: var(--color-text-main);
  margin-bottom: 0.5rem;
}

.decodificacion-subtitle {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  font-style: italic;
}

.decodificacion-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  max-width: 820px;
  margin: 0 auto;
}

@media (min-width: 680px) {
  .decodificacion-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.radar-card {
  background-color: var(--color-surface-card);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.35rem 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.radar-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-accent);
}

.radar-card-header {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.radar-term {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-text-main);
}

.radar-category {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-accent);
}

.radar-desc {
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--color-text-muted);
}

.radar-desc strong {
  color: var(--color-text-main);
}

/* ==========================================================================
   6. CIERRE DE AUTOR (CERO FRICCIÓN COMERCIAL · CLEMENSSTRASSE 39)
   ========================================================================== */
.autor-abschluss {
  margin-top: 5rem;
  padding-top: 3.5rem;
  border-top: 1px solid var(--color-border);
  text-align: center;
}

.autor-abschluss .ort-notiz {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--color-text-main);
  margin-bottom: 1rem;
}

.autor-abschluss .zitat-text {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  line-height: 1.75;
  max-width: 600px;
  margin: 0 auto 1.25rem;
  font-style: italic;
}

.autor-abschluss .kontakt-link {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text-main);
}

.autor-abschluss .kontakt-link a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

.autor-abschluss .kontakt-link a:hover {
  color: var(--color-accent-hover);
}

/* ==========================================================================
   7. PIE DE PÁGINA EDITORIAL
   ========================================================================== */
.footer-tagebuch {
  margin-top: 4rem;
  padding: 3rem 0;
  border-top: 1px solid var(--color-border);
  text-align: center;
  background-color: #F8F6F2;
}

.footer-tagebuch p {
  color: var(--color-text-subtle);
}
