/* Print stylesheet for professional paged output */

/* Ensure colors are preserved */
* {
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

html, body {
  margin: 0;
  padding: 0;
  background: #f0f0f0; /* preview backdrop */
  color: #000;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.print-container {
  width: 100%;
  margin: 0 auto;
  padding: 20px 0;
}

.print-page {
  position: relative;
  background: white;
  margin: 0 auto 20px auto;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.page-inner {
  position: relative;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 48px; /* default padding; JS may override content area height */
  display: flex;
  flex-direction: column;
}

.page-header, .page-footer {
  flex: 0 0 auto;
  font-size: 12px;
  color: #555;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.page-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.page-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.no-break {
  break-inside: avoid-page;
  page-break-inside: avoid;
}

/* Tables for printable sections */
.print-table {
  width: 100%;
  border-collapse: collapse;
}
.print-table th,
.print-table td {
  border-bottom: 1px solid #ddd;
  padding: 6px 8px;
  font-size: 12px;
}
.print-table tfoot td {
  font-weight: bold;
}
.section-block { margin-bottom: 16px; }
.section-title { font-size: 16px; font-weight: 800; margin: 8px 0; }

/* Script specific coloring (optional) */
.script-line.scene_heading { font-weight: bold; }
.script-line.character { font-weight: bold; }

/* Anclaje de numeración lado y lado en encabezado de escena */
.scene_heading { position: relative; }
.scene-number-left { position: absolute; left: -1in; white-space: nowrap; }
.scene-number-right { position: absolute; right: -1in; white-space: nowrap; }

@media print {
  html, body { background: white; }
  .print-page { box-shadow: none; margin-bottom: 0; }
}


