/*!
 * pelotapasto.com — core.css (capa global)
 * Alcance: sistema tipográfico global + compatibilidad WordPress.
 * LOCK: sin tocar markup ni lógica; sin rediseño; sin cambios de métricas.
 *
 * Refactor estructural (2026-02-22) — Iteración core.css depurado:
 * - Elimina duplicaciones internas y overrides cruzados.
 * - Saca contaminación de Single (no hay .pp-single aquí).
 * - Mantiene UNA (1) definición global de captions.
 * - Mantiene valores existentes (métricas/tamaños/espaciados) tal como estaban.
 */

/* ----------------------------------------------------------------------
   Capas (cascada predecible)
   Nota: reglas fuera de @layer (si existieran) mantendrían prioridad por encima
   de las layers. Este archivo queda completamente layered.
   ---------------------------------------------------------------------- */
@layer reset, base, wordpress, prose;

/* ----------------------------------------------------------------------
   @layer reset — normalización mínima
   (migrado 1:1 desde style.css filas 52–89)
   ---------------------------------------------------------------------- */
@layer reset {
  *,
  *::before,
  *::after { box-sizing: border-box; }

  html,
  body { height: 100%; }

  body {
    margin: 0;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  img,
  picture,
  video,
  canvas,
  svg {
    display: block;
    max-width: 100%;
    height: auto;
  }

  input,
  button,
  textarea,
  select { font: inherit; }

  a { color: inherit; text-decoration: none; }
  a:hover { text-decoration: underline; text-underline-offset: .2em; }

  :focus-visible {
    outline: 2px solid var(--pp-blue);
    outline-offset: 2px;
  }
}

/* ----------------------------------------------------------------------
   @layer base — fonts + tokens + lectura base + helpers
   (migrado 1:1 desde style.css filas 94–218; rutas de fonts ajustadas)
   ---------------------------------------------------------------------- */
@layer base {

  /* ---------------------------
     Local fonts (NO Google Fonts)
     --------------------------- */
  @font-face {
    font-family: "Bebas Neue";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/bebas-neue/BebasNeue-Regular.woff2") format("woff2");
  }

  @font-face {
    font-family: "Spectral";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/spectral/Spectral-Regular.woff2") format("woff2");
  }

  @font-face {
    font-family: "Spectral";
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/spectral/Spectral-Italic.woff2") format("woff2");
  }

  @font-face {
    font-family: "Spectral";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("../fonts/spectral/Spectral-Bold.woff2") format("woff2");
  }

  @font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/inter/Inter-roman.var.woff2") format("woff2");
  }

  @font-face {
    font-family: "Inter";
    font-style: italic;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/inter/Inter-italic.var.woff2") format("woff2");
  }

  /* ---------------------------
     Tokens (fuente de verdad)
     --------------------------- */
  :root {
    /* Colores pelotapasto (institucionales) */
    --pp-orange: #ff6900;
    --pp-blue:   #598fbf;
    --pp-black:  #262626;
    --pp-gray:   #BFBFBF;
    --pp-white:  #ffffff;

    /* Tono editorial */
    --pp-ink: var(--pp-black);
    --pp-paper: var(--pp-white);
    --pp-ink-soft: #3a3a3a; /* fallback */

    /* Tipografías */
    --pp-font-display: "Bebas Neue", system-ui, sans-serif;
    --pp-font-reading: "Spectral", ui-serif, Georgia, serif;
    --pp-font-ui: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;

    /* Escalas estructurales */
    --pp-wide: 1200px;
    --pp-mid: 960px;
    --pp-measure: 68ch;
    --pp-gutter: 20px;

    /* Ritmo vertical */
    --pp-flow: 1.25rem;

    /* Hairline editorial */
    --pp-hairline: .5px solid var(--pp-gray);
  }

  /* Refinamiento tipográfico progresivo */
  @supports (color: color-mix(in srgb, black 90%, white)) {
    :root { --pp-ink-soft: color-mix(in srgb, var(--pp-ink) 90%, var(--pp-paper)); }
  }

  /* Superficie + lectura base */
  body {
    background: var(--pp-paper);
    color: var(--pp-ink);
    font-family: var(--pp-font-reading);
    font-weight: 400;
    line-height: 1.6;
  }

  /* Helpers de ancho (estructura global) */
  .pp-wide {
    max-width: var(--pp-wide);
    margin-inline: auto;
  }

  .pp-content {
    padding-inline: var(--pp-gutter);
  }
}

/* ----------------------------------------------------------------------
   @layer wordpress — alineaciones + neutralización de layouts WP
   - No define “diseño editorial”; solo compatibilidad y baseline neutral.
   ---------------------------------------------------------------------- */
@layer wordpress {

  /* Alineaciones estándar WP */
  .alignfull {
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
  }

  .alignwide {
    max-width: var(--pp-wide);
    margin-left: auto;
    margin-right: auto;
  }

  /* Semántica: baseline sin márgenes por defecto */
  figure { margin: 0; }

  /* CAPTIONS (global) — UNA fuente de verdad */
  figcaption,
  .wp-element-caption {
    margin-top: .35rem;
    text-align: right;
    padding-right: 8px;
    font-size: 0.8rem;
    font-style: italic;
  }

  @media (max-width: 760px) {
    figcaption,
    .wp-element-caption { font-size: 0.75rem; }
  }

  /* Gutenberg layout neutralization — theme-controlled width */
  .is-layout-constrained,
  .wp-block-group-is-layout-constrained,
  .wp-block-post-template-is-layout-constrained {
    max-width: none;
    margin-left: 0;
    margin-right: 0;
  }

  .wp-block-query,
  .wp-block-group,
  .wp-block-post-template {
    margin-left: 0;
    margin-right: 0;
  }
}

/* =========================================================
   @layer prose — .pp-prose baseline editorial (FUENTE DE VERDAD)
   Alcance: tipografía y ritmo dentro del flujo narrativo.
   No toca layout (anchos/alineaciones wide/full) ni módulos externos.
   ========================================================= */
@layer prose {

  /* ------------------------------------------------------------------
     MOBILE — ajuste de escala editorial
     Objetivo: mantener densidad y legibilidad sin “texto gigante”.
     Nota: layout/padding de template vive fuera; aquí solo prosa.
     (se mantiene EXACTO como estaba en core.css original)
     ------------------------------------------------------------------ */
  @media (max-width: 760px) {
    .pp-prose {
      font-size: 17.5px;
      line-height: 1.46;

      max-width: none;
      margin-inline: 0;

      padding-left: 20px;
      padding-right: 20px;
    }
  }

  /* ---------------------------
     Párrafos
     --------------------------- */
  .pp-prose p { margin: 0; }

  .pp-prose p + p { margin-top: 0.85em; }

  .pp-prose > p:first-of-type { margin-top: 0.35em; }

  /* ---------------------------
     Links (editorial)
     --------------------------- */
  .pp-prose a {
    text-decoration: underline;
    text-decoration-thickness: from-font;
    text-underline-offset: .2em;
  }

  .pp-prose a:hover { text-decoration-thickness: .12em; }

  /* ---------------------------
     Listas
     --------------------------- */
  .pp-prose ul,
  .pp-prose ol {
    margin: 0 0 1.1em 1.2em;
    padding: 0;
  }

  .pp-prose li { margin: .25em 0; }

  /* ---------------------------
     Figuras / imágenes de Gutenberg
     --------------------------- */
  .pp-prose figure > a { display: inline-block; }

  /* ---------------------------
     Headings
     --------------------------- */
  .pp-prose h2,
  .pp-prose h3,
  .pp-prose h4 {
    margin: 1.6em 0 0.45em;
    font-family: var(--pp-font-reading);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0;
    text-wrap: balance;
  }

  .pp-prose h2 { font-size: 1.35em; }
  .pp-prose h3 { font-size: 1.20em; }
  .pp-prose h4 { font-size: 1.10em; }

  /* ---------------------------
     Gutenberg: neutralizar alineaciones textuales dentro del cuerpo editorial
     --------------------------- */
  .pp-prose .has-text-align-left,
  .pp-prose .has-text-align-center,
  .pp-prose .has-text-align-right {
    text-align: inherit;
  }

  .pp-prose p.has-text-align-left,
  .pp-prose p.has-text-align-center,
  .pp-prose p.has-text-align-right,
  .pp-prose ul.has-text-align-left,
  .pp-prose ul.has-text-align-center,
  .pp-prose ul.has-text-align-right,
  .pp-prose ol.has-text-align-left,
  .pp-prose ol.has-text-align-center,
  .pp-prose ol.has-text-align-right,
  .pp-prose blockquote.has-text-align-left,
  .pp-prose blockquote.has-text-align-center,
  .pp-prose blockquote.has-text-align-right {
    text-align: left;
  }

  /* ---------------------------
     Gutenberg: drop cap (OFF) — baseline “tipografía pura”
     --------------------------- */
  .pp-prose .has-drop-cap:not(:focus)::first-letter,
  .pp-prose .has-drop-cap::first-letter {
    float: none;
    margin: 0;
    padding: 0;
    font-size: inherit;
    line-height: inherit;
    font-weight: inherit;
  }

  /* ---------------------------
     Gutenberg: botones dentro del flujo editorial (control mínimo)
     --------------------------- */
  .pp-prose .wp-block-button__link {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
  }
}
