/* ===========================================================================
   enw-series.css — the series page, and the "Book 3 of 8" block on a book page.

   Scoped to `.series-*` and `.bd-series*` on purpose: this file is linked by
   series.php alone, so it must not be a place where shared components quietly
   change. Colours come from the existing --enw-* tokens with the same fallbacks
   enw-clay.css uses, so the page follows the reader's palette without this file
   knowing which palette that is.
   =========================================================================== */

.series-page {
  max-width: 820px;
  margin: 0 auto;
  padding: 24px 16px 56px;
}

/* ── breadcrumb ─────────────────────────────────────────────────────────── */

/* `inline-flex` and `width: max-content`, because the shared chrome styles a
   <nav> as a full-width bar with space-between children — which spread this
   trail edge to edge the first time it rendered. A breadcrumb is as wide as its
   own text and no wider. */
.series-crumbs {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--enw-ink-soft, #5b6472);
  margin-bottom: 14px;
}

.series-crumbs a {
  color: var(--enw-accent, #1f52c4);
  text-decoration: none;
}

.series-crumbs a:hover,
.series-crumbs a:focus-visible {
  text-decoration: underline;
}

/* ── heading ────────────────────────────────────────────────────────────── */

.series-head h1 {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  line-height: 1.2;
  margin: 0 0 8px;
  color: var(--enw-ink, #12161d);
}

.series-lede {
  margin: 0 0 26px;
  font-size: 1rem;
  color: var(--enw-ink-soft, #5b6472);
}

/* ── the list ───────────────────────────────────────────────────────────── */

.series-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  counter-reset: none;
}

.series-item-link {
  display: grid;
  grid-template-columns: 40px 60px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 10px 14px 10px 10px;
  border-radius: 18px;
  background: var(--enw-surface, #fff);
  border: 1px solid var(--enw-line, rgba(18, 22, 29, 0.08));
  box-shadow: 0 6px 14px -12px rgba(31, 82, 196, 0.5);
  text-decoration: none;
  color: inherit;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.series-item-link:hover,
.series-item-link:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px -14px rgba(31, 82, 196, 0.55);
}

.series-volume {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--enw-accent-ink, #fff);
  background: var(--enw-accent, #1f52c4);
}

.series-cover {
  width: 60px;
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--enw-surface-2, #eef1f7);
}

.series-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.series-title {
  font-weight: 600;
  font-size: 0.98rem;
  line-height: 1.3;
  color: var(--enw-ink, #12161d);
  overflow-wrap: anywhere;
}

.series-author {
  font-size: 0.85rem;
  color: var(--enw-ink-soft, #5b6472);
}

.series-position {
  font-size: 0.78rem;
  color: var(--enw-accent, #1f52c4);
}

/* The list is a phone-width card stack; four-column badges and a cover would
   leave about 120px for a title on a 320px screen. */
@media (max-width: 420px) {
  .series-item-link {
    grid-template-columns: 32px minmax(0, 1fr);
    padding: 12px;
  }

  .series-cover {
    display: none;
  }
}

.series-note {
  margin-top: 26px;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--enw-ink-soft, #5b6472);
}

/* ── the block on a book page ───────────────────────────────────────────── */

.bd-series {
  margin: 22px 0;
  padding: 18px 20px;
  border-radius: 20px;
  background: var(--enw-surface, #fff);
  border: 1px solid var(--enw-line, rgba(18, 22, 29, 0.08));
}

.bd-series-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
}

.bd-series-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.bd-series-head h2 a,
.bd-series-head .bd-series-count a {
  color: var(--enw-accent, #1f52c4);
  text-decoration: none;
}

.bd-series-head h2 a:hover,
.bd-series-head h2 a:focus-visible,
.bd-series-head .bd-series-count a:hover,
.bd-series-head .bd-series-count a:focus-visible {
  text-decoration: underline;
}

.bd-series-head .bd-series-count {
  font-size: 0.82rem;
  color: var(--enw-ink-soft, #5b6472);
}

.bd-series-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}

.bd-series-thumb {
  flex: 0 0 auto;
  width: 74px;
  text-decoration: none;
  color: inherit;
}

.bd-series-thumb img {
  width: 74px;
  height: 112px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid transparent;
  background: var(--enw-surface-2, #eef1f7);
}

.bd-series-thumb.is-current img {
  border-color: var(--enw-accent, #1f52c4);
}

.bd-series-thumb span {
  display: block;
  margin-top: 4px;
  font-size: 0.7rem;
  line-height: 1.25;
  color: var(--enw-ink-soft, #5b6472);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.bd-series-next {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.bd-series-next a {
  display: inline-block;
  padding: 9px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  background: var(--enw-accent, #1f52c4);
  color: var(--enw-accent-ink, #fff);
}

/* ── the directory ──────────────────────────────────────────────────────── */

.series-letters {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 22px;
}

.series-letters a {
  min-width: 30px;
  padding: 4px 8px;
  border-radius: 8px;
  text-align: center;
  font-size: 0.84rem;
  text-decoration: none;
  color: var(--enw-ink, #12161d);
  background: var(--enw-surface, #fff);
  border: 1px solid var(--enw-line, rgba(18, 22, 29, 0.08));
}

.series-letters a:hover,
.series-letters a:focus-visible {
  border-color: var(--enw-accent, #1f52c4);
}

.series-letters a[aria-current='page'] {
  background: var(--enw-accent, #1f52c4);
  border-color: var(--enw-accent, #1f52c4);
  color: var(--enw-accent-ink, #fff);
}

.series-dir {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
}

.series-dir a {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  text-decoration: none;
  color: var(--enw-ink, #12161d);
  background: var(--enw-surface, #fff);
  border: 1px solid var(--enw-line, rgba(18, 22, 29, 0.08));
}

.series-dir a:hover,
.series-dir a:focus-visible {
  border-color: var(--enw-accent, #1f52c4);
}

.series-dir-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.series-dir-name {
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.series-dir-author {
  font-size: 0.76rem;
  color: var(--enw-ink-soft, #5b6472);
  overflow-wrap: anywhere;
}

.series-dir-count {
  margin-inline-start: auto;
  flex: none;
  font-size: 0.76rem;
  color: var(--enw-ink-soft, #5b6472);
}

.series-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 26px;
  font-size: 0.88rem;
  color: var(--enw-ink-soft, #5b6472);
}

.series-pager a {
  padding: 8px 16px;
  border-radius: 999px;
  text-decoration: none;
  background: var(--enw-accent, #1f52c4);
  color: var(--enw-accent-ink, #fff);
  font-weight: 600;
}

/* ── prices in the other markets ────────────────────────────────────────── */

.bd-markets {
  margin: 18px 0 6px;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--enw-surface, #fff);
  border: 1px solid var(--enw-line, rgba(18, 22, 29, 0.08));
}

.bd-markets-head {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--enw-ink-soft, #5b6472);
  margin-bottom: 10px;
}

.bd-markets-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 6px 14px;
}

.bd-markets-list a {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 5px 8px;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  font-size: 0.88rem;
}

.bd-markets-list a:hover,
.bd-markets-list a:focus-visible {
  background: var(--enw-surface-2, #eef1f7);
}

.bd-markets-list li.is-active a {
  background: var(--enw-surface-2, #eef1f7);
  font-weight: 600;
}

.bd-markets-price {
  margin-inline-start: auto;
  font-variant-numeric: tabular-nums;
  color: var(--enw-accent, #1f52c4);
}

.bd-markets-note {
  margin: 10px 0 0;
  font-size: 0.76rem;
  line-height: 1.45;
  color: var(--enw-ink-soft, #5b6472);
}

@media (prefers-reduced-motion: reduce) {
  .series-item-link,
  .series-item-link:hover,
  .series-item-link:focus-visible {
    transition: none;
    transform: none;
  }
}
