/* =====================================================================
   Journal page: the interactive book (journal.js + s6-book.js).
   Book pages live INSIDE the film stage, so their type is set in stage
   units (--u, see V2-film/lib/film.js): the stage is cover-scaled and the
   book is fitted to the viewport, so every size scales together.
   Landscape stage 1920x1080 (u = 14.04px), portrait 1080x1920 (u = 10.8px).
   ===================================================================== */
#scenes .jr-page {
  --fs: calc(var(--u) * 1.42 * var(--fit, 1));
  --pad-t: calc(var(--u) * 5);
  --pad-x: calc(var(--u) * 4.6);
  --pad-b: calc(var(--u) * 6.2);
  position: absolute;
  inset: 0;
  z-index: 1;
  padding: var(--pad-t) var(--pad-x) var(--pad-b);
  color: var(--ink);
  font: 500 var(--fs) / 1.5 var(--ff-serif);
  text-align: left;
}

.is-portrait #scenes .jr-page {
  --fs: calc(var(--u) * 3.1 * var(--fit, 1));
  --pad-t: calc(var(--u) * 8.5);
  --pad-x: calc(var(--u) * 7);
  --pad-b: calc(var(--u) * 11);
}

#scenes .jr-slot > .gutter-l,
#scenes .jr-slot > .gutter-r,
#scenes .slice > .gutter-l,
#scenes .slice > .gutter-r {
  z-index: 2;
}

#scenes .sl-in {
  position: absolute;
  inset: 0;
}

#scenes .jr-page :focus-visible {
  outline: calc(var(--u) * 0.18) solid var(--wine);
  outline-offset: calc(var(--u) * 0.25);
}

#scenes .jr-page h2:focus,
#scenes .jr-page h3:focus,
#scenes .jr-page:focus {
  outline: none;
}

/* ---- shared page parts ---------------------------------------------- */
#scenes .pg-folio {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(var(--pad-b) * 0.42);
  text-align: center;
  font: italic 500 calc(var(--fs) * 0.9) / 1 var(--ff-serif);
  color: rgba(43, 33, 26, 0.55);
}

#scenes .pg-rule {
  display: block;
  width: calc(var(--fs) * 9);
  height: calc(var(--fs) * 0.9);
  margin: calc(var(--fs) * 0.55) auto calc(var(--fs) * 0.5);
  overflow: visible;
}

#scenes .pg-tag,
#scenes .pg-kicker {
  font: 500 calc(var(--fs) * 0.62) / 1.3 var(--ff-sans);
  letter-spacing: 0.42em;
  padding-left: 0.42em;
  text-transform: uppercase;
  color: #6f5a26;
  text-align: center;
}

/* titles: wine ink with a gold foil glint that sweeps through now and
   then (s6-book.js moves background-position in ambient time) */
#scenes .pg-title,
#scenes .pg-atitle {
  margin-top: calc(var(--fs) * 0.45);
  font: 400 calc(var(--fs) * 2.25) / 1.08 var(--ff-display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  color: var(--wine);
  background-image: linear-gradient(100deg, var(--wine) 0 44%, #b38a3c 47.5%, #f1dc9c 50%, #b38a3c 52.5%, var(--wine) 56% 100%);
  background-size: 300% 100%;
  background-repeat: no-repeat;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

#scenes .pg-atitle {
  font-size: calc(var(--fs) * 1.5);
  line-height: 1.15;
  text-transform: none;
  letter-spacing: 0.01em;
}

@media (forced-colors: active) {
  #scenes .pg-title,
  #scenes .pg-atitle {
    background: none;
    -webkit-text-fill-color: CanvasText;
  }
}

#scenes .pg-meta {
  font: italic 500 calc(var(--fs) * 0.95) / 1.35 var(--ff-serif);
  text-align: center;
  color: var(--truffle);
}

/* ---- photo pages (left of a spread) --------------------------------- */
#scenes .pg-photo {
  margin: 0 0 calc(var(--fs) * 1.3);
}

#scenes .pg-mount {
  position: relative;
  height: calc(var(--u) * 23);
  padding: calc(var(--u) * 0.6);
  background: #fbf8f1;
  box-shadow: 0 calc(var(--u) * 0.15) calc(var(--u) * 0.3) rgba(40, 25, 10, 0.3), 0 calc(var(--u) * 0.8) calc(var(--u) * 1.4) rgba(40, 25, 10, 0.16);
}

.is-portrait #scenes .pg-mount {
  height: calc(var(--u) * 52);
  padding: calc(var(--u) * 1);
}

#scenes .pg-mount img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.92) contrast(1.03) sepia(0.06);
}

#scenes .cn {
  position: absolute;
  width: calc(var(--u) * 2.6);
  height: calc(var(--u) * 2.6);
  background: linear-gradient(135deg, #5a4430, #2b211a 60%, #1c140e);
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35));
}

.is-portrait #scenes .cn {
  width: calc(var(--u) * 4.6);
  height: calc(var(--u) * 4.6);
}

#scenes .cn.tl { left: calc(var(--u) * -0.7); top: calc(var(--u) * -0.7); clip-path: polygon(0 0, 100% 0, 0 100%); }
#scenes .cn.tr { right: calc(var(--u) * -0.7); top: calc(var(--u) * -0.7); clip-path: polygon(0 0, 100% 0, 100% 100%); }
#scenes .cn.bl { left: calc(var(--u) * -0.7); bottom: calc(var(--u) * -0.7); clip-path: polygon(0 0, 100% 100%, 0 100%); }
#scenes .cn.br { right: calc(var(--u) * -0.7); bottom: calc(var(--u) * -0.7); clip-path: polygon(100% 0, 100% 100%, 0 100%); }

/* "Photo coming soon": an empty mount with a gold rule, for photos the client adds later */
#scenes .pg-ph {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(var(--fs) * 0.4);
  background:
    linear-gradient(#fbf8f1, #fbf8f1) padding-box,
    repeating-linear-gradient(45deg, rgba(168, 140, 69, 0.5) 0 2px, rgba(168, 140, 69, 0) 2px 9px) border-box;
  border: calc(var(--u) * 0.6) solid transparent;
  outline: 1.5px solid rgba(168, 140, 69, 0.75);
  outline-offset: calc(var(--u) * -1.6);
}

#scenes .pg-ph__orn .pg-rule {
  margin: 0;
}

#scenes .pg-ph__label {
  font: 500 calc(var(--fs) * 0.62) / 1 var(--ff-sans);
  letter-spacing: 0.42em;
  padding-left: 0.42em;
  text-transform: uppercase;
  color: #6f5a26;
}

#scenes .pg-cap {
  margin-top: calc(var(--fs) * 0.55);
  font: italic 500 calc(var(--fs) * 0.68) / 1.35 var(--ff-serif);
  color: rgba(43, 33, 26, 0.78);
  text-align: center;
}

#scenes .pg-cap a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(168, 140, 69, 0.8);
  text-underline-offset: 0.2em;
}

/* ---- text pages (right of a spread) --------------------------------- */
#scenes .pg-body p {
  margin: 0 0 calc(var(--fs) * 0.7);
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
}

#scenes .pg-body p.split {
  text-align-last: justify;
}

#scenes .pg-body p.cont {
  text-indent: 0;
}

#scenes .pg-body > p.drop::first-letter,
#scenes .jr-page--text[data-venue] .pg-body > p:first-child::first-letter {
  float: left;
  margin: calc(var(--fs) * 0.08) calc(var(--fs) * 0.18) 0 0;
  font: 400 calc(var(--fs) * 3.2) / 0.8 var(--ff-display);
  color: #8a6d2c;
}

#scenes .pg-body h3 {
  margin: calc(var(--fs) * 1.1) 0 calc(var(--fs) * 0.45);
  font: 600 calc(var(--fs) * 1.08) / 1.25 var(--ff-serif);
  color: var(--wine);
}

#scenes .pg-body h3:first-child {
  margin-top: 0;
}

#scenes .pg-actions,
#scenes .pg-end {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: calc(var(--fs) * 0.9) calc(var(--fs) * 1.2);
  margin-top: calc(var(--fs) * 1.1);
}

#scenes .pg-btn,
.jr-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--champagne);
  border-radius: 999px;
  background: var(--wine);
  color: var(--gold-hi);
  font-family: var(--ff-sans);
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
}

#scenes .pg-btn {
  min-height: calc(var(--fs) * 2.5);
  padding: 0 calc(var(--fs) * 1.25) 0 calc(var(--fs) * 1.45);
  font-size: calc(var(--fs) * 0.6);
  box-shadow: 0 calc(var(--u) * 0.2) calc(var(--u) * 0.6) rgba(62, 10, 12, 0.25);
}

#scenes .pg-btn:hover,
.jr-back:hover {
  background: var(--wine-deep);
}

#scenes .pg-link,
#scenes .pg-map a,
#scenes .pg-cta a {
  font: 500 calc(var(--fs) * 0.6) / 1.4 var(--ff-sans);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--wine);
  text-decoration: underline;
  text-decoration-color: var(--champagne);
  text-underline-offset: 0.45em;
  padding: calc(var(--fs) * 0.5) 0;
}

#scenes .pg-map {
  margin: calc(var(--fs) * 0.2) 0 calc(var(--fs) * 0.8);
}

#scenes .pg-cta {
  margin-top: calc(var(--fs) * 0.6);
  padding: calc(var(--fs) * 0.9) calc(var(--fs) * 1);
  border: 1px solid rgba(168, 140, 69, 0.6);
  text-align: center;
}

#scenes .pg-cta h3 {
  margin: 0 0 calc(var(--fs) * 0.35);
  font: 400 calc(var(--fs) * 1.25) / 1.2 var(--ff-display);
  letter-spacing: 0.03em;
  color: var(--wine);
}

#scenes .pg-cta p {
  text-align: center;
  font-size: calc(var(--fs) * 0.9);
  margin-bottom: calc(var(--fs) * 0.3);
}

/* ---- the title page and the contents -------------------------------- */
#scenes .jr-page--intro,
#scenes .jr-page--end {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-bottom: calc(var(--pad-b) * 1.6);
}

#scenes .pg-script {
  font: 400 calc(var(--fs) * 2.6) / 1.15 var(--ff-script);
  color: var(--wine);
}

#scenes .pg-lead {
  max-width: 24em;
  font: italic 500 calc(var(--fs) * 1.02) / 1.55 var(--ff-serif);
  color: var(--truffle);
}

#scenes .pg-flower {
  position: absolute;
  right: calc(var(--pad-x) * 0.5);
  bottom: calc(var(--pad-b) * 0.3);
  width: calc(var(--fs) * 5.6);
  height: calc(var(--fs) * 7.6);
  overflow: visible;
  transform: rotate(-24deg);
  filter: drop-shadow(0 1px 1px rgba(60, 30, 20, 0.25));
}

#scenes .pg-h {
  font: 400 calc(var(--fs) * 1.7) / 1.1 var(--ff-display);
  letter-spacing: 0.3em;
  padding-left: 0.3em;
  text-transform: uppercase;
  text-align: center;
  color: var(--wine);
  margin-bottom: calc(var(--fs) * 1);
}

#scenes .toc {
  list-style: none;
}

#scenes .toc__a {
  display: flex;
  align-items: baseline;
  gap: calc(var(--fs) * 0.4);
  padding: calc(var(--fs) * 0.24) 0;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.25;
}

#scenes .toc__a:hover .toc__t {
  color: var(--wine);
  text-decoration: underline;
  text-decoration-color: var(--champagne);
}

#scenes .toc__t {
  font-size: calc(var(--fs) * 1.04);
}

#scenes .toc__tag {
  font: 500 calc(var(--fs) * 0.5) / 1 var(--ff-sans);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #6f5a26;
  white-space: nowrap;
}

#scenes .toc__dots {
  flex: 1;
  min-width: calc(var(--fs) * 1);
  border-bottom: 1.5px dotted rgba(43, 33, 26, 0.35);
}

#scenes .toc__n {
  font-style: italic;
  color: var(--truffle);
}

/* ---- page chrome around the book ------------------------------------ */
.jr {
  position: relative;
  height: 100vh;
  height: 100svh;
}

.jr-film {
  touch-action: pan-y; /* vertical scroll stays native, horizontal swipes turn pages */
}

.jr-title {
  position: fixed;
  left: 0;
  right: 0;
  top: 84px;
  z-index: 12;
  padding: 0 16px;
  font: 500 12px/1.3 var(--ff-sans);
  letter-spacing: 0.42em;
  text-transform: uppercase;
  text-align: center;
  color: rgba(43, 33, 26, 0.74);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.9s ease;
}

.jr-on .jr-title,
.jr-ready .jr-title {
  opacity: 1;
}

.jr-ctrl {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 18px;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.jr-ready .jr-ctrl {
  opacity: 1;
}

.jr-ctrl > * {
  pointer-events: auto;
}

.jr-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(168, 140, 69, 0.85);
  border-radius: 50%;
  background: rgba(251, 248, 241, 0.86);
  color: var(--wine);
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(40, 25, 10, 0.18);
  transition: background 0.2s ease, opacity 0.2s ease;
}

.jr-arrow svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.jr-arrow:hover {
  background: #fff;
}

.jr-arrow:disabled {
  opacity: 0.35;
  cursor: default;
}

/* landscape: the arrows flank the book (journal.js sets --bk-l, --bk-r, --bk-cy) */
html:not(.is-portrait) .jr-prev,
html:not(.is-portrait) .jr-next {
  position: fixed;
  top: calc(var(--bk-cy, 50vh) - 26px);
}

html:not(.is-portrait) .jr-prev {
  left: max(12px, calc(var(--bk-l, 80px) - 76px));
}

html:not(.is-portrait) .jr-next {
  left: min(calc(100vw - 64px), calc(var(--bk-r, 80vw) + 24px));
}

.jr-count {
  min-width: 7em;
  font: 500 12px/1 var(--ff-sans);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  text-align: center;
  color: rgba(43, 33, 26, 0.8);
}

.jr-back[hidden] {
  display: none;
}

.jr-back {
  min-height: 44px;
  padding: 0 20px 0 22px;
  font-size: 12px;
}

:focus-visible {
  outline: 2px solid var(--wine);
  outline-offset: 3px;
}

.jr-live {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* the footer scrolls up over the fixed book */
.jr-body .site-foot {
  position: relative;
  z-index: 20;
}

/* portrait: one page at a time; the controls sit bottom left, clear of
   the Book button (bottom right on phones), Back to venues under the header */
.is-portrait .jr-title {
  top: 70px;
  font-size: 11px;
  letter-spacing: 0.3em;
}

.is-portrait .jr-ctrl {
  left: 12px;
  right: auto;
  bottom: max(16px, env(safe-area-inset-bottom));
  gap: 6px;
}

.is-portrait .jr-count {
  min-width: 5.5em;
  font-size: 11px;
  letter-spacing: 0.18em;
}

.is-portrait .jr-back {
  position: fixed;
  left: 12px;
  top: 66px;
  min-height: 40px;
  padding: 0 16px 0 18px;
  font-size: 11px;
}

.is-portrait.jr-article .jr-title {
  opacity: 0;
}

/* ---- without the book (no JS, or the film failed): a plain list ------ */
.jr-source {
  display: none;
}

html:not(.js) .jr-source,
.jr-failed .jr-source {
  display: block;
  position: relative;
  z-index: 5;
  max-width: 720px;
  margin: 0 auto;
  padding: 140px 20px 80px;
  background: var(--pearl);
  color: var(--ink);
  font: 500 19px/1.55 var(--ff-serif);
}

html:not(.js) .jr,
.jr-failed .jr {
  height: auto;
  background: var(--pearl);
}

html:not(.js) .jr-film,
html:not(.js) .jr-ctrl,
.jr-failed .jr-film,
.jr-failed .jr-ctrl,
html:not(.js) .pg-more,
.jr-failed .pg-more,
.jr-source .pg-folio,
.jr-source .pg-flower {
  display: none;
}

html:not(.js) .jr-title,
.jr-failed .jr-title {
  position: static;
  opacity: 1;
  padding: 120px 20px 0;
  background: var(--pearl);
}

.jr-source .jr-page {
  margin-bottom: 28px;
}

.jr-source .jr-page--photo {
  margin-top: 56px;
}

.jr-source img {
  display: block;
  width: 100%;
  height: auto;
}

.jr-source h2 {
  font: 400 32px/1.15 var(--ff-display);
  color: var(--wine);
  text-transform: uppercase;
}

.jr-source .pg-rule,
.jr-source .cn {
  display: none;
}

.jr-source a {
  color: var(--wine);
}

/* the turning leaf holds a copy of the page per strip: no filters or
   shadows in it, so its layers raster once and only composite per frame */
#scenes .turner .pg-mount img,
#scenes .turner .cn,
#scenes .turner .pg-flower {
  filter: none;
}

#scenes .turner .pg-mount,
#scenes .turner .pg-btn {
  box-shadow: none;
}

/* article text pages: a fixed text box that pagination fills */
#scenes .jr-page--art.jr-page--text .pg-body {
  height: 100%;
  overflow: hidden;
}

/* the shared header draws a white logo; on this cream page it is inked */
/* (always, whatever data-tone a shared script may set; no dark halo on cream) */
html .jr-body .hdr__logo,
html[data-tone] .jr-body .hdr__logo {
  filter: none;
}

html .jr-body .hdr__logo img,
html[data-tone] .jr-body .hdr__logo img {
  filter: brightness(0);
  opacity: 0.82;
}

/* text for screen readers and crawlers only: names the guide a "Read the guide" link opens */
.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
