/**
 * print.css
 * Print-optimized styles for Sermonizr sermon output.
 * Loaded with media="print" — only applies when printing.
 */

@media print {
  /* ======================================================================
     HIDE INTERACTIVE UI
     ====================================================================== */
  .app-header,
  .meta-family-grid,
  .denomination-detail,
  .denomination-info,
  .date-row,
  .readings-section,
  .no-lectionary-note,
  .style-row,
  .style-subtitle,
  .style-disclaimer,
  .topic-textarea,
  .topic-controls,
  .candidates-section,
  .generating-indicator,
  .candidate-error,
  .sermon-header,
  .sermon-toolbar,
  .sermon-textarea,
  .sermon-usage,
  .editor-tabs,
  .length-row,
  .advanced-toggle,
  .advanced-panel,
  .generate-sermon-row,
  .clipboard-toast,
  .teleprompter-modal-overlay,
  .export-popover,
  .export-wrapper,
  .btn-icon,
  .btn,
  .btn-sm,
  .btn-outline,
  .btn-primary,
  .btn-accent,
  .btn-generate,
  .connection-status,
  .control-group,
  .checkbox-label,
  .spinner,
  .card h2 {
    display: none !important;
  }

  /* Hide all cards except the sermon editor */
  .card:not(.sermon-editor-card) {
    display: none !important;
  }

  /* ======================================================================
     RESET PAGE LAYOUT
     ====================================================================== */
  * {
    box-shadow: none !important;
  }

  body {
    background: white !important;
    color: black !important;
    font-family: Georgia, 'Times New Roman', Times, serif !important;
    font-size: 12pt !important;
    line-height: 2 !important; /* double-spaced */
    margin: 0;
    padding: 0;
  }

  .app-main {
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .card.sermon-editor-card {
    background: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
  }

  /* ======================================================================
     SERMON TEXT FORMATTING
     ====================================================================== */
  .sermon-display {
    background: none !important;
    border: none !important;
    padding: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    font-family: Georgia, 'Times New Roman', Times, serif !important;
    font-size: 12pt !important;
    line-height: 2 !important;
    color: black !important;
  }

  .sermon-display h1 {
    font-size: 18pt !important;
    font-weight: bold !important;
    color: black !important;
    text-align: center !important;
    margin-bottom: 12pt !important;
    page-break-after: avoid !important;
  }

  .sermon-display h2 {
    font-size: 14pt !important;
    font-weight: bold !important;
    color: black !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    margin-top: 18pt !important;
    margin-bottom: 6pt !important;
    page-break-after: avoid !important;
  }

  .sermon-display h3 {
    font-size: 12pt !important;
    font-weight: bold !important;
    color: black !important;
    margin-top: 12pt !important;
    margin-bottom: 6pt !important;
    page-break-after: avoid !important;
  }

  .sermon-display p {
    margin-bottom: 6pt !important;
    text-indent: 0.5in !important;
    orphans: 3 !important;
    widows: 3 !important;
  }

  .sermon-display p:first-child,
  .sermon-display h1 + p,
  .sermon-display h2 + p,
  .sermon-display h3 + p {
    text-indent: 0 !important;
  }

  .sermon-display strong {
    font-weight: bold !important;
    color: black !important;
  }

  .sermon-display em {
    font-style: italic !important;
  }

  /* Scripture references: bold in print, remove hyperlink styling */
  .sermon-display a,
  .sermon-display a.scripture-ref {
    color: black !important;
    text-decoration: none !important;
    border-bottom: none !important;
    font-weight: bold !important;
  }

  /* ======================================================================
     PAGE SETUP
     ====================================================================== */
  @page {
    size: letter;
    margin: 1in;
  }

  /* ======================================================================
     PAGE NUMBERS (via CSS counter)
     ====================================================================== */
  @page {
    @bottom-center {
      content: counter(page);
      font-family: Georgia, serif;
      font-size: 10pt;
      color: #666;
    }
  }

  /* ======================================================================
     SPLIT VIEW: hide textarea, show only preview
     ====================================================================== */
  .sermon-split {
    display: block !important;
    grid-template-columns: none !important;
  }

  .sermon-split .sermon-textarea {
    display: none !important;
  }
}
