/* CASE STUDY — PRINT STYLESHEET
 * Loaded by views/case-study.ejs so that Cmd+P on /case-study produces the
 * same output as /case-study/print. The on-screen dark theme is preserved;
 * all rules are scoped to @media print so they don't bleed into the live view.
 *
 * Color philosophy: invert the dark-on-dark brand theme to black-on-white so
 * the printed PDF is legible for an email recipient who prints in B&W, while
 * preserving the visual hierarchy (headline weight, accent gold → solid black).
 */

@page {
  size: Letter;
  margin: 0.6in 0.5in;
}

@media print {
  /* THEME OVERRIDES — swap the dark palette for a print-safe one */
  :root {
    --bg: #ffffff;
    --bg-alt: #ffffff;
    --bg-panel: #ffffff;
    --fg: #111111;
    --fg-muted: #333333;
    --accent: #000000;
    --accent-dim: rgba(0, 0, 0, 0);
    --amber: #000000;
    --amber-dim: rgba(0, 0, 0, 0);
    --border: #000000;
    --border-dim: #999999;
  }

  html, body {
    background: #ffffff !important;
    color: #111111 !important;
  }

  /* CHROME — strip nav, footer, CTAs, toasts, and analytics from the PDF */
  .site-nav,
  .site-footer,
  #cs-copy-link-btn,
  #cs-pdf-btn,
  #cs-hero-pdf-btn,
  #cs-copy-toast,
  .roadmap-cta,
  script {
    display: none !important;
  }

  /* Disable effects that print as solid black blocks */
  *, *::before, *::after {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
    background-image: none !important;
  }

  /* Reset fixed positioning so content flows naturally on the printed page */
  body { overflow: visible !important; }

  /* SPACING — tighter than on screen so the content fits on a Letter page */
  .sp-hero {
    min-height: 0 !important;
    padding: 0 0 24px !important;
    border-bottom: 2px solid #000 !important;
  }

  .sp-hero-grid,
  .sp-hero::before { display: none !important; }

  .sp-hero-inner {
    padding: 0 !important;
    max-width: 100% !important;
  }

  .sp-hero-headline {
    /* The on-screen clamp(56px, 8vw, 96px) is sized for a viewport;
     * for print we want a fixed size that fits on Letter. */
    font-size: 28pt !important;
    line-height: 1.05 !important;
    color: #000 !important;
    margin-bottom: 16px !important;
  }

  .sp-hero-headline-accent {
    color: #000 !important;
    border-bottom: 1px solid #000;
    padding-bottom: 2px;
  }

  .hero-eyebrow {
    color: #000 !important;
    margin-bottom: 8px !important;
  }

  .sp-hero-sub {
    color: #111 !important;
    max-width: 100% !important;
    margin-bottom: 16px !important;
    font-size: 11pt !important;
  }

  .sp-hero-badges { gap: 8px !important; }

  .tag {
    color: #000 !important;
    background: transparent !important;
    border: 1px solid #000 !important;
    padding: 2px 8px !important;
    font-size: 9pt !important;
  }

  /* SECTION FRAMEWORK */
  .section-eyebrow {
    color: #000 !important;
    margin-bottom: 8px !important;
  }

  .section-heading {
    color: #000 !important;
    font-size: 18pt !important;
    margin-bottom: 24px !important;
  }

  .sp-cases,
  .sp-testimonials,
  .sp-cta,
  .cs-prose-section,
  .services,
  .credentials,
  .difference,
  .closing,
  .sp-share {
    padding: 24px 0 !important;
    border-top: 1px solid #000 !important;
    border-bottom: 1px solid #000 !important;
    background: #fff !important;
  }

  .cs-prose-section-alt {
    background: #fff !important;
  }

  .sp-cases-inner,
  .sp-testimonials-inner,
  .sp-cta-inner,
  .cs-prose-inner,
  .sp-share-inner,
  .stats-inner {
    padding: 0 !important;
    max-width: 100% !important;
  }

  /* CARDS — keep each pillar finding on one page */
  .sp-case-card {
    background: #fff !important;
    border: 1px solid #000 !important;
    padding: 16px !important;
    margin-bottom: 12px !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .sp-case-headline {
    color: #000 !important;
    font-size: 14pt !important;
    margin-bottom: 8px !important;
  }

  .sp-case-body {
    color: #111 !important;
    font-size: 10pt !important;
    line-height: 1.5 !important;
  }

  .sp-case-meta {
    border-top: 1px solid #000 !important;
    padding-top: 8px !important;
    gap: 16px !important;
    color: #000 !important;
    font-size: 9pt !important;
  }

  .cs-ranking {
    background: #fff !important;
    border: 1px solid #000 !important;
    padding: 16px !important;
    margin-top: 16px !important;
    page-break-inside: avoid !important;
  }

  .cs-ranking-list li {
    color: #111 !important;
    font-size: 10pt !important;
  }

  .cs-ranking-list li strong {
    color: #000 !important;
  }

  .cs-prose {
    color: #111 !important;
    font-size: 11pt !important;
    line-height: 1.5 !important;
    margin-bottom: 12px !important;
  }

  .cs-prose a {
    color: #000 !important;
    text-decoration: underline !important;
  }

  /* STATS ROW */
  .stats-row {
    background: #fff !important;
    border-top: 2px solid #000 !important;
    border-bottom: 2px solid #000 !important;
    padding: 16px 0 !important;
  }

  .stat-item {
    padding: 0 16px !important;
  }

  .stat-item:not(:last-child) {
    border-right: 1px solid #000 !important;
  }

  .stat-value {
    color: #000 !important;
    font-size: 20pt !important;
  }

  .stat-label {
    color: #111 !important;
    font-size: 9pt !important;
  }

  /* CREDENTIALS PARTIAL — fall back to plain text */
  .credentials,
  .services,
  .difference,
  .closing {
    page-break-inside: avoid !important;
  }
}
