/* ==========================================================================
   Studio preview — mm-accurate pages drawn by assets/js/worksheet-preview.js.
   Uses the same font (Andika, SIL OFL) the PDF embeds.
   ========================================================================== */
@font-face {
  font-family: 'PVAndika';
  src: url('../fonts/andika/andika-latin-400-normal.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'PVAndika';
  src: url('../fonts/andika/andika-latin-700-normal.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}

/* The old .paper card becomes a transparent holder for real pages. */
.paper.pvp-paper {
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  min-height: 0 !important;
  max-width: none !important;
  border-radius: 0;
  overflow: visible;
}
.paper.pvp-paper::before, .paper.pvp-paper::after { content: none !important; }

.pvp-stack { width: max-content; }
.pvp-page {
  position: relative;
  background: #fff;
  font-family: 'PVAndika', 'Andika', system-ui, sans-serif;
  color: rgb(30, 41, 59);
  overflow: hidden;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.08),
    0 8px 24px -4px rgba(15, 23, 42, 0.12);
  border-radius: 2px;
}
.pvp-abs { position: absolute; margin: 0; padding: 0; }
.pvp-break {
  font: 600 12px/1 system-ui, sans-serif;
  color: #64748b;
  text-align: center;
  padding: 14px 0 10px;
  letter-spacing: .02em;
}

/* More options (Studio panel) */
.more-options { margin-top: 12px; border-top: 1px solid var(--border, #e2e8f0); padding-top: 10px; }
.more-options summary { cursor: pointer; font-weight: 600; font-size: 14px; list-style-position: inside; }
.more-options-hint { font-weight: 400; color: #64748b; font-size: 12px; margin-left: 4px; }
.more-options .form-field { margin: 10px 0; }
.more-options .control-select { width: 100%; max-width: 220px; }
.opt-note { color: #64748b; font-size: 12px; }
.word-notices {
  margin: 8px 0 0; padding: 8px 10px; border-radius: 8px;
  background: #fff7ed; color: #9a3412; font-size: 13px; line-height: 1.4;
}

/* Toolbar: keep three actions usable on small screens */
.preview-toolbar-actions { flex-wrap: wrap; }
@media (max-width: 480px) {
  .preview-toolbar-actions .btn { padding-left: 10px; padding-right: 10px; }
}

/* Printing the preview prints the real pages, one per sheet. */
@media print {
  .pvp-break { display: none !important; }
  .paper.pvp-paper { width: auto !important; height: auto !important; transform: none !important; }
  .pvp-stack { transform: none !important; }
  .pvp-page { box-shadow: none; border-radius: 0; break-after: page; page-break-after: always; }
  .pvp-page:last-child { break-after: auto; page-break-after: auto; }
  @page { margin: 0; }
}

/* Theme backgrounds on rendered pages */
.pvp-page.theme-space { background: linear-gradient(180deg, #fff 0%, #f0f5ff 100%); }
.pvp-page.theme-nature { background: linear-gradient(180deg, #fff 0%, #f0fdf4 100%); }
.pvp-page.theme-ocean { background: linear-gradient(180deg, #fff 0%, #ecfeff 100%); }
.pvp-page.theme-animals { background: linear-gradient(180deg, #fff 0%, #fff7ed 100%); }
.pvp-page.theme-school { background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%); }
.pvp-page.theme-festive { background: linear-gradient(180deg, #fff 0%, #fdf2f8 100%); }
.pvp-page.theme-rainbow { background: linear-gradient(180deg, #faf5ff 0%, #ede9fe 100%); }

/* Ink-saving: even inherited text colour is neutral grey. */
.pvp-ink .pvp-page { color: rgb(43, 43, 43); }
