/* ============================================================
   Reset, tipografía base y comportamiento táctil global
   ------------------------------------------------------------
   Capa: base
   Reúne, en este orden: 02-reset.css, 03-touch.css
   ============================================================ */

/* ═══════════════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  /* Compensa navbar fija + pills sticky: los anchors ya no quedan tapados */
  scroll-padding-top: calc(var(--navbar-h) + 70px);
}
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  font-size: 16px;
  transition: background var(--t), color var(--t);
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* ── SCROLLBAR ── */
html, body {
  scrollbar-width: thin;
  scrollbar-color: var(--accent) var(--bg2);
}
html::-webkit-scrollbar, body::-webkit-scrollbar { width: 5px; }
html::-webkit-scrollbar-track { background: var(--bg2); }
html::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }
*:not(html):not(body) { scrollbar-width: none; }
*:not(html):not(body)::-webkit-scrollbar { display: none; }
@media(max-width: 600px) {
  html, body { scrollbar-width: none; }
  html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; }
}

/* ═══════════════════════════════════════════════════
   TOUCH GLOBAL · v2.1
   - Eliminamos el delay de 300ms de iOS en elementos interactivos.
   - Quitamos el highlight gris feo de Safari al tocar.
═══════════════════════════════════════════════════ */
.nav-btn,
.section-header,
.ejercicio-pregunta,
.practica-header,
.practica-btn,
.toggle-all-btn,
#theme-toggle,
#btn-arriba,
.toc-dot,
.copy-latex-btn,
.feedback-btn,
.modal-bienv-btn,
.btn-google,
.btn-contacto,
.next-apunte,
.nav-back {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
