/* ============================================================
 * theme.css — TEMA de la guía de LOGARITMOS (capa LIBRE).
 * Estilos de los widgets propios (prefijo log-): convertidor (potencia⇄log),
 * propiedad (stepper) y escalera (tabla viva), más la leyenda de roles de color
 * y el reaseguro del hero. Andamiaje en assets/guia-components.css; se usan las
 * variables --guia-* (no se hardcodean hex, salvo los roles de la notación que
 * deben coincidir con content.js/theme.js).
 * Pisos de letra: lectura ≥17px · apoyo ≥15px · etiquetas MAYÚS ≥13px.
 * Toques ≥44px. reduced-motion y print al final.
 * ============================================================ */

/* ===== Reaseguro de longitud en el hero ===== */
.guia-reassure { font-size: 15px; line-height: 1.5; color: var(--guia-muted); margin: 2px 0 0; }

/* ===== Leyenda de roles de color ===== */
.log-legend { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; background: #fff; border: 1.5px solid var(--guia-line); border-radius: 12px; padding: 10px 14px; font-size: 15px; font-weight: 600; }
.log-legend .it { display: flex; gap: 8px; align-items: center; }
.log-legend .it b { font-weight: 800; }
.log-legend .sw { width: 18px; height: 18px; border-radius: 5px; flex: 0 0 auto; }
.log-legend .sw.base { background: var(--guia-navy); border: 2px solid var(--guia-navy); }
.log-legend .sw.exp { background: var(--guia-deep); border: 2px solid var(--guia-deep); }
.log-legend .sw.res { background: var(--guia-green-deep); border: 2px solid var(--guia-green-deep); }

/* ===== Tarjeta base de widget ===== */
.log-wg {
  display: grid; gap: 12px; padding: 16px;
  border: 2px solid var(--guia-ink); border-radius: 14px; background: var(--guia-cream);
  margin: 2px 0;
}
.log-wg-top { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: baseline; }
.log-flag { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: #fff; background: var(--guia-navy); border-radius: 999px; padding: 4px 12px; flex: 0 0 auto; }
.log-wg-inst { font-size: 15px; line-height: 1.45; color: var(--guia-deep); font-weight: 600; }

/* ===== Opciones por toque (compartidas por los widgets del tema) ===== */
.log-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.log-opt {
  font: inherit; font-weight: 700; font-size: 17px; line-height: 1.3;
  min-height: 44px; padding: 10px 16px;
  border: 2px solid var(--guia-ink); border-radius: 12px; background: #fff; color: var(--guia-ink);
  cursor: pointer; box-shadow: 2px 2px 0 var(--guia-ink); transition: transform .1s, box-shadow .1s;
}
.log-opt:hover:not(:disabled) { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--guia-ink); border-color: var(--guia-orange); }
.log-opt:active:not(:disabled) { transform: translate(0, 0); box-shadow: 1px 1px 0 var(--guia-ink); }
.log-opt.right { background: #e6f5ec; border-color: var(--guia-green-deep); color: var(--guia-green-deep); }
.log-opt.wrong { background: #fdeaf1; border-color: #a01243; color: #a01243; }
.log-opt:disabled { cursor: default; }

.log-prompt { font-size: 17px; line-height: 1.45; font-weight: 700; color: var(--guia-ink); margin: 0; }
.log-fb, .log-conv-fb { font-size: 17px; line-height: 1.45; margin: 0; min-height: 1.2em; }
.log-fb.ok, .log-conv-fb.ok { color: var(--guia-green-deep); font-weight: 700; }
.log-fb.miss, .log-conv-fb.miss { color: #a01243; font-weight: 700; }
.log-done, .log-conv-done {
  font-size: 18px; line-height: 1.5; font-weight: 700; color: var(--guia-green-deep);
  background: #e6f5ec; border: 2px solid var(--guia-green); border-radius: 12px; padding: 14px; margin: 0; text-align: center;
}

/* ===== Botones de acción del tema (siguiente / repetir) ===== */
.log-btn {
  font: inherit; font-weight: 800; font-size: 15px; min-height: 44px; padding: 10px 18px;
  border: 2px solid var(--guia-ink); border-radius: 12px; background: var(--guia-orange); color: #fff;
  cursor: pointer; box-shadow: 2px 2px 0 var(--guia-ink); transition: transform .1s, box-shadow .1s;
  justify-self: center;
}
.log-btn:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--guia-ink); }
.log-btn:active { transform: translate(0, 0); box-shadow: 1px 1px 0 var(--guia-ink); }
.log-btn.ghost { background: #fff; color: var(--guia-ink); box-shadow: none; }
.log-btn.ghost:hover { border-color: var(--guia-orange); transform: none; box-shadow: none; }
.log-btn.small { font-size: 15px; padding: 8px 16px; }

/* ===== Convertidor (el diferenciador) ===== */
.log-conv-prog { font-size: 15px; font-weight: 700; color: var(--guia-muted); margin: 0; }
.log-conv-body { display: grid; gap: 12px; }
.log-conv-eq {
  font-size: 24px; text-align: center; background: #fff;
  border: 2px solid var(--guia-line); border-radius: 12px; padding: 16px 12px; overflow-x: auto;
}
.log-conv-lbl, .log-conv-ask { font-size: 17px; line-height: 1.45; font-weight: 600; color: var(--guia-ink); margin: 0; }
.log-conv-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.log-flip { animation: log-flip .36s ease forwards; }
@keyframes log-flip { 0% { transform: rotateX(0); opacity: 1; } 100% { transform: rotateX(90deg); opacity: .15; } }
.log-pop { animation: log-pop .45s ease; }
@keyframes log-pop { 0% { transform: scale(.96); } 60% { transform: scale(1.03); } 100% { transform: scale(1); } }

/* roles tras convertir */
.log-conv-roles { display: grid; gap: 8px; }
.log-roles-title { font-size: 15px; font-weight: 800; color: var(--guia-deep); margin: 0; }
.log-roles-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.log-roles-list li { font-size: 17px; line-height: 1.4; color: var(--guia-ink); display: flex; gap: 8px; align-items: baseline; }
.log-roles-list b { font-weight: 800; }
.log-sw { width: 14px; height: 14px; border-radius: 4px; flex: 0 0 auto; display: inline-block; transform: translateY(1px); }
.log-sw.base { background: var(--guia-navy); }
.log-sw.exp { background: var(--guia-deep); }
.log-sw.res { background: var(--guia-green-deep); }

/* ===== Propiedad (stepper) ===== */
.log-prop-eq {
  font-size: 22px; text-align: center; background: #fff;
  border: 2px solid var(--guia-line); border-radius: 12px; padding: 14px 12px; overflow-x: auto;
}
.log-prop-panel { display: grid; gap: 10px; }
.log-trace { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.log-trace li { font-size: 17px; text-align: center; color: var(--guia-muted); background: #fff; border: 1.5px solid var(--guia-line); border-radius: 8px; padding: 7px 10px; overflow-x: auto; }
.log-trace li.op { background: #f6f8fc; border: 1.5px dashed #c5cde6; }
.log-trace li.res { color: var(--guia-ink); font-weight: 600; }

/* ===== Escalera (tabla viva) ===== */
.log-esc-list { display: grid; gap: 8px; }
.log-esc-row {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px 12px;
  width: 100%; min-height: 44px; padding: 10px 12px; text-align: center;
  border: 2px solid var(--guia-line); border-radius: 12px; background: #fff; color: var(--guia-ink);
  cursor: pointer; font-size: 17px; transition: border-color .15s, background .15s, transform .1s;
}
.log-esc-pow { justify-self: end; }
.log-esc-log { justify-self: start; }
.log-esc-arrow { font-size: 18px; font-weight: 800; color: var(--guia-deep); }
.log-esc-row:hover { border-color: var(--guia-orange); transform: translateY(-1px); }
.log-esc-row.is-hi { background: var(--guia-cream); border-color: var(--guia-deep); }
.log-esc-row.is-active { background: #eaf6ee; border-color: var(--guia-green-deep); box-shadow: 2px 2px 0 var(--guia-green-deep); }
.log-esc-status { font-size: 17px; line-height: 1.5; font-weight: 600; color: var(--guia-deep); margin: 0; min-height: 1.5em; }

/* ===== Responsive: en pantallas chicas, la escalera apila potencia y log ===== */
@media (max-width: 460px) {
  .log-esc-row { grid-template-columns: 1fr; gap: 4px; }
  .log-esc-pow, .log-esc-log { justify-self: center; }
  .log-esc-arrow { transform: rotate(90deg); }
}

/* ===== reduced-motion: sin animaciones de transformación ===== */
@media (prefers-reduced-motion: reduce) {
  .log-flip, .log-pop { animation: none !important; }
}

/* ===== Impresión: oculta los interactivos (no aportan en papel) ===== */
@media print {
  .log-wg { display: none !important; }
}
