/* ═══════════════════════════════════════════════════════════════
   Blueprint.gg — Print Stylesheet
   Optimised for ink-saving, readable printouts of articles,
   legal pages, and general site content.
   ═══════════════════════════════════════════════════════════════ */

@media print {

  /* ── Hide non-content elements ── */
  .nav,
  .footer,
  [class$="-cta"],
  .newsletter,
  .float-toc,
  .reading-progress,
  .nav__toggle,
  .btn,
  .hero__ctas,
  .post-related,
  .post-author,
  .post-link-card,
  .badge {
    display: none !important;
  }

  /* ── Base reset for print ── */
  *,
  *::before,
  *::after {
    background: transparent !important;
    color: var(--color-slate-900) !important;
    box-shadow: none !important;
    text-shadow: none !important;
    border-radius: 0 !important;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
    color: var(--color-slate-900);
    background: var(--color-white);
    margin: 0;
    padding: 0;
  }

  /* ── Typography scale ── */
  h1 { font-size: 24pt; }
  h2 { font-size: 20pt; }
  h3 { font-size: 16pt; }
  h4 { font-size: 14pt; }
  h5, h6 { font-size: 12pt; }

  h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
    break-after: avoid;
  }

  p, li, td, th, blockquote {
    font-size: 12pt;
    orphans: 3;
    widows: 3;
  }

  /* ── Links: show URL after text ── */
  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 10pt;
    font-weight: normal;
    word-break: break-all;
  }

  /* Don't print URL for anchor links */
  a[href^="#"]::after {
    content: none;
  }

  /* Don't print URL for inline-toc links (they're all anchors) */
  .inline-toc a::after {
    content: none;
  }

  /* ── Hero sections: remove dark bg, make text readable ── */
  .hero--dark,
  .post-hero,
  .legal-hero {
    padding-top: 1cm;
    padding-bottom: 0.5cm;
  }

  /* ── Article / legal body ── */
  .post-body,
  .legal-body {
    max-width: 100%;
    padding: 0;
  }

  /* ── Inline TOC: keep visible for reference ── */
  .inline-toc {
    border: 1px solid var(--color-slate-300) !important;
    padding: 0.5cm;
    margin-bottom: 0.5cm;
  }

  .inline-toc__collapse {
    max-height: none !important;
    opacity: 1 !important;
    overflow: visible !important;
  }

  /* ── Callout boxes ── */
  .post-callout {
    border-left: 3pt solid var(--color-slate-900) !important;
    padding: 0.3cm;
    margin-bottom: 0.5cm;
  }

  /* ── Tables ── */
  table {
    border-collapse: collapse;
    width: 100%;
  }

  th, td {
    border: 1px solid var(--color-slate-900) !important;
    padding: 4pt 6pt;
  }

  .comparison__table {
    border: 1px solid var(--color-slate-900) !important;
  }

  /* ── Blockquotes ── */
  blockquote {
    border-left: 3pt solid var(--color-slate-900) !important;
    padding-left: 0.5cm;
    margin-left: 0;
  }

  /* ── Images ── */
  img {
    max-width: 100% !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  /* ── Tools cards: clean print without coming-soon overlays ── */
  .tools-card--coming-soon {
    opacity: 1 !important;
  }

  .tools-card__cta--muted {
    display: none !important;
  }

  .tools-card {
    border: 1px solid var(--color-slate-300) !important;
  }

  /* ── UTM builder: hide interactive elements, keep preview ── */
  .utm-builder__form-panel {
    display: none !important;
  }

  .utm-builder__sticky-copy {
    display: none !important;
  }

  .utm-builder__preview-panel {
    position: static !important;
  }

  .utm-builder__preview-actions {
    display: none !important;
  }

  .utm-builder__layout {
    grid-template-columns: 1fr !important;
  }

  /* ── Prevent page breaks inside key elements ── */
  .card,
  [class*="card"],
  .accordion__item,
  .faq__item,
  table,
  tr,
  .post-callout,
  .post-takeaways,
  .inline-toc,
  figure,
  pre {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  /* ── Code blocks ── */
  pre {
    border: 1px solid var(--color-slate-300) !important;
    padding: 0.3cm;
    white-space: pre-wrap;
    word-wrap: break-word;
  }

  /* ── Page margins ── */
  @page {
    margin: 2cm;
  }
}
