/* ══════════════════════════════════════════════════════════════
   Tesaurus — hoja de estilos
   Paleta papel cálido · azul tinta · serif editorial + sans
   ══════════════════════════════════════════════════════════════ */

:root {
  /* Color */
  --bg:          #FAF8F4;   /* papel/crema */
  --bg-sunk:     #F3F0E9;   /* fondos hundidos suaves */
  --text:        #1F1B16;   /* casi negro cálido */
  --muted:       #6B6459;   /* gris cálido para metadatos */
  --accent:      #AE5A34;   /* arcilla / terracota */
  --accent-ink:  #8C4526;   /* arcilla más profunda (hover) */
  --border:      #E5DFD3;   /* línea de pelo cálida */

  /* Tipografía */
  --serif: "Spectral", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Medidas */
  --measure: 42rem;         /* ancho cómodo de lectura */
  --wrap:    48rem;         /* ancho general del contenedor */
  --gap:     clamp(1.5rem, 5vw, 3rem);
}

/* ── Reset ligero ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.125rem;
  line-height: 1.7;
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
img, svg { max-width: 100%; height: auto; }

/* ── Contenedor ───────────────────────────────────────────── */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gap);
}

/* ── Enlaces ──────────────────────────────────────────────── */
a { color: var(--accent); text-decoration: none; }
.post-body a,
.page-lead a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  transition: text-decoration-color .15s ease;
}
.post-body a:hover,
.page-lead a:hover { text-decoration-color: var(--accent); }

/* ── Cabecera ─────────────────────────────────────────────── */
.site-header {
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.1) blur(6px);
  position: sticky; top: 0; z-index: 10;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4.25rem;
  gap: 1rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  color: var(--text);
  font-family: var(--serif);
}
.brand-name {
  font-size: 1.2rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.logo-mark {
  width: 1.55rem; height: 1.55rem;
  color: var(--accent);
  flex: none;
}
.site-nav {
  display: flex;
  gap: clamp(1rem, 4vw, 2rem);
  font-size: .95rem;
  font-weight: 500;
}
.site-nav a { color: var(--muted); }
.site-nav a:hover { color: var(--text); }
.site-nav a.is-active { color: var(--text); }

/* ── Contenido principal ──────────────────────────────────── */
.main { flex: 1 0 auto; }

/* ── Portada / hero ───────────────────────────────────────── */
.hero {
  padding-top: clamp(3.5rem, 9vw, 6rem);
  padding-bottom: clamp(2rem, 6vw, 3.5rem);
  max-width: var(--wrap);
}
.hero-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.4rem, 7vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
}
.hero-intro {
  max-width: var(--measure);
  color: var(--muted);
  font-size: 1.2rem;
  margin: 0;
}

/* ── Etiquetas de sección ─────────────────────────────────── */
.section-label {
  font-family: var(--sans);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 .5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* ── Listado de posts ─────────────────────────────────────── */
.post-list { padding-bottom: clamp(3rem, 8vw, 5rem); }
.post-item { border-bottom: 1px solid var(--border); }
.post-item-link {
  display: block;
  color: inherit;
  padding: 1.75rem 0;
}
.post-item-link:hover .post-item-title { color: var(--accent); }
.post-item-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.55rem;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0 0 .4rem;
  transition: color .15s ease;
}
.post-item-summary {
  color: var(--muted);
  margin: 0 0 .7rem;
  max-width: var(--measure);
  font-size: 1.02rem;
}
.post-item-meta,
.post-meta {
  font-size: .85rem;
  color: var(--muted);
  font-family: var(--sans);
  display: flex;
  align-items: center;
  gap: .5rem;
}
.dot { opacity: .5; }

/* ── Cabecera de página / listado ─────────────────────────── */
.page-head {
  padding-top: clamp(3rem, 8vw, 5rem);
  padding-bottom: 1rem;
}
.page-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2rem, 6vw, 2.8rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 .5rem;
}
.page-lead {
  color: var(--muted);
  font-size: 1.15rem;
  max-width: var(--measure);
  margin: 0;
}

/* ── Post individual ──────────────────────────────────────── */
.post { padding-top: clamp(3rem, 8vw, 5rem); padding-bottom: clamp(3rem, 8vw, 5rem); }
.post-head { margin-bottom: 2.5rem; }
.post-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.1rem, 6vw, 3rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 .9rem;
  max-width: var(--measure);
}

/* Cuerpo del artículo — la experiencia de lectura */
.post-body { max-width: var(--measure); }
.post-body > * + * { margin-top: 1.4rem; }
.post-body p { margin: 0; }
.post-body h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.65rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-top: 2.8rem;
}
.post-body h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.3rem;
  margin-top: 2rem;
}
.post-body ul, .post-body ol { margin: 0; padding-left: 1.3rem; }
.post-body li + li { margin-top: .4rem; }
.post-body strong { font-weight: 600; }

.post-body blockquote {
  margin: 2rem 0;
  padding: .3rem 0 .3rem 1.4rem;
  border-left: 3px solid var(--accent);
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.3rem;
  line-height: 1.4;
  color: var(--text);
}
.post-body blockquote p { margin: 0; }

.post-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.8rem auto;
  width: 40%;
}

.post-body code {
  font-family: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  font-size: .875em;
  background: var(--bg-sunk);
  padding: .15em .4em;
  border-radius: 4px;
}
.post-body pre {
  background: var(--bg-sunk);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
  font-size: .9rem;
  line-height: 1.6;
}
.post-body pre code { background: none; padding: 0; font-size: inherit; }

.post-body img {
  border-radius: 10px;
  display: block;
  margin-inline: auto;
}

/* Etiquetas del post */
.tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  padding: 0;
  margin: 2.5rem 0 0;
  max-width: var(--measure);
}
.tags li {
  font-size: .82rem;
  color: var(--muted);
  background: var(--bg-sunk);
  border: 1px solid var(--border);
  padding: .2rem .65rem;
  border-radius: 999px;
}

/* Navegación anterior / siguiente */
.post-nav {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr 1fr;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  max-width: var(--measure);
}
.post-nav a {
  display: block;
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.3;
}
.post-nav a span {
  display: block;
  font-family: var(--sans);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  margin-bottom: .3rem;
}
.post-nav a:hover { color: var(--accent); }
.post-nav-next { text-align: left; }
.post-nav-prev { text-align: right; grid-column: 2; }

/* ── Paginación ───────────────────────────────────────────── */
.pagination {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: .4rem;
  padding: 0;
  margin: 3rem 0 4rem;
}
.pagination .page-item a,
.pagination .page-item.disabled span {
  display: inline-flex;
  min-width: 2.4rem;
  height: 2.4rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-size: .95rem;
}
.pagination .page-item.active a {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.pagination .page-item.disabled span { opacity: .4; }

/* ── 404 ──────────────────────────────────────────────────── */
.notfound { text-align: center; padding: clamp(4rem, 12vw, 8rem) 0; }
.notfound-code {
  font-family: var(--serif);
  font-size: clamp(3.5rem, 14vw, 6rem);
  color: var(--accent);
  margin: 0 0 .5rem;
  line-height: 1;
}
.notfound-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  margin: 0 0 .6rem;
}
.notfound-text { color: var(--muted); margin: 0 0 2rem; }

/* Botón */
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: .7rem 1.4rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: .95rem;
  transition: background .15s ease;
}
.btn:hover { background: var(--accent-ink); }

.empty { color: var(--muted); padding: 2rem 0; }

/* ── Pie ──────────────────────────────────────────────────── */
.site-footer {
  flex: none;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}
.footer-inner {
  padding-block: 2.5rem 3rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.footer-mark {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--serif);
  font-size: 1.05rem;
  margin: 0;
}
.footer-mark span {
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.footer-mark .logo-mark { width: 1.3rem; height: 1.3rem; }
.footer-meta { color: var(--muted); font-size: .88rem; margin: 0; }
.footer-meta a { margin-left: .6rem; }

/* ── Accesibilidad ────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ── Responsivo ───────────────────────────────────────────── */
@media (max-width: 34rem) {
  body { font-size: 1.06rem; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav-prev { grid-column: 1; text-align: left; }
}
