/* ============================================================================
   SOLOVINO.PET — Reset Moderno y Accesibilidad Base (02-reset.css)
   Dependencia: 01-tokens.css
   Regla: Cero colores HEX y cero píxeles mágicos; foco accesible WCAG AA.
   ============================================================================ */

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

/* Prevención de reajuste de texto en iOS y desplazamiento suave */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

/* Lienzo base de la aplicación */
body {
  margin: 0;
  min-height: 100dvh;
  background-color: var(--color-bg-canvas);
  color: var(--color-text-body);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Reseteo de márgenes por defecto en bloques tipográficos */
h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

/* Jerarquía de encabezados con soporte multilingüe */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--color-text-primary);
  font-weight: 800;
  line-height: var(--leading-tight);
  letter-spacing: -0.02em;
  overflow-wrap: break-word;
}

h1 {
  font-size: var(--text-3xl);
}

h2 {
  font-size: var(--text-2xl);
}

h3 {
  font-size: var(--text-xl);
  font-weight: 700;
}

h4 {
  font-size: var(--text-lg);
  font-weight: 700;
}

h5,
h6 {
  font-size: var(--text-base);
  font-weight: 700;
  letter-spacing: 0;
}

p,
li {
  overflow-wrap: break-word;
}

/* Listas sin viñetas cuando tienen rol semántico explícito */
ul[role="list"],
ol[role="list"] {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Enlaces accesibles (WCAG AA sobre blanco y lienzo -> --sv-teal-700) */
a {
  color: var(--color-primary-text);
  text-decoration-thickness: var(--border-width-thin);
  text-underline-offset: var(--space-1);
  transition: color 150ms ease;
}

a:hover {
  color: var(--color-text-primary);
}

/* Medios embebidos responsivos */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

/* Iconos SVG inline (.sv-icon) mantienen alineación limpia dentro de texto/botones */
svg.sv-icon {
  display: inline-block;
  flex-shrink: 0;
  vertical-align: middle;
}

/* Herencia tipográfica en controles de formulario */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

button {
  padding: 0;
  border: 0;
  background-color: transparent;
  cursor: pointer;
}

textarea {
  resize: vertical;
}

/* Tablas limpias */
table {
  width: 100%;
  border-collapse: collapse;
}

hr {
  margin: var(--space-5) 0;
  border: 0;
  border-top: var(--border-width-thin) solid var(--color-border-subtle);
}

code,
pre,
kbd,
samp {
  font-family: var(--font-mono);
}

/* Respeto estricto al atributo hidden */
[hidden] {
  display: none !important;
}

/* --------------------------------------------------------------------------
   FOCO ACCESIBLE (:focus-visible)
   -------------------------------------------------------------------------- */
:focus:not(:focus-visible) {
  outline: none;
}

:focus-visible {
  outline: var(--border-width-ink) solid var(--color-primary-text);
  outline-offset: var(--border-width-ink);
  box-shadow: var(--shadow-focus);
  border-radius: var(--radius-sm);
}

/* --------------------------------------------------------------------------
   UTILIDADES DE ACCESIBILIDAD Y TIPOGRAFÍA DE MARCA
   -------------------------------------------------------------------------- */
.sr-only {
  position: absolute;
  width: var(--border-width-thin);
  height: var(--border-width-thin);
  padding: 0;
  margin: calc(var(--border-width-thin) * -1);
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: calc(var(--space-8) * -2);
  left: var(--space-4);
  z-index: var(--z-toast);
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-target-min);
  padding: var(--space-2) var(--space-4);
  background-color: var(--color-text-primary);
  color: var(--color-text-inverse);
  border-radius: var(--radius-md);
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus-visible {
  top: var(--space-3);
  color: var(--color-text-inverse);
}

.sv-font-brand {
  font-family: var(--font-brand);
  letter-spacing: 0;
}

.sv-font-mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.sv-text-muted {
  color: var(--color-text-muted);
}

.sv-text-accent {
  color: var(--color-primary-text);
}

/* --------------------------------------------------------------------------
   PREFERENCIA DE MOVIMIENTO REDUCIDO
   -------------------------------------------------------------------------- */
@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;
  }
}
