/* ============================================================
   DarCrist Base CSS v1.0
   Reset, estilos globales y fundamentos de accesibilidad.
   Depende de tokens.css — cargar DESPUÉS de tokens.css.
   ============================================================ */

/* ── RESET ────────────────────────────────────────────────── */

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

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

body {
  font-family: var(--dc-font);
  font-size: var(--dc-text-base);
  font-weight: var(--dc-fw-normal);
  line-height: var(--dc-leading-normal);
  color: var(--dc-text);
  background-color: var(--dc-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ── TIPOGRAFÍA ────────────────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--dc-font);
  font-weight: var(--dc-fw-bold);
  line-height: var(--dc-leading-tight);
  letter-spacing: var(--dc-tracking-snug);
  color: var(--dc-text);
}

h1 { font-size: clamp(var(--dc-text-4xl), 5vw, var(--dc-text-6xl)); font-weight: var(--dc-fw-black); }
h2 { font-size: clamp(var(--dc-text-3xl), 4vw, var(--dc-text-5xl)); }
h3 { font-size: clamp(var(--dc-text-xl),  3vw, var(--dc-text-3xl)); }
h4 { font-size: var(--dc-text-xl); }
h5 { font-size: var(--dc-text-lg); }
h6 { font-size: var(--dc-text-base); }

p {
  color: var(--dc-text-2);
  line-height: var(--dc-leading-normal);
  max-width: 68ch;
}

strong, b { font-weight: var(--dc-fw-semi); color: var(--dc-text); }
em, i     { font-style: italic; }

small { font-size: var(--dc-text-sm); }

/* ── ENLACES ───────────────────────────────────────────────── */

a {
  color: var(--dc-gold);
  text-decoration: none;
  transition: color var(--dc-t-fast);
}

a:hover { color: var(--dc-gold-light); }

a:focus-visible {
  outline: 2px solid var(--dc-gold);
  outline-offset: 3px;
  border-radius: var(--dc-r-xs);
}

/* ── LISTAS ────────────────────────────────────────────────── */

ul, ol { list-style: none; }

/* ── IMÁGENES / MEDIOS ─────────────────────────────────────── */

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

img {
  object-fit: cover;
  font-style: italic; /* alt text styling */
}

/* Lazy loading placeholder */
img[loading="lazy"] {
  background: var(--dc-surface);
}

/* ── FORMULARIOS ───────────────────────────────────────────── */

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--dc-gold);
  outline-offset: 2px;
}

::placeholder { color: var(--dc-text-faint); opacity: 1; }

/* ── SCROLLBAR (Webkit) ────────────────────────────────────── */

::-webkit-scrollbar             { width: 6px; height: 6px; }
::-webkit-scrollbar-track       { background: var(--dc-bg-2); }
::-webkit-scrollbar-thumb       { background: var(--dc-surface-3); border-radius: var(--dc-r-full); }
::-webkit-scrollbar-thumb:hover { background: var(--dc-surface-4); }

/* ── SELECCIÓN ─────────────────────────────────────────────── */

::selection {
  background: var(--dc-gold-dim);
  color: var(--dc-text);
}

/* ── ACCESIBILIDAD ─────────────────────────────────────────── */

/* Skip link para teclado */
.dc-skip-link {
  position: fixed;
  top: -100%;
  left: var(--dc-sp-4);
  z-index: calc(var(--dc-z-cursor) + 1);
  padding: var(--dc-sp-3) var(--dc-sp-6);
  background: var(--dc-gold);
  color: var(--dc-text-inv);
  font-weight: var(--dc-fw-bold);
  border-radius: var(--dc-r-md);
  transition: top var(--dc-t-fast);
}
.dc-skip-link:focus { top: var(--dc-sp-4); }

/* Focus ring global */
:focus-visible {
  outline: 2px solid var(--dc-gold);
  outline-offset: 3px;
}

/* No focus visible para mouse */
:focus:not(:focus-visible) { outline: none; }

/* ── UTILIDADES GLOBALES ───────────────────────────────────── */

/* Container centrado */
.dc-container {
  width: 100%;
  max-width: var(--dc-container);
  margin-inline: auto;
  padding-inline: var(--dc-section-px);
}

.dc-container--lg { max-width: var(--dc-container-lg); }
.dc-container--md { max-width: var(--dc-container-md); }
.dc-container--sm { max-width: var(--dc-container-sm); }

/* Sección espaciado vertical */
.dc-section {
  padding-block: var(--dc-section-py);
}

/* Visualmente oculto pero accesible */
.dc-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;
}

/* Texto truncado */
.dc-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Línea separadora */
.dc-divider {
  border: none;
  border-top: 1px solid var(--dc-line-2);
  margin-block: var(--dc-sp-8);
}

/* Reducción de movimiento */
@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;
  }
}
