/* Chronicles of the Sewer — the guild's tales. Same type and gold as the Okanvil page
   (public/okanvil/okanvil.css), on the shared tokens in assets/css/theme.css; the tales
   themselves are set in a book face (Spectral) so they read like a chronicle, not a UI. */

:root {
  --lo-display: "Marcellus", "Trajan Pro", Georgia, serif;
  --lo-body: "Figtree", var(--font);
  --lo-book: "Spectral", Georgia, "Times New Roman", serif;
  --lo-title: #f3e3bd;
  --lo-heading: #f1e6cc;
  --lo-ink: #d9d2c3;          /* tale text: parchment-white, easier on the eye than pure white */
  --lo-line: #3a3530;
  --lo-wrap: var(--wrap-wide);  /* same column as the shared bar */
}

body {
  background: var(--bg);
  font-family: var(--lo-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100% }
a { color: var(--accent-hi) }
:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 3px }
.eyebrow {
  margin: 0 0 12px; font-size: 12px; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase; color: var(--accent);
}

/* ---------- list ---------- */
.wrap-lore { max-width: var(--lo-wrap); margin: 0 auto; padding: 0 20px 40px }
.intro { padding: 64px 0 36px; max-width: 760px }
.intro h1 {
  font-family: var(--lo-display); font-weight: 400;
  font-size: clamp(42px, 6vw, 70px); line-height: 1.02; margin: 0 0 18px;
  color: var(--lo-title); text-wrap: balance;
}
.lede { font-size: 19px; color: var(--text-dim); margin: 0; max-width: 56ch }

/* the newest tale, big */
.featured {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  border: 1px solid var(--lo-line); border-radius: var(--radius-xl); overflow: hidden;
  background: var(--surface); text-decoration: none; color: inherit;
  transition: border-color .15s, transform .15s;
}
.featured:hover { border-color: var(--accent); transform: translateY(-2px) }
.featured .art { min-height: 340px }
.featured .copy { padding: 34px 34px 30px; display: flex; flex-direction: column; justify-content: center }
.featured .chip {
  align-self: flex-start; margin-bottom: 14px;
  font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: #16120a; background: var(--accent); border-radius: 20px; padding: 3px 11px;
}
.featured h2 {
  font-family: var(--lo-display); font-weight: 400; text-transform: none; letter-spacing: 0;
  font-size: clamp(28px, 3.2vw, 38px); line-height: 1.12; margin: 0 0 8px; color: var(--lo-heading);
}
.featured .teaser { font-family: var(--lo-book); font-size: 17.5px; color: var(--lo-ink); margin: 10px 0 20px }

.art {
  background: radial-gradient(circle at 50% 40%, #2a241b, #101011 75%);
  position: relative; overflow: hidden;
}
.art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .4s }
a:hover .art img { transform: scale(1.03) }
.art .rat { position: absolute; inset: 0; display: grid; place-items: center; font-size: 46px; opacity: .5 }

.date { font-size: 13px; color: var(--text-faint); letter-spacing: .04em }
.read { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--accent-hi) }
.read::after { content: "→"; transition: transform .15s }
a:hover .read::after { transform: translateX(4px) }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 22px }
.tale {
  display: flex; flex-direction: column; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden;
  transition: border-color .15s, transform .15s;
}
.tale:hover { border-color: var(--accent); transform: translateY(-3px) }
.tale .art { aspect-ratio: 16 / 9 }
.tale .t-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1 }
.tale h3 { font-family: var(--lo-display); font-weight: 400; font-size: 21px; line-height: 1.2; margin: 0; color: var(--lo-heading) }
.tale .teaser { font-family: var(--lo-book); font-size: 15.5px; color: var(--text-dim); margin: 2px 0 8px; flex: 1 }
.tale .new { color: var(--accent); font-weight: 700; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; margin-left: 8px }

.status { color: var(--text-faint); text-align: center; margin: 40px 0 }
.status:empty { display: none }

/* ---------- one tale ---------- */
.reader { padding-bottom: 20px }
/* The tale's cover, big: most of the first screen is the art, the title rising out of its foot. */
.r-art { margin: 0; height: min(62vh, 640px); position: relative; overflow: hidden; background: #0f0f10 }
.r-art img { width: 100%; height: 100%; object-fit: cover; object-position: center 40% }
.r-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, var(--bg) 0%, transparent 55%) }
.r-art:empty { height: 40px }
.r-in { max-width: 900px; margin: -90px auto 0; padding: 0 22px; position: relative; z-index: 1 }
.r-art:empty + .r-in { margin-top: 30px }
.r-back { display: inline-block; margin-bottom: 26px; color: var(--text-dim-2); text-decoration: none; font-size: 14px }
.r-back:hover { color: var(--accent-hi) }
/* officer-only re-post of the tale to the lore webhook */
.r-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap }
.r-post {
  font: 600 13px var(--lo-body); color: var(--accent-hi); background: transparent; cursor: pointer;
  border: 1px solid var(--lo-line); border-radius: 20px; padding: 5px 14px;
}
.r-post:hover:not(:disabled) { border-color: var(--accent) }
.r-post:disabled { opacity: .5; cursor: default }
.r-msg { margin: -16px 0 20px; font-size: 14px; min-height: 0 }
.r-msg:empty { display: none }
.r-in > h1 {
  font-family: var(--lo-display); font-weight: 400;
  font-size: clamp(36px, 5vw, 56px); line-height: 1.06; margin: 0 0 30px; color: var(--lo-title);
  text-wrap: balance;
}
.r-body { font-family: var(--lo-book); font-size: 20px; line-height: 1.75; color: var(--lo-ink) }
.r-body p { margin: 0 0 1.1em; text-align: justify; hyphens: auto; -webkit-hyphens: auto }
.r-body strong { color: var(--white); font-weight: 500 }
.r-body em { color: #c8bfae }
.r-body h2, .r-body h3, .r-body h4 {
  font-family: var(--lo-display); font-weight: 400; text-transform: none; letter-spacing: 0;
  color: var(--lo-heading); line-height: 1.2; margin: 1.4em 0 .6em;
}
.r-body h2 { font-size: 30px }
.r-body h3 { font-size: 25px }
.r-body blockquote {
  margin: 1.2em 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--accent);
  color: #c8bfae; font-style: italic;
}
/* the first line of a tale is its dateline ("From the Chronicles of the Sewer...") */
.r-body > p:first-child { font-size: 16px; letter-spacing: .06em; color: var(--accent) }
/* a drop cap on the first real paragraph */
.r-body > p.opening::first-letter {
  float: left; font-family: var(--lo-display); font-size: 3.4em; line-height: .9;
  padding: 6px 18px 0 0; color: var(--accent-hi);
}

.r-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin: 48px 0 0; padding-top: 24px; border-top: 1px solid var(--border);
}
.r-nav a { text-decoration: none; color: var(--text-dim); font-size: 14px }
.r-nav a b { display: block; font-family: var(--lo-display); font-weight: 400; font-size: 19px; color: var(--lo-heading); margin-top: 4px }
.r-nav a:hover b { color: var(--accent-hi) }
.r-nav #rNext { text-align: right }
.r-nav a:empty { visibility: hidden }

/* ---------- special tales ---------- */
.special {
  display: inline-block; margin: 0 0 12px; padding: 5px 12px; border-radius: 999px;
  border: 1px solid rgba(224, 184, 96, .55); background: rgba(224, 184, 96, .08);
  color: var(--accent-hi); font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
}
.special[hidden] { display: none }
.featured.is-special { border-color: rgba(224, 184, 96, .55); box-shadow: 0 0 0 1px rgba(224, 184, 96, .18), 0 18px 50px rgba(0, 0, 0, .45) }

/* pictures inside a tale: wider than the text column, like plates in a book */
.inline-art { margin: 2em -60px 2.2em }
.inline-art img { display: block; width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--border); box-shadow: 0 18px 50px rgba(0, 0, 0, .55) }
.inline-art figcaption { margin-top: 10px; text-align: center; color: var(--text-dim-2); font-family: var(--lo-book); font-style: italic; font-size: 16px }

/* the roll of names at the end of a special tale */
.roll { margin: 3em 0 1em; padding-top: 2em; border-top: 1px solid var(--border) }
.roll h2 { font-family: var(--lo-display); font-weight: 400; color: var(--accent-hi); text-align: center; letter-spacing: .06em; margin: 0 0 .3em; font-size: 30px }
.roll-sub { text-align: center; color: var(--text-dim-2); margin: 0 0 1.4em; font-family: var(--lo-book); font-style: italic; font-size: 16px }
.roll-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px }
.roll-card { position: relative; aspect-ratio: 16 / 10; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); background: #1b1c1f center / cover no-repeat }
.roll-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(10, 10, 12, .92) 0%, rgba(10, 10, 12, .1) 60%) }
.roll-card span { position: absolute; left: 10px; bottom: 8px; z-index: 1; color: var(--white); font-weight: 600; font-size: 14px }
.roll-card:first-child { outline: 1px solid var(--accent-hi) }
.roll-card:first-child span::before { content: "👑 " }

.foot { max-width: var(--lo-wrap); margin: 30px auto 0; padding: 26px 20px 40px; border-top: 1px solid var(--border); color: var(--text-faint); font-size: 13px }

/* big screens: a wider column and a slightly larger book face, so the line length stays comfortable */
@media (min-width: 1600px) {
  .r-in { max-width: 1040px }
  .r-body { font-size: 21px }
}

@media (max-width: 900px) {
  .inline-art { margin-left: 0; margin-right: 0 }
  .roll-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .featured { grid-template-columns: minmax(0, 1fr) }
  .featured .art { min-height: 0; aspect-ratio: 16 / 9 }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)) }
}
@media (max-width: 600px) {
  .grid { grid-template-columns: minmax(0, 1fr) }
  .r-body { font-size: 18px }
  .r-in { margin-top: -50px }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important } }
