/* Shared by the English desktop and mobile chapter layouts only. */
html[data-locale="en"] .chapter-gallery-image {
  opacity: 0;
  transition: opacity 800ms ease;
  pointer-events: none;
}
html[data-locale="en"] .chapter-gallery-image.is-gallery-active { opacity: 1; }
html[data-locale="en"] .chapter-gallery-controls {
  position: absolute;
  z-index: 3;
  left: clamp(40px, 4.4vw, 84px);
  bottom: 24px;
  display: flex;
  align-items: center;
  padding: 0 4px 0 14px;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 24px;
  background: rgba(0, 0, 0, .66);
  color: #fff;
  line-height: 1;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
html[data-locale="en"] .is-active > .chapter-gallery-controls {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
html[data-locale="en"] .chapter-gallery-count {
  min-width: 36px;
  margin-right: 4px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
}
html[data-locale="en"] .chapter-gallery-controls button {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: inherit;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
}
html[data-locale="en"] .chapter-gallery-choice::after {
  content: '';
  width: 7px;
  height: 7px;
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 50%;
  background: transparent;
}
html[data-locale="en"] .chapter-gallery-choice[aria-pressed="true"]::after {
  border-color: var(--yellow, #f0b429);
  background: var(--yellow, #f0b429);
}
html[data-locale="en"] .chapter-gallery-controls button:hover { background: rgba(255, 255, 255, .13); }
html[data-locale="en"] .chapter-gallery-controls button:focus-visible { outline: 2px solid var(--yellow, #f0b429); outline-offset: -4px; }
html[data-locale="en"] .chapter-gallery-pause svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; }
html[data-locale="en"] .chapter-gallery-pause .gallery-play-icon { display: none; fill: currentColor; stroke: none; }
html[data-locale="en"] .chapter-gallery-pause[data-paused="true"] .gallery-pause-icon { display: none; }
html[data-locale="en"] .chapter-gallery-pause[data-paused="true"] .gallery-play-icon { display: block; }
html[data-locale="en"] .chapter-gallery-pause:disabled { opacity: .4; cursor: default; }
html[data-locale="en"] .chapter-gallery-status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
/* Leave a clear lane above mobile chapter actions and the first-screen scroll cue. */
html[data-locale="en"] .screen .chapter-gallery-controls {
  left: var(--gutter);
  bottom: calc(76px + var(--safe-bottom));
}
html[data-locale="en"] .screen.has-chapter-gallery .screen-copy {
  bottom: calc(136px + var(--safe-bottom));
}
html[data-locale="en"] .screen-05 .chapter-gallery-controls { bottom: calc(178px + var(--safe-bottom)); }
html[data-locale="en"] .screen-05.has-chapter-gallery .screen-copy { bottom: calc(238px + var(--safe-bottom)); }
@media (orientation: landscape) and (max-height: 600px) {
  html[data-locale="en"] .screen .chapter-gallery-controls { bottom: calc(12px + var(--safe-bottom)); }
  html[data-locale="en"] .screen.has-chapter-gallery .screen-copy { bottom: calc(72px + var(--safe-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  html[data-locale="en"] .chapter-gallery-image { transition: none; }
}
@media (orientation: landscape) and (max-height: 600px) and (max-width: 640px) {
  html[data-locale="en"] .screen .chapter-gallery-controls { left: 14px; padding-left: 4px; }
  html[data-locale="en"] .screen .chapter-gallery-count { display: none; }
}

/* Keep the supplied brighter images readable without obscuring their right side. */
html[data-locale="en"] .chapter.has-chapter-gallery .chapter-shade,
html[data-locale="en"] #chapter-01.chapter.has-chapter-gallery .chapter-shade--hero {
  background: linear-gradient(90deg, rgba(0, 0, 0, .78) 0%, rgba(0, 0, 0, .66) 35%, rgba(0, 0, 0, .5) 55%, rgba(0, 0, 0, .05) 85%, rgba(0, 0, 0, .02) 100%);
}
html[data-locale="en"] .chapter.has-chapter-gallery .section-content {
  max-height: calc(100svh - 90px);
}
html[data-locale="en"] .screen.has-chapter-gallery .screen-shade {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, .68), rgba(0, 0, 0, .48) 70%, rgba(0, 0, 0, .3)),
    linear-gradient(180deg, rgba(0, 0, 0, .12), transparent 42%, rgba(0, 0, 0, .3));
}
