/* ==========================================================================
   Ayudarte · Base compartida (reset, elementos, utilidades)
   Usa los tokens que define site.css.
   ========================================================================== */
@layer reset, tokens, base, parts, template, utilities;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  * { margin: 0; }

  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-padding-top: calc(var(--header-h) + 1px); /* alto del header fijo + su filete */
  }
  body {
    min-height: 100dvh;
    padding-inline: env(safe-area-inset-left) env(safe-area-inset-right);
  }
  img, svg { display: block; max-width: 100%; }
  button { font: inherit; color: inherit; }
  [hidden] { display: none !important; }
}

@layer base {
  body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-text);
    font-size: var(--text-base);
    line-height: 1.6;
    font-kerning: normal;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  /* La página escala con la pantalla: todo está en rem, así que textos, espacios y contenedor
     crecen juntos y no queda tanto vacío en monitores anchos. (Los media queries en rem miden
     siempre sobre 16 px, por eso los cortes no se mueven.) */
  html { font-size: 100%; }
  @media (min-width: 48rem)  { html { font-size: 106.25%; } }
  @media (min-width: 72rem)  { html { font-size: 112.5%; } }
  @media (min-width: 100rem) { html { font-size: 118.75%; } }

  h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: var(--fw-display);
    letter-spacing: var(--tracking-display);
    line-height: 1.12;
    text-wrap: balance;
  }
  h1 { font-size: var(--h1); line-height: 1.06; }
  h2 { font-size: var(--h2); }
  h3 { font-size: var(--h3); line-height: 1.2; }

  p, li { text-wrap: pretty; }
  strong, b { font-weight: 700; }

  a { color: var(--brand); text-underline-offset: 0.2em; }
  a:hover { color: var(--brand-hover); }

  :focus-visible { outline: 3px solid var(--focus, var(--brand)); outline-offset: 3px; border-radius: 4px; }
  ::selection { background: var(--brand); color: var(--on-brand); }

  /* Sprite de iconos en línea: trazo continuo, heredan color.
     Va en "base" para que cualquier componente pueda cambiar su tamaño. */
  .sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
  .icon {
    width: 1.5rem;
    height: 1.5rem;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  /* Glifos sólidos de botón (corazón, ▶): relleno + trazo fino que redondea las esquinas */
  .icon--solid { fill: currentColor; stroke-width: 1.5; }

  @media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
  }
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
      scroll-behavior: auto !important;
    }
  }
}

@layer utilities {
  .container { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }

  .visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }

  .skip-link {
    position: absolute;
    inset-block-start: 0.5rem;
    inset-inline-start: 0.5rem;
    z-index: 100;
    padding: 0.75rem 1rem;
    background: var(--ink);
    color: var(--bg);
    font-weight: 700;
    border-radius: 8px;
    transform: translateY(-200%);
  }
  .skip-link:focus { transform: none; color: var(--bg); }
}
