/* Exclivia · base.css — cimientos: tipografía, ritmo, utilidades.
 *
 * Todo se pinta con las variables de theme.css (--exc-*). Ningún color va
 * escrito a mano fuera de ese archivo generado: si aquí se cuela un #fff, el
 * modo noche se rompe y el panel del admin deja de servir para algo.
 */

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

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

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--exc-font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--exc-text);
  background: var(--exc-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Respeta a quien pidió menos movimiento en su sistema. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Tipografía ─────────────────────────────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 .5rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -.01em;
}

/* Títulos en sentence case y peso ligero: el uppercase se reserva para botones
   y badges, donde sí ayuda a distinguir. */
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 500; }
h2 { font-size: clamp(1.35rem, 3vw, 1.7rem); font-weight: 500; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.05rem; }

.exc-display {
  font-family: var(--exc-font-display);
  font-weight: 500;
  letter-spacing: -.02em;
}

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

a {
  color: var(--exc-accent);
  text-decoration: none;
  transition: color .15s ease, opacity .15s ease;
}
a:hover { opacity: .82; }

small, .exc-small { font-size: .82rem; }
.exc-muted { color: var(--exc-muted); }
.exc-accent-text { color: var(--exc-accent); }

hr, .exc-divider {
  border: 0;
  border-top: 1px solid var(--exc-border);
  margin: 1.25rem 0;
}

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

code, pre, kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .88em;
}
pre {
  background: var(--exc-surface-2);
  border: 1px solid var(--exc-border);
  border-radius: var(--exc-radius-sm);
  padding: .75rem 1rem;
  overflow-x: auto;
}

/* ── Contenedores ───────────────────────────────────────────────────────── */

.exc-container        { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: 1rem; }
.exc-container-narrow { max-width: 740px; }
.exc-container-wide   { max-width: 1440px; }

@media (min-width: 768px) {
  .exc-container { padding-inline: 1.5rem; }
}

/* ── Rejillas ───────────────────────────────────────────────────────────── */

.exc-grid { display: grid; gap: 1rem; }
.exc-grid-2 { grid-template-columns: 1fr; }
.exc-grid-3 { grid-template-columns: 1fr; }
.exc-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.exc-grid-auto { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

@media (min-width: 640px) {
  .exc-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .exc-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 992px) {
  .exc-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .exc-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.exc-row   { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.exc-stack { display: flex; flex-direction: column; gap: .75rem; }
.exc-between { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.exc-spacer { flex: 1 1 auto; }

/* ── Utilidades mínimas (lo demás lo pone Bootstrap) ────────────────────── */

.exc-hide { display: none !important; }

/* Ocultar en móvil SIN imponer cómo se muestra en escritorio: forzar
   display:block aquí rompía botones, celdas de tabla y textos truncados. */
@media (max-width: 767.98px) { .exc-only-desktop { display: none !important; } }
@media (min-width: 768px)    { .exc-only-mobile  { display: none !important; } }

.exc-text-center { text-align: center; }
.exc-nowrap      { white-space: nowrap; }
.exc-truncate    { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exc-mt-0 { margin-top: 0 !important; }
.exc-mb-0 { margin-bottom: 0 !important; }
.exc-mb-1 { margin-bottom: .5rem; }
.exc-mb-2 { margin-bottom: 1rem; }
.exc-mb-3 { margin-bottom: 1.5rem; }
.exc-mt-2 { margin-top: 1rem; }
.exc-mt-3 { margin-top: 1.5rem; }

/* Solo para lectores de pantalla. */
.exc-sr {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ── Foco visible ───────────────────────────────────────────────────────── */

:focus-visible {
  outline: 2px solid var(--exc-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection {
  background: rgba(var(--exc-accent-rgb), .3);
  color: var(--exc-text);
}

/* ── Barra de desplazamiento discreta ───────────────────────────────────── */

* { scrollbar-width: thin; scrollbar-color: var(--exc-border) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--exc-border); border-radius: 8px; }
