@page {
  size: A4;
  margin: 18mm 19mm 20mm;
  @bottom-center {
    content: "NaySung   ·   " counter(page);
    font: 9pt sans-serif;
    color: #566762;
  }
}
@media print {
  html,
  body#top,
  body#top main,
  body#top #read {
    display: block !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: white !important;
    color: #172927 !important;
    overflow: visible !important;
    box-shadow: none !important;
  }
  body#top > :not(main),
  body#top main > :not(#read),
  body#top #read > :not(.print-heading, .prose, aside.print-reflection),
  #read .mood-trigger,
  #read .more-photos {
    display: none !important;
  }
  body#top #read,
  body#top #read .prose,
  body#top #read .print-reflection {
    font:
      400 13pt/1.65 sarabun,
      sans-serif !important;
    letter-spacing: normal !important;
    text-align: left !important;
    color: #172927 !important;
    background: white !important;
    overflow-wrap: anywhere;
  }
  #read .print-heading[hidden] {
    display: block !important;
    border-bottom: 1pt solid #86a49f;
    margin-bottom: 6mm;
    padding-bottom: 4mm;
    break-inside: avoid;
    break-after: avoid;
  }
  #read .print-heading strong {
    display: block;
    font:
      600 23pt/1.35 sarabun,
      sans-serif;
    margin: 2mm 0;
  }
  #read .print-heading small {
    font:
      400 10pt/1.5 sarabun,
      sans-serif;
    color: #315954;
  }
  #read .print-heading img {
    display: block;
    max-width: 100%;
    max-height: 64mm;
    width: auto;
    height: auto;
    margin: 5mm auto 0;
  }
  #read .prose {
    margin: 0 !important;
  }
  #read .prose p {
    margin: 0 0 4mm;
    orphans: 3;
    widows: 3;
    box-shadow: none;
    background: none;
  }
  #read .prose :is(h2, h3),
  #read .print-reflection h2 {
    font:
      600 16pt/1.45 sarabun,
      sans-serif;
    margin: 7mm 0 2mm;
    break-after: avoid;
  }
  #read .prose h3 {
    font-size: 14pt;
  }
  #read .prose .story-photos {
    display: block;
    margin: 3mm 0;
  }
  #read .prose .photo-open,
  #read .prose p:has(> img:only-child):not([data-paragraph]) {
    display: inline-block !important;
    vertical-align: middle;
    width: 48%;
    margin: 1%;
    padding: 0;
    border: 0;
    break-inside: avoid;
    overflow: visible;
  }
  #read .prose .photo-open:only-child,
  #read
    .prose
    p:has(> img:only-child):not([data-paragraph]):not(:has(+ p img)):not(
      p:has(img) + p
    ) {
    width: 98%;
  }
  #read .prose img,
  #read .story-photos .photo-open:not(:only-child) img {
    display: block;
    max-width: 100%;
    width: auto;
    height: auto;
    max-height: 110mm;
    object-fit: contain;
    aspect-ratio: auto;
    margin: auto;
    break-inside: avoid;
  }
  #read a {
    color: inherit;
  }
}
