/*
 * Clases de Física · estilo común de las presentaciones
 * Papel claro y tinta oscura (se lee bien en cualquier proyector) y un código
 * de colores fijo para las magnitudes: fuerza en rojo, campo en azul,
 * potencial y energía potencial en morado, energía cinética en verde y las
 * masas en dorado.
 */
@font-face { font-family: "Inter"; font-weight: 400; font-style: normal; src: url("fuentes/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 400; font-style: italic; src: url("fuentes/inter-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-style: normal; src: url("fuentes/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-style: normal; src: url("fuentes/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-style: italic; src: url("fuentes/inter-latin-600-italic.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-style: normal; src: url("fuentes/inter-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 800; font-style: normal; src: url("fuentes/inter-latin-800-normal.woff2") format("woff2"); }

:root {
  --papel: #fbfaf6; --papel-2: #f2f0e8; --tinta: #1b1f24; --tenue: #5f6874; --linea: #d7d3c8;
  --acento: #1d4e89; --acento-suave: #e6eef8; --aviso: #c8641b; --aviso-suave: #fbefe3;
  --fuerza: #d1382d; --campo: #1f6fd1; --potencial: #7b3fb5; --cinetica: #1e8a4c; --masa: #b7791f;
  --r: 14px;
}

html, body, .reveal-viewport { background: var(--papel); }
body { font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; }
.reveal { font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 28px; color: var(--tinta); }
.reveal .slides { text-align: left; }
.reveal .slides section { padding: 48px 64px 56px; box-sizing: border-box; height: 100%; }
.reveal .slides section.centrada { display: flex !important; flex-direction: column; justify-content: center; }

/* ── Tipografía ── */
.reveal h1, .reveal h2, .reveal h3 { font-family: Inter, system-ui, sans-serif; color: var(--tinta); letter-spacing: -0.02em; margin: 0 0 22px; text-transform: none; }
.reveal h1 { font-size: 76px; font-weight: 800; line-height: 1.05; }
.reveal h2 { font-size: 46px; font-weight: 750; line-height: 1.15; }
.reveal h3 { font-size: 32px; font-weight: 700; }
.reveal p { margin: 0 0 18px; line-height: 1.45; }
.reveal strong { font-weight: 700; }
.reveal ul, .reveal ol { margin: 0 0 18px 1.1em; line-height: 1.45; }
.reveal li { margin: 6px 0; }
.reveal small, .reveal .peque { font-size: 22px; color: var(--tenue); line-height: 1.4; }
.reveal .etiqueta { display: block; font-size: 17px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--acento); margin-bottom: 10px; }
.reveal .katex { font-size: 1.08em; }
.reveal .katex-display { margin: 14px 0; }
.reveal .grande .katex-display .katex { font-size: 1.6em; }

/* Colores de las magnitudes (en el texto: <span class="c-fuerza">…</span>; en KaTeX: \textcolor{…}) */
.c-fuerza { color: var(--fuerza); } .c-campo { color: var(--campo); } .c-potencial { color: var(--potencial); }
.c-cinetica { color: var(--cinetica); } .c-masa { color: var(--masa); } .c-acento { color: var(--acento); } .c-tenue { color: var(--tenue); }

/* ── Bloques ── */
.dos-col { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; height: calc(100% - 90px); }
.dos-col.texto-sim { grid-template-columns: 0.85fr 1.15fr; }
.dos-col.texto-sim > div:not(.sim) { font-size: 25px; }
.dos-col.texto-sim > div:not(.sim) p { margin-bottom: 14px; }
.dos-col.arriba { align-items: start; }
.tres-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.cuatro-col { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.cuatro-col .tarjeta { padding: 16px 18px; }
.cuatro-col .tarjeta p { font-size: 21px; }
.cuatro-col .tarjeta h3 { font-size: 22px; }
.clave {
  border-left: 6px solid var(--acento); background: var(--acento-suave); border-radius: 0 var(--r) var(--r) 0;
  padding: 16px 22px; margin: 14px 0;
}
.aviso { border-left: 6px solid var(--aviso); background: var(--aviso-suave); border-radius: 0 var(--r) var(--r) 0; padding: 16px 22px; margin: 14px 0; }
.tarjeta { background: #fff; border: 1px solid var(--linea); border-radius: var(--r); padding: 22px 24px; box-shadow: 0 2px 10px rgba(30, 30, 20, .05); }
.tarjeta h3 { font-size: 25px; margin-bottom: 8px; }
.tarjeta p, .dos-col.texto-sim > div:not(.sim) .tarjeta p { font-size: 24px; margin: 0; }
/* Diapositivas con mucho texto junto a una simulación: letra algo menor */
.compacta .dos-col.texto-sim > div:not(.sim) { font-size: 23px; }
.compacta .tarjeta { padding: 16px 20px; }
.compacta .tarjeta p, .compacta .dos-col.texto-sim > div:not(.sim) .tarjeta p { font-size: 21px; }
.compacta .tarjeta h3 { font-size: 22px; margin-bottom: 4px; }
.formula { background: #fff; border: 1px solid var(--linea); border-radius: var(--r); padding: 6px 22px; margin: 10px 0 16px; }
.paso { display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: baseline; margin: 10px 0; }
.paso .n { width: 36px; height: 36px; border-radius: 50%; background: var(--acento); color: #fff; font-weight: 700; font-size: 20px; display: grid; place-items: center; }
.pregunta { font-size: 40px; font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; }
.leyenda-colores { display: flex; flex-wrap: wrap; gap: 10px 22px; font-size: 20px; color: var(--tenue); }
.leyenda-colores span::before { content: ""; display: inline-block; width: 14px; height: 14px; border-radius: 50%; margin-right: 7px; vertical-align: -1px; background: currentColor; }

/* Portada */
.portada h1 { font-size: 92px; margin-bottom: 14px; }
.portada .sub { font-size: 30px; color: var(--tenue); }
.portada .curso { font-size: 20px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--acento); }

/* ── Simulaciones ── */
.sim {
  position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--linea);
  border-radius: var(--r); overflow: hidden; height: 100%; min-height: 0; box-shadow: 0 2px 14px rgba(30, 30, 20, .06);
}
.sim > canvas { flex: 1 1 auto; width: 100%; min-height: 0; display: block; touch-action: none; }
.sim.ancha { height: calc(100% - 90px); }
.mandos { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 12px 16px; border-top: 1px solid var(--linea); background: var(--papel-2); font-size: 19px; }
.mando { display: inline-flex; align-items: center; gap: 10px; }
.mando-eti { font-weight: 600; color: var(--tinta); white-space: nowrap; }
.mando-val { min-width: 92px; font-variant-numeric: tabular-nums; color: var(--acento); font-weight: 600; white-space: nowrap; }
.mando input[type=range] { width: 170px; accent-color: var(--acento); }
.boton {
  font: 600 18px Inter, system-ui, sans-serif; color: var(--tinta); background: #fff; border: 1px solid var(--linea);
  border-radius: 9px; padding: 7px 14px; cursor: pointer;
}
.boton:hover { border-color: var(--acento); color: var(--acento); }
.boton.principal { background: var(--acento); border-color: var(--acento); color: #fff; }
.boton.principal:hover { filter: brightness(1.1); color: #fff; }
.casilla { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; white-space: nowrap; }
.casilla input { width: 18px; height: 18px; accent-color: var(--acento); }
.lectura { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--tinta); }
/* El reset de reveal.js aplana los subíndices: aquí se devuelven */
.mandos sub, .reveal sub { vertical-align: sub; font-size: 0.72em; line-height: 0; }
.mandos sup, .reveal sup { vertical-align: super; font-size: 0.72em; line-height: 0; }

/* ── Pie: tema a la izquierda (el número de diapositiva lo pone reveal.js) ── */
.pie-tema { position: fixed; left: 26px; bottom: 14px; font-size: 14px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--tenue); z-index: 20; pointer-events: none; }
.reveal .slide-number { background: transparent; color: var(--tenue); font: 600 15px Inter, sans-serif; right: 96px; bottom: 14px; }
.reveal .slide-number a { color: inherit; text-decoration: none; }
.reveal .progress { color: var(--acento); height: 4px; }
.reveal .controls { color: var(--acento); }

/* ── Lápiz (tecla D) ── */
.lapiz-capa { position: fixed; inset: 0; z-index: 50; pointer-events: none; width: 100vw; height: 100vh; }
body.con-lapiz .lapiz-capa { pointer-events: auto; cursor: crosshair; }
.lapiz-barra {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 60; display: none; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--linea); border-radius: 12px; padding: 8px 12px; box-shadow: 0 4px 18px rgba(0,0,0,.12);
  font: 600 15px Inter, sans-serif;
}
body.con-lapiz .lapiz-barra { display: flex; }
.lapiz-barra button { border: 1px solid var(--linea); border-radius: 8px; background: #fff; font: 600 14px Inter, sans-serif; padding: 5px 10px; cursor: pointer; }
.lapiz-barra button[data-color] { width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--linea); }
.lapiz-barra button[data-color].elegido { box-shadow: 0 0 0 3px var(--tinta); }

/* Fragmentos: aparecer suave y resaltar */
.reveal .fragment.resaltar.visible { background: #fff3bf; border-radius: 6px; box-shadow: 0 0 0 6px #fff3bf; }

/* PDF (?print-pdf): sin pie fijo ni mandos */
html.print-pdf .pie-tema, html.print-pdf .lapiz-barra { display: none; }
html.print-pdf .reveal .slides section:not(.stack) { padding: 48px 64px 56px !important; height: 720px !important; box-sizing: border-box !important; }

/* ── Problemas de la PAU («A la pizarra» y la presentación de problemas) ── */
.pizarra .enunciado { font-size: 26px; line-height: 1.5; background: #fff; border: 1px solid var(--linea); border-left: 6px solid var(--aviso); border-radius: 0 var(--r) var(--r) 0; padding: 18px 26px; }
.pizarra .enunciado p { margin: 0 0 12px; }
.pizarra .enunciado p:last-child { margin-bottom: 0; }
.pizarra .enunciado p.dato { color: var(--tenue); font-size: 22px; }
.pizarra .pista-abajo { position: absolute; right: 64px; bottom: 58px; font-size: 17px; color: var(--tenue); margin: 0; }
.reveal .solucion { font-size: 21px; line-height: 1.45; }
.solucion .sol-cuerpo p { margin: 0 0 10px; }
.solucion .sol-formula { margin: 4px 0 10px; break-inside: avoid; }
.solucion .sol-formula .katex-display { margin: 4px 0; }
.solucion.dos-columnas .sol-cuerpo { column-count: 2; column-gap: 40px; column-fill: balance; }
.solucion .consejo { font-size: 0.9em; }
.resultado { margin-top: 12px; border: 2px solid var(--acento); background: var(--acento-suave); border-radius: var(--r); padding: 4px 18px; font-size: 0.9em; }
.resultado .katex-display { margin: 6px 0; }
.tabla-pau { border-collapse: collapse; margin: 8px 0; font-size: 19px; }
.tabla-pau td { border: 1px solid var(--linea); padding: 4px 10px; }
.fig-pau { margin: 8px 0; text-align: center; }
.fig-pau img { max-height: 260px; max-width: 100%; background: #fff; }
/* Separador de cada tipo de problema (presentación de problemas) */
.metodo ol { font-size: 25px; }
.metodo li { margin: 8px 0; }

/* Mapa de deducciones (de qué idea sale cada fórmula) */
.mapa { display: grid; grid-template-columns: 1.35fr 34px 1fr 34px 0.9fr 34px 1fr; row-gap: 20px; align-items: center; margin-top: 14px; }
.mapa .nodo { background: #fff; border: 1px solid var(--linea); border-radius: var(--r); padding: 8px 12px; text-align: center; font-size: 19px; font-weight: 700; }
.mapa .nodo .katex-display { margin: 4px 0 0; font-weight: 400; }
.mapa .nodo.idea { text-align: left; border-left: 6px solid var(--acento); background: var(--acento-suave); }
.mapa .flecha { text-align: center; font-size: 28px; color: var(--tenue); }
/* Reparto de la puntuación de un apartado */
.barra-puntos { display: flex; gap: 4px; margin: 22px 0 8px; border-radius: var(--r); overflow: hidden; }
.barra-puntos > div { padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; font-size: 20px; }
.barra-puntos strong { font-size: 30px; }
/* Fórmula que hay que deducir en el examen */
.deducir { display: inline-block; vertical-align: 3px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #fff; background: var(--aviso); border-radius: 6px; padding: 1px 7px; }

/* Esquema con etiquetas KaTeX encima de un SVG (ley de gravitación) */
.esquema-ley .lienzo { position: relative; }
.esquema-ley svg { width: 100%; display: block; }
.esquema-ley .eti { position: absolute; transform: translate(-50%, -50%); font-size: 26px; font-weight: 700; }
/* Cita */
.cita { margin: 0 0 12px; padding: 14px 20px; border-left: 5px solid var(--tenue); background: #fff; border-radius: 0 var(--r) var(--r) 0; font-size: 21px; font-style: italic; line-height: 1.45; }
.cita cite { display: block; margin-top: 8px; font-size: 17px; font-style: normal; font-weight: 700; color: var(--tenue); }
/* Leyenda de una definición */
.leyenda-def { list-style: none; margin: 4px 0 0; padding: 0; font-size: 21px; }
.leyenda-def li { margin: 6px 0; }
.leyenda-def li > span:first-child { display: inline-block; min-width: 38px; font-weight: 700; }

/* Índice (lo rellena clase.js) */
.indice-titulo { font-size: 1.3em; margin: 0 0 14px; display: flex; align-items: baseline; gap: 22px; }
.indice-titulo span { font-size: 0.4em; font-weight: 600; letter-spacing: 0; color: var(--tenue); }
.indice-lista { column-count: 4; column-gap: 26px; font-size: 0.5em; line-height: 1.25; }
.indice-grupo { margin-bottom: 12px; }
.indice-grupo li { break-inside: avoid; }
.indice-grupo h3 { break-after: avoid; break-inside: avoid; font-size: 0.95em; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--acento); margin: 0 0 4px; }
.indice-grupo ol { list-style: none; margin: 0; padding: 0; }
.indice-grupo li { margin: 1px 0; }
.indice-grupo a { display: grid; grid-template-columns: 2.1em 1fr; color: var(--tinta); text-decoration: none; border-radius: 4px; }
.indice-grupo a:hover { background: var(--acento-suave); color: var(--acento); }
.indice-grupo a.es-pizarra { color: var(--aviso); }
.indice-grupo .num { color: var(--tenue); font-variant-numeric: tabular-nums; text-align: right; padding-right: 0.5em; }
.indice-grupo .katex { font-size: 1em; }
.ir { cursor: pointer; }
.tarjeta.ir:hover { border-color: var(--acento); }
.pie-tema.ir { pointer-events: auto; }
.pie-tema.ir:hover { color: var(--acento); }
/* Botón «Índice», fijo arriba a la derecha en todas las diapositivas */
.boton-indice { position: fixed; top: 12px; right: 16px; z-index: 40; font: 600 14px Inter, sans-serif; color: var(--acento); background: rgba(255,255,255,.9); border: 1px solid var(--linea); border-radius: 999px; padding: 6px 14px; cursor: pointer; box-shadow: 0 2px 8px rgba(30,30,20,.08); }
.boton-indice:hover { background: var(--acento-suave); border-color: var(--acento); }
html.print-pdf .boton-indice { display: none; }

/* Tablas comparativas (fuerza/campo; las cuatro magnitudes) */
.tabla-comp { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.72em; line-height: 1.3; margin-top: 10px; background: #fff; border: 1px solid var(--linea); border-radius: var(--r); overflow: hidden; }
.tabla-comp th, .tabla-comp td { padding: 9px 16px; text-align: left; vertical-align: middle; border-top: 1px solid var(--linea); }
.tabla-comp thead th { border-top: 0; background: var(--papel-2); font-size: 1.05em; }
.tabla-comp tbody th { width: 16%; color: var(--tenue); font-weight: 700; font-size: 0.92em; }
.tabla-comp td { width: 42%; }
.tabla-comp.cuatro { font-size: 0.6em; }
.tabla-comp.cuatro td { width: 21%; }
.tabla-comp.cuatro tbody th { width: 14%; }
.tabla-comp .katex { font-size: 1.05em; }
