/* ==========================================================================
   ESTEEM — GAFETES
   Se ven en el diálogo a su tamaño real y se imprimen a ese mismo tamaño:
   9 × 12.5 cm, que caben cuatro por hoja carta (la de México) o A4.

   Lo que debe leerse de lejos va grande: el nombre de pila y el tipo de
   credencial, en una franja de color que el staff reconoce de un vistazo.
   La preferencia alimentaria NO se imprime: es un dato de salud y un gafete
   lo lee cualquiera. Vive en la credencial digital, que es privada.
   ========================================================================== */

.badges-grid {
  display: grid; grid-template-columns: repeat(auto-fill, 90mm); gap: 6mm;
  justify-content: center;
}
.badges-grid.is-single { grid-template-columns: 90mm; }

.badge {
  --band: #4b5563;
  --band-ink: #ffffff;
  position: relative; overflow: hidden;
  width: 90mm; height: 125mm;
  display: grid; grid-template-rows: auto auto 1fr auto auto auto;
  justify-items: center;
  background: #ffffff; color: #14140f;
  border-radius: 3mm;
  box-shadow: 0 0 0 1px #ddd8cc, 0 14px 30px -12px rgba(0,0,0,.6);
  font-family: var(--sans, sans-serif);
  break-inside: avoid; page-break-inside: avoid;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.badge.tone-ponente   { --band: var(--brand, #c8a951); --band-ink: var(--brand-ink, #17130a); }
.badge.tone-expositor { --band: #0f766e; }
.badge.tone-prensa    { --band: #6d28d9; }

/* Ranura para el cordón */
.badge-slot {
  width: 14mm; height: 2.4mm; margin-top: 4mm; border-radius: 1.2mm;
  border: .3mm solid #b8b2a4; background: #f4f2ee;
}

.badge-head {
  width: 100%; padding: 3mm 6mm 2.5mm; text-align: center;
  border-bottom: .6mm solid var(--brand, #c8a951);
}
.badge-logo { max-height: 9mm; max-width: 40mm; margin: 0 auto 1.5mm; object-fit: contain; }
.badge-event { font-family: var(--serif, Georgia, serif); font-size: 15pt; line-height: 1.05; color: #14140f; }
.badge-event em { font-style: italic; }
.badge-dates { font-family: var(--mono, monospace); font-size: 6.5pt; letter-spacing: .12em; text-transform: uppercase; color: #6b6658; margin-top: 1mm; }

.badge-who { align-self: center; text-align: center; padding: 2mm 5mm 0; width: 100%; }
.badge-given {
  font-size: 25pt; font-weight: 700; line-height: 1; letter-spacing: -.01em;
  text-transform: uppercase; color: #14140f;
  overflow-wrap: anywhere;
}
.badge-family { font-size: 14pt; font-weight: 500; line-height: 1.15; color: #14140f; margin-top: .8mm; }
.badge-org { font-size: 8.5pt; color: #57534a; margin-top: 1.5mm; }

.badge-qr { line-height: 0; margin-top: 2mm; }
.badge-qr img, .badge-qr canvas { width: 32mm !important; height: 32mm !important; image-rendering: pixelated; }
.badge-id { font-family: var(--mono, monospace); font-size: 7pt; letter-spacing: .18em; color: #57534a; margin: 1mm 0 3mm; }

.badge-band {
  width: 100%; min-height: 13mm; padding: 2mm 5mm;
  display: flex; align-items: center; justify-content: space-between; gap: 3mm;
  background: var(--band); color: var(--band-ink);
}
.badge-kind { font-size: 12pt; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.badge-where { font-size: 7.5pt; text-align: right; line-height: 1.2; opacity: .95; }

/* ==========================================================================
   Impresión
   ========================================================================== */
@media print {
  @page { margin: 10mm; }

  html, body { background: #fff !important; color: #000 !important; height: auto !important; overflow: visible !important; }
  body::before, body::after { display: none !important; }

  /* Con el diálogo de gafetes abierto, solo la hoja de gafetes. */
  html.has-modal body > *:not(#badges-modal) { display: none !important; }
  html.has-modal #badges-modal {
    position: static !important; display: block !important; padding: 0 !important;
    background: none !important; backdrop-filter: none !important; animation: none !important;
  }
  html.has-modal #badges-modal .modal-card {
    max-width: none !important; max-height: none !important; width: auto !important;
    border: 0 !important; border-radius: 0 !important; overflow: visible !important;
    background: none !important; box-shadow: none !important; animation: none !important;
  }
  html.has-modal #badges-modal .modal-head { display: none !important; }
  html.has-modal #badges-modal .modal-body { padding: 0 !important; overflow: visible !important; }

  .badges-grid { grid-template-columns: repeat(2, 90mm) !important; gap: 6mm !important; }
  .badges-grid.is-single { grid-template-columns: 90mm !important; }
  /* Guía de corte en lugar de la sombra de pantalla */
  .badge { box-shadow: none !important; outline: .25mm dashed #9a958c; outline-offset: 0; border-radius: 0 !important; }

  /* Sin el diálogo: la página en tinta oscura sobre papel, legible. */
  html:not(.has-modal) .topbar, html:not(.has-modal) .botnav, html:not(.has-modal) .toast-region,
  html:not(.has-modal) .presenter-only, html:not(.has-modal) [data-volver-portafolio] { display: none !important; }
  html:not(.has-modal) .main * { color: #000 !important; background: transparent !important; box-shadow: none !important; }
}
