/* ============================================================
   Luna y Misi — plantillas imprimibles de las manualidades
   Hojas A4 verticales. En pantalla se ven como folios; al imprimir,
   cada .pl-hoja es una página. Tinta justa: líneas finas y poco color.
   ============================================================ */

@page { size: A4 portrait; margin: 0; }

:root {
  --noche: #241a47;
  --ambar: #e8a33d;
  --rojo: #b5432e;
  --tinta: #3d3128;
  --gris: #8a7f75;
  --corte: #6b5d51;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body.pl-body {
  font-family: 'Nunito', system-ui, sans-serif;
  color: var(--tinta);
  background: #e9e1cf;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

/* ── Barra de arriba (solo en pantalla) ── */
.pl-barra {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 1rem; justify-content: space-between;
  background: var(--noche); color: #faf3e3; padding: .7rem 1.2rem;
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
}
.pl-barra-centro { display: flex; flex-direction: column; align-items: center; text-align: center; line-height: 1.2; }
.pl-barra-centro strong { font-family: 'Baloo 2', sans-serif; font-size: 1.1rem; }
.pl-barra-centro span { font-size: .8rem; opacity: .8; }
.pl-volver { color: #f6c86b; text-decoration: none; font-weight: 700; font-size: .9rem; }
.pl-boton {
  font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 1.05rem;
  background: var(--ambar); color: var(--noche); border: 0; border-radius: 999px;
  padding: .55rem 1.3rem; cursor: pointer;
}
.pl-boton:hover { background: #f6c86b; }
.pl-consejo { max-width: 210mm; margin: 1rem auto 0; font-size: .88rem; text-align: center; color: var(--tinta); padding: 0 1rem; }

/* ── La hoja ── */
.pl-hoja {
  width: 210mm; height: 297mm; margin: 1.2rem auto 2rem; background: #fff;
  padding: 11mm 12mm 9mm; position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 10px 30px rgba(61,49,40,.18);
}
.pl-cabecera { display: flex; justify-content: space-between; align-items: center; font-size: 9pt; color: var(--gris); margin-bottom: 3mm; }
.pl-logo { font-family: 'Baloo 2', sans-serif; font-weight: 800; color: var(--noche); font-size: 11pt; }
.pl-titulo { font-family: 'Baloo 2', sans-serif; color: var(--noche); font-size: 22pt; line-height: 1.1; text-align: center; }
.pl-indicacion { text-align: center; font-size: 10.5pt; margin: 1.5mm auto 0; max-width: 160mm; }
.pl-pie { margin-top: auto; padding-top: 3mm; text-align: center; font-size: 8.5pt; color: var(--gris); }

/* Línea de corte */
.pl-corte { border: 1.2px dashed var(--corte); }
.pl-svg-corte, .pl-svg-corte * { fill: none; stroke: var(--corte); stroke-width: 1.1; stroke-dasharray: 3.2 2.4; vector-effect: non-scaling-stroke; }
.pl-svg-pliegue { stroke: var(--gris); stroke-width: .8; stroke-dasharray: 1 2; vector-effect: non-scaling-stroke; }

.pl-grid { display: grid; flex: 1; margin-top: 5mm; }

/* Tarjetas: 2 × 4 */
.pl-tarjetas { grid-template-columns: 1fr 1fr; grid-template-rows: repeat(4, 1fr); gap: 0; max-height: 228mm; }
.pl-tarjeta { margin: -0.6px; padding: 6mm 7mm; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 2mm; }
.pl-tarjeta strong { font-family: 'Baloo 2', sans-serif; font-size: 14pt; color: var(--noche); line-height: 1.1; }
.pl-tarjeta p { font-size: 11pt; line-height: 1.35; }
.pl-estrella { color: var(--ambar); font-size: 13pt; }

/* Marcapáginas: 4 tiras verticales */
.pl-marcapaginas { grid-template-columns: repeat(4, 1fr); gap: 5mm; max-height: 238mm; }
.pl-marca { padding: 9mm 4mm 5mm; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3mm; position: relative; }
.pl-agujero { position: absolute; top: 3mm; left: 50%; width: 4mm; height: 4mm; margin-left: -2mm; border: 1px solid var(--gris); border-radius: 50%; }
.pl-marca-marca { font-family: 'Baloo 2', sans-serif; font-weight: 800; color: var(--noche); font-size: 9.5pt; }
.pl-marca strong { font-family: 'Baloo 2', sans-serif; font-size: 13pt; color: var(--rojo); line-height: 1.1; }
.pl-marca p { font-size: 10pt; line-height: 1.35; font-style: italic; }
.pl-caja { flex: 1; width: 100%; border: 1px solid #d9cfc2; border-radius: 3mm; display: flex; align-items: flex-end; justify-content: center; font-size: 7.5pt; color: #b3a89c; padding-bottom: 2mm; min-height: 50mm; }
.pl-linea-firma { width: 100%; font-size: 8pt; text-align: left; border-bottom: 1px solid #b3a89c; padding-bottom: 6mm; }

/* Banderines: 2 × 2 */
.pl-banderines { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 6mm 8mm; max-height: 242mm; }
.pl-bandera { position: relative; }
.pl-bandera svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pl-pliegue-txt { position: absolute; top: 2.2%; left: 0; right: 0; text-align: center; font-size: 7pt; color: var(--gris); }
.pl-bandera-txt {
  position: absolute; top: 20%; left: 18%; right: 18%; text-align: center;
  font-family: 'Baloo 2', sans-serif; font-weight: 800; color: var(--noche); line-height: 1.05;
  font-size: 26pt; overflow-wrap: normal; hyphens: manual;
}
.pl-bandera-txt.pl-largo-s { font-size: 46pt; top: 17%; }
.pl-bandera-txt.pl-largo-l { font-size: 17pt; left: 22%; right: 22%; }

/* Recortables: 2 × 3 */
.pl-recortables { grid-template-columns: 1fr 1fr; grid-template-rows: repeat(3, 1fr); gap: 5mm 8mm; max-height: 238mm; }
.pl-figura { position: relative; display: flex; align-items: center; justify-content: center; }
.pl-figura svg { width: 100%; height: 100%; max-height: 74mm; }
.pl-figura text { font-family: 'Baloo 2', sans-serif; font-weight: 700; fill: var(--noche); }

/* Ficha para rellenar: fluye por las hojas que haga falta */
.pl-ficha { margin-top: 6mm; display: flex; flex-direction: column; gap: 6mm; }
.pl-seccion { border: 1.5px solid #e2d7c6; border-radius: 4mm; padding: 5mm 6mm; break-inside: avoid; page-break-inside: avoid; }
.pl-seccion h3 { font-family: 'Baloo 2', sans-serif; color: var(--noche); font-size: 14pt; line-height: 1.1; }
.pl-seccion p { font-size: 10.5pt; margin-top: 1mm; color: var(--tinta); }
.pl-dibujo { height: 45mm; border: 1px dashed #c9bdae; border-radius: 3mm; margin-top: 3mm; }
.pl-dibujo-alto { height: 75mm; }
.pl-renglon { height: 9mm; border-bottom: 1px solid #c9bdae; }
.pl-casillas { list-style: none; margin-top: 3mm; display: grid; grid-template-columns: 1fr 1fr; gap: 3mm 8mm; font-size: 11pt; }
.pl-casillas li { display: flex; align-items: center; gap: 3mm; }
.pl-check { width: 5mm; height: 5mm; border: 1.3px solid var(--noche); border-radius: 1.2mm; flex: none; }

/* ── Pantallas estrechas: la hoja se encoge para verla entera ── */
@media screen and (max-width: 820px) {
  .pl-barra { flex-wrap: wrap; }
  .pl-barra-centro { order: -1; width: 100%; }
  .pl-hoja { zoom: .46; margin: .6rem auto 1rem; }
}

/* ── Impresión ── */
@media print {
  body.pl-body { background: #fff; }
  .pl-barra, .pl-consejo { display: none !important; }
  .pl-hoja { margin: 0; box-shadow: none; page-break-after: always; break-after: page; }
  .pl-hoja:last-of-type { page-break-after: auto; break-after: auto; }
}
