.open-stories {
  --story-rule: #d6c9b5;
  --story-green: #355442;
  padding-block: clamp(48px, 6.4vw, 100px);
}
.open-stories-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px 30px;
}
.open-stories-heading h2 {
  font-size: clamp(36px, 4.6vw, 68px);
  line-height: 1.2;
  letter-spacing: -.05em;
}
.story-deck {
  max-width: 31em;
  color: var(--subtle);
  font-size: clamp(16px,1.22vw,19px);
  line-height: 1.85;
  margin-top: 13px;
}
.reading-choices {
  padding: 3px;
  display: inline-flex;
  background: #eee9df;
  border: 1px solid var(--story-rule);
  border-radius: 28px;
}
.reading-choices button {
  background: transparent;
  border: 0;
  border-radius: 25px;
  padding: 0 18px;
  min-height: 44px;
  color: #514a40;
  font-size: 14px;
  font-weight: 650;
}
.reading-choices button[aria-pressed="true"] { color: #fffaf0; background: var(--story-green); }
.reading-choices button:hover:not([aria-pressed="true"]) { background: #e3dbcc; }
.story-contents {
  margin-block: 20px 0;
  display: flex;
  flex-wrap: wrap;
  column-gap: clamp(14px, 2.4vw, 36px);
  border-block: 1px solid var(--story-rule);
}
.story-contents a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 14px;
  font-weight: 570;
  color: var(--story-green);
}
.story-contents a:hover, .story-contents a:focus-visible { text-decoration: underline; text-underline-offset: 4px; }
.open-story { min-width: 0; scroll-margin-top: 18px; padding-top: clamp(24px, 2.8vw, 44px); }
.open-story + .open-story { border-top: 1px solid var(--story-rule); }
.open-story-heading { margin-block: 0 clamp(15px, 1.6vw, 24px); }
.open-story-heading p {
  color: var(--clay);
  font-size: 14px;
  font-weight: 650;
  letter-spacing: .08em;
}
.open-story .open-story-heading h3 {
  margin: 4px 0 0;
  font-size: clamp(28px, 2.8vw, 44px);
  line-height: 1.4;
  letter-spacing: -.035em;
}
.open-story-spreads { display: grid; gap: clamp(30px, 3.5vw, 58px); }
.open-story .quad-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(21px, 2.4vw, 33px) clamp(13px, 1.6vw, 24px);
}
.open-story .quad-frame {
  position: relative;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}
.quad-frame img, .story-stage img {
  display: block;
  width: 100%;
  aspect-ratio: 760 / 504;
  height: auto;
  border-radius: 10px;
  object-fit: cover;
}
.open-story .quad-frame figcaption { padding: 9px 0 0; }
.open-story .quad-frame figcaption span {
  display: block;
  color: var(--clay);
  font: 650 14px/1.5 var(--sans);
  letter-spacing: .045em;
}
.open-story .quad-frame figcaption p {
  margin: 5px 0 0;
  color: #40392f;
  font-size: clamp(16px, 1.18vw, 19px);
  line-height: 1.9;
}
.story-stage { display: none; }
/* Fully visible four-panel pages are also the script-free version. */
.open-stories:not([data-view="reader"]) .open-story { width: min(100%, 1000px); margin-inline: auto; }
.open-stories[data-view="reader"] .story-body {
  display: grid;
  grid-template-columns: minmax(0,1.5fr) minmax(0,1fr);
  align-items: start;
  gap: clamp(28px,5vw,84px);
}
[data-view="reader"] .story-stage {
  display: block;
  position: sticky;
  top: max(18px, 4vh);
  min-width: 0;
}
.stage-pictures {
  display: grid;
  isolation: isolate;
  border-radius: 10px;
  overflow: hidden;
}
.stage-pictures > img { grid-area: 1 / 1; }
.stage-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 1px;
  color: var(--subtle);
  font-size: 13px;
  font-weight: 550;
}
.stage-strip span:last-child { font-variant-numeric: tabular-nums; letter-spacing: .08em; }
[data-view="reader"] .quad-grid { display: block; }
[data-view="reader"] .quad-frame {
  display: flex;
  align-items: flex-start;
  min-height: clamp(172px, 24vh, 260px);
  padding: clamp(14px,2.4vh,30px) 0 22px clamp(15px,1.6vw,25px);
  border-left: 1px solid var(--story-rule);
}
[data-view="reader"] .quad-frame[data-current]::before {
  content: "";
  position: absolute;
  width: 3px;
  height: 39px;
  left: -2px;
  top: clamp(14px,2.4vh,30px);
  border-radius: 2px;
  background: var(--story-green);
}
[data-view="reader"] .quad-frame figcaption { padding: 0; max-width: 28em; }
[data-view="reader"] .quad-frame img {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
[data-view="reader"] .quad-frame[data-current] figcaption span { color: var(--story-green); }
@media (min-width: 701px) and (max-height: 600px) {
  [data-view="reader"] .story-stage img { max-height: 72vh; object-fit: contain; }
}
@media (max-width: 700px) {
  .open-stories { padding-block: 45px; }
  .open-stories-heading { display: grid; gap: 16px; }
  .reading-choices { justify-self: start; }
  .story-contents { column-gap: 18px; margin-top: 16px; }
  .story-contents a { font-size: 13px; }
  .open-stories[data-view="reader"] .story-body { display: block; }
  [data-view="reader"] .story-stage {
    z-index: 1;
    top: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--story-rule);
    padding-top: 5px;
  }
  [data-view="reader"] .story-stage img { max-height: 34vh; max-height: 34svh; object-fit: contain; }
  [data-view="reader"] .quad-grid { margin-top: 8px; }
  [data-view="reader"] .quad-frame { min-height: clamp(138px,21vh,192px); }
  .open-story .quad-grid { gap: 17px 12px; }
  .open-story .quad-frame figcaption p { font-size: 16px; line-height: 1.8; }
  .open-stories:not([data-view="reader"]) .quad-frame figcaption p { font-size: 15px; }
  .open-story-heading { margin-bottom: 13px; }
  .stage-strip { font-size: 12px; padding: 5px 0; }
}
@media print {
  .reading-choices, .story-contents, [data-view="reader"] .story-stage { display: none; }
  .open-stories[data-view="reader"] .story-body { display: block; }
  [data-view="reader"] .quad-grid { display: grid; }
  [data-view="reader"] .quad-frame { display: block; min-height: 0; padding: 0; border: 0; break-inside: avoid; }
  [data-view="reader"] .quad-frame img { position: static; width: 100%; height: auto; clip-path: none; }
}

@media screen and (min-width: 701px) {
  .open-stories[data-view="reader"] { padding-block-start: clamp(14px, 2.5vh, 28px); }
  .open-stories[data-view="reader"] .open-stories-heading > div:first-child { flex: 1 1 27rem; }
  .open-stories[data-view="reader"] .open-stories-heading h2 { font-size: clamp(34px, 3.3vw, 52px); }
  .open-stories[data-view="reader"] .story-deck { max-width: 55em; margin-top: 6px; line-height: 1.6; }
  .open-stories[data-view="reader"] .story-contents { margin-top: 12px; }
  .open-stories[data-view="reader"] .open-story:first-child { padding-top: 16px; }
  .open-stories[data-view="reader"] .open-story:first-child .open-story-heading { margin-bottom: 12px; }
  .open-stories[data-view="reader"] .story-body {
    /* Share the space left by the measured picture and counter above and below them. */
    --story-center-gap: max(12px, calc((100vh - var(--mast-height) - var(--story-stage-height, 100vh)) / 2));
  }
  .open-stories[data-view="reader"] .story-stage {
    top: calc(var(--mast-height) + var(--story-center-gap));
    /* Fit the whole illustration and its counter even in a short desktop window. */
    width: min(100%, max(1px, calc((100vh - var(--mast-height) - 68px) * 760 / 504)));
    justify-self: center;
  }
  .open-stories[data-view="reader"] .story-stage img { max-height: none; }
  .open-stories[data-view="reader"] .quad-frame:last-child {
    /* Hold the centered stage until the last line has passed the navigation. */
    padding-block-end: calc(var(--story-stage-height, 0px) + var(--story-center-gap));
  }
}

.story-try {
  display: inline-flex;
  align-items: center;
  gap: .7em;
  min-height: 44px;
  margin-top: 12px;
  color: var(--story-green);
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: .24em;
}
.story-try:hover { text-decoration-thickness: 2px; }
.story-try:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
