/* ===================================================================
 * RESET — limpieza moderna estilo Josh Comeau, adaptada al tema oscuro.
 * Cargado tras tokens.css.
 * =================================================================*/

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

* {
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

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

button {
  background: none;
  border: 0;
  cursor: pointer;
}

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
  hyphens: auto;
}

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

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex="0"]:focus-visible {
  outline: 2px solid var(--horreo-gold);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}

/* Quitar autocompletado amarillo de Chrome sobre fondo oscuro */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-text-fill-color: var(--horreo-text-primary);
  -webkit-box-shadow: 0 0 0 1000px var(--horreo-bg-secondary) inset;
  caret-color: var(--horreo-text-primary);
  transition: background-color 5000s ease-in-out 0s;
}

/* Selección de texto: dorado sobre negro */
::selection {
  background: var(--horreo-gold);
  color: var(--horreo-bg-primary);
}

/* Scrollbar oscura coherente con el tema (WebKit) */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--horreo-bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--horreo-gold-dim);
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--horreo-gold);
}

/* Skip link para accesibilidad (visible solo al recibir foco) */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: var(--z-tooltip);
  padding: var(--space-3) var(--space-5);
  background: var(--horreo-gold);
  color: var(--horreo-bg-primary);
  font-family: var(--horreo-font-body);
  font-weight: var(--fw-semibold);
}
.skip-link:focus {
  left: var(--space-4);
  top: var(--space-4);
}

/* Esconder visualmente sin perder a11y */
.screen-reader-text,
.sr-only {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}
