/* ============================================================
   TC Sentinel — Print CSS
   Applied when printing or rendering to PDF via Playwright.
   ============================================================ */

@page {
  size: 11in 17in;   /* Tabloid / broadsheet */
  margin: 0.5in 0.5in 0.6in 0.5in;

  @top-center {
    content: "TC Sentinel — " string(issue-date);
    font-family: 'Libre Franklin', Arial, sans-serif;
    font-size: 7pt;
    color: #666;
  }

  @bottom-left {
    content: "© " counter(year) " TC Sentinel";
    font-family: 'Libre Franklin', Arial, sans-serif;
    font-size: 7pt;
    color: #666;
  }

  @bottom-right {
    content: "Page " counter(page);
    font-family: 'Libre Franklin', Arial, sans-serif;
    font-size: 7pt;
    color: #666;
  }
}

@page :first {
  @top-center { content: none; }
}

/* Force page breaks between newspaper pages */
.newspaper-page { page-break-after: always; break-after: page; }
.newspaper-page:last-child { page-break-after: avoid; break-after: avoid; }

/* Issue date for running header */
.issue-date-string { string-set: issue-date content(); }

/* Print-specific resets */
@media print {
  body {
    background: white !important;
    font-size: 9.5pt;
  }

  .page {
    max-width: none;
    padding: 0;
    border: none;
    box-shadow: none;
  }

  /* Hide editorial dashboard elements in print */
  nav, .dashboard-controls, .no-print { display: none !important; }

  /* Ensure images print */
  img { max-width: 100%; page-break-inside: avoid; }

  /* Avoid breaking inside articles */
  .article { page-break-inside: avoid; break-inside: avoid; }

  /* Reduce font sizes slightly for print density */
  .masthead-text { font-size: 38pt; }
  .article .headline { font-size: 14pt; }
  .article .headline.xl { font-size: 22pt; }
  .article .headline.lg { font-size: 18pt; }
  .article .body { font-size: 9.5pt; line-height: 1.5; }
  .article .byline { font-size: 7pt; }
  .section-label { font-size: 7pt; }

  /* Crop marks for print production (optional) */
  /* Uncomment if sending to printer:
  .newspaper-page {
    outline: 0.5pt solid #ccc;
    outline-offset: 0.25in;
  }
  */

  a { color: inherit; text-decoration: none; }
  a[href]::after { content: none; }
}
