:root {
  color-scheme: dark;
  --background: #111113;
  --surface: #18181b;
  --text: #f2f0ed;
  --muted: #afadb0;
  --border: #343438;
  --accent: #ffe45c;
  --gutter: clamp(12px, 2.5vw, 24px);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

.series-wrap {
  width: min(calc(100% - 2 * var(--gutter)), 1100px);
  margin-inline: auto;
}

.series-header {
  position: sticky;
  z-index: 10;
  top: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 8px clamp(10px, 2vw, 20px);
  padding-block: 9px;
}

.series-back {
  display: inline-flex;
  align-items: center;
  gap: .45em;
  min-height: 44px;
  padding: 6px 12px;
  border: 1px solid rgba(255, 228, 92, .38);
  border-radius: 8px;
  background: rgba(255, 228, 92, .08);
  color: #ffe45c;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}

.series-back:hover,
.series-back:focus-visible {
  background: #ffe45c;
  color: #17150b;
}

.series-identity {
  flex: 1;
  min-width: 0;
}

.series-artist {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.series-title {
  margin: 2px 0 0;
  font-size: clamp(18px, 2.3vw, 25px);
  line-height: 1.12;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.series-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 9px;
}

.series-tabs a {
  display: grid;
  place-items: center;
  min-height: 40px;
  padding: 4px 12px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 550;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.series-tabs a:hover {
  background: #29292d;
  color: var(--text);
}

.series-tabs a[aria-current="page"] {
  background: #313034;
  color: var(--accent);
}

.series-gallery {
  padding-block: 16px 32px;
}

.thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  gap: 10px;
}

.thumb {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  min-width: 0;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  cursor: zoom-in;
}

.thumb:hover {
  border-color: var(--accent);
}

.thumb img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}

.lightbox {
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 16px 68px;
  border: 0;
  background: transparent;
}

.lightbox[open] {
  display: grid;
  place-items: center;
}

.lightbox::backdrop {
  background: rgba(0, 0, 0, .94);
}

body:has(.lightbox[open]) {
  overflow: hidden;
}

.lightbox img {
  max-width: 100%;
  max-height: calc(100dvh - 32px);
  object-fit: contain;
  cursor: zoom-out;
}

.lightbox-control {
  position: absolute;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.lightbox-control:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.lightbox-close {
  top: 12px;
  right: 12px;
}

.lightbox-prev,
.lightbox-next {
  top: 50%;
  translate: 0 -50%;
}

.lightbox-prev {
  left: 12px;
}

.lightbox-next {
  right: 12px;
}

@media (max-width: 600px) {
  .lightbox {
    padding: 62px 12px;
  }

  .lightbox img {
    max-height: calc(100dvh - 124px);
  }

  .lightbox-prev,
  .lightbox-next {
    top: auto;
    bottom: 12px;
    translate: none;
  }

  .lightbox-prev {
    left: calc(50% - 52px);
  }

  .lightbox-next {
    right: calc(50% - 52px);
  }
}

/* Match the reading column in Over het project on the PTP overview. */
.series-reading {
  width: calc((min(100%, 1200px) - 2 * 18px - 64px) / 1.65);
  max-width: 66ch;
  padding-block: clamp(20px, 4vw, 38px) 56px;
  color: #e2dfdf;
  font-size: 17px;
  line-height: 1.8;
}

.series-reading p {
  margin: 0 0 1em;
  white-space: pre-line;
}

.series-reading .series-lead {
  margin-bottom: 1.4em;
  color: var(--muted);
}

.series-reading h2,
.series-reading h3 {
  margin: 1.25em 0 .4em;
  color: var(--text);
}

.series-reading h2 {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -.025em;
  line-height: 1.15;
}

.series-reading h3 {
  font-size: 20px;
  line-height: 1.3;
}

@media (max-width: 960px) {
  .series-reading {
    width: calc((100% - 2 * 18px - 32px) / 1.6);
  }
}

@media (max-width: 720px) {
  .series-reading {
    width: calc(100% - 2 * 18px);
    font-size: 16px;
  }

  .topbar {
    flex-wrap: wrap;
  }

  .series-tabs {
    flex-basis: 100%;
  }

  .series-tabs a {
    padding-inline: 4px;
  }

  .series-gallery {
    padding-top: 10px;
  }

  .thumbs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }
}

@media (max-width: 360px) {
  .series-artist {
    display: none;
  }

  .series-title {
    font-size: 14px;
  }
}
