/* ==========================================================================
   yamitim.com · Estilos base compartidos
   Editorial cálido: Cormorant Garamond (títulos) + Open Sauce (textos)
   Mobile first (375 px) → escritorio.
   ========================================================================== */

/* ---------- Fuentes ---------- */
/* Open Sauce Sans (gratuita, OFL) servida desde jsDelivr / Fontsource */
@font-face {
  font-family: "Open Sauce";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  /* El .woff2 de 400 viene dañado en el paquete 5.3.0; el .woff sí funciona */
  src: url("https://cdn.jsdelivr.net/npm/@fontsource/open-sauce-sans@5.3.0/files/open-sauce-sans-latin-400-normal.woff") format("woff");
}
@font-face {
  font-family: "Open Sauce";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("https://cdn.jsdelivr.net/npm/@fontsource/open-sauce-sans@5.3.0/files/open-sauce-sans-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Open Sauce";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("https://cdn.jsdelivr.net/npm/@fontsource/open-sauce-sans@5.3.0/files/open-sauce-sans-latin-600-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Open Sauce";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("https://cdn.jsdelivr.net/npm/@fontsource/open-sauce-sans@5.3.0/files/open-sauce-sans-latin-700-normal.woff2") format("woff2");
}

/* Banderas en emoji: Windows no las dibuja (muestra "CO", "MX"…),
   así que esta fuente gratuita (Twemoji, licencia CC-BY) solo se usa para banderas
   y solo se descarga en las páginas que las tienen. */
@font-face {
  font-family: "Banderas";
  font-display: swap;
  src: url("https://cdn.jsdelivr.net/npm/country-flag-emoji-polyfill@0.1.8/dist/TwemojiCountryFlags.woff2") format("woff2");
  unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E007F;
}

/* ---------- Tokens ---------- */
:root {
  /* Paleta oficial */
  --ivory: #F2EBDD;
  --forest: #102F27;
  --emerald: #185844;
  --sage: #78947F;
  --gold: #B08A4F;

  /* Fondos claros principales */
  /* Texto en Open Sauce sobre fondos claros (decidido el 21 nov 2026) */
  --ink: #232323;              /* carbón: títulos y párrafos */
  --ink-soft: rgba(35, 35, 35, .78); /* texto secundario sobre claro */
  --paper: #F4F3EF;            /* fondo de la página */
  --gold-deep: #9A7740;        /* mismo dorado, un punto más hondo: palabras destacadas
                                  sobre fondo claro (contraste 3,7:1, títulos grandes) */
  --gold-hover: #C29C62;       /* botón dorado al pasar el cursor */

  /* Derivados (solo matices de la paleta) */
  --ivory-2: #F2EBDD;          /* secciones alternas */
  --ivory-3: #FBFAF7;          /* tarjetas claras */
  --forest-2: #0B241D;         /* fondo oscuro profundo */
  --forest-soft: rgba(16, 47, 39, .78);   /* texto secundario sobre ivory (≥ 7:1) */
  --ivory-soft: rgba(242, 235, 221, .80); /* texto secundario sobre forest (≥ 9:1) */
  --line: rgba(16, 47, 39, .16);
  --line-dark: rgba(242, 235, 221, .16);
  --gold-line: rgba(176, 138, 79, .55);

  /* Tipografía */
  --serif: "Cormorant Garamond", "Cormorant", Garamond, "Times New Roman", serif;
  --sans: "Open Sauce", "Open Sauce Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --fs-body: 1.0625rem;              /* 17 px */
  --fs-small: 1rem;                  /* 16 px: nunca menos para lectura */
  --fs-label: .8125rem;              /* 13 px solo etiquetas en mayúsculas */
  --fs-h1: clamp(2.5rem, 9vw, 5.4rem);
  --fs-h2: clamp(1.75rem, 5.2vw, 2.9rem);
  --fs-h3: clamp(1.2rem, 3.4vw, 1.5rem);
  --fs-lead: clamp(1.2rem, 3.8vw, 1.45rem);

  /* Espacio */
  --gutter: clamp(1.25rem, 5vw, 3.5rem);
  --section: clamp(3.5rem, 9vw, 6.5rem);   /* espacio entre secciones (antes 5.5–11rem) */
  --maxw: 1100px;   /* columna centrada: el contenido ya no va de borde a borde */
  --radius: 2px;

  /* Movimiento */
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body, h1, h2, h3, h4, p, ul, ol, figure, blockquote, dl, dd { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
img, svg, video { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--forest); color: var(--ivory); }

/* Grano de papel: textura editorial muy sutil */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  opacity: .07;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---------- Accesibilidad ---------- */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 300;
  background: var(--forest);
  color: var(--ivory);
  padding: .9rem 1.2rem;
  text-decoration: none;
  font-weight: 600;
}
.skip-link:focus { top: 1rem; }

:focus-visible {
  outline: 2px solid var(--forest);
  outline-offset: 4px;
}
.on-dark :focus-visible, .on-dark:focus-visible { outline-color: var(--gold); }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ---------- Layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-block: var(--section); position: relative; }

.on-dark {
  background: var(--forest);
  color: var(--ivory);
}
.on-dark ::selection { background: var(--ivory); color: var(--forest); }

/* ---------- Tipografía ---------- */
/* Tipografía según la guía de identidad (19 nov 2026):
   - Open Sauce es la fuente principal: títulos, textos, botones.
   - Títulos sin cursiva: Bold. Títulos con una palabra en cursiva: Medium.
   - Cormorant Garamond SOLO en cursiva, como complemento. */
.display, h1, h2, h3 {
  font-family: var(--sans);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.02em;
}
h1, .h1 { font-size: var(--fs-h1); line-height: 1.08; letter-spacing: -.025em; }
h2, .h2 { font-size: var(--fs-h2); }
h3, .h3 { font-size: var(--fs-h3); font-weight: 600; line-height: 1.2; letter-spacing: -.01em; }
/* Un título con una palabra en cursiva va en Medium (junto a Bold, Cormorant se ve débil) */
h1:has(em), h2:has(em), h3:has(em), .display:has(em) { font-weight: 500; }

/* La palabra en cursiva: Cormorant SemiBold cursiva al ~122 % del título.
   Color: dorado profundo sobre fondos claros, dorado sobre fondos oscuros
   (20 nov 2026: se dejó de usar esmeralda en las cursivas). */
h1 em, h2 em, h3 em, .display em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: 1.22em;
  line-height: 0;          /* que el tamaño mayor no separe las líneas */
  letter-spacing: 0;
  color: var(--gold-deep);
}
.on-dark h1 em, .on-dark h2 em, .on-dark h3 em, .on-dark .display em { color: var(--gold); }

/* Variante: palabra destacada en Open Sauce (sin cursiva), solo con color */
h1 em.sans, h2 em.sans, h3 em.sans, .display em.sans {
  font-family: var(--sans);
  font-style: normal;
  font-weight: inherit;
  font-size: 1em;
  line-height: inherit;
  letter-spacing: inherit;
}
/* Un título sin palabra en cursiva vuelve a Bold */
:is(h1, h2, h3):has(em.sans):not(:has(em:not(.sans))) { font-weight: 700; }
/* Variante: palabra destacada en dorado (dorado profundo sobre claro, dorado sobre oscuro) */
h1 em.gold, h2 em.gold, h3 em.gold { color: var(--gold-deep); }
.on-dark h1 em.gold, .on-dark h2 em.gold, .on-dark h3 em.gold { color: var(--gold); }

/* Párrafo de entrada: Open Sauce (Cormorant nunca en párrafos largos) */
.lead {
  font-family: var(--sans);
  font-size: clamp(1.1rem, 3.4vw, 1.3rem);
  line-height: 1.5;
  font-weight: 500;
}

.label {
  font-family: var(--sans);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  line-height: 1.4;
}

.muted { color: var(--ink-soft); }
.on-dark .muted { color: var(--ivory-soft); }

p + p { margin-top: 1.1em; }
/* Líneas cómodas de leer: unas 65 letras como máximo */
p, dd, li { max-width: 65ch; }

/* Folio editorial: "01 — Reconocimiento" */
.folio {
  display: flex;
  align-items: center;
  gap: .9rem;
  margin-bottom: clamp(1.75rem, 5vw, 3rem);
  color: var(--ink);
}
.folio .folio__num { color: var(--gold-deep); }
.folio__num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
.folio__rule {
  flex: 0 0 auto;
  width: clamp(2.5rem, 10vw, 5rem);
  height: 1px;
  background: var(--gold);
  transform-origin: left center;
}
.on-dark .folio, .on-dark .folio .folio__num { color: var(--gold); }

/* ---------- Botones ---------- */
/* Botones en Antique gold con texto Forest profundo (contraste 5:1) */
.btn {
  --btn-bg: var(--gold);
  --btn-fg: var(--forest-2);
  --btn-fill: var(--gold-hover);
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .85rem;
  min-height: 56px;
  padding: 1rem 1.6rem;
  border: 0;
  border-radius: var(--radius);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: .02em;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  transition: transform .5s var(--ease), box-shadow .5s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--btn-fill);
  transform: scaleY(0);
  transform-origin: bottom center;
  transition: transform .55s var(--ease);
}
.btn:hover::before, .btn:focus-visible::before { transform: scaleY(1); }
.btn__arrow {
  display: inline-block;
  width: 1.25rem;
  height: 1px;
  background: currentColor;
  position: relative;
  transition: width .5s var(--ease);
}
.btn__arrow::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: 7px;
  height: 7px;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  transform: translateY(-50%) rotate(45deg);
}
.btn:active { transform: scale(.98); }

/* (se mantiene por compatibilidad: ahora todos los botones principales son dorados) */
.btn--light {
  --btn-bg: var(--gold);
  --btn-fg: var(--forest-2);
  --btn-fill: var(--gold-hover);
}
.btn--block { width: 100%; }

/* Botón secundario (WhatsApp, dudas) */
.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--forest);
  --btn-fill: rgba(176, 138, 79, .14);
  box-shadow: inset 0 0 0 1px var(--forest);
}
.on-dark .btn--ghost {
  --btn-fg: var(--ivory);
  --btn-fill: rgba(242, 235, 221, .08);
  box-shadow: inset 0 0 0 1px var(--ivory-soft);
}

.btn-note {
  margin-top: .9rem;
  font-size: var(--fs-small);
  color: var(--ink-soft);
}
.on-dark .btn-note { color: var(--ivory-soft); }

/* Enlace subrayado editorial */
.link {
  color: var(--ink);
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  padding-bottom: 2px;
  transition: background-size .5s var(--ease);
  font-weight: 500;
}
.link:hover { background-size: 0 1px; background-position: 100% 100%; }
.on-dark .link { color: var(--ivory); }

/* ---------- Espacio reservado para fotos ---------- */
.ph {
  position: relative;
  overflow: hidden;
  background-color: var(--ivory-2);
  background-image:
    repeating-linear-gradient(135deg, rgba(120, 148, 127, .16) 0 1px, transparent 1px 14px);
  display: grid;
  place-items: center;
  color: var(--ink);
}
.ph::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid var(--gold-line);
  pointer-events: none;
}
.ph__tag {
  position: relative;
  text-align: center;
  padding: 1rem 1.25rem;
  background: var(--ivory);
  max-width: 82%;
}
.ph__tag .label { display: block; color: var(--ink); }
.ph__tag small {
  display: block;
  margin-top: .35rem;
  font-size: .9375rem;
  color: var(--ink-soft);
}
.ph--dark {
  background-color: rgba(26, 22, 18, .45);
  background-image:
    repeating-linear-gradient(135deg, rgba(176, 138, 79, .16) 0 1px, transparent 1px 14px);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.ph--dark .ph__tag { background: rgba(20, 17, 13, .85); }
.ph--dark .ph__tag .label { color: var(--gold); }
.ph--dark .ph__tag small { color: var(--ivory-soft); }

/* ---------- Revelados (solo con JS activo) ----------
   Se usan únicamente en la secuencia de entrada del encabezado (.hero).
   El resto de la página aparece quieta: un solo momento orquestado. */
.js .hero [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition: opacity 1.1s var(--ease), transform 1.1s var(--ease);
  transition-delay: var(--d, 0s);
}
.js .hero [data-reveal].is-in { opacity: 1; transform: none; }

/* Líneas de título que suben desde una máscara (solo en el encabezado) */
.line { display: block; overflow: hidden; padding-bottom: .08em; margin-bottom: -.08em; }
.line > span { display: block; }
.js .hero .lines .line > span {
  transform: translate3d(0, 105%, 0);
  transition: transform 1.3s var(--ease);
  transition-delay: calc(var(--i, 0) * .11s + var(--d, 0s));
}
.js .hero .lines.is-in .line > span { transform: none; }

/* ---------- Movimiento reducido ----------
   Solo se apagan los efectos intrusivos (bucles, parallax).
   Los fundidos y los hovers se mantienen: Windows trae esta opción activada. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-loop] { animation: none !important; }
}
