/**
 * ═══════════════════════════════════════════════════════════
 * BLACK BIRD — Base Styles
 * Reset moderno + estilos globales
 * ═══════════════════════════════════════════════════════════
 */

/* ─── CSS Reset Moderno ───────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 100%;               /* 16px base */
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  hanging-punctuation: first last;
}

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

body {
  font-family: var(--bb-font-sans);
  font-size: var(--bb-text-base);
  font-weight: var(--bb-weight-regular);
  line-height: var(--bb-leading-relaxed);
  color: var(--bb-text-primary);
  background-color: var(--bb-color-gray-10);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
  text-align: left; /* Justificado a la izquierda solicitado */
}

/* ─── Tipografía base ─────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--bb-font-sans);
  font-weight: var(--bb-weight-semibold);
  line-height: var(--bb-leading-tight);
  letter-spacing: var(--bb-tracking-tight);
  color: var(--bb-text-primary);
}

p {
  max-width: 70ch;
  color: var(--bb-text-secondary);
}

a {
  color: var(--bb-color-blue-primary);
  text-decoration: none;
  transition: color var(--bb-duration-base) var(--bb-ease-out);
}

a:hover {
  color: var(--bb-color-blue-mid);
}

a:focus-visible {
  outline: 2px solid var(--bb-color-blue-primary);
  outline-offset: 3px;
  border-radius: var(--bb-radius-sm);
}

/* ─── Listas ──────────────────────────────────────────────── */
ul, ol {
  list-style: none;
}

/* ─── Imágenes ────────────────────────────────────────────── */
img, video, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ─── Formularios base ────────────────────────────────────── */
input, textarea, select, button {
  font-family: inherit;
  font-size: inherit;
}

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

/* ─── Tablas accesibles ───────────────────────────────────── */
table {
  border-collapse: collapse;
}

/* ─── Código ──────────────────────────────────────────────── */
code, pre {
  font-family: var(--bb-font-mono);
  font-size: var(--bb-text-sm);
}

/* ─── Focus global visible ────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--bb-color-blue-primary);
  outline-offset: 3px;
}

/* ─── Skip link accesibilidad ─────────────────────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--bb-space-4);
  z-index: var(--bb-z-toast);
  padding: var(--bb-space-2) var(--bb-space-4);
  background: var(--bb-color-blue-primary);
  color: var(--bb-text-inverse);
  font-size: var(--bb-text-sm);
  font-weight: var(--bb-weight-semibold);
  border-radius: var(--bb-radius-md);
  transition: top var(--bb-duration-fast);
}

.skip-link:focus {
  top: var(--bb-space-4);
}

/* ─── Utilidades de accesibilidad ────────────────────────────*/
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ─── Selección de texto ──────────────────────────────────── */
::selection {
  background-color: var(--bb-color-blue-tint);
  color: var(--bb-color-blue-primary);
}
