/**
 * GR58 Design System - base.css
 * Reset moderno, jerarquía tipográfica, estilos base y reglas de accesibilidad WCAG AA.
 */

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

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

body {
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--text-primary);
  background-color: var(--bg-base);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 1. ENLACES Y ACCESIBILIDAD POR TECLADO */
a {
  color: inherit;
  text-decoration: none;
  transition: color var(--trans-fast), background-color var(--trans-fast), border-color var(--trans-fast);
}

:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg-base), 0 0 0 5px var(--focus-ring);
  border-radius: var(--radius-sm);
}

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

/* 2. JERARQUÍA TIPOGRÁFICA */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: var(--font-weight-extrabold);
  line-height: var(--line-height-tight);
  letter-spacing: -0.02em;
}

h1 {
  font-size: var(--font-size-3xl);
  margin-bottom: var(--space-4);
}

h2 {
  font-size: var(--font-size-2xl);
  margin-bottom: var(--space-4);
}

h3 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-2);
}

h4 {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-2);
}

p {
  color: var(--text-muted);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  margin-bottom: var(--space-4);
}

p:last-child {
  margin-bottom: 0;
}

p.lead {
  font-size: var(--font-size-md);
  line-height: var(--line-height-snug);
  font-weight: var(--font-weight-medium);
}

p.hint {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  font-weight: var(--font-weight-medium);
}

/* 3. RESALTADOS DE COLOR EN TITULARES (Regla: solo 1 palabra por titular) */
.highlight {
  color: var(--brand-accent); /* Tobiko Orange sobre claro */
  display: inline-block;
}

.text-dark .highlight,
.bg-dark .highlight,
.bg-invert .highlight {
  color: var(--brand-highlight); /* Sneezeweeds sobre oscuro */
}

/* 4. ETIQUETAS Y ANTETÍTULOS */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--brand-primary);
  margin-bottom: var(--space-3);
}

.eyebrow::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 2px;
  background-color: var(--brand-primary);
}

.bg-dark .eyebrow,
.bg-invert .eyebrow {
  color: var(--brand-highlight);
}

.bg-dark .eyebrow::before,
.bg-invert .eyebrow::before {
  background-color: var(--brand-highlight);
}

/* 5. ENLACES EN LÍNEA */
.link-inline {
  color: var(--brand-accent);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
  font-weight: var(--font-weight-medium);
  transition: color var(--trans-fast), text-decoration-color var(--trans-fast);
}

.link-inline:hover {
  color: var(--text-primary);
  text-decoration-color: var(--text-primary);
}

/* 6. CITAS DESTACADAS (BLOCKQUOTE) */
.quote-highlight {
  position: relative;
  font-style: italic;
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  padding: var(--space-3) var(--space-4);
  border-left: 3px solid var(--brand-highlight);
  background-color: rgba(242, 182, 53, 0.08);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: var(--space-4) 0;
}

.quote-highlight .quote-subline {
  display: block;
  font-style: normal;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-regular);
  color: var(--text-secondary);
  margin-top: var(--space-1);
}

/* 7. ELEMENTOS MULTIMEDIA */
img,
video,
svg {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

figure {
  margin: 0;
}

figcaption {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  margin-top: var(--space-2);
}

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