/* Memoria Feliz — hoja de estilo
 * Paleta "Patio de sol": crema cálida, terracota mate, oliva viva, sol apagado, índigo sereno.
 * Tipografía: Lora (títulos) + Source Sans 3 (cuerpo).
 */

/* ---------- Fuentes ---------- */
@font-face {
  font-family: "Lora";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/lora-400-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Lora";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/lora-600-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Lora";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/lora-italic-400-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/source-sans-3-400-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/source-sans-3-700-latin.woff2") format("woff2");
}

/* ---------- Variables ---------- */
:root {
  --bg: #F8F3EA;
  --bg-2: #F1E9D8;
  --bg-3: #ECE1C9;
  --ink: #1E1B26;
  --ink-2: #4A4553;
  --ink-3: #7A7382;
  --rule: #DFD4BE;
  --rule-soft: #EBE1CB;
  --terra: #B45A3C;
  --terra-deep: #8A4028;
  --olive: #5F7046;
  --olive-deep: #44502F;
  --sun: #D8A24A;
  --sun-deep: #B87F28;
  --indigo: #394E6A;
  --indigo-deep: #273854;
  --surface: #FFFDF6;
  --surface-2: #F7EFDE;

  --radius: 2px;
  --radius-lg: 6px;
  --maxw: 1180px;
  --measure: 36rem;

  --ff-serif: "Lora", Georgia, "Times New Roman", serif;
  --ff-sans: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --fs-base: 19px;
  --lh-body: 1.65;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

html.text-large body { font-size: 20.5px; }
html.text-xlarge body { font-size: 22px; }

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--ff-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; height: auto; display: block; }

a { color: var(--terra-deep); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { color: var(--terra); text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--olive); outline-offset: 2px; border-radius: 2px; }

h1, h2, h3, h4 { font-family: var(--ff-serif); font-weight: 600; color: var(--ink); margin: 0 0 .5em; line-height: 1.2; letter-spacing: -0.005em; }
h1 { font-size: clamp(2rem, 4.2vw, 3rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; }

p { margin: 0 0 1em; }
ul { padding-left: 1.3em; margin: 0 0 1em; }
li { margin: 0 0 .35em; }

em { font-style: italic; }
strong { font-weight: 700; }

.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.skip-link {
  position: absolute; top: 0; left: 0;
  background: var(--ink); color: var(--bg);
  padding: .75rem 1rem;
  transform: translateY(-110%);
  transition: transform .15s;
  z-index: 1000;
}
.skip-link:focus { transform: translateY(0); }

/* ---------- Layout ---------- */
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 720px; }

/* ---------- Header ---------- */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
  padding: 1rem 0;
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.masthead a.brand {
  color: var(--ink);
  text-decoration: none;
  display: flex;
  gap: .75rem;
  align-items: center;
}
.masthead a.brand:hover { color: var(--terra-deep); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name {
  font-family: var(--ff-serif);
  font-weight: 600;
  font-size: 1.35rem;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.brand-tag {
  font-size: .9rem;
  color: var(--ink-3);
  font-style: italic;
  margin-top: .15rem;
}

.header-tools { display: flex; gap: .5rem; align-items: center; }
.icon-btn {
  background: var(--surface);
  border: 1px solid var(--rule);
  color: var(--ink-2);
  font-family: var(--ff-sans);
  font-size: .95rem;
  padding: .5rem .85rem;
  border-radius: var(--radius-lg);
  cursor: pointer;
  min-height: 40px;
}
.icon-btn:hover { background: var(--bg-2); color: var(--terra-deep); }
.icon-btn .aa { font-family: var(--ff-serif); font-weight: 600; }
.menu-btn { display: none; }

.site-nav ul {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: flex;
  gap: 1.75rem;
  flex-wrap: wrap;
}
.site-nav a {
  color: var(--ink-2);
  text-decoration: none;
  font-weight: 400;
  padding: .3rem 0;
  border-bottom: 1px solid transparent;
}
.site-nav a:hover { color: var(--terra-deep); border-bottom-color: var(--terra); }
.site-nav a[aria-current="page"] { color: var(--terra-deep); border-bottom-color: var(--terra); }

@media (max-width: 720px) {
  .menu-btn { display: inline-flex; align-items: center; justify-content: center; }
  .site-nav { display: none; }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; gap: .25rem; margin-top: .75rem; }
  .site-nav li { border-bottom: 1px solid var(--rule-soft); padding: .4rem 0; }
  .brand-tag { display: none; }
}

/* ---------- Sections ---------- */
.section { padding: 3.5rem 0; }
.section--muted { background: var(--bg-2); border-top: 1px solid var(--rule-soft); border-bottom: 1px solid var(--rule-soft); }
.section--accent { background: var(--bg-3); }

.section-head { margin-bottom: 2rem; }
.section-head--centered { text-align: center; }
.section-eyebrow {
  display: inline-block;
  font-size: .85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--terra);
  font-weight: 700;
  margin-bottom: .35rem;
}
.section-title { margin-bottom: .5rem; }
.section-lede {
  color: var(--ink-2);
  max-width: var(--measure);
  font-size: 1.05rem;
}
.section-head--centered .section-lede { margin-left: auto; margin-right: auto; }
.section-more { margin-top: 2rem; font-weight: 700; }

/* ---------- Hero ---------- */
.hero {
  padding: 4rem 0 3.25rem;
  background:
    radial-gradient(ellipse at top left, rgba(216,162,74,0.15), transparent 55%),
    radial-gradient(ellipse at bottom right, rgba(95,112,70,0.12), transparent 55%),
    var(--bg);
  border-bottom: 1px solid var(--rule-soft);
}
.hero-eyebrow {
  display: inline-block;
  font-size: .85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--terra);
  font-weight: 700;
  margin-bottom: .75rem;
}
.hero-title {
  max-width: 900px;
  font-size: clamp(2.2rem, 5.5vw, 3.6rem);
  line-height: 1.1;
  margin-bottom: 1rem;
}
.hero-lede {
  max-width: 720px;
  font-size: 1.25rem;
  color: var(--ink-2);
  margin-bottom: 1.5rem;
}
.hero-cta {
  display: inline-block;
  background: var(--terra);
  color: var(--surface);
  text-decoration: none;
  font-weight: 700;
  padding: .85rem 1.5rem;
  border-radius: var(--radius-lg);
  font-size: 1.05rem;
}
.hero-cta:hover { background: var(--terra-deep); color: var(--surface); }

/* ---------- Featured card + article cards ---------- */
.featured-card {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 2rem;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
.featured-card .thumb img {
  border-radius: var(--radius-lg);
  width: 100%;
  height: auto;
}
.featured-card h3 {
  font-size: clamp(1.4rem, 2.4vw, 1.8rem);
  margin: .25rem 0 .75rem;
}
.featured-card h3 a { color: var(--ink); text-decoration: none; }
.featured-card h3 a:hover { color: var(--terra-deep); }
.featured-card .dek {
  color: var(--ink-2);
  font-size: 1.05rem;
  margin-bottom: 1rem;
}
.featured-card .meta,
.article-card .meta {
  font-size: .9rem;
  color: var(--ink-3);
  margin-bottom: .5rem;
  display: flex; gap: .5rem; align-items: center;
}
.meta .topic { color: var(--olive-deep); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; font-size: .78rem; }
.meta .dot { color: var(--ink-3); }

.readmore {
  display: inline-block;
  font-weight: 700;
  color: var(--terra-deep);
  text-decoration: none;
}
.readmore:hover { text-decoration: underline; color: var(--terra); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}
.article-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.article-card .thumb { display: block; }
.article-card .thumb img { width: 100%; height: auto; }
.article-card .body { padding: 1.25rem 1.5rem 1.5rem; flex: 1; display: flex; flex-direction: column; }
.article-card h3 {
  font-size: 1.2rem;
  line-height: 1.3;
  margin-bottom: .5rem;
}
.article-card h3 a { color: var(--ink); text-decoration: none; }
.article-card h3 a:hover { color: var(--terra-deep); }
.article-card .dek { color: var(--ink-2); font-size: 1rem; margin: 0 0 1rem; flex: 1; }

@media (max-width: 760px) {
  .featured-card { grid-template-columns: 1fr; padding: 1rem; }
}

/* ---------- Section tiles ---------- */
.section-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
}
.section-tile {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  padding: 1.25rem 1.25rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--ink);
  min-height: 160px;
  transition: transform .12s, border-color .15s, background .15s;
}
.section-tile:hover { transform: translateY(-1px); border-color: var(--terra); background: var(--surface-2); }
.section-tile__eyebrow {
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .75rem;
  color: var(--ink-3);
  font-weight: 700;
}
.section-tile__name {
  font-family: var(--ff-serif);
  font-weight: 600;
  font-size: 1.4rem;
  color: var(--terra-deep);
}
.section-tile__tag {
  font-size: .98rem;
  color: var(--ink-2);
  line-height: 1.4;
}
.section-tile--memoria { border-top: 4px solid var(--terra); }
.section-tile--emociones { border-top: 4px solid var(--indigo); }
.section-tile--sueno { border-top: 4px solid var(--indigo-deep); }
.section-tile--mesa { border-top: 4px solid var(--olive); }
.section-tile--dias { border-top: 4px solid var(--sun); }

/* ---------- Section cards (cuadernos index) ---------- */
.section-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}
.section-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.section-card__thumb img { width: 100%; height: auto; display: block; }
.section-card__body { padding: 1.5rem; }
.section-card h2 { margin: .2rem 0 .6rem; font-size: 1.4rem; }
.section-card h2 a { color: var(--ink); text-decoration: none; }
.section-card h2 a:hover { color: var(--terra-deep); }
.section-card .eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; color: var(--terra); font-weight: 700; margin-bottom: .2rem; }
.section-card .dek { color: var(--ink-2); font-size: 1rem; margin-bottom: 1rem; }

/* ---------- Page hero ---------- */
.page-hero {
  padding: 3rem 0 2rem;
  background: var(--bg);
  border-bottom: 1px solid var(--rule-soft);
}
.page-title { margin-bottom: 1rem; }
.page-lede { color: var(--ink-2); font-size: 1.15rem; max-width: 680px; }
.section-intro {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule-soft);
  color: var(--ink-2);
  font-size: 1.05rem;
}
.section-intro p { margin: 0; }

/* ---------- Crumbs ---------- */
.crumbs {
  padding: 1rem 0;
  color: var(--ink-3);
  font-size: .95rem;
  background: var(--bg);
}
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--terra-deep); }
.crumbs .sep { margin: 0 .35rem; color: var(--ink-3); }

/* ---------- Article page ---------- */
.article-hero {
  padding: 3rem 0 2rem;
  background: var(--bg);
}
.article-eyebrow {
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .85rem;
  color: var(--terra);
  font-weight: 700;
  margin-bottom: .5rem;
}
.article-eyebrow a { color: var(--terra); text-decoration: none; }
.article-eyebrow a:hover { color: var(--terra-deep); }
.article-title {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.15;
  margin-bottom: .75rem;
}
.article-subtitle {
  font-family: var(--ff-serif);
  font-style: italic;
  color: var(--ink-2);
  font-size: 1.2rem;
  max-width: 720px;
  margin-bottom: 1rem;
}
.article-meta {
  color: var(--ink-3);
  font-size: .95rem;
  margin: 0 0 1.5rem;
}
.article-illus img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-lg);
  border: 1px solid var(--rule);
}

.article-body {
  padding: 2rem 0 3.5rem;
  background: var(--surface);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.article-body h2 {
  margin-top: 2rem;
  margin-bottom: .75rem;
  font-size: 1.55rem;
}
.article-body h3 { margin-top: 1.5rem; font-size: 1.2rem; }
.article-body p { font-size: 1.08rem; color: var(--ink); max-width: var(--measure); }
.article-body ul { max-width: var(--measure); }
.article-body li { color: var(--ink); font-size: 1.05rem; }
.article-body a { color: var(--terra-deep); }

.article-brief {
  background: var(--bg-2);
  padding: 1.25rem 1.5rem 1rem;
  border-left: 4px solid var(--terra);
  margin: 0 0 2rem;
  border-radius: var(--radius-lg);
  max-width: var(--measure);
}
.article-brief h2 { margin: 0 0 .5rem; font-size: 1.1rem; text-transform: uppercase; letter-spacing: .06em; color: var(--terra-deep); }
.article-brief ul { margin: 0; padding-left: 1.1em; }
.article-brief li { font-size: 1rem; color: var(--ink-2); }

.article-sources {
  margin-top: 2.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--bg-2);
  border-radius: var(--radius-lg);
  border: 1px solid var(--rule-soft);
  max-width: var(--measure);
}
.article-sources h2 { margin: 0 0 .5rem; font-size: 1.1rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.article-sources ul { margin: 0; padding-left: 1.1em; }
.article-sources li { color: var(--ink-2); font-size: .98rem; }

.article-tail { padding: 3rem 0; background: var(--bg-2); border-bottom: 1px solid var(--rule-soft); }

/* ---------- Longform (legal pages) ---------- */
.longform h2 { margin-top: 2rem; }
.longform h3 { margin-top: 1.25rem; }
.longform p, .longform li { max-width: var(--measure); color: var(--ink); font-size: 1.05rem; }
.longform ul { max-width: var(--measure); }
.longform a { color: var(--terra-deep); }

/* ---------- Newsletter form ---------- */
.newsletter-inline,
.newsletter-form {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 1.5rem 0 .5rem;
}
.newsletter-form label { flex-basis: 100%; font-weight: 700; color: var(--ink-2); font-size: 1rem; }
.newsletter-inline input,
.newsletter-form input {
  flex: 1 1 260px;
  padding: .75rem 1rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  font-family: var(--ff-sans);
  font-size: 1rem;
  background: var(--surface);
  color: var(--ink);
  min-height: 44px;
}
.newsletter-inline input:focus,
.newsletter-form input:focus {
  outline: 2px solid var(--terra);
  outline-offset: 2px;
}
.newsletter-inline button,
.newsletter-form button {
  padding: .75rem 1.5rem;
  background: var(--terra);
  color: var(--surface);
  border: none;
  border-radius: var(--radius-lg);
  font-family: var(--ff-sans);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  min-height: 44px;
}
.newsletter-inline button:hover,
.newsletter-form button:hover { background: var(--terra-deep); }
.section-micro { font-size: .9rem; color: var(--ink-3); margin-top: .35rem; }
.text-small { font-size: .9rem; color: var(--ink-3); }

.btn-link {
  display: inline-block;
  background: var(--terra);
  color: var(--surface);
  text-decoration: none;
  font-weight: 700;
  padding: .75rem 1.25rem;
  border-radius: var(--radius-lg);
}
.btn-link:hover { background: var(--terra-deep); color: var(--surface); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--bg-3);
  border-top: 1px solid var(--rule);
  padding: 3rem 0 1.5rem;
  margin-top: 2rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-col h4 { font-size: .95rem; text-transform: uppercase; letter-spacing: .08em; color: var(--terra-deep); margin: 0 0 .75rem; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: .4rem; }
.footer-col a { color: var(--ink-2); text-decoration: none; }
.footer-col a:hover { color: var(--terra-deep); text-decoration: underline; }
.footer-col p { color: var(--ink-2); font-size: .95rem; margin: 0 0 .5rem; }
.footer-col p a { color: var(--terra-deep); text-decoration: underline; }

.health-disclaimer-footer {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  margin: 1rem 0 1.25rem;
}
.health-disclaimer-footer p { margin: 0; color: var(--ink-2); font-size: .92rem; }
.health-disclaimer-footer strong { color: var(--ink); }
.health-disclaimer-footer a { color: var(--terra-deep); }

.footer-legal {
  padding-top: 1rem;
  border-top: 1px solid var(--rule-soft);
  color: var(--ink-3);
  font-size: .85rem;
}
.footer-legal p { margin: 0 0 .5rem; }
.footer-legal a { color: var(--ink-2); text-decoration: underline; }

/* ---------- Cookie bar ---------- */
.cookie-bar {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
  max-width: 420px;
  margin-left: auto;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  box-shadow: 0 6px 24px rgba(30,27,38,0.12);
  z-index: 50;
  font-size: .9rem;
  color: var(--ink-2);
}
.cookie-bar p { margin: 0 0 .75rem; }
.cookie-bar a { color: var(--terra-deep); }
.cookie-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.cookie-bar button {
  padding: .55rem 1rem;
  border-radius: var(--radius-lg);
  font-family: var(--ff-sans);
  font-weight: 700;
  font-size: .9rem;
  cursor: pointer;
  border: 1px solid var(--rule);
  background: var(--surface);
  color: var(--ink);
  min-height: 40px;
}
.cookie-bar button.btn-accept { background: var(--terra); color: var(--surface); border-color: var(--terra); }
.cookie-bar button.btn-accept:hover { background: var(--terra-deep); border-color: var(--terra-deep); }
.cookie-bar button.btn-refuse:hover { background: var(--bg-2); }
.cookie-bar[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

@media (max-width: 480px) {
  .hero { padding: 2.5rem 0 2rem; }
  .section { padding: 2.5rem 0; }
  .site-footer { padding: 2rem 0 1rem; }
}
