/* =========================================================
   Gerardo Guerra Rincón — estilos
   Minimalista · cálido · tipografía editorial
   ========================================================= */

:root {
  --bg: #faf8f4;
  --bg-tint: #f2efe8;
  --surface: #ffffff;
  --ink: #1d231f;
  --ink-soft: #4d544f;
  --muted: #8a8f89;
  --line: #e4e0d6;
  --accent: #2f4a3a;        /* verde bosque */
  --accent-soft: #e6ece7;
  --gold: #9a7638;

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --wrap: 1120px;
  --narrow: 680px;
  --radius: 14px;
  --gutter: clamp(16px, 4vw, 32px);
  --space: clamp(72px, 11vw, 136px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141715;
    --bg-tint: #1a1e1b;
    --surface: #1f2420;
    --ink: #ece9e2;
    --ink-soft: #b9bcb6;
    --muted: #868b83;
    --line: #2d332e;
    --accent: #9cc2a8;
    --accent-soft: #223029;
    --gold: #d2b27a;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: clamp(2.3rem, 5.4vw, 4rem); font-weight: 300; }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.7rem); font-weight: 300; }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1.1em; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: calc(var(--narrow) + 2 * var(--gutter)); }
.center { text-align: center; }
.muted { color: var(--muted); }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; z-index: 100; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--serif); font-size: 1.1rem; }
.brand img { border-radius: 50%; }
.nav { display: flex; align-items: center; gap: 28px; }
.nav a { text-decoration: none; font-size: .9rem; color: var(--ink-soft); transition: color .2s; }
.nav a:hover { color: var(--ink); }
.nav-cta { border: 1px solid var(--line); padding: 7px 16px; border-radius: 999px; }
.nav-cta:hover { border-color: var(--ink); }

.nav-toggle { display: none; background: none; border: 0; width: 40px; height: 40px; cursor: pointer; position: relative; }
.nav-toggle span { position: absolute; left: 10px; right: 10px; height: 1.5px; background: var(--ink); transition: transform .3s, top .3s; }
.nav-toggle span:first-child { top: 15px; }
.nav-toggle span:last-child { top: 24px; }
.nav-toggle[aria-expanded="true"] span:first-child { top: 20px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { top: 20px; transform: rotate(-45deg); }

@media (max-width: 880px) {
  .nav-toggle { display: block; }
  .nav {
    position: fixed; inset: 68px 0 auto 0;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: var(--bg); padding: 8px var(--gutter) 24px;
    border-bottom: 1px solid var(--line);
    transform: translateY(-8px); opacity: 0; pointer-events: none;
    transition: opacity .25s, transform .25s;
  }
  .nav.open { opacity: 1; transform: none; pointer-events: auto; }
  .nav a { width: 100%; padding: 14px 0; font-size: 1.05rem; border-bottom: 1px solid var(--line); }
  .nav-cta { border: 0; border-radius: 0; padding: 14px 0; }
}

/* ---------- Buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.actions.center { justify-content: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 24px; border-radius: 999px;
  font: 500 .92rem var(--sans); text-decoration: none;
  border: 1px solid var(--accent); background: var(--accent); color: var(--bg);
  cursor: pointer; transition: transform .2s, background .2s, color .2s, border-color .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-small { padding: 9px 18px; font-size: .85rem; }
.btn-block { width: 100%; margin-top: 16px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.link-arrow { text-decoration: none; color: var(--accent); font-weight: 500; border-bottom: 1px solid currentColor; padding-bottom: 2px; }

.eyebrow { font-size: .76rem; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); font-weight: 500; margin-bottom: 14px; }

/* ---------- Sections ---------- */
.section { padding: var(--space) 0; }
.tinted { background: var(--bg-tint); }
.section-head { max-width: 640px; margin: 0 auto 56px; text-align: center; }
.section-sub { color: var(--ink-soft); }

/* ---------- Hero ---------- */
.hero { padding: clamp(48px, 8vw, 110px) 0 clamp(40px, 6vw, 80px); }
.hero-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.hero h1 em { color: var(--accent); }
.lead { font-size: 1.12rem; color: var(--ink-soft); max-width: 520px; }
.hero-media { margin: 0; }
.hero-media img { max-height: 560px; width: auto; margin: 0 auto; object-fit: contain; }
@media (max-width: 800px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-media { order: -1; }
  .hero-media img { max-height: 300px; }
}

/* ---------- Welcome ---------- */
.welcome { padding-top: 0; }
.welcome p { font-family: var(--serif); font-size: clamp(1.15rem, 2vw, 1.35rem); font-weight: 300; line-height: 1.6; color: var(--ink-soft); }
.welcome .sign { font-style: italic; color: var(--accent); margin-top: 28px; }

/* ---------- Daily ---------- */
.daily { border-top: 1px solid var(--line); }
.daily-featured {
  max-width: 820px; margin: 0 auto 72px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(28px, 6vw, 64px);
  text-align: center;
}
.daily-date { font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 20px; }
.daily-title { font-size: clamp(1.3rem, 2.4vw, 1.6rem); margin-bottom: 18px; }
.daily-text { font-family: var(--serif); font-size: clamp(1.35rem, 3vw, 2rem); font-weight: 300; line-height: 1.45; color: var(--ink); white-space: pre-line; margin: 0; }
.daily-featured.is-reflexion .daily-text { font-family: var(--sans); font-size: 1.05rem; line-height: 1.85; text-align: left; color: var(--ink-soft); }
.daily-body { margin: 24px auto 0; max-width: 620px; font-size: 1.02rem; line-height: 1.85; color: var(--ink-soft); white-space: pre-line; text-align: left; }
[hidden] { display: none !important; }
.daily-img { max-width: 420px; width: 100%; margin: 0 auto 28px; border-radius: 10px; }
.daily-sign { margin: 24px 0 0; font-style: italic; color: var(--muted); font-size: .92rem; }
.daily-share { margin-top: 28px; display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.daily-empty { color: var(--muted); margin: 0; }

.daily-archive { max-width: 820px; margin: 0 auto; }
.archive-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; margin-bottom: 8px; }
.archive-head h3 { margin: 0; font-size: 1.15rem; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font: 500 .8rem var(--sans); padding: 6px 14px; border-radius: 999px; background: none; border: 1px solid var(--line); color: var(--ink-soft); cursor: pointer; }
.chip.is-active { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.daily-list { list-style: none; padding: 0; margin: 0; }
.daily-list li { border-bottom: 1px solid var(--line); }
.daily-list button {
  all: unset; box-sizing: border-box; cursor: pointer; width: 100%;
  display: grid; grid-template-columns: 120px 1fr 20px; gap: 16px; align-items: baseline;
  padding: 20px 0;
}
.daily-list button:focus-visible { outline: 2px solid var(--accent); }
.daily-list .d { font-size: .82rem; color: var(--muted); }
.daily-list .t { font-family: var(--serif); font-size: 1.08rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.daily-list .p { color: var(--muted); transition: transform .2s; }
.daily-list button:hover .p { transform: translateX(4px); color: var(--accent); }
.daily-list .is-current .t { color: var(--accent); }
@media (max-width: 560px) {
  .daily-list button { grid-template-columns: 1fr 20px; gap: 4px 12px; }
  .daily-list .d { grid-column: 1 / -1; }
}

.wa-banner {
  max-width: 820px; margin: 56px auto 0;
  display: flex; align-items: center; gap: 16px;
  padding: 20px 24px; border-radius: var(--radius);
  background: var(--accent-soft); text-decoration: none; color: var(--ink);
  transition: transform .2s;
}
.wa-banner:hover { transform: translateY(-2px); }
.wa-banner svg { width: 30px; height: 30px; fill: var(--accent); flex: none; }
.wa-banner span { font-size: .95rem; }
.wa-banner .arrow { margin-left: auto; font-size: 1.3rem; color: var(--accent); }

/* ---------- Split ---------- */
.split { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(32px, 6vw, 88px); align-items: center; }
.split-media { margin: 0; }
.split-media img { border-radius: var(--radius); }
.split-text p { color: var(--ink-soft); }
.quote-inline { border-left: 2px solid var(--gold); padding-left: 18px; font-family: var(--serif); font-size: 1.1rem; color: var(--ink) !important; }
.split > *, .hero-grid > *, .book > * { min-width: 0; }
@media (max-width: 800px) { .split { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Frases ---------- */
.big-quote { margin: 0 auto 72px; max-width: 800px; text-align: center; }
.big-quote p { font-family: var(--serif); font-size: clamp(1.6rem, 3.6vw, 2.5rem); font-weight: 300; line-height: 1.35; }
.big-quote cite { font-style: normal; color: var(--muted); font-size: .92rem; }
.cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-bottom: 48px; }
.card-img { margin: 0; }
.card-img img { border-radius: var(--radius); aspect-ratio: 1; object-fit: cover; width: 100%; }
.card-img figcaption { font-family: var(--serif); font-size: 1.1rem; margin-top: 14px; text-align: center; }
@media (max-width: 720px) { .cards-3 { grid-template-columns: 1fr; max-width: 420px; margin-inline: auto; } }

/* ---------- Libros ---------- */
.books { display: grid; grid-template-columns: repeat(2, 1fr); gap: 56px 48px; }
.book { display: grid; grid-template-columns: 150px 1fr; gap: 28px; align-items: start; }
.book img { border-radius: 6px; box-shadow: 0 18px 40px -18px rgba(0,0,0,.35); aspect-ratio: 3/4.3; object-fit: cover; width: 100%; }
.book h3 { margin-bottom: 10px; }
.book p { color: var(--ink-soft); font-size: .95rem; }
.tag { display: inline-block; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; font-weight: 600; }
@media (max-width: 880px) { .books { grid-template-columns: 1fr; } }
@media (max-width: 460px) { .book { grid-template-columns: 104px 1fr; gap: 18px; } }

/* ---------- Autor ---------- */
.role { color: var(--gold); font-size: .95rem; margin-bottom: 28px; }
#autor p:not(.eyebrow):not(.role) { color: var(--ink-soft); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 40px 0; padding: 32px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stats div { text-align: center; }
.stats dt { font-family: var(--serif); font-size: clamp(1.8rem, 4vw, 2.5rem); font-weight: 300; color: var(--accent); }
.stats dd { margin: 0; font-size: .82rem; color: var(--muted); }

/* ---------- Contacto ---------- */
.contact-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.contact-item { background: var(--bg); padding: 28px 22px; text-decoration: none; display: flex; flex-direction: column; gap: 6px; font-size: .92rem; word-break: break-word; transition: background .2s; }
a.contact-item:hover { background: var(--surface); }
.contact-item .label { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 880px) { .contact-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .contact-grid { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0; font-size: .85rem; color: var(--ink-soft); }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.footer-inner p { margin: 0; }

/* ---------- Animación de entrada ---------- */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .8s ease, transform .8s ease; }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
}
