/* --------------------------------------------------------------------------
   Estilos del sitio. Sin frameworks: el sitio es contenido, no una aplicacion.

   El sitio es un hub con varias publicaciones. El chrome (header, footer, hub)
   usa siempre la paleta neutra de abajo; las paginas de una publicacion reciben
   ademas los tokens --brand-dark / --pub-* que el layout inyecta a partir del
   propio mail, y son los que hacen que cada newsletter se vea como su mail.
   -------------------------------------------------------------------------- */

:root {
  --accent: #1f5f4f;          /* lo pisa el <style> inline del layout */
  --ink: #1a1a1a;
  --ink-soft: #5c5c58;
  --ink-faint: #8a8a85;
  --paper: #ffffff;
  --paper-alt: #f7f7f4;
  --line: #e4e4de;
  --serif: Georgia, 'Iowan Old Style', 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --measure: 34rem;

  /* Valores por defecto de los tokens de publicacion, para que las paginas del
     sitio (hub, legales) no dependan de que exista una. */
  --brand-dark: #1a1a1a;
  --pub-bg: var(--paper-alt);
  --pub-card: var(--paper);
  --pub-ink: var(--ink);
  --pub-muted: var(--ink-soft);
  --pub-line: var(--line);
  --pub-body: var(--serif);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.65;
}

a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); margin: 0 0 .6rem; }
h2 { font-size: 1.4rem; margin: 2rem 0 .6rem; }
h3 { font-size: 1.15rem; margin: 0 0 .3rem; }

p { margin: 0 0 1rem; }

.wrap { width: 100%; max-width: 62rem; margin: 0 auto; padding: 0 1.5rem; }
.narrow { max-width: calc(var(--measure) + 3rem); }
.section { padding: 3rem 1.5rem 4rem; }

.muted { color: var(--ink-soft); }
.small { font-size: .875rem; }

.lede { font-size: 1.15rem; color: var(--ink-soft); max-width: var(--measure); }

.eyebrow {
  font-family: var(--sans);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 .5rem;
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 1rem; top: 1rem; z-index: 10;
  background: var(--paper); padding: .6rem 1rem; border: 2px solid var(--accent);
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* --- Header --------------------------------------------------------------- */

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 1.1rem;
  padding-bottom: 1.1rem;
}

.brand {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-family: var(--sans);
  font-size: .9rem;
}

.site-header nav a { color: var(--ink-soft); text-decoration: none; }
.site-header nav a:hover,
.site-header nav a[aria-current] { color: var(--accent); }

.nav-cta {
  padding: .4rem .9rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent) !important;
}
.nav-cta:hover { background: var(--accent); color: var(--paper) !important; }

/* --- Hero y bandas -------------------------------------------------------- */

.hero { padding: 4rem 0 3rem; }
.hero h1 { max-width: 20ch; }
.hero .subscribe-form { margin-top: 2rem; }

.band {
  background: var(--paper-alt);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 2.5rem 0;
}

.cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 2rem;
}
.cols p { margin: 0; color: var(--ink-soft); }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.more {
  font-family: var(--sans);
  font-size: .9rem;
  text-decoration: none;
}
.more:hover { text-decoration: underline; }

.topics {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.topics li {
  font-family: var(--sans);
  font-size: .875rem;
  padding: .35rem .8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
}

/* --- Formulario ----------------------------------------------------------- */

.subscribe-form { max-width: var(--measure); }

.field-row { display: flex; gap: .5rem; flex-wrap: wrap; }

input[type="email"], input[type="text"] {
  flex: 1 1 15rem;
  min-width: 0;
  font-family: var(--sans);
  font-size: 1rem;
  padding: .75rem .9rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
}
input[type="email"]:focus, input[type="text"]:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

button {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  padding: .75rem 1.4rem;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: var(--paper);
  cursor: pointer;
}
button:hover { filter: brightness(1.12); }
button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.form-note {
  font-family: var(--sans);
  font-size: .8125rem;
  line-height: 1.5;
  color: var(--ink-faint);
  margin: .75rem 0 0;
}

.inline-form {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 1.5rem 0;
}

/* Honeypot: invisible para personas, presente en el HTML para los bots.
   No usamos display:none porque algunos bots lo detectan y lo saltean. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* --- Avisos --------------------------------------------------------------- */

.notice {
  border-left: 3px solid var(--accent);
  background: var(--paper-alt);
  padding: 1.5rem 1.75rem;
  border-radius: 0 6px 6px 0;
  margin-bottom: 2rem;
}
.notice h1 { margin-top: 0; }
.notice > :last-child { margin-bottom: 0; }
.notice-ok { border-left-color: #2f7d4f; }
.notice-warn { border-left-color: #b06a1a; }

.cta-box {
  margin-top: 3rem;
  padding: 2rem;
  background: var(--paper-alt);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.cta-box h2 { margin-top: 0; }

/* --- Ediciones ------------------------------------------------------------ */

.editions { list-style: none; padding: 0; margin: 1.5rem 0 0; }

.editions li { border-top: 1px solid var(--line); }
.editions li:last-child { border-bottom: 1px solid var(--line); }

.editions a {
  display: block;
  padding: 1.25rem 0;
  text-decoration: none;
  color: inherit;
}
.editions a:hover h2, .editions a:hover h3 { color: var(--accent); }

.editions time {
  font-family: var(--sans);
  font-size: .75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.editions h2, .editions h3 { margin: .3rem 0 .3rem; font-size: 1.25rem; }
.editions p { margin: 0; font-size: .95rem; }

.edition-head { margin-bottom: 2.5rem; }
.edition-head h1 { margin-top: .3rem; }

/* --- Tarjetas de publicacion (hub y desks) -------------------------------- */

.pub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.pub-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.pub-card:hover { border-color: var(--card-brand); }

/* La franja superior lleva los dos colores del mail de esa publicacion: es la
   forma mas corta de mostrar que cada una tiene identidad propia. */
.pub-card-bar {
  height: 6px;
  background: linear-gradient(
    to right,
    var(--card-brand) 0 60%,
    var(--card-accent) 60% 100%
  );
}

.pub-card-body { padding: 1.25rem 1.35rem 1.4rem; }

.pub-card-name {
  display: block;
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--card-brand);
  line-height: 1.2;
}
.pub-card-tagline {
  display: block;
  margin-top: .4rem;
  color: var(--ink-soft);
  font-size: 1rem;
}
.pub-card-meta {
  display: block;
  margin-top: .9rem;
  font-family: var(--sans);
  font-size: .78rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* --- Cabecera de una publicacion ------------------------------------------ */
/* Reproduce el header del mail: fondo de marca, kicker espaciado, nombre en
   serif y, debajo, la franja de temas en el color de acento. */

.pub-masthead {
  background: var(--brand-dark);
  color: var(--paper);
  padding: 3rem 0 2.5rem;
  text-align: center;
}
.pub-masthead h1 { margin: 0; color: var(--paper); }
.pub-masthead a { color: inherit; }

.pub-kicker {
  font-family: var(--sans);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  opacity: .72;
  margin: 0 0 .7rem;
}

.pub-frequency,
.edition-date {
  font-family: var(--sans);
  font-size: .85rem;
  opacity: .72;
  margin: .8rem 0 0;
}

.pub-accentbar {
  background: var(--accent);
  color: var(--paper);
  font-family: var(--sans);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  text-align: center;
  padding: .7rem 0;
}

/* --- Edicion -------------------------------------------------------------- */

.edition .item {
  padding-bottom: 2.25rem;
  margin-bottom: 2.25rem;
  border-bottom: 1px solid var(--pub-line);
}
.edition .item:last-of-type { border-bottom: 0; }

.edition .item p { font-family: var(--pub-body); color: var(--pub-ink); }
.edition .item h1 { font-size: clamp(1.75rem, 4.4vw, 2.3rem); }
.edition .item h2 { font-size: 1.45rem; margin-top: 0; }
.edition .item h1,
.edition .item h2 { color: var(--brand-dark); }

/* El badge del mail: mayusculas, espaciado y el color de acento de la marca. */
.badge {
  display: inline-block;
  font-family: var(--sans);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--accent);
  padding: .3rem .7rem;
  border-radius: 3px;
  margin: 0 0 .8rem;
}
/* Las secundarias van en el color de marca, como en el mail. */
.item:not(.item-lead) .badge { background: var(--brand-dark); }

.item-meta {
  font-family: var(--sans) !important;
  font-size: .85rem;
  color: var(--pub-muted) !important;
  margin: -.2rem 0 .9rem;
}

.rating {
  display: inline-block;
  font-family: var(--sans) !important;
  font-size: .9rem;
  color: var(--brand-dark) !important;
  background: var(--paper-alt);
  border: 1px solid var(--pub-line);
  border-radius: 4px;
  padding: .5rem .85rem;
}
.rating span[aria-hidden] { color: #eab308; }

.item-link { margin-bottom: 0; }
.item-link a {
  font-family: var(--sans);
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
}
.item-link a:hover { text-decoration: underline; }

.item-lead .item-link a {
  display: inline-block;
  background: var(--accent);
  color: var(--paper);
  padding: .7rem 1.3rem;
  border-radius: 4px;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-size: .78rem;
}
.item-lead .item-link a:hover { filter: brightness(1.12); text-decoration: none; }

.edition-nav {
  margin-top: 2.5rem;
  font-family: var(--sans);
  font-size: .9rem;
}

/* --- Prosa ---------------------------------------------------------------- */

.prose { max-width: var(--measure); }
.prose h2 { margin-top: 2.5rem; }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li { margin-bottom: .5rem; }
.prose blockquote {
  margin: 1.5rem 0;
  padding-left: 1.25rem;
  border-left: 3px solid var(--line);
  color: var(--ink-soft);
  font-style: italic;
}
.prose img { max-width: 100%; height: auto; border-radius: 6px; }
.prose code {
  font-size: .9em;
  background: var(--paper-alt);
  padding: .15em .4em;
  border-radius: 3px;
}
.prose pre {
  background: var(--paper-alt);
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
}
.prose pre code { background: none; padding: 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }

/* --- Footer --------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--paper-alt);
  margin-top: 4rem;
  padding: 2.5rem 0;
}

.footer-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 2rem;
  font-family: var(--sans);
  font-size: .875rem;
}

.footer-inner p { margin: 0 0 .25rem; }
.footer-name { font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.footer-inner a { color: var(--ink-soft); }

.footer-links { display: flex; flex-direction: column; gap: .4rem; }

@media (max-width: 34rem) {
  body { font-size: 17px; }
  .header-inner { flex-direction: column; align-items: flex-start; }
  .site-header nav { gap: 1rem; }
  .field-row button { width: 100%; }
}

/* Respuesta inline de los forms estaticos (alta y baja via fetch). */
.form-msg { margin-top: .75rem; font-size: .95rem; }
.form-msg-ok { color: #2f7d4f; }
.form-msg-err { color: #a33a2a; }
