/* base.css — reset + tipografia base.
 *
 * - Body usa Inter (--font-content) por default; shell elements override pra mono.
 * - Selection accent.
 * - Focus visible com accent ring.
 */

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-content);
  font-size: var(--content-fs);
  line-height: var(--line-base);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: var(--accent-soft); text-decoration: underline; }

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--line-tight);
  letter-spacing: -0.015em;
  color: var(--fg-strong);
  margin: 0 0 var(--sp-3);
}

h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); }

p { margin: 0 0 var(--sp-3); }

code, pre, .mono {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

code {
  background: var(--bg-muted);
  padding: 1px 5px;
  border-radius: var(--r-sm);
  color: var(--fg-strong);
}

pre {
  background: var(--bg-muted);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  overflow-x: auto;
  font-size: var(--fs-sm);
}

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

/* [hidden]{display:none} vive en la hoja del NAVEGADOR, que pierde contra
   cualquier regla de autor. Basta un «display: grid» en la clase del elemento
   para que el atributo hidden deje de esconder nada — pasó con .topic-grid en
   la grilla del dashboard: el atributo estaba puesto y las 19 tarjetas seguían
   a la vista. El !important lo devuelve a ser la última palabra, que es lo que
   uno espera de hidden. */
[hidden] { display: none !important; }

button {
  font: inherit;
  cursor: pointer;
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--border);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-md);
  transition: background var(--transition-fast), border-color var(--transition-fast);
}
button:hover { background: var(--bg-muted); border-color: var(--border-strong); }
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

input, textarea, select {
  font: inherit;
  background: var(--bg-muted);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-2) var(--sp-3);
}
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

ul, ol { padding-left: var(--sp-5); }
li { margin-bottom: var(--sp-1); }

table {
  border-collapse: collapse;
  width: 100%;
  margin: var(--sp-3) 0;
  font-size: var(--fs-sm);
}
th, td {
  text-align: left;
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--border);
}
th {
  color: var(--fg-strong);
  font-weight: 600;
  background: var(--bg-elev);
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--sp-6) 0;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--r-md); }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }
