/* AexApuntes: estilos de los apuntes. Se usan en la página y van dentro del HTML descargado,
   por eso no dependen de app.css ni de fuentes externas. */

.apuntes {
  --a-fondo: #ffffff;
  --a-tinta: #1c1a24;
  --a-suave: #5f5c6b;
  --a-borde: #e8e3d8;
  --a-acento: #4f46e5;
  --a-acento-suave: #eef0ff;
  --a-marcador: #fde68a;
  --a-codigo: #f5f3ee;
  --a-ok: #15803d;
  color-scheme: light;
  padding: clamp(22px, 5vw, 48px);
  border: 1px solid var(--a-borde);
  border-radius: 18px;
  background: var(--a-fondo);
  color: var(--a-tinta);
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  overflow-wrap: break-word;
}

@media (prefers-color-scheme: dark) {
  .apuntes {
    --a-fondo: #1b1a23;
    --a-tinta: #eceaf3;
    --a-suave: #a9a6b8;
    --a-borde: #2f2d3b;
    --a-acento: #9a9bff;
    --a-acento-suave: #26274a;
    --a-marcador: rgba(250, 204, 21, 0.32);
    --a-codigo: #24232e;
    --a-ok: #4ade80;
    color-scheme: dark;
  }
}

/* Página del HTML descargado */
.aex-doc { margin: 0; padding: clamp(0px, 4vw, 40px) clamp(0px, 3vw, 24px); background: #f6f4ee; }
.aex-doc .apuntes { max-width: 820px; margin: 0 auto; }
@media (prefers-color-scheme: dark) { .aex-doc { background: #121118; } }

/* ---------- cabecera ---------- */

.apuntes-cabecera { display: flex; align-items: center; gap: 22px; margin-bottom: 26px; }

.apuntes-miniatura {
  display: block;
  flex: none;
  width: 184px;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  background: var(--a-borde);
  object-fit: cover;
}

.apuntes-etiqueta {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--a-acento-suave);
  color: var(--a-acento);
  font-size: 0.8rem;
  font-weight: 700;
}

.apuntes h1 {
  margin: 10px 0 8px;
  font-size: clamp(1.55rem, 4.2vw, 2.15rem);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.apuntes-meta { margin: 0; color: var(--a-suave); font-size: 0.87rem; }
.apuntes-meta a { color: var(--a-acento); font-weight: 600; text-decoration: none; }
.apuntes-meta a:hover { text-decoration: underline; }

.apuntes-tldr { margin: 0 0 6px; padding: 16px 20px; border-radius: 14px; background: var(--a-acento-suave); }
.apuntes-tldr b {
  display: block;
  margin-bottom: 4px;
  color: var(--a-acento);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.apuntes-tldr p { margin: 0; font-size: 1.05rem; font-weight: 500; }

/* ---------- secciones ---------- */

.apuntes-seccion { margin-top: 36px; }

.apuntes h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--a-borde);
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}
.apuntes h2 .icono { font-size: 1.05rem; }

.apuntes h3 { margin: 3px 0; font-size: 1.04rem; line-height: 1.35; }
.apuntes p { margin: 0; }
.apuntes ul,
.apuntes ol { margin: 0; padding-left: 1.3em; }
.apuntes li { margin: 4px 0; }
.apuntes li::marker { color: var(--a-acento); }

.apuntes mark {
  padding: 0 2px;
  background: linear-gradient(transparent 58%, var(--a-marcador) 58%);
  color: inherit;
}

.apuntes code {
  font-family: ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 0.95rem;
  font-weight: 600;
  white-space: pre-wrap;
}

.apuntes .minuto {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--a-acento-suave);
  color: var(--a-acento);
  font-family: ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  vertical-align: middle;
}
.apuntes a.minuto:hover { background: var(--a-acento); color: var(--a-fondo); }

/* temas: línea de tiempo numerada */
.apuntes-temas { padding: 0 !important; list-style: none; counter-reset: tema; }
.apuntes-temas > li { position: relative; margin: 0; padding: 2px 0 20px 46px; counter-increment: tema; }
.apuntes-temas > li::before {
  content: counter(tema);
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--a-acento-suave);
  color: var(--a-acento);
  font-size: 0.88rem;
  font-weight: 800;
}
.apuntes-temas > li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 38px;
  bottom: 6px;
  left: 14.5px;
  width: 1px;
  background: var(--a-borde);
}
.tema-cabecera { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.apuntes-temas p { margin: 4px 0 6px; }
.apuntes-temas ul { color: var(--a-suave); }

/* conceptos */
.apuntes-conceptos { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; margin: 0; }
.concepto { padding: 12px 14px; border: 1px solid var(--a-borde); border-radius: 12px; }
.concepto dt { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-weight: 700; }
.concepto dd { margin: 4px 0 0; color: var(--a-suave); }

/* fórmulas y comandos */
.apuntes-formulas { display: grid; gap: 10px; padding: 0 !important; list-style: none; }
.apuntes-formulas li { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--a-codigo); }
.formula-fila { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.apuntes-formulas p { margin-top: 6px; color: var(--a-suave); font-size: 0.92rem; }

/* pendientes */
.apuntes-pendientes { display: grid; gap: 8px; padding: 0 !important; list-style: none; }
.apuntes-pendientes li { display: flex; gap: 12px; margin: 0; padding: 12px 14px; border: 1px solid var(--a-borde); border-radius: 12px; }
.casilla { flex: none; width: 18px; height: 18px; margin-top: 4px; border: 2px solid var(--a-acento); border-radius: 5px; }
.pendiente-tipo {
  margin-right: 8px;
  color: var(--a-acento);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.pendiente-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 6px !important; color: var(--a-suave); font-size: 0.86rem; }

/* preguntas de repaso */
.apuntes-quiz { padding-left: 1.5em !important; }
.apuntes-quiz li { margin: 10px 0; }
.apuntes-quiz details { padding-bottom: 10px; border-bottom: 1px dashed var(--a-borde); }
.apuntes-quiz summary { font-weight: 600; list-style: none; cursor: pointer; }
.apuntes-quiz summary::-webkit-details-marker { display: none; }
.apuntes-quiz summary::after { content: " · ver respuesta"; color: var(--a-acento); font-size: 0.82rem; font-weight: 600; }
.apuntes-quiz details[open] summary::after { content: ""; }
.apuntes-quiz details p { margin-top: 6px; color: var(--a-ok); }

.apuntes-pie { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--a-borde); color: var(--a-suave); font-size: 0.8rem; }

@media (max-width: 560px) {
  .apuntes-cabecera { flex-direction: column; align-items: flex-start; gap: 14px; }
  .apuntes-miniatura { width: 100%; }
}

@media print {
  .apuntes {
    --a-fondo: #ffffff;
    --a-tinta: #000000;
    --a-suave: #444444;
    --a-borde: #dddddd;
    --a-acento: #3730a3;
    --a-acento-suave: #eef0ff;
    --a-marcador: #fde68a;
    --a-codigo: #f5f5f5;
    --a-ok: #166534;
    padding: 0;
    border: 0;
    border-radius: 0;
    font-size: 11.5pt;
  }
  .aex-doc { padding: 0; background: #ffffff; }
  .apuntes * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .apuntes h2,
  .apuntes h3 { break-after: avoid; }
  .apuntes-temas > li,
  .concepto,
  .apuntes-formulas li,
  .apuntes-pendientes li,
  .apuntes-quiz li { break-inside: avoid; }
  .apuntes-quiz summary::after { content: "" !important; }
  .apuntes-quiz details::details-content { content-visibility: visible; }
}
