/* ============================================================
   PRINT STYLESHEET
   The Louis Clergerie Letter — michaeldbush.org/clergerie
   ============================================================ */

@media print {

  /* --- Page setup --- */
  @page {
    margin: 2cm 2.5cm;
    size: A4 portrait;
  }

  @page :first {
    margin-top: 3cm;
  }

  /* --- Reset screen layout --- */
  *,
  *::before,
  *::after {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  body {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 11pt;
    line-height: 1.6;
    color: #000;
  }

  /* --- Hide non-content elements --- */
  .site-header,
  .site-footer,
  .nav-toggle,
  .nav-links,
  .hero-image,
  .nav-cards,
  .thumb-btn,
  .thumbnail-strip,
  .lang-tabs,
  .lightbox,
  .lightbox-close,
  .lightbox-prev,
  .lightbox-next,
  .lightbox-counter,
  .download-card-icon {
    display: none !important;
  }

  /* --- Remove sticky/fixed positioning --- */
  .site-header,
  .letter-image-panel,
  .letter-text-panel {
    position: static !important;
    max-height: none !important;
    overflow: visible !important;
  }

  /* --- Site wrapper: remove flex column --- */
  .site-wrapper {
    display: block;
    min-height: auto;
  }

  .site-main {
    padding: 0;
  }

  /* --- Links: show URL after link text --- */
  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #444 !important;
    word-break: break-all;
  }

  /* Don't print URLs for nav links or download cards (redundant) */
  .nav-links a::after,
  .download-card::after {
    content: none;
  }

  /* --- Typography --- */
  h1 {
    font-size: 22pt;
    margin-bottom: 6pt;
    page-break-after: avoid;
  }

  h2 {
    font-size: 16pt;
    margin-top: 24pt;
    margin-bottom: 8pt;
    page-break-after: avoid;
  }

  h3 {
    font-size: 12pt;
    margin-top: 16pt;
    margin-bottom: 4pt;
    page-break-after: avoid;
  }

  p, li {
    orphans: 3;
    widows: 3;
  }

  blockquote {
    border-left: 2pt solid #666;
    padding-left: 12pt;
    margin: 12pt 0;
    font-style: italic;
  }

  pre, code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 9pt;
    border: 1pt solid #ccc;
    padding: 8pt 10pt;
    white-space: pre-wrap;
    word-break: break-word;
    page-break-inside: avoid;
  }

  pre code {
    border: none;
    padding: 0;
  }

  /* --- Content width: full column, no max-width --- */
  .content-wrap {
    max-width: none;
  }

  /* --- Hero: strip to heading block only --- */
  .hero {
    min-height: auto;
    padding: 0;
    margin: 0;
    background: none;
    display: block;
  }

  .hero-content {
    position: static;
  }

  .hero h1 {
    color: #000;
  }

  .hero-intro {
    font-size: 11pt;
    color: #000;
  }

  .hero-epigraph blockquote {
    color: #333;
  }

  /* --- Letter viewer: single column --- */
  .letter-viewer {
    display: block;
  }

  .letter-active-image img {
    max-width: 100%;
    page-break-after: always;
  }

  /* Show only the active (visible) tabpanel; hide others */
  .tabpanel[hidden] {
    display: none !important;
  }

  .letter-text {
    font-size: 10.5pt;
    line-height: 1.7;
  }

  /* --- Pull-quotes --- */
  .pull-quote {
    font-size: 13pt;
    border-top: 1pt solid #888;
    border-bottom: 1pt solid #888;
    padding: 10pt 0;
    margin: 16pt 0;
    page-break-inside: avoid;
  }

  /* --- Timeline aside: inline, no float --- */
  .timeline-aside {
    float: none;
    width: auto;
    border: 1pt solid #ccc;
    margin: 12pt 0;
    page-break-inside: avoid;
  }

  /* --- Info boxes --- */
  .info-box {
    border: 1pt solid #999;
    border-left: 4pt solid #444;
    padding: 8pt 10pt;
    margin: 10pt 0;
    page-break-inside: avoid;
  }

  /* --- Highlight passage --- */
  .highlight-passage {
    border-left: 2pt solid #666;
    padding-left: 10pt;
    font-style: italic;
    page-break-inside: avoid;
  }

  /* --- Download cards: print as plain list items --- */
  .download-card {
    display: block;
    border: 1pt solid #ccc;
    padding: 8pt 10pt;
    margin: 8pt 0;
    page-break-inside: avoid;
    text-decoration: none;
  }

  .download-card h3 {
    margin-top: 0;
  }

  /* --- Nav cards: hide on print (page links irrelevant on paper) --- */
  .nav-cards {
    display: none;
  }

  /* --- Page title block --- */
  .page-title-block {
    border-bottom: 1pt solid #888;
    padding-bottom: 8pt;
    margin-bottom: 20pt;
  }

  /* --- Research steps --- */
  .research-step {
    border-bottom: 1pt solid #ccc;
    padding-bottom: 12pt;
    margin-bottom: 12pt;
    page-break-inside: avoid;
  }

  .step-number {
    font-size: 20pt;
    color: #ccc !important;
  }

  /* --- Kicker labels --- */
  .kicker,
  .nav-card-label,
  .download-card-label,
  .timeline-aside-label,
  .info-box-label {
    font-size: 8pt;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #666 !important;
  }

  /* --- Images inside letter pages: allow page breaks after --- */
  .letter-active-image {
    page-break-inside: avoid;
  }
}
