/* IntelliCert print stylesheet — clean PDF/print output for topics & workbooks. */
@media print {
  @page { size: A4; margin: 18mm 14mm; }
  body { background: #fff !important; color: #111 !important; font-family: Georgia, 'Times New Roman', serif; }
  body[data-theme="dark"] { background: #fff !important; color: #111 !important; }

  /* Hide app chrome */
  .sidebar, .sidebar-overlay, .app-header, .scroll-progress,
  .lesson-flow-bar, .focus-mode-trigger, .try-before, .smart-summary,
  .topic-detail-actions, .ai-section, .youtube-section, .topic-detail-nav,
  .coach-widget, #app-header, .breadcrumb, .listen-btn, .concept-listen-btn,
  .mark-read-btn, .bookmark-btn, button, .btn, .qr-on-screen { display: none !important; }

  .main-content { margin-left: 0 !important; padding: 0 !important; }
  .content-area { padding: 0 !important; max-width: 100% !important; }

  h1 { font-size: 24pt; color: #1A3557 !important; border-bottom: 2pt solid #EA580C; padding-bottom: 6pt; margin: 0 0 12pt; page-break-after: avoid; }
  h2 { font-size: 16pt; color: #1A3557 !important; margin-top: 16pt; margin-bottom: 6pt; page-break-after: avoid; }
  h3 { font-size: 13pt; color: #333 !important; page-break-after: avoid; }
  p, li { font-size: 11pt; line-height: 1.55; color: #222 !important; }

  .detail-card, .content-section { background: #fff !important; border: 1pt solid #ddd !important; box-shadow: none !important; padding: 10pt !important; margin-bottom: 10pt !important; page-break-inside: avoid; border-radius: 4pt !important; }
  .detail-card .detail-card-body { display: block !important; }
  .detail-card.open .detail-card-body, .detail-card .detail-card-body { max-height: none !important; overflow: visible !important; }

  table { width: 100%; border-collapse: collapse; page-break-inside: avoid; }
  th, td { border: 0.5pt solid #999; padding: 4pt 6pt; font-size: 10pt; }
  th { background: #F1F5F9 !important; color: #1A3557 !important; }

  svg { max-width: 100%; height: auto; }
  img { max-width: 100%; page-break-inside: avoid; }

  /* Page break helpers */
  .page-break { page-break-before: always; }
  .no-break { page-break-inside: avoid; }

  /* Print-only header & footer */
  .print-header { display: block !important; text-align: center; border-bottom: 1pt solid #1A3557; padding-bottom: 6pt; margin-bottom: 12pt; font-size: 9pt; color: #666; }
  .print-footer { display: block !important; position: fixed; bottom: 6mm; left: 0; right: 0; text-align: center; font-size: 8pt; color: #888; border-top: 0.5pt solid #ccc; padding-top: 4pt; }
  .print-qr { display: block !important; position: fixed; bottom: 6mm; right: 8mm; width: 22mm; height: 22mm; }

  /* Workbook answer key */
  .answer-key { page-break-before: always; }
  .answer-key h2 { border-top: 2pt solid #EA580C; padding-top: 8pt; }
}

/* Print-only elements (hidden on screen) */
.print-header, .print-footer, .print-qr { display: none; }
