/* InsightRPG Print Stylesheet
   ===========================
   Optimised for PDF generation and browser print.
*/

@media print {
  @page {
    size: A4 portrait;
    margin: 20mm 18mm 25mm 18mm;
  }

  @page :first {
    margin-top: 0;
  }

  body {
    font-size: 10pt;
    line-height: 1.5;
    color: #1a1a1a;
    background: white;
    max-width: none;
    padding: 0;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Hide interactive / screen-only elements */
  .sidebar,
  .nav-toc,
  .skip-link,
  .section-nav,
  .product-nav,
  .lgp-endorser,
  .lgp-footer,
  .lgp-cross-ctas,
  .lgp-cross-cta,
  .cross-cta-section,
  .theme-toggle,
  .no-print {
    display: none !important;
  }

  /* Layout flatten */
  .page,
  .page--with-sidebar {
    display: block;
  }

  .main {
    padding: 0;
    max-width: none;
  }

  p, li {
    max-width: none;
  }

  .callout, .stat-block, .exercise-card {
    max-width: none;
  }

  /* Page breaks */
  h1, h2, h3 {
    page-break-after: avoid;
    break-after: avoid;
  }

  article {
    page-break-before: always;
    break-before: page;
  }

  article:first-of-type {
    page-break-before: auto;
    break-before: auto;
  }

  .stat-block,
  .callout,
  .exercise-card,
  table,
  figure,
  .no-break {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  /* Links */
  a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: #999;
  }

  a[href^="http"]::after {
    content: " [" attr(href) "]";
    font-family: 'iA Writer Mono', 'Courier New', monospace;
    font-size: 7pt;
    color: #666;
    word-break: break-all;
  }

  a[href^="/"]::after,
  a[href^="#"]::after {
    content: none;
  }

  /* Component adjustments */
  .callout {
    border-left-width: 3pt;
  }

  .stat-block {
    border-top-width: 3pt;
  }

  .exercise-card {
    box-shadow: none;
    border-width: 1pt;
  }

  tbody tr:nth-child(even) {
    background-color: #f5f5f5 !important;
  }

  .spread--cover {
    min-height: auto;
    padding: 40mm 0;
  }

  .footer {
    display: none;
  }
}
