/* ============================================================
 * theme.css — TEMA de la guía de POLÍGONOS (capa LIBRE).
 * Leyenda (lados/vértices/diagonales), dibujo de polígonos por SVG,
 * comparativas, y los 2 widgets por toque (constructor / detector).
 * Andamiaje en assets/guia-components.css; variables --guia-*.
 * ============================================================ */

/* ===== 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 color ===== */
.poly-legend { display: flex; gap: 16px; 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; }
.poly-legend .it { display: flex; gap: 8px; align-items: center; }
.poly-legend .it b { font-weight: 800; }
.poly-legend .sw { width: 17px; height: 17px; border-radius: 4px; flex: 0 0 auto; }
.poly-legend .sw.side { background: rgba(40, 56, 145, .14); border: 2px solid var(--guia-navy); }
.poly-legend .sw.vtx { background: var(--guia-ink); border: 2px solid var(--guia-ink); border-radius: 50%; }
.poly-legend .sw.diag { background: #fff; border: 2px dashed var(--guia-deep); }

/* ===== Dibujo del polígono (SVG estático) ===== */
.poly-visual { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 2px 0; }
.poly-visual .vcap { font-size: 15px; font-weight: 700; color: var(--guia-muted); text-align: center; max-width: 44ch; }
/* Ancho RESUELTO (viewBox + max-width): el dibujo nunca colapsa a "astilla". */
.poly-svg { width: 100%; max-width: 280px; height: auto; display: block; }

/* Comparativa de dos figuras lado a lado */
.poly-pair { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.poly-pair figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.poly-pair .poly-svg { max-width: 160px; }
.poly-pair figcaption { font-size: 14px; font-weight: 700; color: var(--guia-muted); text-align: center; max-width: 22ch; }

/* Dibujo dentro de un ejercicio (guiado/serie): más compacto */
.guia-pitem .poly-visual { align-items: flex-start; margin: 8px 0 4px; }
.guia-pitem .poly-visual .vcap { text-align: left; font-size: 14px; }
.guia-pitem .poly-svg { max-width: 184px; }
.guia-serie-grid .poly-svg { max-width: 156px; }
.guia-pitem .poly-pair .poly-svg, .guia-serie-grid .poly-pair .poly-svg { max-width: 130px; }

/* ===== Widgets por toque (constructor / detector) ===== */
.poly-build, .poly-det { display: grid; gap: 12px; padding: 16px; border: 2px solid var(--guia-ink); border-radius: 14px; background: var(--guia-cream); }
.poly-lab-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.poly-flag { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: #fff; background: var(--guia-orange); border: 2px solid var(--guia-ink); border-radius: 999px; padding: 3px 11px; }
.poly-inst { font-size: 15px; font-weight: 700; color: var(--guia-deep); }
.poly-stage { text-align: center; touch-action: none; }
.poly-build-svg { width: 100%; max-width: 300px; margin: 0 auto; }
.poly-det-svg { width: 100%; max-width: 320px; margin: 0 auto; cursor: grab; }
.poly-det-svg:active { cursor: grabbing; }
.poly-det-svg [data-handle] { cursor: grab; }

/* Lectura del constructor: nombre + datos vivos */
.poly-read { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.poly-read.center { min-height: 1.6em; }
.poly-name { font-size: 26px; font-weight: 800; letter-spacing: .02em; color: var(--guia-ink); }
.poly-facts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.poly-facts .fact { font-size: 15px; font-weight: 700; color: var(--guia-deep); background: #fff; border: 1.5px solid var(--guia-line); border-radius: 999px; padding: 5px 12px; }
.poly-facts .fact b { font-weight: 800; color: var(--guia-ink); }

/* Lectura del detector: etiqueta viva CÓNCAVO/CONVEXO */
.poly-type { font-size: 22px; font-weight: 800; letter-spacing: .03em; padding: 3px 16px; border-radius: 999px; border: 2px solid var(--guia-ink); background: #fff; }
.poly-type.is-convex { color: var(--guia-navy); }
.poly-type.is-concave { color: #A01243; }
.poly-extra { font-size: 15px; line-height: 1.5; color: var(--guia-deep); text-align: center; margin: 0; }
.poly-extra b.o { color: var(--guia-deep); }

/* Controles (sticker buttons, igual lenguaje que el motor) */
.poly-ctrl { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.poly-btn { font: inherit; font-weight: 800; font-size: 17px; min-width: 64px; padding: 9px 16px; border: 2px solid var(--guia-ink); border-radius: 10px; background: #fff; color: var(--guia-ink); cursor: pointer; box-shadow: 2px 2px 0 var(--guia-ink); transition: transform .1s, box-shadow .1s; }
.poly-btn.mini { min-width: 44px; padding: 9px 12px; font-size: 15px; }
.poly-btn:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--guia-ink); }
.poly-btn:active { transform: translate(0, 0); box-shadow: 1px 1px 0 var(--guia-ink); }

/* ===== Impresión: oculta los widgets interactivos ===== */
@media print {
  .poly-build, .poly-det { display: none !important; }
}
