@page {
  size: 6in 9in;
  margin: 0;
}

:root {
  --page-width: 6in;
  --page-height: 9in;
  --paper: #fffdf8;
  --ink: #211d18;
  --muted-ink: #675d50;
  --ochre: #9f6539;
  --tile: #963f2d;
  --vine: #566046;
  --limestone: #d9c9aa;
  --safe: rgba(26, 111, 90, 0.72);
  --trim: rgba(175, 54, 38, 0.78);
}

* {
  box-sizing: border-box;
}

html {
  font-size: 11.25pt;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  font-kerning: normal;
  font-variant-numeric: oldstyle-nums proportional-nums;
  text-rendering: optimizeLegibility;
}

.book {
  counter-reset: folio;
}

.page {
  position: relative;
  width: var(--page-width);
  height: var(--page-height);
  overflow: hidden;
  background: var(--paper);
  break-after: page;
  page-break-after: always;
  counter-increment: folio;
  isolation: isolate;
}

.page:last-child {
  break-after: auto;
  page-break-after: auto;
}

.page__content {
  position: absolute;
  inset-block: 0;
  display: flex;
  flex-direction: column;
}

/*
   Gouttière prudente pour un ouvrage estimé entre 300 et 500 pages.
   Recto : intérieur à gauche. Verso : intérieur à droite.
*/
.page--recto .page__content {
  left: 0.70in;
  right: 0.51in;
  top: 0.59in;
  bottom: 0.70in;
}

.page--verso .page__content {
  left: 0.51in;
  right: 0.70in;
  top: 0.59in;
  bottom: 0.70in;
}

.page--front .page__content,
.page--chapter .page__content {
  top: 0.66in;
  bottom: 0.66in;
}

.page--bleed .page__content {
  inset: 0;
}

.running-head {
  position: absolute;
  top: 0.31in;
  color: var(--muted-ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 6.9pt;
  font-weight: 600;
  letter-spacing: 0.115em;
  line-height: 1;
  text-transform: uppercase;
}

.page--recto .running-head {
  right: 0.51in;
  text-align: right;
}

.page--verso .running-head {
  left: 0.51in;
  text-align: left;
}

.folio {
  position: absolute;
  bottom: 0.31in;
  min-width: 0.28in;
  color: var(--muted-ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 7.6pt;
  letter-spacing: 0.05em;
  line-height: 1;
}

.page--recto .folio {
  right: 0.51in;
  text-align: right;
}

.page--verso .folio {
  left: 0.51in;
  text-align: left;
}

.folio::before {
  content: attr(data-folio);
}

.front-title,
.chapter-title,
.chapter-kicker,
.series-name,
.author-name {
  margin: 0;
}

.faux-title {
  justify-content: center;
  text-align: center;
}

.faux-title .series-name {
  margin-bottom: 0.22in;
  color: var(--vine);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 8pt;
  font-weight: 700;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}

.faux-title .front-title {
  max-width: 4.1in;
  margin-inline: auto;
  font-size: 29pt;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.04;
}

.faux-title .volume {
  margin: 0.20in 0 0;
  color: var(--ochre);
  font-size: 9.2pt;
  font-style: italic;
  letter-spacing: 0.04em;
}

.faux-title::after {
  content: "";
  width: 0.78in;
  height: 1px;
  margin: 0.34in auto 0;
  background: linear-gradient(90deg, transparent, var(--tile), transparent);
}

.quiet-mark {
  display: grid;
  place-items: center;
  color: var(--limestone);
  font-size: 20pt;
}

.title-page {
  justify-content: space-between;
  padding-block: 0.28in 0.10in;
  text-align: center;
}

.title-page__top {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 7.3pt;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.title-page__mark {
  display: inline-block;
  width: 0.86in;
  height: 0.34in;
  margin-bottom: 0.30in;
}

.title-page__mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.title-page .front-title {
  max-width: 4.25in;
  margin-inline: auto;
  font-size: 32pt;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.03;
}

.title-page .subtitle {
  margin: 0.28in 0 0;
  color: var(--ochre);
  font-size: 10pt;
  font-style: italic;
}

.title-page .author-name {
  font-size: 14pt;
  font-variant-caps: small-caps;
  letter-spacing: 0.07em;
}

.copyright {
  justify-content: flex-end;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 7.8pt;
  line-height: 1.46;
}

.copyright p {
  margin: 0 0 0.11in;
}

.copyright .work-note {
  margin-top: 0.25in;
  padding-top: 0.16in;
  border-top: 1px solid var(--limestone);
  color: var(--tile);
  font-weight: 700;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.chapter-open {
  justify-content: flex-start;
  padding-top: 1.02in;
}

.chapter-kicker {
  color: var(--tile);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 7.3pt;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.chapter-title {
  max-width: 4.3in;
  margin-top: 0.12in;
  font-size: 26pt;
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.02;
}

.chapter-rule {
  display: flex;
  width: 1.22in;
  align-items: center;
  gap: 0.08in;
  margin: 0.30in 0 0.34in;
  color: var(--vine);
}

.chapter-rule::before,
.chapter-rule::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--ochre);
}

.chapter-rule img {
  display: block;
  width: 0.36in;
  height: 0.20in;
  object-fit: contain;
}

.chapter-open .lead {
  margin: 0;
  font-size: 11.5pt;
  line-height: 1.43;
  text-align: left;
}

.chapter-open .lead::first-letter {
  float: left;
  margin: 0.035in 0.06in 0 0;
  color: var(--tile);
  font-size: 43pt;
  font-weight: 500;
  line-height: 0.78;
}

.prose {
  font-size: 11.25pt;
  line-height: 1.39;
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
  orphans: 3;
  widows: 3;
}

.prose p {
  margin: 0;
  text-indent: 1.05em;
}

.prose p:first-child,
.prose .no-indent,
.prose .dialogue {
  text-indent: 0;
}

.prose p + p {
  margin-top: 0.02em;
}

.prose .dialogue + .dialogue {
  margin-top: 0.12em;
}

.scene-break {
  margin: 0.20in auto;
  color: var(--ochre);
  font-size: 10pt;
  letter-spacing: 0.28em;
  text-align: center;
}

.image-block {
  position: relative;
  margin: 0;
  background: transparent;
}

.image-block img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: transparent;
}

.image-block--vignette {
  width: 1.53in;
  height: 1.02in;
  margin: 0.03in 0 0.12in 0.18in;
  float: right;
}

.image-block--third {
  width: 100%;
  height: 2.32in;
  margin: 0 0 0.20in;
}

.image-block--wide {
  width: 100%;
  height: 2.7in;
  margin: 0 0 0.22in;
}

.image-block--soft img {
  -webkit-mask-image: linear-gradient(to bottom, #000 76%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 76%, transparent 100%);
}

.image-caption {
  margin: 0.07in 0 0;
  color: var(--muted-ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 6.7pt;
  font-style: italic;
  line-height: 1.3;
  text-align: right;
}

.bleed-hero {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3.44in;
  overflow: hidden;
}

.bleed-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 58%;
}

.bleed-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 72%, var(--paper) 100%);
}

.bleed-copy {
  position: absolute;
  left: 0.51in;
  right: 0.70in;
  top: 3.20in;
  bottom: 0.70in;
  padding-top: 0.23in;
}

.pull-quote {
  margin: 0.10in 0 0.20in;
  padding: 0.16in 0.18in 0.16in 0.20in;
  border-left: 2px solid var(--tile);
  background: linear-gradient(90deg, rgba(217, 201, 170, 0.32), transparent);
  color: #493b2f;
  font-size: 12.2pt;
  font-style: italic;
  line-height: 1.32;
  text-align: left;
}

.page-note {
  margin-top: auto;
  color: var(--muted-ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 6.5pt;
  letter-spacing: 0.04em;
  line-height: 1.35;
}

.diagnostic-label,
.diagnostic-only {
  display: none;
}

@media print {
  html,
  body {
    width: 6in;
    background: transparent;
  }

  .reader-ui {
    display: none !important;
  }

  .book {
    display: block !important;
    margin: 0 !important;
  }

  .spread {
    display: contents !important;
  }

  .page {
    margin: 0 !important;
    box-shadow: none !important;
  }
}
