/* ==========================================================================
   base.css — Dr. Rodrigo Mata · Reset, fuentes, tipografía, contenedores,
   foco y accesibilidad base. Requiere tokens.css.
   ========================================================================== */

/* ---------- Fuentes autoalojadas (sin Google Fonts) ---------- */
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 300 700;            /* fuente variable: cubre 300/400/500/600/700 */
  font-display: swap;
  src: url('../fonts/montserrat-latin-wght.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/playfair-display-latin-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Playfair Display';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/playfair-display-latin-400italic.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Reset mínimo ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body {
  margin: 0;
  background: var(--s-white);
  color: var(--t-strong);
  font-family: var(--f-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: var(--fw-regular);
  min-height: 100vh;
}
h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg, video, picture { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
address { font-style: normal; }
hr { border: 0; border-top: var(--bw) solid var(--b-200); margin: 0; }
[hidden] { display: none !important; }
strong, b { font-weight: var(--fw-semibold); }

/* ---------- Enlaces ---------- */
a { color: var(--c-teal); text-decoration: none; transition: color var(--d-hover) ease, border-color var(--d-hover) ease, background-color var(--d-hover) ease; }
a:hover { color: var(--c-teal-hover); }

/* ---------- Foco visible (contorno 2 px #82B0B1, offset 2 px) ---------- */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--c-teal-300); outline-offset: 2px; border-radius: var(--r-2); }
.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 1000;
  background: var(--s-black); color: #fff; padding: 12px 18px; border-radius: var(--r-2);
  font-size: var(--fs-btn); font-weight: var(--fw-bold); letter-spacing: var(--ls-btn); text-transform: uppercase;
}
.skip-link:focus { top: 16px; color: #fff; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* ---------- Selección y placeholders ---------- */
::selection { background: var(--c-teal-100); color: var(--t-ink); }
input::placeholder, textarea::placeholder { color: var(--t-faint); opacity: 1; }

/* ---------- Tipografía ---------- */
h1, .h1 { font-size: var(--fs-h1-int); line-height: var(--lh-tight); letter-spacing: var(--ls-h1); font-weight: var(--fw-semibold); color: var(--t-ink); text-wrap: balance; }
h2, .h2 { font-size: var(--fs-h2); line-height: var(--lh-heading); letter-spacing: var(--ls-h2); font-weight: var(--fw-semibold); color: var(--t-ink); text-wrap: balance; }
h3, .h3 { font-size: var(--fs-h3); line-height: var(--lh-h3); letter-spacing: var(--ls-h3); font-weight: var(--fw-semibold); color: var(--t-ink); }
h4, .h4 { font-size: var(--fs-h4); line-height: 1.35; letter-spacing: var(--ls-h4); font-weight: var(--fw-semibold); color: var(--t-ink); }
.h1--home { font-size: var(--fs-h1); }
.h2--home { font-size: var(--fs-h2-home); }
.serif { font-family: var(--f-serif); font-weight: var(--fw-regular); letter-spacing: 0; }
.serif-i { font-family: var(--f-serif); font-weight: var(--fw-regular); font-style: italic; letter-spacing: 0; }
.lead { font-family: var(--f-serif); font-size: var(--fs-lead); line-height: var(--lh-lead); color: var(--t-on-dark); }
.quote { font-family: var(--f-serif); font-size: var(--fs-quote); line-height: 1.4; color: var(--t-ink); }
p { color: inherit; }
.text-body   { color: var(--t-body); }
.text-muted  { color: var(--t-muted); font-size: var(--fs-small); line-height: var(--lh-small); }
.text-micro  { color: var(--t-faint); font-size: var(--fs-micro); line-height: var(--lh-small); }
.text-small  { font-size: var(--fs-small); line-height: var(--lh-small); }
.measure     { max-width: var(--measure); }
.measure-legal { max-width: var(--measure-legal); }

/* ---------- Contenedores y secciones ---------- */
.container { max-width: var(--container); margin: 0 auto; padding-left: var(--pad-x); padding-right: var(--pad-x); }
.section { padding-top: var(--section-y); padding-bottom: var(--section-y); position: relative; }
.section--s { padding-top: var(--section-y-s); padding-bottom: var(--section-y-s); }
.section--clip { overflow: hidden; }            /* confina las líneas orgánicas */
.bg-white { background: var(--s-white); color: var(--t-strong); }
.bg-gray  { background: var(--s-gray);  color: var(--t-strong); }
.bg-cream { background: var(--s-cream); color: var(--t-strong); }
.bg-black { background: var(--s-black); color: var(--t-on-dark); }
.bg-black h1, .bg-black h2, .bg-black h3, .bg-black h4 { color: #fff; }
.bg-black p { color: var(--t-on-dark-muted); }
.bg-black a:not(.btn) { color: #fff; }
.bg-black a:not(.btn):hover { color: var(--c-teal-300); }

/* ---------- Rejillas utilitarias ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--min-col-2)), 1fr)); gap: var(--gap-col); align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--min-col-3)), 1fr)); gap: var(--gap-col-s); }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--min-col-4)), 1fr)); gap: var(--gap-col-s); }
.stack > * + * { margin-top: var(--sp-6); }
.flow > * + * { margin-top: 1em; }

/* ---------- Main ---------- */
main { display: block; }
