@charset "UTF-8";
/* mejorar-apuntes · tema visual: aula */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Fraunces:opsz,wght@9..144,600;9..144,700&display=swap');

/* ===========================================================
   TEMA "AULA" — editorial claro
   Inter (cuerpo) + Fraunces (titulares) · índigo y verde petróleo
   Radios amplios, sombras suaves, código sobre panel oscuro.
   Copiado por la skill como <SIGLAS>\styles.css — no editar aquí
   por tema: los cambios se hacen en la skill y se refrescan con
   scaffold.ps1 -Force.
   =========================================================== */

:root {
  /* superficie */
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-alt: #f0f2f7;
  --border: #e6e8ef;
  --text: #171a23;
  --text-muted: #5c6478;
  --text-faint: #98a0b0;

  /* color de marca */
  --primary: #4338ca;
  --primary-dark: #3730a3;
  --primary-light: #eeecfd;
  --primary-border: #ddd9fb;
  --accent: #0f766e;
  --accent-light: #e4f4f1;
  --accent-border: #c2e6e0;

  /* semánticos */
  --warning: #b45309;
  --warning-light: #fef3e2;
  --danger: #be123c;
  --danger-light: #fdeaef;
  --info: #0369a1;
  --info-light: #e5f4fd;

  /* código */
  --code-bg: #171a23;
  --code-text: #e6e9f5;
  --code-bar-bg: rgba(255,255,255,.05);
  --code-bar-text: #9aa3c0;
  --code-inline-bg: #f0f2f7;
  --code-inline-text: #4338ca;

  /* forma */
  --radius: 14px;
  --radius-sm: 9px;
  --radius-pill: 99px;
  --bw: 1px;
  --shadow: 0 1px 2px rgba(20,24,40,.04), 0 6px 18px rgba(20,24,40,.05);
  --dot-radius: 50%;
  --bar-fill: linear-gradient(90deg, #4338ca, #0f766e);
  --bar-h: 8px;

  /* casillas */
  --check-bg: #ffffff;
  --check-border: #c2c8d6;
  --check-bg-on: #0f766e;
  --check-border-on: #0f766e;
  --check-tick: #ffffff;
  --check-radius: 5px;
  --check-shadow: none;

  /* tipografía */
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-head: "Fraunces", Georgia, "Times New Roman", serif;
  --font-code: "Cascadia Code", "JetBrains Mono", Consolas, "Courier New", monospace;
  --head-weight: 600;
  --head-transform: none;
  --head-spacing: -0.01em;

  --sidebar-w: 272px;
  --content-max: 880px;
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  font-size: 15.5px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; align-items: flex-start; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--surface);
  border-right: var(--bw) solid var(--border);
  padding: 22px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.sidebar:empty { display: none; }

/* marca con tesela de color a la izquierda */
.brand {
  display: grid;
  grid-template-columns: 30px 1fr;
  column-gap: 10px;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: var(--bw) solid var(--border);
}
.brand::before {
  content: "";
  grid-column: 1;
  grid-row: 1 / span 3;
  width: 30px; height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
}
.brand > * { grid-column: 2; }
.brand .kicker {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--primary);
}
.brand h1 {
  font-family: var(--font-head);
  font-weight: var(--head-weight);
  font-size: 16px;
  margin: 2px 0 0;
  line-height: 1.3;
}
.brand .sub { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }

/* ---------- Progreso del tema ---------- */
.overall-progress { display: flex; flex-direction: column; gap: 8px; }
.level-pill {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11.5px; color: var(--text-muted);
}
.level-name { font-weight: 600; }
.level-pct { font-weight: 700; color: var(--primary); }
.overall-progress .label {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--text-muted);
}
.overall-progress .label strong { color: var(--text); }
.bar-track {
  height: var(--bar-h);
  background: var(--surface-alt);
  border: var(--bw) solid var(--border);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  width: 0%;
  background: var(--bar-fill);
  border-radius: var(--radius-pill);
  transition: width .35s ease;
}

/* ---------- Navegación ---------- */
nav.tasklist { display: flex; flex-direction: column; gap: 3px; }
nav.tasklist .nav-heading {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-faint); margin: 10px 4px 2px;
}
nav.tasklist a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  border: var(--bw) solid transparent;
  color: var(--text); font-size: 13.5px; font-weight: 500;
}
nav.tasklist a:hover { background: var(--surface-alt); text-decoration: none; }
nav.tasklist a.active {
  background: var(--primary-light);
  border-color: var(--primary-border);
  color: var(--primary);
  font-weight: 700;
}
nav.tasklist a .dot {
  width: 22px; height: 22px; flex-shrink: 0;
  border-radius: var(--dot-radius);
  background: var(--surface-alt);
  border: var(--bw) solid var(--border);
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}
nav.tasklist a.active .dot { background: var(--primary); border-color: var(--primary); color: #fff; }
nav.tasklist a.done .dot { background: var(--accent); border-color: var(--accent); color: #fff; }
nav.tasklist a.done .dot .dotnum { display: none; }
nav.tasklist a.done .dot::after { content: "✓"; }
nav.tasklist a .navlabel { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
nav.tasklist a .navcount { font-size: 10.5px; color: var(--text-faint); font-weight: 700; flex-shrink: 0; }
nav.tasklist a.done .navcount { color: var(--accent); }

.sidebar-footer {
  margin-top: auto; padding-top: 12px;
  border-top: var(--bw) solid var(--border);
  display: flex; flex-direction: column; gap: 8px;
}
.sidebar-footer a.source-link { font-size: 11.5px; color: var(--text-faint); }
.theme-btn {
  display: flex; align-items: center; gap: 8px;
  font-family: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
  background: var(--surface-alt);
  border: var(--bw) solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text);
  padding: 6px 12px;
}
.theme-btn:hover { border-color: var(--primary); color: var(--primary); }
.theme-btn .theme-ico { font-size: 14px; line-height: 1; }
.reset-btn {
  font-family: inherit; font-size: 11.5px; color: var(--danger);
  background: none; border: none; cursor: pointer; text-align: left; padding: 4px;
}
.reset-btn:hover { text-decoration: underline; }

/* ---------- Contenido ---------- */
main.content { flex: 1; min-width: 0; padding: 40px 32px 80px; display: flex; justify-content: center; }
.content-inner { width: 100%; max-width: var(--content-max); }

.page-header { margin-bottom: 28px; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600; padding: 4px 11px;
  border-radius: var(--radius-pill);
  background: var(--primary-light); color: var(--primary);
  border: var(--bw) solid var(--primary-border);
}
.badge.accent { background: var(--accent-light); color: var(--accent); border-color: var(--accent-border); }
.badge.muted { background: var(--surface-alt); color: var(--text-muted); border-color: var(--border); }

.page-header h1 {
  font-family: var(--font-head);
  font-weight: var(--head-weight);
  text-transform: var(--head-transform);
  letter-spacing: var(--head-spacing);
  font-size: 28px; margin: 0 0 8px; line-height: 1.25;
}
.page-header .lead { font-size: 16px; color: var(--text-muted); max-width: 66ch; }

.task-progress {
  margin-top: 18px;
  background: var(--surface);
  border: var(--bw) solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
}
.task-progress .label { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 8px; }
.task-progress .label strong { color: var(--primary); }

section.block {
  background: var(--surface);
  border: var(--bw) solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  margin-bottom: 20px;
}
section.block h2 {
  font-family: var(--font-head);
  font-weight: var(--head-weight);
  text-transform: var(--head-transform);
  font-size: 18px; margin: 0 0 4px;
  display: flex; align-items: center; gap: 9px;
}
section.block h2 .num {
  width: 26px; height: 26px; flex-shrink: 0;
  border-radius: var(--dot-radius);
  background: var(--primary); color: #fff;
  font-family: var(--font-body); font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
section.block .section-sub { font-size: 13.5px; color: var(--text-muted); margin: 0 0 14px; }
section.block h3 { font-family: var(--font-head); font-weight: var(--head-weight); font-size: 15.5px; margin: 18px 0 8px; }
section.block p { margin: 0 0 10px; }
section.block ul, section.block ol { margin: 0 0 10px; padding-left: 22px; }
section.block li { margin-bottom: 5px; }
section.block li:last-child { margin-bottom: 0; }

/* ---------- Checklist ---------- */
.checklist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.checklist li {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius-sm);
}
.checklist li:hover { background: var(--surface-alt); }
.checklist input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  width: 18px; height: 18px; margin: 2px 0 0; flex-shrink: 0; cursor: pointer;
  background: var(--check-bg);
  border: 1.5px solid var(--check-border);
  border-radius: var(--check-radius);
  box-shadow: var(--check-shadow);
  display: grid; place-content: center;
}
.checklist input[type="checkbox"]::after {
  content: "✓"; font-size: 12px; font-weight: 700; line-height: 1;
  color: var(--check-tick); opacity: 0;
}
.checklist input[type="checkbox"]:checked { background: var(--check-bg-on); border-color: var(--check-border-on); }
.checklist input[type="checkbox"]:checked::after { opacity: 1; }
.checklist label { cursor: pointer; font-size: 14.5px; }
.checklist input:checked + label { color: var(--text-muted); text-decoration: line-through; text-decoration-color: var(--accent); }

/* ---------- Avisos ---------- */
.callout {
  padding: 12px 14px; margin: 12px 0; font-size: 13.8px;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--info);
  background: var(--info-light);
}
.callout strong.tag {
  display: block; font-size: 11px; text-transform: uppercase;
  letter-spacing: .05em; margin-bottom: 4px; color: var(--info);
}
.callout.tip { border-color: var(--accent); background: var(--accent-light); }
.callout.tip strong.tag { color: var(--accent); }
.callout.warn { border-color: var(--warning); background: var(--warning-light); }
.callout.warn strong.tag { color: var(--warning); }
.callout.danger { border-color: var(--danger); background: var(--danger-light); }
.callout.danger strong.tag { color: var(--danger); }

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; margin: 12px 0; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
table th, table td { text-align: left; padding: 8px 10px; vertical-align: top; border-bottom: var(--bw) solid var(--border); }
table th {
  background: var(--surface-alt); color: var(--text-muted);
  font-weight: 700; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em;
}
table code { white-space: nowrap; }
table tr:last-child td { border-bottom: none; }

/* ---------- Código ---------- */
code {
  font-family: var(--font-code); font-size: 12.8px;
  background: var(--code-inline-bg); color: var(--code-inline-text);
  padding: 1px 5px; border-radius: 4px;
}
.code-block {
  position: relative; margin: 12px 0; overflow: hidden;
  background: var(--code-bg);
  border-radius: var(--radius-sm);
}
.code-block .code-label {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 12px;
  background: var(--code-bar-bg);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.code-block .code-lang {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--code-bar-text); font-weight: 700;
}
.code-block pre { margin: 0; padding: 14px 16px; overflow-x: auto; }
.code-block pre code {
  background: none; padding: 0; color: var(--code-text);
  font-size: 12.8px; line-height: 1.55; white-space: pre;
}
.copy-btn {
  font-family: inherit; font-size: 11px; font-weight: 600; cursor: pointer;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18);
  color: #cfd6ee; padding: 3px 9px; border-radius: 6px;
}
.copy-btn:hover { background: rgba(255,255,255,.18); color: #fff; }
.copy-btn.copied { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- Piezas sueltas ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mini-card {
  background: var(--surface-alt);
  border: var(--bw) solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
}
.mini-card h4 { margin: 0 0 4px; font-size: 13px; }
.mini-card p { margin: 0; font-size: 12.8px; color: var(--text-muted); }

.pill-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.pill {
  font-size: 12px; font-weight: 600; padding: 3px 11px;
  border-radius: var(--radius-pill);
  background: var(--surface-alt);
  border: var(--bw) solid var(--border);
  color: var(--text);
}

/* ---------- Anterior / siguiente ---------- */
.page-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 30px; }
.page-nav a {
  flex: 1; max-width: 48%;
  background: var(--surface);
  border: var(--bw) solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 2px;
}
.page-nav a:hover { border-color: var(--primary); text-decoration: none; }
.page-nav a.next { text-align: right; margin-left: auto; }
.page-nav .dir {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-faint); font-weight: 700;
}
.page-nav .title { font-size: 14.5px; font-weight: 700; color: var(--text); }

.source-note { margin-top: 22px; font-size: 12px; color: var(--text-faint); text-align: center; }

/* ---------- Índice de módulo ---------- */
.module-page { max-width: 940px; margin: 0 auto; padding: 48px 24px 80px; }
.module-header { margin-bottom: 28px; }
.module-header h1 {
  font-family: var(--font-head); font-weight: var(--head-weight);
  text-transform: var(--head-transform); letter-spacing: var(--head-spacing);
  font-size: 30px; margin: 8px 0 8px;
}
.module-header .lead { color: var(--text-muted); font-size: 16px; max-width: 70ch; }
.tema-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.tema-card {
  background: var(--surface);
  border: var(--bw) solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  display: flex; flex-direction: column; gap: 6px;
}
.tema-card:hover { border-color: var(--primary); text-decoration: none; }
.tema-card .tema-code {
  font-size: 10.5px; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--primary);
}
.tema-card .tema-title {
  font-family: var(--font-head); font-weight: var(--head-weight);
  font-size: 17px; color: var(--text);
}
.tema-card .tema-meta { font-size: 12.5px; color: var(--text-muted); }
.tema-card .bar-track { margin-top: 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidebar {
    position: relative; width: 100%; height: auto; top: auto;
    border-right: none; border-bottom: var(--bw) solid var(--border);
  }
  nav.tasklist { flex-direction: row; flex-wrap: wrap; }
  nav.tasklist a { flex: 1 1 45%; }
  main.content { padding: 24px 16px 60px; }
  .grid-2 { grid-template-columns: 1fr; }
  .page-nav { flex-direction: column; }
  .page-nav a { max-width: 100%; }
  .module-page { padding: 28px 16px 60px; }
}
