/* =============================================================
   LA CRÓNICA — Estilos del sitio público
   ============================================================= */

:root,
[data-theme="light"] {
  --paper: #f4f0e6;
  --paper-deep: #ebe5d4;
  --ink: #1a1612;
  --ink-soft: #403830;
  --ink-muted: #7a6f60;
  --rule: #1a1612;
  --accent: #8b2e1f;
  --highlight: #d4a94a;
  --grain-opacity: 0.5;
  --grain-blend: multiply;
}

[data-theme="dark"] {
  --paper: #17140f;
  --paper-deep: #211d17;
  --ink: #ede6d4;
  --ink-soft: #c4bca9;
  --ink-muted: #8a8172;
  --rule: #ede6d4;
  --accent: #d9693a;
  --highlight: #e4bc5e;
  --grain-opacity: 0.35;
  --grain-blend: screen;
}

:root { --max-width: 1280px; }

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Spectral', Georgia, serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  position: relative;
  overflow-x: hidden;
  transition: background .4s ease, color .4s ease;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.1 0 0 0 0 0.08 0 0 0 0 0.05 0 0 0 0.35 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: var(--grain-opacity);
  mix-blend-mode: var(--grain-blend);
  pointer-events: none;
  z-index: 1;
}

.wrap { max-width: var(--max-width); margin: 0 auto; padding: 0 2rem; position: relative; z-index: 2; }

/* ---------- CABECERA ---------- */
.masthead { border-bottom: 3px double var(--rule); padding: 1.2rem 0 0.8rem; }

.masthead-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--ink);
  margin-bottom: 1.5rem;
}

.masthead-top .edition { display: flex; gap: 1.5rem; }
.masthead-top .tools { display: flex; gap: 1rem; align-items: center; }
.masthead-top .tools a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px dotted var(--ink-muted);
  transition: color .2s;
}
.masthead-top .tools a:hover { color: var(--accent); }

.theme-toggle {
  background: transparent;
  border: 1px solid var(--ink);
  color: var(--ink);
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .3s ease;
  font-size: 0.9rem;
  padding: 0;
}
.theme-toggle:hover {
  background: var(--ink);
  color: var(--paper);
  transform: rotate(20deg);
}
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.masthead-logo {
  text-align: center;
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: clamp(3rem, 9vw, 6rem);
  letter-spacing: -0.02em;
  line-height: 0.95;
  margin-bottom: 0.4rem;
}

.masthead-logo .sub {
  display: block;
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 400;
  font-size: 0.28em;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  margin-top: 0.2rem;
}

.masthead-nav {
  display: flex;
  justify-content: center;
  gap: 2.2rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--ink);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.masthead-nav a {
  color: var(--ink);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: border-color .2s;
}
.masthead-nav a:hover { border-bottom-color: var(--accent); }

/* Buscador */
.search-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--ink-muted);
}
.search-bar input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--ink);
  font-family: 'Spectral', serif;
  font-size: 1rem;
  font-style: italic;
  padding: 0.3rem 0;
  outline: none;
}
.search-bar input::placeholder { color: var(--ink-muted); }
.search-bar .search-icon {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--ink-muted);
  letter-spacing: 0.1em;
}

/* ---------- NOTA PRINCIPAL ---------- */
.lead {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2.5rem;
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--ink);
}

.lead-img {
  position: relative;
  overflow: hidden;
  background: var(--ink);
  aspect-ratio: 4/3;
}

.lead-img img {
  width: 100%; height: 100%; object-fit: cover;
  filter: contrast(1.05) saturate(0.85);
  transition: transform .8s ease, filter .4s ease;
}
[data-theme="dark"] .lead-img img { filter: contrast(1.05) saturate(0.75) brightness(0.85); }
.lead:hover .lead-img img { transform: scale(1.03); }

.lead-img-caption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 0.8rem 1rem;
  background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
  color: #f4f0e6;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
}

.lead-body { display: flex; flex-direction: column; justify-content: center; }

.kicker {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
  display: inline-block;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--accent);
  align-self: flex-start;
}

.lead h1 {
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.05;
  margin-bottom: 1.2rem;
  letter-spacing: -0.01em;
}
.lead h1 a { color: inherit; text-decoration: none; }
.lead h1 a:hover { color: var(--accent); }

.bajada {
  font-family: 'Spectral', serif;
  font-size: 1.15rem;
  font-style: italic;
  color: var(--ink-soft);
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.byline {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  padding-top: 1rem;
  border-top: 1px solid var(--paper-deep);
  text-transform: uppercase;
}
.byline strong { color: var(--ink); font-weight: 500; }

/* ---------- SECCIÓN: GRID DE 3 NOTAS ---------- */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 2rem 0 1rem;
  border-bottom: 1px solid var(--ink);
  margin-bottom: 2rem;
}
.section-head h2 {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.8rem;
}
.section-head .see-all {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-muted);
  text-decoration: none;
  transition: color .2s;
}
.section-head .see-all:hover { color: var(--accent); }

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  padding-bottom: 2rem;
}

.card {
  display: flex;
  flex-direction: column;
  padding-right: 2rem;
  border-right: 1px solid var(--paper-deep);
}
.card:last-child { border-right: none; padding-right: 0; }

.card-img {
  aspect-ratio: 3/2;
  overflow: hidden;
  margin-bottom: 1rem;
  background: var(--ink);
}
.card-img img {
  width: 100%; height: 100%; object-fit: cover;
  filter: contrast(1.05) saturate(0.85);
  transition: transform .6s ease;
}
[data-theme="dark"] .card-img img { filter: contrast(1.05) saturate(0.75) brightness(0.85); }
.card:hover .card-img img { transform: scale(1.05); }

.card h3 {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.35rem;
  line-height: 1.15;
  margin-bottom: 0.8rem;
}
.card h3 a { color: inherit; text-decoration: none; }
.card h3 a:hover { color: var(--accent); }

.card .bajada { font-size: 0.95rem; margin-bottom: 1rem; flex: 1; }
.card .byline { font-size: 0.68rem; padding-top: 0.6rem; border-top: 1px solid var(--paper-deep); }

/* ---------- RÍO DE NOTAS MENORES ---------- */
.river {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  padding: 2rem 0;
  border-top: 1px solid var(--ink);
  border-bottom: 3px double var(--rule);
}

.river-item { display: flex; gap: 1rem; }
.river-item .num {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 400;
  font-size: 2.5rem;
  color: var(--ink-muted);
  line-height: 1;
  min-width: 2.5rem;
}
.river-item h4 {
  font-family: 'Spectral', serif;
  font-weight: 500;
  font-size: 1.05rem;
  line-height: 1.3;
  margin-bottom: 0.4rem;
}
.river-item h4 a { color: inherit; text-decoration: none; border-bottom: 1px solid transparent; transition: border-color .2s; }
.river-item h4 a:hover { border-bottom-color: var(--accent); color: var(--accent); }

.river-item .meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  text-transform: uppercase;
}

/* ---------- FOOTER ---------- */
.footer {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 3rem;
  padding: 3rem 0 2rem;
  margin-top: 2rem;
}

.footer h5 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--paper-deep);
}

.footer p { font-size: 0.9rem; margin-bottom: 1rem; color: var(--ink-soft); }

.footer ul { list-style: none; }
.footer ul li { margin-bottom: 0.4rem; }
.footer ul a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.88rem;
  transition: color .2s;
}
.footer ul a:hover { color: var(--accent); }

.newsletter-form {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}
.newsletter-form input {
  flex: 1;
  background: transparent;
  border: 1px solid var(--ink);
  color: var(--ink);
  font-family: 'Spectral', serif;
  font-size: 0.88rem;
  padding: 0.5rem 0.7rem;
  outline: none;
}
.newsletter-form input::placeholder { color: var(--ink-muted); font-style: italic; }
.newsletter-form button {
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0 1rem;
  cursor: pointer;
  transition: all .2s;
}
.newsletter-form button:hover { background: var(--accent); border-color: var(--accent); }

.footer-bottom {
  grid-column: 1 / -1;
  padding-top: 2rem;
  margin-top: 1rem;
  border-top: 1px solid var(--paper-deep);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  text-transform: uppercase;
}

/* ---------- ARTÍCULO (página individual) ---------- */
.articulo-cuerpo {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 0;
}
.articulo-cuerpo h2 {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.6rem;
  margin: 2.5rem 0 1rem;
}
.articulo-cuerpo p {
  font-family: 'Spectral', serif;
  font-size: 1.1rem;
  line-height: 1.7;
  margin-bottom: 1.4rem;
  color: var(--ink-soft);
}
.articulo-cuerpo p:first-of-type::first-letter {
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: 4.5rem;
  float: left;
  line-height: 0.85;
  padding: 0.3rem 0.6rem 0 0;
  color: var(--accent);
}
.articulo-cuerpo blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.5rem 0 0.5rem 1.5rem;
  margin: 2rem 0;
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 1.25rem;
  line-height: 1.5;
  color: var(--ink);
}
.articulo-cuerpo blockquote cite {
  display: block;
  margin-top: 0.8rem;
  font-family: 'JetBrains Mono', monospace;
  font-style: normal;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
  text-transform: uppercase;
}
.articulo-cuerpo .destacado {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 700;
  font-size: 1.6rem;
  line-height: 1.3;
  padding: 2rem 0;
  margin: 2rem 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  text-align: center;
  color: var(--ink);
}
.articulo-cuerpo img {
  max-width: 100%;
  height: auto;
  margin: 2rem 0 0.8rem;
  display: block;
}
.articulo-cuerpo figure { margin: 2rem 0; }
.articulo-cuerpo figcaption {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--ink-muted);
  letter-spacing: 0.05em;
  margin-top: 0.4rem;
}
.articulo-cuerpo ul, .articulo-cuerpo ol { margin: 1rem 0 1.5rem 1.5rem; }
.articulo-cuerpo li { margin-bottom: 0.5rem; font-size: 1.05rem; line-height: 1.6; }

.articulo-head {
  text-align: center;
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--ink);
  max-width: 860px;
  margin: 0 auto;
}
.articulo-head h1 {
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.05;
  margin: 1rem 0 1.2rem;
  letter-spacing: -0.01em;
}
.articulo-head .bajada {
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
  .lead { grid-template-columns: 1fr; gap: 1.5rem; }
  .grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .card { padding-right: 0; border-right: none; padding-bottom: 2rem; border-bottom: 1px solid var(--paper-deep); }
  .card:last-child { border-bottom: none; }
  .river { grid-template-columns: 1fr; }
  .footer { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .footer > div:first-child { grid-column: 1 / -1; }
  .masthead-nav { flex-wrap: wrap; gap: 1rem 1.5rem; }
  .masthead-top { flex-direction: column; gap: 0.6rem; align-items: flex-start; }
}

@media (max-width: 600px) {
  .footer { grid-template-columns: 1fr; }
  .wrap { padding: 0 1rem; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.lead, .grid > *, .river-item { animation: fadeUp .6s ease-out backwards; }
.grid > *:nth-child(1) { animation-delay: .1s; }
.grid > *:nth-child(2) { animation-delay: .2s; }
.grid > *:nth-child(3) { animation-delay: .3s; }
