/* ═══ Micro ensayos — estilos compartidos ═══
   Una sola hoja para el índice y todas las páginas de ensayo: un retoque
   estético aquí cambia toda la sección sin tocar N páginas.
   Tokens del sistema visual de la landing (fuente de la verdad: config.yaml). */

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

:root {
  --bg: #ffffff;
  --ink: #0a0a0a;
  --muted: #888;
  --border: #e8e8e8;
  --texto: #444;
  --texto-tenue: #555;
  --pie: #bbb;
  --radio: 6px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Geist', -apple-system, sans-serif;
  font-weight: 300;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── LAYOUT ── */
.wrap {
  max-width: 600px;
  margin: 0 auto;
  padding: 48px 32px 140px;
}

/* ── CABECERA (la misma de la landing, con la navegación de la sección) ── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;      /* en pantallas muy estrechas, el menú baja a una 2.ª línea */
  row-gap: 14px;
  gap: 16px;
  margin-bottom: 72px;
  opacity: 0;
  animation: fadeIn 0.9s ease forwards;
  animation-delay: 0.2s;
}

.topbar .marca {
  font-family: 'Schibsted Grotesk', -apple-system, sans-serif;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.topbar .marca .punto {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ink);
  display: inline-block;
}

.topbar nav {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: auto;  /* a la derecha también si baja a la 2.ª línea */
}

/* Enlace discreto (sin caja): la sección en la que ya estás no compite con el CTA */
.topbar .enlace {
  font-family: 'Geist', sans-serif;
  font-size: 12px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.topbar .enlace:hover { color: var(--ink); }

.topbar .membresia {
  font-family: 'Geist', sans-serif;
  font-size: 12px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--ink);
  border-radius: var(--radio);
  padding: 9px 16px;
  transition: background 0.2s ease, color 0.2s ease;
}

.topbar .membresia:hover {
  background: var(--ink);
  color: var(--bg);
}

/* ── TITULAR DEL ENSAYO (más contenido que el de la portada: los H1 long-tail
      son frases largas) ── */
h1 {
  font-family: 'Schibsted Grotesk', -apple-system, sans-serif;
  font-size: clamp(1.9rem, 5.5vw, 2.8rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
  opacity: 0;
  animation: fadeIn 0.9s ease forwards;
  animation-delay: 0.2s;
}

/* El asunto original del correo, como subtítulo */
.asunto {
  font-size: 18px;
  line-height: 1.6;
  color: var(--texto-tenue);
  margin-bottom: 20px;
  opacity: 0;
  animation: fadeIn 0.9s ease forwards;
  animation-delay: 0.25s;
}

/* Autor y fecha */
.firma {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.02em;
  margin-bottom: 44px;
  opacity: 0;
  animation: fadeIn 0.9s ease forwards;
  animation-delay: 0.25s;
}

/* ── DIVIDER ── */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin-bottom: 48px;
  opacity: 0;
  animation: fadeIn 0.6s ease forwards;
  animation-delay: 0.35s;
}

/* ── CUERPO (los bloques entran a la vez, como en la portada) ── */
.cuerpo, .lista-seccion, .form-section, .relacionados {
  opacity: 0;
  animation: fadeIn 0.8s ease forwards;
  animation-delay: 0.45s;
}

.cuerpo p {
  font-size: 16px;
  line-height: 1.8;
  color: var(--texto);
  margin-bottom: 24px;
}

.cuerpo p strong, .cuerpo li strong { color: var(--ink); font-weight: 500; }

.cuerpo a { color: var(--ink); text-decoration: underline; }

/* Encabezados internos del ensayo (si el correo los trae) */
.cuerpo h2 {
  font-family: 'Schibsted Grotesk', -apple-system, sans-serif;
  font-weight: 600;
  font-size: 1.35rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 40px 0 16px;
}

/* ── LISTAS con flecha y líneas finas (idénticas a la portada) ── */
ul.items {
  list-style: none;
  margin: 0 0 40px;
}

ul.items li {
  font-size: 16px;
  line-height: 1.8;
  color: var(--texto);   /* mismo tono que el cuerpo (coherente con la portada) */
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 16px;
}

ul.items li:first-child { border-top: 1px solid var(--border); }

ul.items li::before {
  content: '→';
  color: var(--muted);
  flex-shrink: 0;
  font-size: 13px;
  margin-top: 2px;
}

/* ── ÍNDICE: la lista de ensayos ── */
ul.lista-ensayos {
  list-style: none;
  margin: 0 0 40px;
}

ul.lista-ensayos li {
  border-bottom: 1px solid var(--border);
}

ul.lista-ensayos li:first-child { border-top: 1px solid var(--border); }

ul.lista-ensayos a {
  display: block;
  padding: 22px 0;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

ul.lista-ensayos a:hover { opacity: 0.6; }

ul.lista-ensayos .titulo {
  display: block;
  font-family: 'Schibsted Grotesk', -apple-system, sans-serif;
  font-weight: 600;
  font-size: 1.15rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 6px;
}

ul.lista-ensayos .fecha {
  display: block;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* ── RELACIONADOS ── */
.relacionados {
  margin-top: 72px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.relacionados h2 {
  font-family: 'Geist', sans-serif;
  font-size: 12px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 8px;
}

ul.relacionados-lista { list-style: none; margin: 0; }

ul.relacionados-lista li { border-bottom: 1px solid var(--border); }

ul.relacionados-lista a {
  display: block;
  padding: 14px 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

ul.relacionados-lista a:hover { opacity: 0.6; }

/* ── CIERRE DE CAPTACIÓN ── */
.form-section { margin-top: 72px; }

.form-section .invitacion {
  font-size: 16px;
  line-height: 1.8;
  color: var(--texto);
  margin-bottom: 24px;
}

.form-section .invitacion strong { color: var(--ink); font-weight: 500; }

/* ── FOOTER ── */
footer {
  margin-top: 120px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--pie);
  letter-spacing: 0.08em;
  display: flex;
  justify-content: space-between;
  opacity: 0;
  animation: fadeIn 0.6s ease forwards;
  animation-delay: 0.45s;
}

footer a { color: inherit; text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ── ANIMATION ── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Formulario de MailerLite (el mismo de la portada, mismos estilos) ── */
#mlb2-40117147.ml-form-embedContainer, #mlb2-40117147 * { box-sizing: border-box; }
#mlb2-40117147.ml-form-embedContainer { width: 100%; }
#mlb2-40117147 .ml-form-embedWrapper {
  background: transparent; border: 0; border-radius: 0;
  max-width: 460px; width: 100%; margin: 0;
}
#mlb2-40117147 .ml-form-embedBody { padding: 0; }
#mlb2-40117147 form { margin: 0; width: 100%; }
#mlb2-40117147 .ml-form-fieldRow { margin: 0 0 14px 0; }

#mlb2-40117147 input[type="email"] {
  width: 100%; background: transparent; color: var(--ink);
  font-family: 'Geist', sans-serif; font-weight: 300;
  font-size: 14px; line-height: 1.5; padding: 14px 18px;
  border: 1px solid var(--ink); border-radius: var(--radio); outline: none;
  -webkit-appearance: none;
}
#mlb2-40117147 input[type="email"]::placeholder { color: var(--pie); }

#mlb2-40117147 .ml-form-embedPermissions { margin: 0 0 12px 0; }
#mlb2-40117147 .ml-form-embedPermissionsContent p {
  color: var(--texto-tenue); font-family: 'Geist', sans-serif;   /* letra pequeña legal: legible, aún secundaria (igual que la portada) */
  font-size: 12px; line-height: 1.6; margin: 0;
}
#mlb2-40117147 .ml-form-checkboxRow { margin: 0 0 18px 0; }
#mlb2-40117147 .ml-form-checkboxRow label {
  display: flex; align-items: flex-start; gap: 10px; cursor: pointer; margin: 0;
}
#mlb2-40117147 .ml-form-checkboxRow input[type="checkbox"] {
  margin: 2px 0 0 0; width: 15px; height: 15px;
  accent-color: var(--ink); flex-shrink: 0; cursor: pointer;
}
#mlb2-40117147 .ml-form-checkboxRow .label-description p {
  color: var(--texto-tenue); font-family: 'Geist', sans-serif;   /* casilla de consentimiento: mismo tono que el bloque RGPD */
  font-size: 12px; line-height: 1.5; margin: 0;
}
#mlb2-40117147 .ml-form-checkboxRow a { color: var(--ink); text-decoration: underline; }
#mlb2-40117147 .ml-form-embedPermissionsContent a { color: var(--ink); text-decoration: underline; }

#mlb2-40117147 .ml-form-embedSubmit { margin: 0; }
#mlb2-40117147 .ml-form-embedSubmit button.primary {
  width: 100%; background: var(--ink); color: var(--bg); border: none; border-radius: var(--radio);
  font-family: 'Geist', sans-serif; font-size: 12px; font-weight: 400;
  letter-spacing: 0.1em; text-transform: uppercase; padding: 14px 22px;
  cursor: pointer; transition: opacity 0.2s; -webkit-appearance: none;
}
#mlb2-40117147 .ml-form-embedSubmit button.primary:hover { opacity: 0.75; }
#mlb2-40117147 .ml-form-embedSubmit button.loading {
  width: 100%; background: var(--ink); border: none; border-radius: var(--radio);
  padding: 14px 22px; cursor: default;
}

#mlb2-40117147 .ml-form-successContent .success-headline {
  font-family: 'Schibsted Grotesk', sans-serif; font-weight: 700;
  font-size: 1.4rem; letter-spacing: -0.02em; color: var(--ink); margin: 0 0 10px 0;
}
#mlb2-40117147 .ml-form-successContent p {
  color: var(--texto); font-family: 'Geist', sans-serif;
  font-size: 14px; line-height: 1.7; margin: 0;
}

#mlb2-40117147 .ml-error input[type="email"] { border-color: #c0392b !important; }
#mlb2-40117147 .ml-error .label-description p,
#mlb2-40117147 .ml-error label { color: #c0392b !important; }

#mlb2-40117147 .ml-form-embedSubmitLoad { display: inline-block; width: 20px; height: 20px; }
#mlb2-40117147 .ml-form-embedSubmitLoad:after {
  content: " "; display: block; width: 11px; height: 11px; margin: 1px auto;
  border-radius: 50%; border: 3px solid var(--bg);
  border-color: var(--bg) var(--bg) var(--bg) transparent; animation: mlSpin 1.2s linear infinite;
}
@keyframes mlSpin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
#mlb2-40117147 .sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

/* ── TABLET + MÓVIL: texto más grande, para leer más cómodo (como la portada) ── */
@media (max-width: 1024px) {
  .cuerpo p, ul.items li, .form-section .invitacion { font-size: 19px; }
  .asunto { font-size: 20px; }
}

/* ── MÓVIL: el toggle sube a la barra de arriba (con el logo centrado) y los
      enlaces quedan en una 2.ª barra a lo ancho (Micro ensayos / Membresía) ── */
@media (max-width: 500px) {
  .wrap { padding: 32px 24px 100px; }
  .topbar { position: relative; margin-bottom: 56px; column-gap: 12px; }
  .topbar .marca { font-size: 14px; }
  .topbar .enlace { font-size: 10px; letter-spacing: 0.05em; }
  .topbar .membresia { font-size: 11px; padding: 8px 11px; }
  footer { flex-direction: column; gap: 6px; }

  /* Ensayos (con enlace "Micro ensayos"): 3 elementos no caben en una línea, así
     que el logo va centrado arriba con el toggle a su derecha (a la misma altura,
     de ahí el min-height), y los enlaces bajan a una 2.ª barra a lo ancho. */
  .topbar:has(.enlace) .marca { width: 100%; justify-content: center; min-height: 30px; }
  .topbar:has(.enlace) .tema-toggle { position: absolute; top: 0; right: 0; }
  .topbar:has(.enlace) nav { width: 100%; margin-left: 0; justify-content: space-between; gap: 12px; }

  /* Índice (solo toggle + Membresía): caben con el logo en una sola línea (la nav
     se queda en línea, empujada a la derecha por margin-left:auto). */
}
