/*
 * qAccess — base: fuentes, reset, tipografía y utilidades.
 * Requiere tokens.css.
 */

/* Libre Franklin v3 variable (OFL 1.1), subconjunto latino. Archivos propios, sin CDN. */
@font-face {
  font-family: "Libre Franklin";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/ds/fonts/libre-franklin-latin-wght-bc34823f42d59bf550e99604c4a1cb08.woff2") format("woff2");
}
@font-face {
  font-family: "Libre Franklin";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("/ds/fonts/libre-franklin-latin-wght-italic-981ccd1aec0d259b9dc23e104df476f2.woff2") format("woff2");
}

/* ---------- Reset mínimo ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
img, svg, video, canvas { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
table { border-collapse: collapse; }
[hidden] { display: none !important; }
p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }

/* ---------- Documento ---------- */
body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--text-md);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, .h1 { font-size: var(--text-3xl); font-weight: var(--weight-semibold); line-height: var(--leading-tight); letter-spacing: -0.01em; }
h2, .h2 { font-size: var(--text-2xl); font-weight: var(--weight-semibold); line-height: var(--leading-tight); }
h3, .h3 { font-size: var(--text-xl); font-weight: var(--weight-semibold); line-height: var(--leading-tight); }
h4, .h4 { font-size: var(--text-lg); font-weight: var(--weight-semibold); line-height: var(--leading-tight); }
small, .text-sm { font-size: var(--text-sm); }
.text-xs { font-size: var(--text-xs); }
.overline {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

a {
  color: var(--color-accent-text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover { text-decoration-thickness: 2px; }

code, kbd, samp { font-family: var(--font-mono); font-size: 0.92em; }
code {
  padding: 0.1em 0.35em;
  background: var(--color-surface-2);
  border-radius: var(--radius-sm);
}

hr { border: 0; border-top: var(--border-width) solid var(--color-border); }

::selection { background: var(--color-accent); color: var(--color-on-accent); }

/* Foco visible y consistente en todo el portal */
:focus-visible {
  outline: var(--focus-width) solid var(--color-accent);
  outline-offset: 2px;
}

/* ---------- Íconos (sprite de Material Symbols) ----------
   <svg class="icon" aria-hidden="true"><use href="/icons/symbols.svg#search"/></svg> */
.icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  fill: currentColor;
}
.icon--sm { width: 1em; height: 1em; }
.icon--lg { width: 1.5em; height: 1.5em; }

/* ---------- Utilidades de layout ---------- */
.stack { display: flex; flex-direction: column; gap: var(--stack-gap, var(--space-4)); }
.stack--sm { --stack-gap: var(--space-2); }
.stack--lg { --stack-gap: var(--space-8); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--cluster-gap, var(--space-3)); }
.cluster--between { justify-content: space-between; }
.cluster--end { justify-content: flex-end; }
.cluster--nowrap { flex-wrap: nowrap; align-items: flex-start; }
.grid { display: grid; gap: var(--grid-gap, var(--space-4)); grid-template-columns: repeat(auto-fit, minmax(min(var(--grid-min, 14rem), 100%), 1fr)); }
.spacer { flex: 1; }

.text-muted { color: var(--color-text-muted); }
.text-subtle { color: var(--color-text-subtle); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-danger { color: var(--color-danger); }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

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

@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;
  }
}
