.jacket {
  position: relative;
  container-type: inline-size;
  background: #18211f;
  color: #f5eddb;
  width: 100%;
  aspect-ratio: 210 / 297;
  display: grid;
  grid-template-rows: 29% 64% 7%;
  margin: 0;
  overflow: hidden;
  order: -1;
}

.jacket::after {
  content: "";
  position: absolute;
  inset: 3%;
  border: 1px solid #b99550;
  pointer-events: none;
}

.jacket-head {
  align-self: center;
  text-align: center;
  padding: 0 7%;
}

.jacket-series, .jacket-author {
  font: bold 1.65cqw/1.3 Arial, sans-serif;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.jacket-series { color: #e2bd73; margin: 0 0 3cqw; }
.jacket-title { font: bold 5.25cqw/1.08 Georgia, serif; text-transform: uppercase; margin: 0; }
.jacket-sub { font: italic 2.45cqw/1.4 Georgia, serif; margin: 2.5cqw 0 0; }
.jacket-art { width: 100%; height: 100%; object-fit: cover; object-position: center 54%; }
.jacket-author { text-align: center; align-self: center; margin: 0; }
.print-contents { display: none; }

.text-masthead { grid-template-columns: minmax(0, .78fr) minmax(0, 1fr); align-items: center; }
.text-masthead .story-masthead-copy { padding-top: 0; }
.text-masthead .story-metadata { margin-top: 1.5rem; }
@media (max-width: 840px) {
  .text-masthead { grid-template-columns: minmax(0, 1fr); }
  .jacket { max-width: 390px; margin-inline: auto; }
}
@page {
  size: A4;
  margin: 17mm 22mm 18mm;

  @bottom-left {
    content: "Sabnock Works";
    color: #615445;
    font: 8pt Arial, sans-serif;
  }

  @bottom-right {
    content: counter(page);
    color: #615445;
    font: 8pt Arial, sans-serif;
  }
}

@page jacket {
  size: A4;
  margin: 0;
  @bottom-left { content: none; }
  @bottom-right { content: none; }
}

@media print {
  html, body.archive-page, main { background: white; color: #24211e; margin: 0; padding: 0; }
  .site-header, .text-masthead .story-masthead-copy, .reader-layout .chapter-menu, footer { display: none; }
  .text-masthead, .reader-layout, .story-prose {
    display: block; width: auto; max-width: none; padding: 0; margin: 0; border: 0;
  }
  .text-masthead { page: jacket; break-after: page; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .text-masthead .jacket { width: 210mm; height: 296.8mm; max-width: none; }
  .print-contents { display: block; margin-top: 10mm; }
  .print-contents a { display: block; margin: 2mm 0; font: 11pt/1.45 Georgia, serif; text-transform: none; letter-spacing: normal; }
  .story-prose #imprint a { color: #503c27; }
  #opening, #sources { break-before: page; }
  .story-prose section, .story-prose section + section { padding: 0; margin: 0; border: 0; }
  .story-prose section h2 { font: bold 15pt/1.2 Georgia, serif; color: #372d21; margin: 6mm 0 2mm; break-after: avoid; }
  .story-prose section p, .article-sources li { font: 10.7pt/1.45 Georgia, serif; color: #24211e; margin: 0 0 3mm; orphans: 3; widows: 3; }
  .article-prose .article-citation, .essay-reading-page .article-prose .article-sources li a { color: #403226; }
  .article-sources { padding-left: 1.6em; }
  .article-sources li { break-inside: avoid; }
}
