@media print {

  /* =========================================================
     1. Page setup
     ========================================================= */

  @page {
    margin: 2.2cm;
  }

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

  body {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 11.5pt;
    line-height: 1.55;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* =========================================================
     2. Hide site chrome / web-only elements
     ========================================================= */

  .site-header,
  nav,
  .hero,
  .hero-media,
  .hero-overlay,
  .site-footer,
  .breadcrumbs,
  .page-tools,
  .post-tools,
  .no-print,
  .related-entries,
  .related-summary,
  .related-entries-inner,
  .series-nav,
  .entry-nav,
  .entry-nav-back,
  .copy-btn,
  .dataset-citation details,
  .dataset-citation summary,
  .dataset-bibtex {
    display: none !important;
  }

  /* =========================================================
     3. Core layout reset
     ========================================================= */

  main,
  .site-container,
  .container,
  article,
  .methods-entry,
  .notebook-entry {
    max-width: none !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    color: #111111 !important;
    border: 0 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  /* =========================================================
     4. Shared print typography
     ========================================================= */

  h1, h2, h3, h4, h5, h6,
  p, li, blockquote, figcaption,
  .methods-entry-header,
  .methods-entry-body,
  .notebook-entry-body,
  .print-imprint,
  .print-journal,
  .print-tagline,
  .print-title,
  .print-meta {
    color: #111111 !important;
    background: transparent !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  h1, h2, h3 {
    page-break-after: avoid;
    break-after: avoid-page;
    page-break-inside: avoid;
    break-inside: avoid-page;
  }

  h1 + *,
  h2 + *,
  h3 + * {
    page-break-before: avoid;
    break-before: avoid-page;
  }

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

  /* =========================================================
     5. Shared title system
     ========================================================= */

  .print-title-block {
    display: block !important;
    margin: 0 0 1.2cm 0 !important;
    padding: 0 !important;
    text-align: left;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  .print-title-block::before,
  .print-title-block::after {
    content: none !important;
    display: none !important;
  }

  .print-imprint {
    margin: 0 0 0.55cm 0 !important;
    padding: 0 !important;
    border: 0 !important;
  }

  .print-journal {
    display: block;
    font-size: 10.5pt;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 0 0 0.08cm 0 !important;
  }

  .print-tagline {
    display: block;
    font-size: 9.5pt;
    font-style: italic;
    color: #444444 !important;
    margin: 0 !important;
  }

  .print-title {
    font-size: 22pt;
    line-height: 1.15;
    font-weight: 700;
    margin: 0 0 0.45cm 0 !important;
    padding: 0 !important;
    border: 0 !important;
  }

  .print-meta {
    font-size: 10pt;
    color: #444444 !important;
    margin: 0 !important;
  }

  /* =========================================================
     6. Optional cover-page mode
     ========================================================= */

  .print-cover-page {
    display: none !important;
  }

  .print-cover-inner,
  .print-cover-mark,
  .print-cover-tagline,
  .print-cover-title,
  .print-cover-meta {
    background: transparent !important;
    color: #111111 !important;
    border: 0 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  /* =========================================================
     7. Blog posts
     ========================================================= */

  .notebook-entry-header {
    display: none !important;
  }

  .notebook-entry-body {
    margin: 0 !important;
    padding: 0 !important;
  }

  .notebook-entry-body p {
    margin: 0 0 0.45cm 0 !important;
  }

  .notebook-entry-body h2 {
    margin-top: 0.9cm !important;
    margin-bottom: 0.28cm !important;
    font-size: 14pt !important;
    line-height: 1.25;
    font-weight: 700;
  }

  .notebook-entry-body h3 {
    margin-top: 0.7cm !important;
    margin-bottom: 0.2cm !important;
    font-size: 12pt !important;
    line-height: 1.25;
    font-weight: 700;
  }

  .notebook-entry-body ul,
  .notebook-entry-body ol {
    margin: 0.18cm 0 0.5cm 0 !important;
    padding-left: 1.1cm !important;
  }

  .notebook-entry-body img,
  .notebook-entry-body figure,
  .notebook-entry-body table,
  .notebook-entry-body pre,
  .notebook-entry-body blockquote {
    page-break-inside: avoid;
    break-inside: avoid-page;
  }

  .notebook-entry-body img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
    margin: 0.5cm auto !important;
    border: 0 !important;
  }

  /* =========================================================
     8. Methods pages
     ========================================================= */

  .methods-entry-header {
    display: block !important;
    margin: 0 0 1.2cm 0 !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    page-break-inside: avoid;
    break-inside: avoid-page;
  }

  .methods-entry-header::before,
  .methods-entry-header::after {
    content: none !important;
    display: none !important;
  }

  .methods-entry-header h1 {
    margin: 0 0 0.45cm 0 !important;
    padding: 0 !important;
    font-size: 22pt !important;
    line-height: 1.15 !important;
    font-weight: 700 !important;
    color: #111111 !important;
    border: 0 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  .methods-entry-description {
    margin: 0 !important;
    font-size: 10pt !important;
    color: #444444 !important;
  }

  .methods-entry-body p {
    margin: 0 0 0.42cm 0 !important;
  }

  .methods-entry-body h2 {
    margin-top: 0.9cm !important;
    margin-bottom: 0.28cm !important;
    font-size: 14pt !important;
    line-height: 1.25;
    font-weight: 700;
  }

  .methods-entry-body h3 {
    margin-top: 0.7cm !important;
    margin-bottom: 0.2cm !important;
    font-size: 12pt !important;
    line-height: 1.25;
    font-weight: 700;
  }

  .methods-entry-body ul,
  .methods-entry-body ol {
    margin: 0.18cm 0 0.5cm 0 !important;
    padding-left: 1.1cm !important;
  }

  /* =========================================================
     9. Shared content elements
     ========================================================= */

  figure {
    margin: 0.6cm 0 !important;
  }

  figcaption {
    font-size: 9.5pt !important;
    line-height: 1.35;
    margin-top: 0.2cm !important;
  }

  blockquote {
    margin: 0.6cm 0 !important;
    padding: 0.2cm 0 0.2cm 0.45cm !important;
    border-left: 2px solid #999999 !important;
    background: transparent !important;
  }

  a,
  a:visited {
    color: #111111 !important;
    text-decoration: none !important;
  }

  /* =========================================================
     10. Dataset / citation blocks
     ========================================================= */

  .dataset-print-reference {
    margin-top: 0.28cm;
    font-size: 9.5pt;
    line-height: 1.35;
    color: #333333 !important;
  }

  /* =========================================================
     11. Investigation pages
     ========================================================= */

  .investigation-page,
  .investigation-header,
  .investigation-header h1,
  .investigation-body {
    background: transparent !important;
    color: #111111 !important;
    border: 0 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  .investigation-header {
    display: block !important;
    margin: 0 0 1.2cm 0 !important;
    padding: 0 !important;
    page-break-inside: avoid;
    break-inside: avoid-page;
  }

  .investigation-header::before,
  .investigation-header::after {
    content: none !important;
    display: none !important;
  }

  .investigation-header h1 {
    margin: 0 0 0.45cm 0 !important;
    padding: 0 !important;
    font-size: 22pt !important;
    line-height: 1.15 !important;
    font-weight: 700 !important;
  }

  .investigation-header .print-imprint {
    display: block !important;
    margin: 0 0 0.55cm 0 !important;
  }

  .investigation-body h2 {
    margin-top: 0.9cm !important;
    margin-bottom: 0.28cm !important;
    font-size: 14pt !important;
    line-height: 1.25;
    font-weight: 700;
  }

  .investigation-body h3 {
    margin-top: 0.7cm !important;
    margin-bottom: 0.2cm !important;
    font-size: 12pt !important;
    line-height: 1.25;
    font-weight: 700;
  }

  .investigation-body p {
    margin: 0 0 0.42cm 0 !important;
  }

  .investigation-body ul,
  .investigation-body ol {
    margin: 0.18cm 0 0.5cm 0 !important;
    padding-left: 1.1cm !important;
  }

  .screen-version {
    display: none !important;
  }

  .print-version {
    display: block !important;
  }

  /* =========================================================
    12. Inline gallery: print as static grid
    ========================================================= */

  .inline-gallery {
    margin: 0.6cm 0 !important;
    page-break-inside: avoid;
    break-inside: avoid-page;
  }

  /* Hide the interactive viewer in print */
  .inline-gallery__viewer {
    display: none !important;
  }

  /* Show thumbnails as the printable gallery */
  .inline-gallery__thumbs {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.35cm !important;
    margin: 0 !important;
  }

  .inline-gallery__thumb {
    display: block !important;
    border: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .inline-gallery__thumb img {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: auto !important;
    object-fit: contain !important;
    margin: 0 !important;
    border: 0 !important;
  }

  /* Remove screen-only active state styling */
  .inline-gallery__thumb.is-active {
    box-shadow: none !important;
    outline: 0 !important;
    border: 0 !important;
  }

  /* ---------- Code / pre ---------- */
  pre,
  code {
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: anywhere;
  }

  pre {
    padding: 0.6em;
    border: 1px solid #ccc;
  }

  pre.highlight,
  .highlight pre,
  pre {
    background: #f7f4ed !important;
    color: #111111 !important;
    border: 0.75pt solid #cfc7b8 !important;
    border-left: 3pt solid #b6934f !important;
    border-radius: 4pt;
    padding: 0.55em 0.7em;
    margin: 0.45cm 0;
    box-shadow: none !important;
    text-shadow: none !important;

    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 8.8pt;
    line-height: 1.38;

    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-wrap: break-word;

    break-inside: avoid-page;
    page-break-inside: avoid;
  }

  pre.highlight code,
  .highlight pre code,
  pre code {
    background: transparent !important;
    color: inherit !important;
    border: 0 !important;
    padding: 0 !important;
    font-family: inherit;
    font-size: inherit;
    white-space: inherit;
  }

  code {
    background: #f3efe6 !important;
    color: #111111 !important;
    border: 0.5pt solid #d8d0c2 !important;
    border-radius: 3pt;
    padding: 0.05em 0.25em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9em;
  }

  /* Avoid double-styling inline code inside code blocks */
  pre code {
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
  }
}
