/*
 * Base CSS de la librería común de los microsites de Greenpeace España.
 *
 * Todo va en capas (@layer gp.*). El CSS del site, escrito fuera de capas,
 * siempre gana sin tener que subir la especificidad.
 *
 * El site solo define las variables del tema (--gp-color-*, --gp-fuente-*,
 * --gp-radio). No toca las variables internas --gp-c-*, que resuelven el tema
 * normal y la versión de alto contraste. Ver guia-visual.md.
 */

@layer gp.reset, gp.tokens, gp.base, gp.componentes, gp.utilidades;

/* ---------- Reset mínimo ---------- */
@layer gp.reset {
  *, *::before, *::after { box-sizing: border-box; }
  * { margin: 0; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  img, picture, svg, video, canvas { display: block; max-width: 100%; height: auto; }
  input, button, textarea, select { font: inherit; color: inherit; }
  p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }
}

/* ---------- Variables ---------- */
@layer gp.tokens {
  :root {
    /* Colores de marca. Fijos: no se cambian en el site. */
    --gp-verde: #66cc00;
    --gp-verde-oscuro: #004b00;
    --gp-amarillo: #ffff00;
    --gp-negro: #000000;
    --gp-blanco: #ffffff;

    /* Tema por defecto (cumple AA). El site los cambia según su tema. */
    --gp-color-fondo: #ffffff;
    --gp-color-superficie: #f3f3ee;
    --gp-color-texto: #1a1a1a;
    --gp-color-texto-suave: #4d4d4d;
    --gp-color-titulos: var(--gp-verde-oscuro);
    --gp-color-enlace: var(--gp-verde-oscuro);
    --gp-color-accion: var(--gp-amarillo);
    --gp-color-accion-texto: var(--gp-negro);
    --gp-color-accion-borde: var(--gp-negro);
    --gp-color-borde-campo: #6b6b6b;
    --gp-color-error: #b3261e;
    --gp-color-foco: #1a1a1a;
    --gp-color-fondo-oscuro: var(--gp-verde-oscuro);
    --gp-color-texto-sobre-oscuro: #ffffff;
    --gp-color-velo: rgb(0 0 0 / 0.6);

    --gp-fuente-texto: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --gp-fuente-titulos: var(--gp-fuente-texto);
    --gp-radio: 0.5rem;

    /* Tipografía fluida: de móvil (360 px) a escritorio (1280 px). */
    --gp-texto-pequeno: 0.9375rem;                              /* 15 px */
    --gp-texto-base: clamp(1rem, 0.95rem + 0.22vw, 1.125rem);   /* 16-18 px */
    --gp-texto-grande: clamp(1.125rem, 1.05rem + 0.35vw, 1.375rem);
    --gp-titulo-3: clamp(1.25rem, 1.15rem + 0.45vw, 1.5rem);
    --gp-titulo-2: clamp(1.5rem, 1.3rem + 1vw, 2.25rem);        /* nunca < 24 px: texto grande */
    --gp-titulo-1: clamp(2rem, 1.55rem + 2.2vw, 3.5rem);

    /* Espaciado */
    --gp-espacio-1: 0.25rem;
    --gp-espacio-2: 0.5rem;
    --gp-espacio-3: 1rem;
    --gp-espacio-4: 1.5rem;
    --gp-espacio-5: 2rem;
    --gp-espacio-6: 3rem;
    --gp-espacio-7: clamp(3rem, 2rem + 4vw, 5rem);

    --gp-ancho-texto: 65ch;
    --gp-ancho-max: 72rem;
    --gp-margen-lateral: clamp(1rem, 0.5rem + 2.5vw, 2rem);
    --gp-objetivo-tactil: 2.75rem; /* 44 px */

    /* Logo: 140 px en el móvil, hasta 200 px en pantallas grandes.
       Espacio libre alrededor: la altura del logo (16 % de su ancho). */
    --gp-logo-ancho: clamp(140px, 105px + 7.5vw, 200px);
    /* En el pie, el logo deja de crecer a partir de unos 740 px de pantalla. */
    --gp-logo-ancho-pie: clamp(140px, 105px + 7.5vw, 160px);
    --gp-logo-espacio: calc(var(--gp-logo-ancho) * 0.158);

    /* Variables internas: no las cambia el site. */
    --gp-c-fondo: var(--gp-color-fondo);
    --gp-c-superficie: var(--gp-color-superficie);
    --gp-c-texto: var(--gp-color-texto);
    --gp-c-texto-suave: var(--gp-color-texto-suave);
    --gp-c-titulos: var(--gp-color-titulos);
    --gp-c-enlace: var(--gp-color-enlace);
    --gp-c-accion: var(--gp-color-accion);
    --gp-c-accion-texto: var(--gp-color-accion-texto);
    --gp-c-accion-borde: var(--gp-color-accion-borde);
    --gp-c-borde-campo: var(--gp-color-borde-campo);
    --gp-c-error: var(--gp-color-error);
    --gp-c-foco: var(--gp-color-foco);
    --gp-c-fondo-oscuro: var(--gp-color-fondo-oscuro);
    --gp-c-texto-sobre-oscuro: var(--gp-color-texto-sobre-oscuro);
    --gp-c-velo: var(--gp-color-velo);
  }

  /*
   * Alto contraste. Si el site no define --gp-color-*-alto-contraste, se usa
   * su color normal. Solo hace falta definirlos si la paleta normal no cumple
   * AA (excepción que pide la persona y que se anota en diseno.md).
   */
  @media (prefers-contrast: more) {
    :root {
      --gp-c-fondo: var(--gp-color-fondo-alto-contraste, var(--gp-color-fondo));
      --gp-c-superficie: var(--gp-color-superficie-alto-contraste, var(--gp-color-superficie));
      --gp-c-texto: var(--gp-color-texto-alto-contraste, var(--gp-color-texto));
      --gp-c-texto-suave: var(--gp-color-texto-suave-alto-contraste, var(--gp-color-texto-suave));
      --gp-c-titulos: var(--gp-color-titulos-alto-contraste, var(--gp-color-titulos));
      --gp-c-enlace: var(--gp-color-enlace-alto-contraste, var(--gp-color-enlace));
      --gp-c-accion: var(--gp-color-accion-alto-contraste, var(--gp-color-accion));
      --gp-c-accion-texto: var(--gp-color-accion-texto-alto-contraste, var(--gp-color-accion-texto));
      --gp-c-accion-borde: var(--gp-color-accion-borde-alto-contraste, var(--gp-color-accion-borde));
      --gp-c-borde-campo: var(--gp-color-borde-campo-alto-contraste, var(--gp-color-borde-campo));
      --gp-c-error: var(--gp-color-error-alto-contraste, var(--gp-color-error));
      --gp-c-foco: var(--gp-color-foco-alto-contraste, var(--gp-color-foco));
      --gp-c-fondo-oscuro: var(--gp-color-fondo-oscuro-alto-contraste, var(--gp-color-fondo-oscuro));
      --gp-c-texto-sobre-oscuro: var(--gp-color-texto-sobre-oscuro-alto-contraste, var(--gp-color-texto-sobre-oscuro));
      --gp-c-velo: rgb(0 0 0 / 0.85);
    }
  }
}

/* ---------- Elementos base ---------- */
@layer gp.base {
  html { scroll-behavior: smooth; }

  /* El pie queda abajo aunque la página sea corta. */
  body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--gp-c-fondo);
    color: var(--gp-c-texto);
    font-family: var(--gp-fuente-texto);
    font-size: var(--gp-texto-base);
    line-height: 1.55;
  }

  main { flex: 1 0 auto; }

  h1, h2, h3, h4 {
    font-family: var(--gp-fuente-titulos);
    line-height: 1.15;
    text-wrap: balance;
  }
  /* Solo h1 y h2 usan --gp-color-titulos, porque nunca bajan de 24 px (texto grande, 3:1). */
  h1, h2 { color: var(--gp-c-titulos); }
  h1 { font-size: var(--gp-titulo-1); }
  h2 { font-size: var(--gp-titulo-2); }
  h3 { font-size: var(--gp-titulo-3); }
  h4 { font-size: var(--gp-texto-grande); }

  p, ul, ol { max-width: var(--gp-ancho-texto); }
  * + p, * + ul, * + ol { margin-top: var(--gp-espacio-3); }
  li + li { margin-top: var(--gp-espacio-1); }

  /* Los enlaces se subrayan: el color solo no basta para distinguirlos. */
  a {
    color: var(--gp-c-enlace);
    text-decoration-line: underline;
    text-decoration-thickness: max(1px, 0.07em);
    text-underline-offset: 0.18em;
  }
  a:hover { text-decoration-thickness: max(2px, 0.12em); }

  :focus-visible {
    outline: 3px solid var(--gp-c-foco);
    outline-offset: 3px;
  }

  strong, b { font-weight: 700; }
  small { font-size: var(--gp-texto-pequeno); }

  ::selection { background: var(--gp-c-accion); color: var(--gp-c-accion-texto); }

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

  @media (prefers-contrast: more) {
    a { text-decoration-thickness: 2px; }
    :focus-visible { outline-width: 4px; }
  }
}

/* ---------- Componentes comunes: cabecera y pie ---------- */
@layer gp.componentes {
  .gp-logo { display: inline-block; flex: none; line-height: 0; }
  .gp-logo img, img.gp-logo { width: var(--gp-logo-ancho); height: auto; }
  /* El enlace del logo llega a 44 px de alto sin cambiar el espacio que ocupa. */
  a.gp-logo {
    --gp-logo-relleno: max(0px, (var(--gp-objetivo-tactil) - var(--gp-logo-ancho) * 0.158) / 2);
    padding-block: var(--gp-logo-relleno);
    margin-block: calc(-1 * var(--gp-logo-relleno));
  }

  /* Variantes con colores de marca. "tema" usa los colores del site, solo si
     el concepto lo pide. */
  .gp-cabecera--claro, .gp-pie--claro {
    --gp-c-fondo: var(--gp-blanco);
    --gp-c-texto: #1a1a1a;
    --gp-c-enlace: var(--gp-verde-oscuro);
    --gp-c-foco: #1a1a1a;
  }
  .gp-cabecera--oscuro, .gp-pie--oscuro {
    --gp-c-fondo: var(--gp-verde-oscuro);
    --gp-c-texto: var(--gp-blanco);
    --gp-c-enlace: var(--gp-blanco);
    --gp-c-foco: var(--gp-blanco);
  }
  .gp-cabecera--negro, .gp-pie--negro {
    --gp-c-fondo: var(--gp-negro);
    --gp-c-texto: var(--gp-blanco);
    --gp-c-enlace: var(--gp-blanco);
    --gp-c-foco: var(--gp-blanco);
  }
  .gp-cabecera, .gp-pie {
    background: var(--gp-c-fondo);
    color: var(--gp-c-texto);
  }

  .gp-cabecera { padding-block: var(--gp-logo-espacio); }
  .gp-cabecera--claro { border-bottom: 1px solid #e3e3e3; }
  .gp-cabecera__interior {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--gp-logo-espacio) var(--gp-espacio-4);
  }
  .gp-cabecera__nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0 var(--gp-espacio-3);
    margin: 0;
    padding: 0;
    max-width: none;
    list-style: none;
  }
  .gp-cabecera__nav li { margin: 0; }
  .gp-cabecera__nav a {
    display: inline-flex;
    align-items: center;
    min-height: var(--gp-objetivo-tactil);
    font-weight: 600;
  }
  .gp-cabecera__nav a:not([aria-current]) { text-decoration-color: transparent; }
  .gp-cabecera__nav a:hover { text-decoration-color: currentColor; }

  /* Botón "Menú": solo en pantallas estrechas y con JavaScript. */
  .gp-menu-boton {
    display: inline-flex;
    align-items: center;
    gap: var(--gp-espacio-2);
    min-height: var(--gp-objetivo-tactil);
    padding: 0 var(--gp-espacio-3);
    border: 2px solid currentColor;
    border-radius: var(--gp-radio);
    background: transparent;
    color: inherit;
    font-weight: 700;
    cursor: pointer;
  }
  .gp-menu-boton[hidden] { display: none; }
  .gp-menu-boton__icono,
  .gp-menu-boton__icono::before,
  .gp-menu-boton__icono::after {
    display: block;
    width: 1.125rem;
    height: 2px;
    background: currentColor;
  }
  .gp-menu-boton__icono { position: relative; }
  .gp-menu-boton__icono::before,
  .gp-menu-boton__icono::after { content: ""; position: absolute; left: 0; }
  .gp-menu-boton__icono::before { top: -6px; }
  .gp-menu-boton__icono::after { top: 6px; }
  .gp-menu-boton[aria-expanded="true"] .gp-menu-boton__icono { background: transparent; }
  .gp-menu-boton[aria-expanded="true"] .gp-menu-boton__icono::before { top: 0; transform: rotate(45deg); }
  .gp-menu-boton[aria-expanded="true"] .gp-menu-boton__icono::after { top: 0; transform: rotate(-45deg); }

  @media (max-width: 47.99rem) {
    .gp-cabecera--js .gp-cabecera__nav { flex-basis: 100%; }
    .gp-cabecera--js .gp-cabecera__nav ul { flex-direction: column; }
    .gp-cabecera--js .gp-menu-boton[aria-expanded="false"] + .gp-cabecera__nav { display: none; }
  }
  @media (min-width: 48rem) {
    .gp-menu-boton:not([hidden]) { display: none; }
  }

  .gp-pie { padding-block: var(--gp-espacio-5); }
  .gp-pie img.gp-logo { width: var(--gp-logo-ancho-pie); }
  .gp-pie__interior {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--gp-espacio-3);
    text-align: center;
  }
  .gp-pie__enlaces {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0 var(--gp-espacio-4);
    margin: 0;
    padding: 0;
    max-width: none;
    list-style: none;
    font-size: var(--gp-texto-pequeno);
  }
  .gp-pie__enlaces li { margin: 0; }
  /* "© año Greenpeace" no es un enlace, pero se alinea con los demás. El
     <span> de dentro evita que flex quite los espacios del texto. */
  .gp-pie__copyright {
    display: inline-flex;
    align-items: center;
    min-height: var(--gp-objetivo-tactil);
  }
  .gp-pie__enlaces a {
    display: inline-flex;
    align-items: center;
    min-height: var(--gp-objetivo-tactil);
  }
  /* "Configuración de cookies": botón con aspecto de enlace, como los demás del pie. */
  .gp-pie__boton {
    display: inline-flex;
    align-items: center;
    min-height: var(--gp-objetivo-tactil);
    padding: 0;
    border: 0;
    background: none;
    color: var(--gp-c-enlace);
    font-size: inherit;
    text-decoration-line: underline;
    text-decoration-thickness: max(1px, 0.07em);
    text-underline-offset: 0.18em;
    cursor: pointer;
  }
  .gp-pie__boton:hover { text-decoration-thickness: max(2px, 0.12em); }
  @media (min-width: 40rem) {
    .gp-pie__interior { flex-direction: row; justify-content: space-between; text-align: left; }
  }
}

/* ---------- Banner de cookies (gp/cookies.njk) ----------
   Colores de marca fijos, como el pie: no cambian con el tema del site.
   "Aceptar" y "Rechazar" tienen el mismo tamaño y la misma posición de
   partida: rechazar no cuesta más que aceptar. */
@layer gp.componentes {
  .gp-cookies {
    --gp-c-fondo: var(--gp-blanco);
    --gp-c-texto: #1a1a1a;
    --gp-c-texto-suave: #4d4d4d;
    --gp-c-titulos: var(--gp-verde-oscuro);
    --gp-c-enlace: var(--gp-verde-oscuro);
    --gp-c-foco: #1a1a1a;
    --gp-c-borde-campo: #6b6b6b;
    width: min(100% - 2rem, 36rem);
    max-width: none;
    margin: auto; /* el reset quita el margen que centra el diálogo */
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
    padding: clamp(var(--gp-espacio-3), 5vw, var(--gp-espacio-4));
    border: 0;
    border-radius: var(--gp-radio);
    background: var(--gp-c-fondo);
    color: var(--gp-c-texto);
    font-family: var(--gp-fuente-texto);
    font-size: var(--gp-texto-pequeno);
    line-height: 1.5;
    box-shadow: 0 0.5rem 2rem rgb(0 0 0 / 0.35);
  }
  .gp-cookies::backdrop { background: rgb(0 0 0 / 0.6); }
  .gp-cookies p { max-width: none; }
  .gp-cookies__titulo {
    font-family: var(--gp-fuente-texto);
    font-size: var(--gp-titulo-3);
    color: var(--gp-c-titulos);
  }
  .gp-cookies__titulo:focus { outline: none; }
  .gp-cookies__botones {
    display: flex;
    flex-wrap: wrap;
    gap: var(--gp-espacio-2);
    margin-top: var(--gp-espacio-4);
  }
  .gp-cookies__boton {
    flex: 1 1 7rem;
    min-height: var(--gp-objetivo-tactil);
    padding: var(--gp-espacio-2) var(--gp-espacio-3);
    border: 2px solid var(--gp-verde-oscuro);
    border-radius: var(--gp-radio);
    background: var(--gp-blanco);
    color: var(--gp-verde-oscuro);
    font-size: var(--gp-texto-base);
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
  }
  .gp-cookies__boton--principal { background: var(--gp-verde-oscuro); color: var(--gp-blanco); }
  .gp-cookies__boton:hover { text-decoration: underline; }
  .gp-cookies__categorias {
    display: grid;
    gap: var(--gp-espacio-3);
    margin-top: var(--gp-espacio-4);
  }
  .gp-cookies .gp-campo label { font-weight: 700; }
  .gp-cookies__descripcion {
    grid-column: 2;
    margin: 0 !important;
    color: var(--gp-c-texto-suave);
  }
  .gp-cookies__categorias .gp-cookies__botones { margin-top: 0; }
}

/* ---------- Formularios ---------- */
@layer gp.componentes {
  .gp-formulario {
    display: grid;
    gap: var(--gp-espacio-4);
    max-width: 32rem;
  }
  .gp-formulario p { max-width: none; margin: 0; }
  .gp-formulario__nota { font-size: var(--gp-texto-pequeno); color: var(--gp-c-texto-suave); }

  .gp-campo { display: grid; gap: var(--gp-espacio-1); }
  .gp-campo label { font-weight: 600; }
  .gp-campo__opcional { font-weight: 400; color: var(--gp-c-texto-suave); }

  .gp-campo input:not([type="checkbox"]) {
    width: 100%;
    min-height: 3rem;
    padding: 0.625rem 0.75rem;
    border: 2px solid var(--gp-c-borde-campo);
    border-radius: calc(var(--gp-radio) / 2);
    background: var(--gp-c-fondo);
    color: var(--gp-c-texto);
    font-size: max(16px, 1em); /* menos de 16 px hace que iOS amplíe la página */
  }
  .gp-campo input.gp-campo--corto { max-width: 12rem; }
  .gp-campo input[aria-invalid="true"] { border-color: var(--gp-c-error); border-width: 3px; }

  /* Autocompletado: mantener los colores del tema (Chrome y Safari pintan su fondo). */
  .gp-campo input:-webkit-autofill {
    -webkit-text-fill-color: var(--gp-c-texto);
    box-shadow: 0 0 0 100px var(--gp-c-fondo) inset;
  }

  .gp-campo__error {
    color: var(--gp-c-error);
    font-size: var(--gp-texto-pequeno);
    font-weight: 700;
  }
  .gp-campo__error::before { content: "⚠ "; }

  .gp-campo--casilla {
    grid-template-columns: auto 1fr;
    align-items: start;
    column-gap: var(--gp-espacio-3);
  }
  .gp-campo--casilla input {
    width: 1.5rem;
    height: 1.5rem;
    margin: 0.1rem 0 0;
    accent-color: var(--gp-c-texto);
  }
  .gp-campo--casilla label { font-weight: 400; }
  .gp-campo--casilla .gp-campo__error { grid-column: 2; }

  .gp-formulario__privacidad { font-size: var(--gp-texto-pequeno); }

  /* Error al enviar, debajo del botón. Vacío no ocupa espacio. */
  .gp-formulario__estado {
    color: var(--gp-c-error);
    font-weight: 700;
  }
  .gp-formulario__estado:empty { display: none; }
  .gp-formulario[aria-busy="true"] button[type="submit"] { cursor: progress; }

  /* Pantalla de gracias: recibe el foco al mostrarse, sin marco alrededor de toda la sección. */
  .gp-gracias:focus { outline: none; }
}

/* ---------- Imágenes (shortcode gpImagen) ---------- */
@layer gp.componentes {
  .gp-imagen { display: block; }
  .gp-imagen img { width: 100%; height: auto; }
  /* Con proporción: recorta la foto para que ocupe ese hueco. */
  .gp-imagen[style*="--gp-proporcion"] img {
    aspect-ratio: var(--gp-proporcion);
    object-fit: cover;
  }
  .gp-imagen--pendiente {
    display: grid;
    place-items: center;
    aspect-ratio: var(--gp-proporcion, 4 / 3);
    padding: var(--gp-espacio-4);
    border: 2px dashed #6b6b6b;
    background: repeating-linear-gradient(45deg, #ecebe4 0 12px, #e2e0d6 12px 24px);
    color: #1a1a1a;
    font-size: var(--gp-texto-pequeno);
    font-weight: 600;
    text-align: center;
  }
  .gp-imagen--pendiente p { margin: 0; }
}

/* ---------- Política de privacidad, cookies y aviso legal ---------- */
@layer gp.componentes {
  .gp-privacidad { padding-block: var(--gp-espacio-7); }
  .gp-privacidad h2 { margin-top: var(--gp-espacio-7); scroll-margin-top: var(--gp-espacio-4); }
  .gp-privacidad h3 { margin-top: var(--gp-espacio-5); }
  .gp-privacidad nav { margin-top: var(--gp-espacio-4); }
  /* Tablas de cookies. En pantallas estrechas, cada cookie es una ficha con
     las etiquetas delante (data-etiqueta). Por si algo no cabe, la caja se
     desplaza en horizontal y recibe el foco, para hacerlo con el teclado. */
  .gp-privacidad__tabla {
    margin-top: var(--gp-espacio-4);
    max-width: 100%;
    overflow-x: auto;
  }
  .gp-privacidad table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--gp-texto-pequeno);
  }
  .gp-privacidad caption {
    padding-bottom: var(--gp-espacio-2);
    font-weight: 700;
    text-align: left;
  }
  .gp-privacidad th, .gp-privacidad td {
    padding: var(--gp-espacio-2);
    border: 1px solid var(--gp-c-borde-campo);
    text-align: left;
    vertical-align: top;
  }
  .gp-privacidad thead th { background: var(--gp-c-superficie); }
  .gp-privacidad tbody th { font-weight: 400; }
  .gp-privacidad code { font-weight: 700; overflow-wrap: anywhere; }
  .gp-privacidad__tipo { color: var(--gp-c-texto-suave); }
  @media (max-width: 39.99rem) {
    .gp-privacidad table, .gp-privacidad tbody, .gp-privacidad tr,
    .gp-privacidad th, .gp-privacidad td { display: block; }
    .gp-privacidad caption { display: block; }
    /* La cabecera de la tabla se oculta a la vista, pero no a los lectores de pantalla. */
    .gp-privacidad thead {
      position: absolute;
      width: 1px;
      height: 1px;
      overflow: hidden;
      clip-path: inset(50%);
      white-space: nowrap;
    }
    .gp-privacidad tr { border: 1px solid var(--gp-c-borde-campo); }
    .gp-privacidad tr + tr { margin-top: var(--gp-espacio-3); }
    .gp-privacidad th, .gp-privacidad td { border: 0; padding-block: var(--gp-espacio-1); }
    .gp-privacidad tbody th { background: var(--gp-c-superficie); padding-block: var(--gp-espacio-2); }
    .gp-privacidad td[data-etiqueta]::before { content: attr(data-etiqueta) ": "; font-weight: 700; }
  }
}

/* ---------- Botones para compartir ---------- */
@layer gp.componentes {
  .gp-compartir p { margin: 0; max-width: none; }
  .gp-compartir__titulo { font-weight: 700; margin-bottom: var(--gp-espacio-2) !important; }
  .gp-compartir__lista {
    display: flex;
    flex-wrap: wrap;
    gap: var(--gp-espacio-2);
    margin: 0;
    padding: 0;
    max-width: none;
    list-style: none;
  }
  .gp-compartir__lista li { margin: 0; }
  .gp-compartir__boton {
    display: inline-flex;
    align-items: center;
    min-height: var(--gp-objetivo-tactil);
    padding: 0 var(--gp-espacio-3);
    border: 2px solid currentColor;
    border-radius: var(--gp-radio);
    background: transparent;
    color: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
  }
  .gp-compartir__boton:hover { background: var(--gp-c-superficie); }
  .gp-compartir__aviso:not(:empty) { margin-top: var(--gp-espacio-2) !important; font-weight: 600; }
}

/* ---------- Utilidades ---------- */
@layer gp.utilidades {
  /* Contenedor centrado con márgenes laterales. */
  .gp-contenedor {
    width: min(100% - 2 * var(--gp-margen-lateral), var(--gp-ancho-max));
    margin-inline: auto;
  }

  /* Sección con espacio vertical. */
  .gp-seccion { padding-block: var(--gp-espacio-7); }
  /* Pantalla de gracias con sus propias secciones: ellas ponen el espacio. */
  .gp-gracias:has(> .gp-seccion) { padding-block: 0; }
  .gp-seccion--superficie { background: var(--gp-c-superficie); }

  /* Zona oscura: cambia los colores de todo lo que contiene. */
  .gp-oscuro {
    --gp-c-fondo: var(--gp-c-fondo-oscuro);
    --gp-c-texto: var(--gp-c-texto-sobre-oscuro);
    --gp-c-texto-suave: var(--gp-c-texto-sobre-oscuro);
    --gp-c-titulos: var(--gp-c-texto-sobre-oscuro);
    --gp-c-enlace: var(--gp-c-texto-sobre-oscuro);
    --gp-c-foco: var(--gp-c-texto-sobre-oscuro);
    --gp-c-borde-campo: var(--gp-c-texto-sobre-oscuro);
    --gp-c-error: var(--gp-c-texto-sobre-oscuro);
    background: var(--gp-c-fondo);
    color: var(--gp-c-texto);
  }

  /*
   * Texto sobre foto: el velo garantiza al menos 4,5:1 con texto blanco sobre
   * cualquier foto (negro al 55 % o más). No bajar de 0.55 en --gp-color-velo.
   */
  .gp-sobre-foto {
    background: var(--gp-c-velo);
    color: #ffffff;
    --gp-c-titulos: #ffffff;
    --gp-c-enlace: #ffffff;
    --gp-c-foco: #ffffff;
  }

  /* Botón de llamada a la acción. Sirve para <a> y <button>. */
  .gp-boton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--gp-espacio-2);
    min-height: var(--gp-objetivo-tactil);
    padding: var(--gp-espacio-2) var(--gp-espacio-4);
    border: 2px solid var(--gp-c-accion-borde);
    border-radius: var(--gp-radio);
    background: var(--gp-c-accion);
    color: var(--gp-c-accion-texto);
    font-weight: 700;
    font-size: var(--gp-texto-grande);
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }
  .gp-boton:hover { transform: translateY(-1px); box-shadow: 0 3px 0 var(--gp-c-accion-borde); }
  .gp-boton:active { transform: translateY(0); box-shadow: none; }
  .gp-boton--ancho { width: 100%; }

  /* Texto solo para lectores de pantalla. */
  .gp-solo-lectores {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }

  /* Enlace para saltar al contenido: primer elemento del <body>. */
  .gp-saltar {
    position: absolute;
    top: var(--gp-espacio-2);
    left: var(--gp-espacio-2);
    z-index: 1000;
    padding: var(--gp-espacio-2) var(--gp-espacio-3);
    background: var(--gp-blanco);
    color: var(--gp-negro);
    font-weight: 700;
    transform: translateY(-200%);
  }
  .gp-saltar:focus { transform: none; }

  /* Pila con espacio vertical uniforme entre hijos. */
  .gp-pila > * + * { margin-top: var(--gp-espacio-3); }
}
