/* Vital Body News — hoja de estilos editorial
   Tipografía legible 40/50/60+, paleta borgoña/crema/oliva. */

:root {
  --wine: #8E2A3A;
  --wine-dark: #5A1A24;
  --wine-soft: #B04150;
  --cream: #FBF5EC;
  --cream-ink: #F3E9D7;
  --olive: #4F5E2E;
  --olive-soft: #CFD5BC;
  --ink: #2A1A1E;
  --ink-soft: #4A3E3F;
  --ink-mute: #6C5B5C;
  --border: #E6D7C5;
  --border-strong: #CDB89A;
  --focus: #0F3C3C;
  --max: 1120px;
  --radius: 12px;
  --font-serif: "Spectral", "Georgia", "Times New Roman", serif;
  --font-sans: "Work Sans", "Helvetica Neue", Arial, sans-serif;
  --fs-body: 18px;
  --lh-body: 1.65;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

html {
  font-size: var(--fs-body);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--cream);
  line-height: var(--lh-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

body.text-large {
  --fs-body: 20px;
  --lh-body: 1.7;
}

img, svg { max-width: 100%; height: auto; display: block; }

a {
  color: var(--wine-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
}

a:hover, a:focus-visible {
  color: var(--wine);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

p { margin: 0 0 1em; }
ul, ol { padding-left: 1.3em; margin: 0 0 1em; }
ul li, ol li { margin: 0.3em 0; }

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  color: var(--ink);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.1vw, 2.1rem); }
h3 { font-size: clamp(1.2rem, 1.0rem + 0.6vw, 1.45rem); }

.container { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--wine);
  color: var(--cream);
  padding: 0.6em 1em;
  z-index: 100;
  text-decoration: none;
}
.skip-link:focus-visible { left: 10px; top: 10px; }

/* --------------------------------- Header */
.site-header {
  background: var(--cream);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.2rem;
}

.brand-mark { flex: 0 0 44px; }
.brand-name { line-height: 1.1; }

.nav {
  display: flex;
  gap: 22px;
  align-items: center;
  font-family: var(--font-sans);
  font-weight: 500;
}

.nav a {
  color: var(--ink);
  text-decoration: none;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
}

.nav a[aria-current="page"] {
  border-bottom-color: var(--wine);
  color: var(--wine);
}

.nav a:hover { color: var(--wine); }

.header-tools { display: inline-flex; gap: 10px; }

.text-toggle, .menu-toggle {
  background: transparent;
  border: 1.5px solid var(--border-strong);
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
}

.text-toggle[aria-pressed="true"] {
  background: var(--ink);
  color: var(--cream);
  border-color: var(--ink);
}

.text-toggle-icon { font-family: var(--font-serif); font-weight: 700; }
.menu-toggle { display: none; }

/* --------------------------------- Hero */
.hero {
  padding: clamp(28px, 4vw, 56px) 0 clamp(24px, 3vw, 44px);
  background: linear-gradient(to bottom, var(--cream) 0%, var(--cream-ink) 100%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 44px;
  align-items: center;
}

.hero-text .eyebrow { color: var(--wine); }

.hero-text h1 {
  margin: 0 0 18px;
}

.hero-text .lede {
  font-family: var(--font-serif);
  font-size: clamp(1.1rem, 0.9rem + 0.4vw, 1.3rem);
  color: var(--ink-soft);
  margin-bottom: 24px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  border-radius: 999px;
  border: 2px solid transparent;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn-primary {
  background: var(--wine);
  color: var(--cream);
  border-color: var(--wine);
}

.btn-primary:hover, .btn-primary:focus-visible {
  background: var(--wine-dark);
  color: var(--cream);
}

.btn-secondary {
  background: transparent;
  color: var(--wine-dark);
  border-color: var(--wine-dark);
}

.btn-secondary:hover, .btn-secondary:focus-visible {
  background: var(--wine-dark);
  color: var(--cream);
}

.btn-small { padding: 10px 18px; font-size: 0.95rem; }

.hero-art img, .hero-art svg {
  border-radius: 16px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--wine);
  margin: 0 0 10px;
}

/* --------------------------------- Section */
.section { padding: clamp(32px, 4vw, 64px) 0; }
.section-alt { background: var(--cream-ink); }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.section-head h2 { margin: 0; }
.section-head p { margin: 0; color: var(--ink-soft); }

/* --------------------------------- Grid Cards */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
}

.card {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
}

.card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(90,26,36,0.08); }

.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  height: 100%;
}

.card img { width: 100%; aspect-ratio: 1200 / 675; object-fit: cover; }

.card-body { padding: 18px 20px 22px; }
.card-body h3 { margin: 6px 0 10px; }
.card-body p { margin: 0 0 10px; color: var(--ink-soft); }
.card-meta { color: var(--ink-mute); font-size: 0.95rem; margin-top: 6px; }

/* --------------------------------- Topics */
.topics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}
.topic {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  text-decoration: none;
  color: var(--ink);
  display: block;
  transition: border-color 0.15s, transform 0.15s;
}
.topic:hover { border-color: var(--wine); transform: translateY(-2px); }
.topic h3 { margin: 2px 0 10px; }
.topic p { margin: 0 0 10px; color: var(--ink-soft); }
.topic-count { color: var(--ink-mute); font-size: 0.9rem; }

/* --------------------------------- Pillars */
.pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
}
.pillar {
  background: var(--cream-ink);
  border-radius: var(--radius);
  padding: 24px 22px;
  border: 1px solid var(--border);
}
.pillar svg {
  width: 44px; height: 44px; margin-bottom: 10px;
}
.pillar h3 { margin: 0 0 10px; }
.pillar p { margin: 0 0 12px; color: var(--ink-soft); }

/* --------------------------------- Prose */
.prose {
  max-width: 760px;
  margin: 0 auto;
}

.prose .lede {
  font-family: var(--font-serif);
  font-size: clamp(1.1rem, 0.95rem + 0.3vw, 1.3rem);
  color: var(--ink);
  margin-bottom: 1.2em;
}

.prose p {
  font-size: 1.08rem;
  line-height: 1.75;
  color: var(--ink);
}

.prose-section { margin-top: 1.8em; }
.prose-section h2 {
  margin-top: 0;
  padding-top: 0.4em;
  border-top: 1px solid var(--border);
  padding-bottom: 0.1em;
  color: var(--wine-dark);
}

.article-meta {
  color: var(--ink-mute);
  font-size: 1rem;
  margin: 0 0 1em;
}

.hero-article {
  padding: clamp(28px, 4vw, 56px) 0 clamp(16px, 2vw, 24px);
  background: var(--cream);
  border-bottom: 1px solid var(--border);
}

.hero-article h1 { max-width: 820px; }
.hero-article .eyebrow a {
  color: var(--wine);
  text-decoration: none;
  font-weight: 700;
}

.article-figure {
  max-width: 900px;
  margin: 0 auto;
}

.article-figure img {
  width: 100%;
  border-radius: var(--radius);
}

.sources .source-list {
  padding-left: 1.3em;
}
.sources .source-list li { margin: 0.4em 0; }

.prose-footnote {
  margin-top: 2.5em;
  padding: 20px 22px;
  background: var(--cream-ink);
  border-left: 4px solid var(--wine);
  border-radius: var(--radius);
  color: var(--ink-soft);
  font-size: 1rem;
}

/* --------------------------------- Articles index */
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}
.filter-row a {
  display: inline-flex;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--border-strong);
  background: var(--cream);
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}
.filter-row a[aria-current="true"] {
  background: var(--wine);
  color: var(--cream);
  border-color: var(--wine);
}

/* --------------------------------- Topic page */
.topic-head {
  padding: clamp(32px, 4vw, 56px) 0;
  background: var(--cream-ink);
}

.topic-head p.lede {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 720px;
}

/* --------------------------------- Contact page */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
  margin-top: 24px;
}
.contact-card {
  background: var(--cream-ink);
  padding: 22px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.contact-card h3 { margin-top: 0; }

/* --------------------------------- Newsletter */
.newsletter {
  background: var(--wine);
  color: var(--cream);
  padding: clamp(32px, 4vw, 56px) 0;
  margin-top: clamp(32px, 4vw, 48px);
}
.newsletter h2 { color: var(--cream); }
.newsletter p { color: var(--cream-ink); margin-bottom: 20px; max-width: 640px; }

.newsletter form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  max-width: 540px;
}
.newsletter input[type="email"] {
  flex: 1 1 240px;
  padding: 14px 16px;
  border-radius: 999px;
  border: none;
  font-size: 1rem;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-sans);
}
.newsletter button {
  padding: 14px 22px;
  border-radius: 999px;
  border: none;
  background: var(--cream);
  color: var(--wine-dark);
  font-family: var(--font-sans);
  font-weight: 700;
  cursor: pointer;
  font-size: 1rem;
}
.newsletter button:hover, .newsletter button:focus-visible {
  background: var(--cream-ink);
}

.newsletter small { color: var(--cream-ink); font-size: 0.86rem; }
.newsletter a { color: var(--cream); text-decoration: underline; }

/* --------------------------------- Footer */
.site-footer {
  background: var(--ink);
  color: var(--cream-ink);
  padding: clamp(32px, 4vw, 56px) 0 32px;
}

.site-footer .footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}

.site-footer .brand-name { color: var(--cream); }
.site-footer .brand { color: var(--cream); gap: 12px; }

.footer-tagline {
  color: var(--cream-ink);
  max-width: 320px;
  margin-top: 12px;
  font-family: var(--font-serif);
  font-size: 1.05rem;
}

.footer-contact-line { color: var(--cream-ink); margin-top: 10px; }
.site-footer a { color: var(--cream); text-decoration: underline; }
.site-footer a:hover { color: var(--cream-ink); }

.footer-head {
  font-family: var(--font-serif);
  color: var(--cream);
  margin: 0 0 10px;
  font-weight: 700;
  font-size: 1.05rem;
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.site-footer li { margin: 6px 0; }

.footer-disclaimer {
  background: var(--wine-dark);
  color: var(--cream);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 20px;
}
.footer-disclaimer p { margin: 0; }
.footer-disclaimer strong { color: var(--cream); }

.footer-legal p { margin: 4px 0; color: var(--cream-ink); font-size: 0.95rem; }
.footer-legal a { color: var(--cream); }

/* --------------------------------- Cookie banner */
.cookie-banner {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  max-width: 720px;
  margin: 0 auto;
  background: var(--ink);
  color: var(--cream);
  border-radius: var(--radius);
  padding: 16px 20px;
  z-index: 60;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.cookie-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}

.cookie-inner p { margin: 0; max-width: 440px; font-size: 0.95rem; }
.cookie-inner a { color: var(--cream); }

.cookie-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.cookie-banner .btn-primary {
  background: var(--cream);
  color: var(--wine-dark);
  border-color: var(--cream);
}
.cookie-banner .btn-primary:hover { background: var(--cream-ink); color: var(--wine-dark); }

.cookie-banner .btn-secondary {
  background: transparent;
  color: var(--cream);
  border-color: var(--cream);
}
.cookie-banner .btn-secondary:hover { background: var(--cream); color: var(--ink); }

/* --------------------------------- 404 */
.notfound {
  text-align: center;
  padding: clamp(48px, 6vw, 96px) 20px;
}
.notfound h1 { font-size: clamp(2.5rem, 1.8rem + 3vw, 4rem); }
.notfound .cta-row { display: inline-flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }

/* --------------------------------- Media queries */
@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; gap: 20px; }
  .hero-art { order: -1; max-width: 480px; margin: 0 auto; }
  .site-footer .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
}

@media (max-width: 640px) {
  .menu-toggle { display: inline-flex; }
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--cream);
    flex-direction: column;
    padding: 16px 20px;
    gap: 10px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }
  .nav.open { display: flex; }
  .site-header { position: relative; }
  .site-footer .footer-grid { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

@media print {
  .site-header, .site-footer, .cookie-banner, .newsletter, .hero-art { display: none; }
  body { background: #fff; }
}
