/* =========================================================
   Tiflo Audio Podcast - Estilo para transcripciones
   Diseño limpio, adaptable y accesible
   ========================================================= */

/* Variables de diseño */
:root {
  --fondo: #f7f8fa;
  --superficie: #ffffff;
  --texto: #1f2933;
  --texto-secundario: #52606d;
  --acento: #174ea6;
  --acento-hover: #0b3d91;
  --borde: #d9e2ec;
  --foco: #ffbf47;

  --ancho-lectura: 52rem;
  --radio: 0.65rem;
}

/* Modelo de caja más predecible */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Documento */
html {
  font-size: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 2rem 1rem;
  background: var(--fondo);
  color: var(--texto);
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  font-size: 1.0625rem;
  line-height: 1.7;
}

/* El contenido principal queda centrado aunque el HTML
   no utilice todavía un elemento <main>. */
body > * {
  width: min(100%, var(--ancho-lectura));
  margin-left: auto;
  margin-right: auto;
}

/* Encabezados */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: #152238;
  line-height: 1.25;
  text-wrap: balance;
}

h1 {
  margin-top: 0;
  margin-bottom: 0.6rem;
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: -0.025em;
}

h2 {
  margin-top: 0.25rem;
  margin-bottom: 1rem;
  color: var(--texto-secundario);
  font-size: clamp(1.3rem, 3vw, 1.65rem);
  font-weight: 600;
}

h3 {
  margin-top: 3rem;
  margin-bottom: 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--borde);
  font-size: clamp(1.35rem, 3vw, 1.7rem);
}

h4 {
  margin-top: 2.25rem;
  font-size: 1.25rem;
}

h5,
h6 {
  margin-top: 2rem;
}

/* Texto */
p {
  margin-top: 0;
  margin-bottom: 1.25rem;
}

strong,
b {
  font-weight: 700;
}

/* Enlaces */
a {
  color: var(--acento);
  text-decoration-thickness: 0.11em;
  text-underline-offset: 0.16em;
}

a:hover {
  color: var(--acento-hover);
  text-decoration-thickness: 0.16em;
}

a:focus-visible {
  outline: 3px solid var(--foco);
  outline-offset: 4px;
  border-radius: 0.15rem;
}

/* Listas, por si se usan en futuras transcripciones */
ul,
ol {
  margin-top: 0;
  margin-bottom: 1.5rem;
  padding-left: 2rem;
}

li + li {
  margin-top: 0.4rem;
}

/* Citas, por si se incorporan posteriormente */
blockquote {
  margin: 1.75rem 0;
  padding: 0.25rem 1.25rem;
  border-left: 4px solid var(--acento);
  color: var(--texto-secundario);
}

/* Separadores */
hr {
  margin: 2.5rem auto;
  border: 0;
  border-top: 1px solid var(--borde);
}

/* Selección de texto */
::selection {
  background: #cfe2ff;
  color: #111827;
}

/* Mejor adaptación a pantallas pequeñas */
@media (max-width: 40rem) {
  body {
    padding: 1.25rem 1rem;
    font-size: 1rem;
  }

  h3 {
    margin-top: 2.25rem;
  }
}

/* Preferencia del usuario: mayor contraste */
@media (prefers-contrast: more) {
  :root {
    --texto: #000000;
    --texto-secundario: #222222;
    --acento: #003f8f;
    --borde: #6b7280;
  }

  a {
    text-decoration-thickness: 0.14em;
  }
}

/* Preferencia del usuario: reducir movimiento */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Impresión */
@media print {
  body {
    padding: 0;
    background: #ffffff;
    color: #000000;
    font-size: 11pt;
  }

  body > * {
    width: 100%;
    max-width: none;
  }

  a {
    color: #000000;
  }

  h3 {
    break-after: avoid;
  }

  p {
    orphans: 3;
    widows: 3;
  }
}
