/* ============================================================
   SCHOOLARYX — Base CSS
   Reset, tipografía base, scrollbar personalizada
   ============================================================ */

/* === RESET & BOX MODEL === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* === SCROLLBAR PERSONALIZADA === */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(48,47,59,0.2); border-radius: var(--radius-pill); }
::-webkit-scrollbar-thumb:hover { background: rgba(48,47,59,0.35); }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); }

/* === BODY === */
body {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--sx-text-body);
  background-color: var(--sx-body-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* === TIPOGRAFÍA === */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--font-display);
  color: var(--sx-text-heading);
  line-height: 1.3;
  font-weight: 700;
}

/* Override para headings con Nunito cuando se necesita */
.fw-heading { font-family: var(--font-body); font-weight: 800; }

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

a {
  color: var(--sx-primary);
  text-decoration: none;
  transition: var(--transition-fast);
}
a:hover { color: var(--sx-primary-dark); text-decoration: none; }

/* === LEAD === */
.lead {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--sx-text-body);
}

/* === DISPLAY SIZES === */
.display-1 { font-family: var(--font-display); font-size: 5rem; }
.display-2 { font-family: var(--font-display); font-size: 4.5rem; }
.display-3 { font-family: var(--font-display); font-size: 4rem; }
.display-4 { font-family: var(--font-display); font-size: 3.5rem; }
.display-5 { font-family: var(--font-display); font-size: 3rem; }
.display-6 { font-family: var(--font-display); font-size: 2.5rem; }

/* === BLOCKQUOTE === */
blockquote, .blockquote {
  border-left: 4px solid var(--sx-primary);
  padding: 1rem 1.5rem;
  background: var(--sx-primary-light);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--sx-text-body);
}
.blockquote-footer { color: var(--sx-text-muted); font-size: 0.8rem; }

/* === CODE === */
code {
  background: var(--sx-primary-light);
  color: var(--sx-primary-dark);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-xs);
  font-size: 0.85em;
  font-family: var(--font-mono);
}

pre {
  background: var(--sx-dark);
  color: #e8e8f0;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.85rem;
  font-family: var(--font-mono);
  line-height: 1.7;
}
pre code {
  background: none;
  color: inherit;
  padding: 0;
  border-radius: 0;
}

/* === LISTAS === */
ul, ol { padding-left: 1.5rem; }
li { margin-bottom: 0.35rem; }
.list-unstyled { padding-left: 0; list-style: none; }
.list-unstyled li { margin-bottom: 0; }

/* === MARK === */
mark, .mark {
  background-color: var(--sx-yellow-light);
  color: var(--sx-yellow-dark);
  padding: 0.1em 0.3em;
  border-radius: var(--radius-xs);
}

/* === HR === */
hr {
  border-color: var(--sx-border-color);
  opacity: 1;
  margin: 1.5rem 0;
}

/* === SELECTION === */
::selection {
  background: rgba(var(--sx-primary-rgb), 0.2);
  color: var(--sx-primary-dark);
}

/* === TEXTO UTILITARIOS === */
.text-primary    { color: var(--sx-primary) !important; }
.text-success    { color: var(--sx-success) !important; }
.text-warning    { color: var(--sx-warning) !important; }
.text-danger     { color: var(--sx-danger) !important; }
.text-info       { color: var(--sx-info) !important; }
.text-purple     { color: var(--sx-purple) !important; }
.text-muted      { color: var(--sx-text-muted) !important; }
.text-heading    { color: var(--sx-text-heading) !important; }
.text-body-color { color: var(--sx-text-body) !important; }

/* === SMOOTH SCROLL === */
html { scroll-behavior: smooth; }

/* === IMÁGENES === */
img { max-width: 100%; height: auto; }

/* === FOCUS RING PERSONALIZADO === */
:focus-visible {
  outline: 2px solid var(--sx-primary);
  outline-offset: 2px;
}

/* === ABBR === */
abbr[title] {
  text-decoration: underline dotted;
  cursor: help;
}
