/* ==========================================================
   amPARo · base
   Reset, superficies del navegador, celular y estructura.
   ========================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent; /* sin destello gris al tocar */
  scroll-behavior: smooth;
  scroll-padding-top: 6.5rem; /* alto del encabezado fijo en desktop */
}

body {
  margin: 0;
  min-height: 100svh;
  background: var(--blanco);
  color: var(--negro);
  font-family: var(--fuente-texto);
  font-size: var(--t-cuerpo);
  line-height: var(--interlineado-texto);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
figure,
blockquote {
  margin: 0;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
}

h1,
h2,
h3,
h4 {
  font-family: var(--fuente-display);
  font-weight: 700;
  line-height: var(--interlineado-titulo);
  letter-spacing: -0.01em;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

/* --- Superficies del navegador: también son diseño --- */

::selection {
  background: var(--celeste);
  color: var(--negro);
}

[data-capa="identificar"] ::selection {
  background: var(--blanco);
  color: var(--azul);
}

html {
  scrollbar-color: var(--azul) var(--blanco);
  accent-color: var(--azul);
  caret-color: var(--azul);
}

a {
  color: inherit;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.22em;
}

:focus-visible {
  outline: 3px solid var(--foco, var(--negro));
  outline-offset: 3px;
  border-radius: 4px;
}

/* --- Celular: que se sienta nativo --- */

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

input,
textarea,
select {
  font-size: max(16px, 1em); /* 16px: iOS no hace zoom al tocar */
}

button,
a,
[role="button"],
label {
  touch-action: manipulation; /* sin demora de 300 ms */
}

button,
[role="button"],
.boton,
.barra__item {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

button {
  cursor: pointer;
}

/* "hidden" siempre oculta, aunque un componente tenga su propio display */
[hidden] {
  display: none !important;
}

/* --- Estructura --- */

.contenedor {
  width: min(100% - 2 * var(--margen), var(--ancho-max));
  margin-inline: auto;
}

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

.saltar {
  position: absolute;
  left: var(--e-4);
  top: var(--e-3);
  z-index: 100;
  padding: var(--e-3) var(--e-4);
  background: var(--negro);
  color: var(--blanco);
  font-weight: 800;
  border-radius: var(--r-chico);
  transform: translateY(-200%);
}

.saltar:focus-visible {
  transform: none;
}

/* Campo de capa: el color ocupa la sección entera, a sangre */
.campo {
  position: relative;
  background: var(--capa, var(--blanco));
  color: var(--capa-tinta, var(--negro));
}

/* --- Revisión de textos provisorios ---
   Agregá ?revisar a la URL para ver qué textos escribió Claude. */
.revisar [data-provisorio] {
  outline: 2px dashed var(--negro);
  outline-offset: 2px;
  background-color: rgb(255 255 255 / 0.001);
}

.revisar [data-capa="identificar"] [data-provisorio],
.revisar [data-capa="reconocer"] [data-provisorio] {
  outline-color: var(--blanco);
}

@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;
  }
}
