/* prose.css: the reading layout for /prose/, its own Zola site beside the
   wiki. Loaded after site.css by the prose templates only. Prose reads in
   the body serif at a book's measure, and nothing is centred but the title. */

body.prose-page main {
  max-width: 760px;
  text-align: left;
}

/* Listings get a wider measure than the reading column, so a chapter's title
   and its badges stay on one line. */
body.prose-page main:has(.prose-listing) {
  max-width: 960px;
}

/* Prose is the reference register, like the wiki: Consolas, left-aligned,
   headings in ink with a rule beneath the top two levels. The sizes and rules
   below mirror .wiki-content in wiki.css and must stay in step with it. The
   marketing pages keep their own register (Cinzel in blood, centred). Only a
   chapter's body text departs from this, reading in the body serif. */
.prose {
  font-family: var(--font-body);
  font-size: 1.3rem;
  line-height: 1.65;
  color: var(--ink);
}

.prose-listing {
  font-family: var(--font-mono);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink);
}

.prose-listing h1,
.prose-listing h2,
.prose-listing h3,
.prose-head h1,
.prose-head,
.prose-mentions h2,
.prose-siblings h2 {
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: normal;
  color: var(--ink);
  text-align: left;
}

.prose-listing h1,
.prose-head h1 {
  font-size: 2.1rem;
  margin: 0 0 0.5em 0;
  padding-bottom: 0.3em;
  border-bottom: 2px solid var(--rule);
}

.prose-listing h2 {
  font-size: 1.55rem;
  margin: 0 0 0.5em 0;
  padding-bottom: 0.2em;
  border-bottom: 1px solid var(--rule);
}

.prose-listing h3 {
  font-size: 1.3rem;
  margin: 1.1em 0 0.4em 0;
}

.prose-head {
  margin-bottom: 2.5rem;
  font-family: var(--font-mono);
  font-size: 1rem;
  line-height: 1.55;
  font-weight: normal;
}

.prose-crumbs {
  font-size: 0.9rem;
  color: var(--ink-faint);
  margin-bottom: 0.8em;
}

.prose-crumbs a {
  color: var(--ink-faint);
  text-decoration: none;
}

.prose-crumbs a:hover,
.prose-crumbs a:focus {
  color: var(--rose-bright);
}

.prose-meta {
  font-size: 1rem;
  color: var(--ink-faint);
  margin: 0 0 0.6em 0;
}

.prose-meta--centred {
  text-align: center;
}

.prose-summary {
  font-style: italic;
  color: var(--ink-faint);
  margin: 0;
}

/* In a chapter's title the badges ride inline after the text, at badge size. */
.prose-head h1 .status-badge {
  font-size: 0.75rem;
  margin-left: 0.5em;
  vertical-align: middle;
}

.status-badge {
  display: inline-block;
  white-space: nowrap;
  padding: 0.1em 0.6em;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  vertical-align: middle;
  color: var(--ink-faint);
  background: var(--void);
}

.status-draft {
  border-color: var(--ink-faint);
}

.status-revised {
  border-color: var(--mauve);
  color: var(--mauve);
}

.status-final {
  border-color: var(--blood);
  color: var(--rose);
}

/* Every paragraph indents, the first included, as in the manuscripts. */
.prose-body p {
  margin: 0 0 0.7em 0;
  text-align: left;
  text-indent: 1.6em;
}

/* Act and scene headings inside a chapter: the reference register again, so
   they match the page's title rather than the marketing pages. */
.prose-body h2 {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: normal;
  text-align: left;
  margin: 2em 0 1em 0;
  padding-bottom: 0.2em;
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
}

.prose-body blockquote {
  margin: 1.4em 2em;
  padding: 0;
  border: none;
  font-style: italic;
  text-align: center;
}

.prose-body blockquote p {
  text-indent: 0;
  margin: 0;
}

.prose-body em {
  color: inherit;
}

.prose-body hr {
  width: 6em;
  margin: 2em auto;
}

.prose-mentions,
.prose-siblings {
  margin-top: 3rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 1rem;
  line-height: 1.55;
}

.prose-mentions h2,
.prose-siblings h2 {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: normal;
  color: var(--ink);
  text-align: left;
  margin: 0 0 0.6em 0;
}

.prose-mentions ul,
.prose-siblings ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em 1.2em;
}

.prose-mentions a,
.prose-siblings a {
  color: var(--rose);
  text-decoration: none;
  border-bottom: 1px dotted rgba(201, 126, 140, 0.5);
}

/* Card and panel titles: no underline, as on the wiki's entry cards. */
.prose-part h2 a {
  color: var(--rose);
  text-decoration: none;
  border-bottom: none;
}

.prose-mentions a:hover,
.prose-siblings a:hover {
  color: var(--rose-bright);
  border-bottom-color: var(--rose-bright);
}

.prose-part h2 a:hover,
.prose-part h2 a:focus {
  color: var(--rose-bright);
}

/* Listings: a work's chapters as cards, same family as the wiki's entry cards.
   On a work's page each part is a panel with every visible chapter inside, the
   panels side by side; a work listed on the root spans the full width. */
.prose-blurb {
  margin-bottom: 1.5rem;
}

/* Two explicit columns of panels, stretched to the same height. A column of
   several panels is justified: first at the top, last at the bottom, the rest
   spaced evenly. A column holding a single panel centres it instead. Which
   column a panel takes is the template's decision (works with parts right,
   everything else left). */
.prose-columns {
  display: flex;
  align-items: stretch;
  gap: 1rem;
  margin-top: 2rem;
}

.prose-column {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
}

.prose-column > .prose-part--panel:only-child {
  margin: auto 0;
}

.prose-column:empty {
  display: none;
}

/* A work's parts: a two-column grid, each panel at its own height, an odd
   last panel on its own row and centred, as the game tiles do. */
.prose-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  align-items: start;
  margin-top: 2rem;
}

.prose-grid > .prose-part--panel:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  width: calc(50% - 0.5rem);
  justify-self: center;
}

.prose-part--panel {
  margin: 0;
  background: var(--void);
  border: 1px solid var(--rule);
  padding: 1em 1.1em 1.1em 1.1em;
}

.prose-part--panel h2 {
  font-size: 1.3rem;
  margin: 0 0 0.4em 0;
  padding-bottom: 0.2em;
  border-bottom: 1px solid var(--rule);
}

.prose-part--piece h2 {
  font-size: 1.05rem;
}

.prose-part--piece .prose-meta {
  margin-bottom: 0;
}

.prose-part--panel h2 {
  margin-top: 0;
}

.prose-part .prose-meta {
  font-size: 0.9rem;
}

/* A part's heading inside a work's panel: a link, in title case, one step
   down from the panel title. */
.prose-part h3 {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: normal;
  text-transform: none;
  text-align: left;
  margin: 1.1em 0 0.2em 0;
}

.prose-part h3 a {
  color: var(--rose);
  text-decoration: none;
  border-bottom: none;
}

.prose-part h3 a:hover,
.prose-part h3 a:focus {
  color: var(--rose-bright);
}

.prose-chapters--stack {
  grid-template-columns: 1fr;
  gap: 0;
  margin-top: 0.5em;
}

.prose-chapters--stack li {
  background: none;
  border: none;
  padding: 0.6em 0 0.8em 0;
}

.prose-chapters--stack li + li {
  border-top: 1px solid var(--rule);
}

.prose-chapters--stack li:hover {
  border-color: var(--rule);
}

.prose-chapters {
  list-style: none;
  padding: 0;
  margin: 0.8em 0 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.6em;
  font-family: var(--font-mono);
  font-size: 1rem;
  line-height: 1.5;
}

.prose-chapters li {
  background: var(--void);
  border: 1px solid var(--rule);
  padding: 0.7em 0.9em;
  transition: border-color var(--quick);
}

.prose-chapters li:hover {
  border-color: var(--mauve);
}

.prose-chapters li > a {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--rose);
  text-decoration: none;
}

/* Badges are a card's footer: their own line, a rule above, so each card reads
   title, body, footer. */
.badges {
  display: block;
  margin-top: 0.6em;
  padding-top: 0.5em;
  border-top: 1px solid var(--rule);
}

.prose-chapters li > a:hover {
  color: var(--rose-bright);
}

.prose-chapters .summary {
  display: block;
  margin-top: 0.3em;
  color: var(--ink-faint);
  font-size: 0.85rem;
}

/* Non-public pages, which only a local build (--visibility public,spoiler,hidden)
   renders: badged so a local preview is never mistaken for the deploy. */
.status-hidden,
.status-spoiler {
  border-style: dashed;
  border-color: var(--ink-faint);
}

@media (max-width: 600px) {
  .prose,
  .prose-listing {
    font-size: 1.15rem;
  }

  .prose-body blockquote {
    margin: 1.2em 0.8em;
  }

  .prose-chapters {
    grid-template-columns: 1fr;
  }

  .prose-columns {
    flex-direction: column;
  }

  .prose-column {
    justify-content: flex-start;
  }

  .prose-column > .prose-part--panel:only-child {
    margin: 0;
  }

  .prose-grid {
    grid-template-columns: 1fr;
  }

  .prose-grid > .prose-part--panel:last-child:nth-child(odd) {
    width: 100%;
  }
}
