/* London Clarion magazine archive
   Colours come from the club's Wix theme so the archive sits naturally inside
   londonclarion.org.uk. */

@font-face {
  font-family: "Old Standard TT";
  src: url("/fonts/old-standard-tt-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Old Standard TT";
  src: url("/fonts/old-standard-tt-latin-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Old Standard TT";
  src: url("/fonts/old-standard-tt-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Work Sans";
  src: url("/fonts/work-sans-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Work Sans";
  src: url("/fonts/work-sans-latin-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Work Sans";
  src: url("/fonts/work-sans-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Work Sans";
  src: url("/fonts/work-sans-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --red: #931a20;
  --red-dark: #7d151d;
  --oxblood: #3e0a0e;
  --oxblood-deep: #2a0609;
  --paper: #fbf9ec;
  --paper-light: #fdfcf5;
  --gold: #c9b42a;
  --gold-light: #e6d987;
  --ink: #1c1917;
  --ink-soft: #57514a;
  --shelf: #cfc08a;
  --cream-on-dark: #f3ead2;
  --cream-on-dark-soft: #cdb9a3;

  --display: "Old Standard TT", "Iowan Old Style", Georgia, serif;
  --ui: "Work Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Type scale, ratio 1.25 */
  --step--1: 0.8125rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.5625rem;
  --step-3: 1.953rem;
  --step-4: 2.441rem;
  --step-5: 3.052rem;

  --gutter: clamp(16px, 4vw, 48px);
  --cover-h: clamp(148px, 19vw, 232px);
  --focus: 0 0 0 3px var(--paper), 0 0 0 5px var(--red);

  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--ui);
  font-size: var(--step-0);
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--red);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: 2px;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--red);
  color: #fff;
  font-weight: 600;
}
.skip:focus {
  top: 12px;
}

@view-transition {
  navigation: auto;
}

@media (prefers-reduced-motion: reduce) {
  @view-transition {
    navigation: none;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

::view-transition-group(cover) {
  animation-duration: 420ms;
  animation-timing-function: cubic-bezier(0.2, 0.7, 0.1, 1);
}

/* ------------------------------------------------------------------------
   Library
   ------------------------------------------------------------------------ */

.masthead {
  padding: 12px var(--gutter) 0;
  text-align: center;
}

.masthead__club {
  display: inline-block;
  font-size: var(--step--1);
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 6px 2px;
}
.masthead__club:hover {
  color: var(--red);
}
.masthead__club::before {
  content: "\2190\00a0";
}

/* Walter Crane's banner, printed in Clarion red. The image is used as a mask
   so the ink colour lives here rather than in the artwork. */
.masthead__banner {
  width: min(420px, 100%);
  aspect-ratio: 1600 / 702;
  margin: 10px auto 0;
  background: var(--red);
  -webkit-mask: url("/img/clarion-banner.webp") center / contain no-repeat;
  mask: url("/img/clarion-banner.webp") center / contain no-repeat;
}

.masthead__title {
  margin: 14px 0 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(var(--step-4), 6vw, var(--step-5));
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.masthead__intro {
  max-width: 34em;
  margin: 6px auto 0;
  font-size: var(--step-0);
  color: var(--ink-soft);
}

/* The thick-and-thin rule under a Victorian newspaper masthead. */
.masthead::after {
  content: "";
  display: block;
  height: 6px;
  margin: 22px calc(var(--gutter) * -1) 0;
  border-top: 3px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.finder {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  padding: 12px var(--gutter);
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid color-mix(in srgb, var(--shelf) 70%, transparent);
}

.finder__search {
  position: relative;
  flex: 1 1 220px;
  max-width: 360px;
}
.finder__search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  width: 18px;
  height: 18px;
  translate: 0 -50%;
  fill: none;
  stroke: var(--ink-soft);
  stroke-width: 2;
  pointer-events: none;
}
.finder input,
.finder select {
  width: 100%;
  height: 44px;
  border: 1px solid #cbbf98;
  border-radius: 6px;
  background: var(--paper-light);
  color: var(--ink);
}
.finder input {
  padding: 0 12px 0 38px;
}
.finder input::placeholder {
  color: #7a7268;
}
.finder input::-webkit-search-cancel-button {
  cursor: pointer;
}
.finder select {
  padding: 0 34px 0 12px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m5 8 5 5 5-5' fill='none' stroke='%2357514a' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
}
.finder input:focus-visible,
.finder select:focus-visible {
  border-color: var(--red);
  box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--red);
}
.finder__decade {
  flex: 0 0 auto;
  width: 150px;
}
.finder__count {
  margin: 0 0 0 auto;
  font-size: var(--step--1);
  color: var(--ink-soft);
}

.shelves {
  padding: 8px 0 40px;
}

.shelf {
  padding: 32px 0 8px;
}
.shelf + .shelf {
  border-top: 1px solid color-mix(in srgb, var(--shelf) 55%, transparent);
}

.shelf__head {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "name tools"
    "summary tools"
    "about about";
  column-gap: 16px;
  padding: 0 var(--gutter);
  margin-bottom: 18px;
}
.shelf__name {
  grid-area: name;
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: var(--step-3);
  line-height: 1.1;
}
.shelf__summary {
  grid-area: summary;
  margin: 4px 0 0;
  font-size: var(--step--1);
  color: var(--ink-soft);
}
.shelf__about {
  grid-area: about;
  max-width: 40em;
  margin: 8px 0 0;
  color: var(--ink-soft);
}
.shelf__tools {
  grid-area: tools;
  align-self: end;
  display: flex;
  align-items: center;
  gap: 6px;
}
.shelf__all {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 4px;
  font-weight: 500;
  font-size: var(--step--1);
  white-space: nowrap;
}
.shelf__scroll {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid #cbbf98;
  border-radius: 50%;
  background: var(--paper-light);
}
.shelf__scroll svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
}
.shelf__scroll:hover {
  border-color: var(--red);
}
.shelf__scroll:disabled {
  opacity: 0.35;
  cursor: default;
  border-color: #cbbf98;
}
@media (pointer: coarse) {
  .shelf__scroll {
    display: none;
  }
}

/* A shelf: covers stand on a line, and the line carries the year wherever it
   changes. Each book draws its own stretch of shelf so the line follows the
   books when they wrap into a grid. */
.shelf__row {
  display: flex;
  align-items: flex-start;
  margin: 0;
  padding: 10px var(--gutter) 6px;
  list-style: none;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scroll-padding-inline: var(--gutter);
  scrollbar-width: thin;
  scrollbar-color: var(--shelf) transparent;
}
.shelf__row.has-more-end {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent);
}
.shelf__row.has-more-start {
  -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 56px), transparent);
  mask-image: linear-gradient(to left, #000 calc(100% - 56px), transparent);
}
.shelf__row.has-more-start.has-more-end {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 56px, #000 calc(100% - 56px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 56px, #000 calc(100% - 56px), transparent);
}

.book {
  position: relative;
  flex: 0 0 auto;
  padding-right: clamp(14px, 2vw, 26px);
  scroll-snap-align: start;
  background: linear-gradient(var(--shelf), var(--shelf)) 0 var(--cover-h) / 100% 3px no-repeat;
}
.book:last-child {
  padding-right: 0;
}

.book__link {
  display: grid;
  grid-template-rows: var(--cover-h) 24px auto auto;
  width: min-content;
  color: var(--ink);
  text-decoration: none;
  border-radius: 3px;
}
.book__link:focus-visible {
  box-shadow: none;
}
.book__link:focus-visible .book__cover {
  box-shadow: var(--focus);
}

.book__cover {
  position: relative;
  align-self: end;
  height: calc(var(--cover-h) - 3px);
  width: auto;
  background: var(--cover, #ddd);
  border-radius: 1px 3px 3px 1px;
  box-shadow:
    0 1px 1px rgb(62 10 14 / 0.12),
    0 12px 16px -12px rgb(62 10 14 / 0.6);
  transition: translate 180ms ease-out, box-shadow 180ms ease-out;
}
.book__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
/* The fold of the spine catches the light. */
.book__cover::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    rgb(0 0 0 / 0.22) 0,
    rgb(255 255 255 / 0.18) 1.5%,
    rgb(0 0 0 / 0.06) 4%,
    transparent 8%
  );
  pointer-events: none;
}
.book__link:hover .book__cover {
  translate: 0 -5px;
  box-shadow:
    0 1px 1px rgb(62 10 14 / 0.12),
    0 18px 18px -14px rgb(62 10 14 / 0.55);
}

/* How far you've read, if you've opened this issue before. */
.book__progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: rgb(28 25 23 / 0.35);
  border-radius: 0 0 3px 1px;
  overflow: hidden;
}
.book__progress::before {
  content: "";
  display: block;
  width: var(--read, 0%);
  height: 100%;
  background: var(--gold);
}

.book__year {
  grid-row: 2;
  align-self: start;
  justify-self: start;
  position: relative;
  margin-top: 5px;
  padding-left: 7px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--red);
  font-variant-numeric: lining-nums;
}
/* A tick mark down from the shelf at each new year. */
.book__year::before {
  content: "";
  position: absolute;
  left: 0;
  top: -5px;
  width: 2px;
  height: 14px;
  background: var(--red);
}

.book__title {
  grid-row: 3;
  margin-top: 4px;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.3;
  text-wrap: balance;
}
.book__date {
  grid-row: 4;
  margin-top: 2px;
  font-size: var(--step--1);
  color: var(--ink-soft);
}

/* Searching, filtering by decade or opening one series turns shelves into
   wrapped grids. */
.is-filtered .shelf__row,
.shelf.is-open .shelf__row {
  flex-wrap: wrap;
  row-gap: 22px;
  overflow: visible;
  -webkit-mask-image: none;
  mask-image: none;
}
.is-filtered .book:last-child,
.shelf.is-open .book:last-child {
  padding-right: clamp(14px, 2vw, 26px);
}
.is-filtered .shelf__scroll,
.shelf.is-open .shelf__scroll {
  display: none;
}

.empty {
  padding: 48px var(--gutter);
  text-align: center;
}
.empty p {
  margin: 0 0 16px;
  font-family: var(--display);
  font-size: var(--step-2);
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 6px;
  background: var(--red);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}
.button:hover {
  background: var(--red-dark);
}

.colophon {
  padding: 28px var(--gutter) 40px;
  border-top: 3px solid var(--ink);
  text-align: center;
  font-size: var(--step--1);
  color: var(--ink-soft);
}
.colophon__motto {
  margin: 0 0 6px;
  font-family: var(--display);
  font-style: italic;
  font-size: var(--step-1);
  color: var(--ink);
}
.colophon p {
  margin: 0;
}

/* Inside the Wix page, which has its own header and footer. */
.is-embedded .masthead,
.is-embedded .colophon,
.is-embedded .skip {
  display: none;
}
.is-embedded .shelves {
  padding-bottom: 8px;
}

@media (max-width: 560px) {
  .masthead__banner {
    width: min(280px, 80%);
  }
  .masthead__title {
    margin-top: 10px;
    font-size: var(--step-4);
  }
  .masthead__intro {
    font-size: 0.9375rem;
  }
  .masthead::after {
    margin-top: 16px;
  }
  .finder__decade {
    flex: 1 1 120px;
  }
  .finder__count {
    flex-basis: 100%;
    margin: 0;
  }
  .shelf {
    padding-top: 24px;
  }
  .shelf__name {
    font-size: var(--step-2);
  }
}

/* ------------------------------------------------------------------------
   Reader
   ------------------------------------------------------------------------ */

/* The root needs its own background: the reader's body is fixed in place, so
   its background would otherwise be painted on the zero-height root instead. */
.reader-page {
  background: var(--oxblood-deep);
}

.reader {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-columns: minmax(0, 1fr);
  overflow: hidden;
  color: var(--cream-on-dark);
  /* The issue lies lit on the club table. */
  background:
    radial-gradient(ellipse 70% 60% at 50% 45%, #5b141a 0%, var(--oxblood) 62%, var(--oxblood-deep) 100%);
  --focus: 0 0 0 2px var(--oxblood), 0 0 0 4px var(--gold);
  -webkit-tap-highlight-color: transparent;
}

.bar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left));
  transition: opacity 300ms ease;
}
.bar--top {
  padding-top: max(8px, env(safe-area-inset-top));
}
.bar--bottom {
  padding-bottom: max(10px, env(safe-area-inset-bottom));
}

.bar__back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  padding: 0 12px 0 6px;
  border-radius: 22px;
  color: var(--cream-on-dark);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9375rem;
}
.bar__back:hover {
  background: rgb(255 255 255 / 0.08);
}
.bar__back svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.bar__title {
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-align: center;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 400;
  font-size: var(--step-0);
}
.bar__series {
  font-family: var(--display);
  font-weight: 700;
  font-size: var(--step-1);
  color: #fff;
}
.bar__issue {
  margin-left: 0.5em;
  color: var(--cream-on-dark-soft);
}

.bar__actions {
  display: flex;
  gap: 4px;
}

.tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 22px;
  background: transparent;
  color: var(--cream-on-dark);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.tool:hover {
  background: rgb(255 255 255 / 0.08);
}
.tool:disabled {
  opacity: 0.35;
  cursor: default;
  background: transparent;
}
.tool svg {
  flex: none;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tool[aria-pressed="true"],
.tool[aria-expanded="true"] {
  background: rgb(255 255 255 / 0.12);
}

.stage {
  position: relative;
  min-height: 0;
  display: grid;
  place-items: center;
  touch-action: pan-y;
}

.book-host {
  position: relative;
}
.is-ready .book-host {
  transition: translate 450ms cubic-bezier(0.3, 0.7, 0.2, 1);
}

/* The pages' own shadow on the table, sized to whichever pages are showing. */
.book-shadow {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 2px;
  box-shadow:
    0 2px 4px rgb(0 0 0 / 0.25),
    0 24px 50px -10px rgb(0 0 0 / 0.65);
  pointer-events: none;
  transition: left 300ms ease, width 300ms ease;
}

.page {
  background: #fff;
  overflow: hidden;
}
.page img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}
/* The gutter: pages darken towards the spine. */
.page::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.page.--left::after {
  background: linear-gradient(to left, rgb(0 0 0 / 0.2), rgb(0 0 0 / 0.04) 4%, transparent 10%);
}
.page.--right::after {
  background: linear-gradient(to right, rgb(0 0 0 / 0.2), rgb(0 0 0 / 0.04) 4%, transparent 10%);
}
.is-portrait .page::after,
.page.is-cover::after {
  background: linear-gradient(to right, rgb(0 0 0 / 0.14), rgb(255 255 255 / 0.1) 1%, transparent 4%);
}

.page__error {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  color: var(--ink);
  background: var(--paper);
}
.page__error button {
  justify-self: center;
}

.turn {
  position: absolute;
  top: 50%;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-top: -26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.07);
  color: var(--cream-on-dark);
  transition: opacity 300ms ease, background 150ms ease;
}
.turn:hover {
  background: rgb(255 255 255 / 0.16);
}
.turn:disabled {
  opacity: 0;
  pointer-events: none;
}
.turn svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}
.turn--prev {
  left: max(12px, env(safe-area-inset-left));
}
.turn--next {
  right: max(12px, env(safe-area-inset-right));
}

.pager {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 12px;
  min-width: 0;
}

.scrub {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 0;
}
.scrub input {
  width: 100%;
  height: 44px;
  margin: 0;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  --fill: 0%;
}
.scrub input::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(var(--gold), var(--gold)) 0 0 / var(--fill) 100% no-repeat, rgb(255 255 255 / 0.2);
}
.scrub input::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: rgb(255 255 255 / 0.2);
}
.scrub input::-moz-range-progress {
  height: 4px;
  border-radius: 2px;
  background: var(--gold);
}
.scrub input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -7px;
  border: 0;
  border-radius: 50%;
  background: var(--cream-on-dark);
  box-shadow: 0 1px 4px rgb(0 0 0 / 0.5);
}
.scrub input::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background: var(--cream-on-dark);
  box-shadow: 0 1px 4px rgb(0 0 0 / 0.5);
}
.scrub input:focus-visible {
  box-shadow: none;
}
.scrub input:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px var(--oxblood), 0 0 0 5px var(--gold);
}
.scrub input:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 3px var(--oxblood), 0 0 0 5px var(--gold);
}

.scrub__preview {
  position: absolute;
  bottom: 52px;
  left: 0;
  translate: -50% 0;
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 8px;
  border-radius: 8px;
  background: var(--oxblood-deep);
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.5);
  pointer-events: none;
}
.scrub__preview span {
  font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
}

.thumb {
  display: block;
  background-color: #fff;
  background-repeat: no-repeat;
}

.pageno {
  margin: 0;
  min-width: 7.5em;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--cream-on-dark-soft);
  white-space: nowrap;
}
.pageno strong {
  font-weight: 600;
  color: var(--cream-on-dark);
}

.pager__step {
  display: none;
}

.resume {
  position: absolute;
  bottom: 16px;
  left: 50%;
  translate: -50% 0;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border-radius: 28px;
  background: var(--cream-on-dark);
  color: var(--oxblood);
  box-shadow: 0 8px 30px rgb(0 0 0 / 0.45);
}
.resume button {
  min-height: 40px;
  white-space: nowrap;
  padding: 0 16px;
  border: 0;
  border-radius: 20px;
  background: transparent;
  color: inherit;
  font-weight: 600;
}
.resume button:hover {
  background: rgb(62 10 14 / 0.08);
}
.resume .resume__close {
  width: 40px;
  padding: 0;
  font-weight: 400;
  font-size: 1.25rem;
  line-height: 1;
}

/* Controls fade away while reading, and come back on any movement. */
.is-idle .bar,
.is-idle .turn {
  opacity: 0;
  pointer-events: none;
}
.is-idle {
  cursor: none;
}

.sheet {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  grid-template-rows: auto 1fr;
  background: rgb(42 6 9 / 0.97);
  color: var(--cream-on-dark);
}
.sheet__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 10px max(20px, env(safe-area-inset-left));
}
.sheet__title {
  flex: 1;
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: var(--step-1);
}

.overview__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 22px 16px;
  align-content: start;
  margin: 0;
  padding: 12px max(20px, env(safe-area-inset-right)) 40px max(20px, env(safe-area-inset-left));
  list-style: none;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.overview__page {
  display: grid;
  justify-items: center;
  gap: 6px;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--cream-on-dark-soft);
  font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
}
.overview__page .thumb {
  box-shadow: 0 4px 12px rgb(0 0 0 / 0.4);
  transition: translate 150ms ease;
}
.overview__page:hover .thumb {
  translate: 0 -3px;
}
.overview__page[aria-current="page"] {
  color: var(--gold);
  font-weight: 600;
}
.overview__page[aria-current="page"] .thumb {
  box-shadow: 0 0 0 3px var(--gold), 0 4px 12px rgb(0 0 0 / 0.4);
}
.overview__page:focus-visible {
  box-shadow: none;
}
.overview__page:focus-visible .thumb {
  box-shadow: var(--focus);
}

.zoom {
  grid-template-rows: auto 1fr;
  background: rgb(26 4 6 / 0.98);
}
.zoom__canvas {
  position: relative;
  min-height: 0;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
}
.zoom__canvas:active {
  cursor: grabbing;
}
.zoom__canvas img {
  position: absolute;
  inset: 0;
  margin: auto;
  max-width: calc(100% - 24px);
  max-height: calc(100% - 24px);
  background: #fff;
  user-select: none;
  -webkit-user-drag: none;
}
.zoom__hint {
  position: absolute;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 50%;
  translate: -50% 0;
  margin: 0;
  padding: 6px 14px;
  border-radius: 16px;
  background: rgb(0 0 0 / 0.55);
  font-size: var(--step--1);
  pointer-events: none;
  transition: opacity 400ms ease;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(84px + env(safe-area-inset-bottom));
  translate: -50% 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--cream-on-dark);
  color: var(--oxblood);
  font-weight: 500;
  box-shadow: 0 8px 30px rgb(0 0 0 / 0.45);
}
.toast input {
  min-width: 0;
  width: 22em;
  max-width: 60vw;
  padding: 6px 8px;
  border: 1px solid rgb(62 10 14 / 0.3);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font-size: var(--step--1);
}

.noscript {
  padding: 40px var(--gutter);
  text-align: center;
}
.noscript a {
  color: var(--gold-light);
}

@media (max-width: 720px) {
  .tool span {
    display: none;
  }
  .tool {
    padding: 0;
  }
  .bar__series {
    font-size: var(--step-0);
  }
  .bar__issue {
    display: block;
    margin: 0;
    font-size: var(--step--1);
  }
  .bar__back span {
    display: none;
  }
  .turn {
    display: none;
  }
}

/* On phones the slider gives way to previous and next buttons, all within
   reach of a thumb. */
@media (max-width: 520px) {
  .scrub {
    display: none;
  }
  .pager {
    justify-content: center;
  }
  .pager__step {
    display: inline-flex;
  }
  .pageno {
    min-width: 0;
    text-align: center;
  }
}
