/* ============================================================
   El Codigo de la Longevidad - editorial design system
   Mobile-first. Premium longevity publication.
   ============================================================ */

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: hidden; max-width: 100%; }
img { max-width: 100%; height: auto; display: block; }

/* ---- Tokens ---- */
:root {
  --ink: #14140f;            /* casi negro, caelido */
  --ink-soft: #4a4a42;
  --muted: #7d7c72;
  --paper: #f6f4ee;          /* off-white caelido */
  --paper-2: #efece3;
  --surface: #ffffff;
  --line: #ddd8cc;
  --accent: #2f5d4f;         /* verde profundo --- longevidad, ciencia */
  --accent-soft: #eef2ef;
  --gold: #a4864f;           /* dorado apagado --- premium */
  --danger: #8a3324;

  --font-head: Georgia, 'Times New Roman', 'Playfair Display', serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;

  --container: 1140px;
  --measure: 680px;          /* ancho de lectura */
  --gutter: 22px;
  --radius: 4px;
  --shadow: 0 12px 40px rgba(20, 20, 15, 0.08);
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; color: var(--ink); line-height: 1.18; margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.9rem, 6vw, 3rem); }
h2 { font-size: clamp(1.5rem, 4.4vw, 2.1rem); }
h3 { font-size: clamp(1.2rem, 3.4vw, 1.45rem); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
p { margin: 0 0 1.15em; }

.container { max-width: var(--container); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.measure { max-width: var(--measure); margin-left: auto; margin-right: auto; }

.kicker { font-family: var(--font-body); font-size: .72rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); margin: 0 0 12px; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 15px 30px; font-family: var(--font-body); font-size: 16px; font-weight: 600;
  background: var(--accent); color: #fff; border: 2px solid var(--accent); border-radius: var(--radius);
  cursor: pointer; text-align: center; transition: background .18s, transform .1s; width: 100%;
}
.btn:hover { background: #26493e; border-color: #26493e; color: #fff; text-decoration: none; transform: translateY(-1px); }
.btn--gold { background: var(--gold); border-color: var(--gold); }
.btn--gold:hover { background: #8f7442; border-color: #8f7442; }
.btn--ghost { background: transparent; color: var(--accent); }
.btn--ghost:hover { background: var(--accent); color: #fff; }

/* ---- Top bar / masthead ---- */
.topbar { background: var(--ink); color: #eceae2; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; text-align: center; padding: 7px 0; }
.masthead { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 60; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); background: rgba(246, 244, 238, 0.9); }
.masthead__row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 0; }
.brand { display: flex; flex-direction: column; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand__name { font-family: var(--font-head); font-weight: 700; font-size: 1.32rem; color: var(--ink); letter-spacing: .01em; line-height: 1; }
.brand__tag { font-family: var(--font-body); font-size: .58rem; letter-spacing: .28em; text-transform: uppercase; color: var(--muted); margin-top: 5px; }
.nav-toggle { display: inline-flex; flex-direction: column; gap: 5px; width: 40px; height: 40px; padding: 9px; background: none; border: none; cursor: pointer; }
.nav-toggle span { display: block; height: 2px; width: 100%; background: var(--ink); border-radius: 2px; }
.mainnav { display: none; }
.mainnav a { color: var(--ink); font-size: .82rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.mainnav a:hover { color: var(--accent); text-decoration: none; }

/* mobile nav drawer */
.mnav { position: fixed; inset: 0; z-index: 200; pointer-events: none; }
.mnav__ov { position: absolute; inset: 0; background: rgba(20,20,15,.4); opacity: 0; transition: opacity .25s; }
.mnav__panel { position: absolute; top: 0; right: 0; height: 100%; width: min(320px, 86vw); background: var(--surface); box-shadow: -16px 0 44px rgba(20,20,15,.2); transform: translateX(105%); transition: transform .3s; padding: 22px; display: flex; flex-direction: column; overflow-y: auto; }
.mnav.open { pointer-events: auto; }
.mnav.open .mnav__ov { opacity: 1; }
.mnav.open .mnav__panel { transform: none; }
.mnav__close { align-self: flex-end; background: none; border: none; font-size: 1.8rem; line-height: 1; color: var(--muted); cursor: pointer; }
.mnav a { display: block; padding: 14px 2px; border-bottom: 1px solid var(--line); color: var(--ink); font-weight: 600; }
.mnav a:hover { text-decoration: none; color: var(--accent); }
html.noscroll { overflow: hidden; }

/* ---- Hero (home) ---- */
.hero { padding: 44px 0 8px; }
.hero__feat { display: grid; gap: 26px; }
.hero__media { border-radius: var(--radius); overflow: hidden; background: var(--paper-2); aspect-ratio: 16/10; box-shadow: var(--shadow); }
.hero__media img { width: 100%; height: 100%; object-fit: cover; }
.hero h1 { margin-top: 6px; }
.hero__dek { font-size: 1.12rem; color: var(--ink-soft); }
.byline { font-size: .82rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-top: 10px; }
.byline b { color: var(--ink); font-weight: 600; }

/* ---- Section blocks ---- */
.section { padding: 40px 0; }
.section--tight { padding: 26px 0; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; border-bottom: 2px solid var(--ink); padding-bottom: 8px; margin-bottom: 26px; }
.section__head h2 { margin: 0; font-size: 1.15rem; text-transform: uppercase; letter-spacing: .04em; }
.section__head a { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }

/* article cards */
.cards { display: grid; gap: 28px; grid-template-columns: 1fr; }
.card { display: flex; flex-direction: column; }
.card a { color: inherit; }
.card__media { border-radius: var(--radius); overflow: hidden; background: var(--paper-2); aspect-ratio: 3/2; margin-bottom: 14px; }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card a:hover .card__media img { transform: scale(1.04); }
.card__cat { font-size: .68rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.card h3 { margin: 0 0 8px; font-size: 1.25rem; }
.card a:hover h3 { color: var(--accent); }
.card__dek { font-size: .95rem; color: var(--muted); margin: 0; }

/* ---- Article page ---- */
.article { padding: 30px 0 10px; }
.article__head { text-align: left; }
.article__cat { font-size: .72rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); }
.article h1 { margin: 12px 0 14px; font-size: clamp(2rem, 6.4vw, 3.1rem); }
.article__dek { font-size: 1.2rem; color: var(--ink-soft); font-family: var(--font-head); font-style: italic; margin-bottom: 18px; }
.article__meta { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; font-size: .84rem; color: var(--muted); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 12px 0; }
.article__meta b { color: var(--ink); }
.article__hero { margin: 26px 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--paper-2); aspect-ratio: 16/9; }
.article__body { font-size: 1.08rem; color: var(--ink-soft); }
.article__body p { margin: 0 0 1.35em; }
.article__body h2 { color: var(--ink); margin: 1.6em 0 .5em; }
.article__body h3 { color: var(--ink); margin: 1.4em 0 .4em; }
.article__body strong { color: var(--ink); }
.article__body ul { padding-left: 1.15em; margin: 0 0 1.35em; }
.article__body li { margin-bottom: .5em; }
.article__body blockquote { margin: 1.6em 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--gold); font-family: var(--font-head); font-style: italic; font-size: 1.3rem; color: var(--ink); }
.dropcap::first-letter { font-family: var(--font-head); font-size: 3.4rem; line-height: .8; float: left; padding: 6px 10px 0 0; color: var(--accent); font-weight: 700; }

/* pull / update box */
.notebox { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 18px 20px; margin: 1.8em 0; font-size: .98rem; }
.notebox__label { font-size: .68rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }

/* CTA card inside article */
.cta-card { background: var(--ink); color: #f2f0e8; border-radius: 8px; padding: 30px 24px; margin: 2em 0; text-align: center; }
.cta-card h3 { color: #fff; margin: 0 0 8px; }
.cta-card p { color: #cfccc0; margin: 0 0 18px; font-size: .98rem; }
.cta-card .btn { max-width: 340px; margin: 0 auto; }
.cta-card small { display: block; margin-top: 12px; color: #9a978c; font-size: .74rem; }

/* comment thread (social proof) */
.thread { margin: 2.4em 0 1em; border-top: 1px solid var(--line); padding-top: 20px; }
.thread__head { display: flex; align-items: center; justify-content: space-between; font-size: .84rem; color: var(--muted); margin-bottom: 18px; }
.cmt { display: flex; gap: 12px; margin-bottom: 18px; }
.cmt__av { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: .9rem; }
.cmt__body { flex: 1; }
.cmt__bubble { background: var(--paper-2); border-radius: 14px; padding: 10px 14px; }
.cmt__name { font-weight: 700; font-size: .9rem; color: var(--ink); }
.cmt__text { font-size: .95rem; color: var(--ink-soft); margin: 2px 0 0; }
.cmt__actions { font-size: .76rem; color: var(--muted); padding: 5px 14px 0; display: flex; gap: 16px; }
.cmt--reply { margin-left: 52px; }

/* ---- Lead capture (guia) ---- */
.lead { background: var(--accent); color: #eef2ef; }
.lead__grid { display: grid; gap: 28px; padding: 46px 0; align-items: center; }
.lead h1 { color: #fff; }
.lead__dek { color: #d6e0da; font-size: 1.1rem; }
.lead ul { list-style: none; padding: 0; margin: 18px 0; }
.lead li { padding-left: 28px; position: relative; margin-bottom: 10px; color: #eef2ef; }
.lead li::before { content: ""; position: absolute; left: 0; top: 9px; width: 12px; height: 7px; border-left: 2px solid var(--gold); border-bottom: 2px solid var(--gold); transform: rotate(-45deg); }
.form-card { background: var(--surface); border-radius: 8px; padding: 26px 22px; box-shadow: var(--shadow); }
.form-card h3 { color: var(--ink); }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: .8rem; font-weight: 600; color: var(--ink); margin-bottom: 5px; }
.field input { width: 100%; font-size: 16px; font-family: var(--font-body); padding: 13px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; color: var(--ink); }
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form-note { font-size: .74rem; color: var(--muted); margin-top: 10px; line-height: 1.5; }
.form-msg { display: none; padding: 12px 14px; border-radius: var(--radius); font-size: .92rem; margin-top: 12px; }
.form-msg.ok { display: block; background: var(--accent-soft); color: var(--accent); }
.form-msg.err { display: block; background: #f7e7e3; color: var(--danger); }

/* ---- Generic page ---- */
.page { padding: 44px 0; }
.page__body { font-size: 1.05rem; color: var(--ink-soft); }
.page__body h2 { color: var(--ink); margin-top: 1.4em; }

/* ---- Disclaimer / RUO ---- */
.ruo { background: var(--paper-2); border: 1px dashed var(--line); border-radius: var(--radius); padding: 14px 16px; font-size: .8rem; color: var(--muted); margin: 2em 0; line-height: 1.55; }

/* ---- Footer ---- */
.footer { background: var(--ink); color: #b7b5a9; padding: 44px 0 30px; margin-top: 40px; font-size: .9rem; }
.footer a { color: #d9d7cd; }
.footer__grid { display: grid; gap: 26px; grid-template-columns: 1fr; }
.footer__brand .brand__name { color: #fff; }
.footer__brand p { color: #96948a; font-size: .86rem; max-width: 30ch; }
.footer h4 { color: #fff; font-family: var(--font-body); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; margin: 0 0 12px; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: 8px; }
.footer__bottom { border-top: 1px solid #2c2c25; margin-top: 30px; padding-top: 20px; font-size: .76rem; color: #7d7b71; }

/* ============================================================
   Breakpoints
   ============================================================ */
@media (min-width: 700px) {
  .btn { width: auto; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .hero__feat { grid-template-columns: 1.15fr 1fr; align-items: center; }
  .lead__grid { grid-template-columns: 1.1fr .9fr; }
  .footer__grid { grid-template-columns: 2fr 1fr 1fr; }
}
@media (min-width: 960px) {
  .nav-toggle { display: none; }
  .mainnav { display: flex; gap: 26px; align-items: center; }
  .cards--3 { grid-template-columns: repeat(3, 1fr); }
  .article__body { font-size: 1.13rem; }
}
