/* Story reading pages: contents page, chapter navigation, quest-page banner.
   Layered on story.css (dialogue / quest-page styles) and the site card grid. */

.story-banner img,
.quest-page-banner img {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  margin-bottom: 1rem;
}

.quest-page .story-blurb,
.quest-page .quest-blurb {
  text-align: center;
  margin: .5rem 0;
}

.story-start {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  margin: 1rem 0;
}

/* ---- Breadcrumbs (story, chapter and hub pages) ---- */
.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  list-style: none;
  margin: 0 0 .75rem;
  padding: 0;
  font-size: .85rem;
  color: var(--ink-soft);
}

.breadcrumbs li + li::before {
  content: "›";
  margin-right: .25rem;
  color: var(--ink-faint);
}

.breadcrumbs span[aria-current] {
  color: var(--ink);
  font-weight: 700;
}

/* ---- Play hubs (category pages, events page) ---- */
.hub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.hub-header h1 {
  margin: 0;
}

.hub-filter {
  display: inline-flex;
  gap: .25rem;
  margin: .75rem 0 0;
  padding: .2rem;
  border: 1px solid var(--tab-line);
  border-radius: 999px;
  background: var(--tab);
}

.hub-filter a {
  padding: .3rem .9rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 700;
  font-size: .9rem;
}

.hub-filter a[aria-current] {
  background: var(--accent);
  color: #fff;
}

.hub-act {
  margin: 1.5rem 0 0;
  padding-bottom: .35rem;
  border-bottom: 1px dashed var(--line);
}

.hub-empty {
  margin: 1.25rem 0 .25rem;
}

/* Story / event cards: the banner art carries the title, so the text stays short. */
.story-card {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.story-card-banner img,
.story-card-banner .thumb-placeholder {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

.story-card-banner .thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  background: var(--tab);
}

.story-card-title {
  margin: .25rem 0 0;
  font-size: 1.15rem;
  line-height: 1.3;
}

.story-card-meta {
  margin: 0;
  font-size: .85rem;
  color: var(--ink-soft);
}

.story-card-blurb {
  margin: 0;
}

.story-card-actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: auto;
  padding-top: .5rem;
}

.story-card--past {
  opacity: .75;
}

/* ---- Story / event page: chapter rows and expandable quest rows ---- */
.story-state {
  text-align: center;
  margin: .25rem 0;
}

.story-section-heading {
  margin: 1.5rem 0 .6rem;
  font-size: 1.2rem;
}

.story-rows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.story-rows > li {
  display: flex;
  gap: .5rem;
  align-items: center;
}

.story-row {
  flex: 1;
  display: flex;
  align-items: center;
  gap: .75rem;
  min-height: 3rem;
  padding: .6rem .9rem;
  border: 1.5px solid var(--tab-line);
  border-radius: 12px;
  background: var(--tab);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: border-color .15s, transform .15s;
}

.story-row:hover,
.story-row:focus-visible {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.story-row-num {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.story-row-title {
  flex: 1;
  min-width: 0;
  font-weight: 700;
}

.story-row-go {
  flex: none;
  color: var(--accent-dark);
  font-weight: 700;
  font-size: .9rem;
}

.story-row-edit {
  flex: none;
}

/* Quest rows are <details>: the summary is the row, the body opens beneath it. */
.story-quest {
  border-radius: 12px;
}

.story-quest > summary {
  list-style: none;
}

.story-quest > summary::-webkit-details-marker {
  display: none;
}

.story-quest > summary::after {
  content: "▾";
  flex: none;
  color: var(--ink-soft);
  transition: transform .15s;
}

.story-quest[open] > summary {
  border-color: var(--accent);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.story-quest[open] > summary::after {
  transform: rotate(180deg);
}

.story-quest-body {
  padding: .9rem 1rem 1rem;
  border: 1.5px solid var(--accent);
  border-top: none;
  border-radius: 0 0 12px 12px;
  background: var(--card);
}

.story-quest-blurb {
  margin: 0 0 .5rem;
  font-style: italic;
  color: var(--ink-soft);
}

.story-quest-heading {
  margin: .25rem 0 .5rem;
  font-size: 1.05rem;
}

.story-quest-actions {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: .75rem;
}

.story-quest--closed > summary {
  opacity: .7;
}

/* "Completed N times", just before the status chip. */
.story-quest-count {
  flex: none;
  color: var(--ink-soft);
  font-size: .78rem;
  font-weight: 700;
  white-space: nowrap;
}

/* Status chip on a collapsed quest row. Text stays --ink on the card colour in both
   themes; the coloured dot and border carry the state, never colour alone. */
.quest-chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .15rem .6rem;
  border: 1.5px solid var(--chip, var(--ink-faint));
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-size: .78rem;
  font-weight: 800;
  white-space: nowrap;
}

.quest-chip::before {
  content: "";
  width: .5rem;
  height: .5rem;
  border-radius: 50%;
  background: var(--chip, var(--ink-faint));
}

:root {
  --chip-open: #3f7a4b;
  --chip-soon: #b7791f;
  --chip-pending: #7a5ab0;
  --chip-done: var(--accent-dark);
  --chip-closed: var(--ink-soft);
}

:root[data-theme="dark"] {
  --chip-open: #7fd3a3;
  --chip-soon: #f0c869;
  --chip-pending: #b9a3f5;
  --chip-done: var(--accent);
  --chip-closed: var(--ink-faint);
}

.quest-chip--open { --chip: var(--chip-open); }
.quest-chip--soon { --chip: var(--chip-soon); }
.quest-chip--pending { --chip: var(--chip-pending); }
.quest-chip--done { --chip: var(--chip-done); }
.quest-chip--closed { --chip: var(--chip-closed); }

@media (max-width: 520px) {
  .story-row {
    padding: .55rem .7rem;
    gap: .5rem;
  }

  .quest-chip,
  .story-quest-count {
    font-size: .72rem;
  }
}

/* Chapter page header + previous / contents links. */
.quest-page .quest-title a {
  color: inherit;
  text-decoration: none;
}

.quest-page .quest-title a:hover {
  text-decoration: underline;
}

.story-chapter-title {
  margin: .25rem 0;
}

.story-chapter-nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  margin: .5rem 0;
}
