@import url("https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,600;0,8..60,700;1,8..60,400&family=Inter:wght@400;500;600;700&display=swap");

:root {
  --bg: #faf8f4;
  --bg-elevated: #ffffff;
  --text: #201f1a;
  --muted: #6b675e;
  --accent: #17434c;
  --accent-strong: #0f2e35;
  --accent-soft: #e4ebe9;
  --border: #e6e1d6;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16181a;
    --bg-elevated: #1e2123;
    --text: #ece8e0;
    --muted: #a19c8f;
    --accent: #7fb8c2;
    --accent-strong: #a3ccd3;
    --accent-soft: #223133;
    --border: #33342f;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 56px 20px 96px;
}

.page-narrow {
  max-width: 560px;
}

/* --- Cabecera / kicker --- */

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

.kicker::before {
  content: "";
  width: 20px;
  height: 2px;
  background: var(--accent);
  display: inline-block;
}

/* --- Tipografía --- */

h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 2.5rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.35em;
}

h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1.3;
  margin: 2.6em 0 0.7em;
  padding-top: 0.9em;
  border-top: 1px solid var(--border);
}

h3 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1rem;
  color: var(--muted);
  margin: 2em 0 0.4em;
}

article p {
  font-size: 1.05rem;
}

article strong {
  font-weight: 600;
}

p.lead {
  font-family: var(--serif);
  color: var(--text);
  font-size: 1.25rem;
  line-height: 1.55;
  margin: 0 0 2em;
}

/* Primer párrafo/subtítulo de cada estudio (el que va en negrita: título
   del artículo original). Le damos aire de "titular secundario". */
article p:has(> strong:only-child) {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.3em;
}

/* --- Tarjeta / formulario de alta --- */

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 28px;
  margin: 32px 0;
}

form.subscribe {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

form.subscribe input[type="email"] {
  flex: 1 1 240px;
  padding: 13px 16px;
  font-size: 1rem;
  font-family: var(--sans);
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg);
  color: var(--text);
}

form.subscribe input[type="email"]:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

form.subscribe button {
  padding: 13px 24px;
  font-size: 0.95rem;
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: 0.01em;
  border: none;
  border-radius: 3px;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

form.subscribe button:hover {
  background: var(--accent-strong);
}

/* Campo honeypot: invisible para personas, visible para bots */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.fine-print {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 14px;
}

.back-link {
  margin-top: 3.5em;
  font-family: var(--sans);
  font-size: 0.9rem;
}

.back-link a {
  color: var(--muted);
}

/* --- Enlaces --- */

a {
  color: inherit;
}

article a,
.back-link a:hover {
  color: var(--accent);
  text-decoration-color: var(--border);
  text-underline-offset: 3px;
}

article a:hover {
  text-decoration-color: currentColor;
}

/* --- Metadatos, listas, referencias --- */

.meta,
article p em {
  color: var(--muted);
  font-style: normal;
  font-size: 0.95rem;
  font-family: var(--sans);
}

/* Índice de temas: como un pequeño sumario de revista */
article ul:first-of-type {
  list-style: none;
  padding: 0;
  margin: 0 0 2.5em;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 6px 20px;
  background: var(--bg-elevated);
}

article ul:first-of-type li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-family: var(--sans);
  font-size: 0.95rem;
}

article ul:first-of-type li:last-child {
  border-bottom: none;
}

article ul:first-of-type a {
  color: var(--text);
  text-decoration: none;
}

article ul:first-of-type a:hover {
  color: var(--accent);
}

.also-published,
article > p + ul {
  font-family: var(--sans);
  font-size: 0.92rem;
  color: var(--muted);
}

.also-published li,
article > p + ul li {
  margin-bottom: 8px;
  line-height: 1.5;
}

/* Referencias finales: numeradas, más compactas */
article h2:last-of-type + ol,
article ol {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.7;
  padding-left: 1.3em;
}

article ol li {
  margin-bottom: 0.6em;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3em 0;
}

footer.site-footer {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 4.5em;
  text-align: center;
  font-family: var(--sans);
}

/* --- Etiquetas de tema (portada) --- */

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 1.5em 0 2.5em;
  padding: 0;
  list-style: none;
}

.tag-list li {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 6px 13px;
  border-radius: 100px;
}

/* --- Lista de características (portada) --- */

.feature-list {
  list-style: none;
  padding: 0;
  margin: 2em 0 2.5em;
  display: grid;
  gap: 22px;
}

.feature-list li {
  padding-left: 28px;
  position: relative;
}

.feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
}

.feature-list strong {
  font-family: var(--serif);
  font-size: 1.05rem;
  display: block;
  margin-bottom: 0.2em;
}

.feature-list span {
  color: var(--muted);
  font-size: 0.95rem;
}

/* --- Casillas de temas extra (formulario de alta) --- */

fieldset.topics {
  border: none;
  padding: 0;
  margin: 18px 0 0;
  /* form.subscribe es un flex container: fuerza a que este bloque ocupe
     toda la fila, debajo del email y el boton, en vez de intentar
     colocarse al lado. */
  flex-basis: 100%;
}

fieldset.topics legend {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  padding: 0;
  margin-bottom: 4px;
}

fieldset.topics .topics-hint {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0 0 12px;
}

.topics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
}

.topics-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 0.92rem;
  color: var(--text);
  cursor: pointer;
}

.topics-grid input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .topics-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Responsive --- */

@media (max-width: 600px) {
  .page {
    padding: 40px 18px 72px;
  }
  h1 {
    font-size: 2rem;
  }
  p.lead {
    font-size: 1.1rem;
  }
}
