/* EmporMogul Wiki. System fonts only (nothing downloaded, no third-party requests). */
:root {
  --bg: #f7f5f0;
  --paper: #ffffff;
  --ink: #1f1d1a;
  --muted: #6a645b;
  --line: #ddd6ca;
  --accent: #c2410c;          /* the game's orange, darkened for contrast on white */
  --link: #1d4ed8;
  --link-new: #b91c1c;
  --band: #fff4e6;
  --draft: #fef3c7;
  --draft-line: #d97706;
  --focus: #2563eb;
  --radius: 6px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161513;
    --paper: #1f1e1b;
    --ink: #ece8e1;
    --muted: #a59e92;
    --line: #3a3732;
    --accent: #fb923c;
    --link: #93b4ff;
    --link-new: #f87171;
    --band: #2a221a;
    --draft: #3a2f12;
    --draft-line: #f59e0b;
    --focus: #93b4ff;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--link); text-underline-offset: 2px; }
a.new { color: var(--link-new); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .9em; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--paper); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }

/* Header */
.top {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
  padding: 10px 16px; background: var(--paper); border-bottom: 3px solid var(--accent);
}
.brand { font-weight: 800; font-size: 1.25rem; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.brand span { color: var(--accent); }
.badge { font-size: .75rem; font-weight: 600; background: var(--draft); border: 1px solid var(--draft-line);
  border-radius: 99px; padding: 2px 10px; }
.search { position: relative; flex: 1 1 260px; max-width: 460px; margin-left: auto; }
.search input { width: 100%; font: inherit; padding: 7px 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg); color: var(--ink); }
#q-list { position: absolute; left: 0; right: 0; top: 100%; margin: 4px 0 0; padding: 4px; list-style: none; z-index: 5;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 6px 20px rgba(0,0,0,.15); }
#q-list li { padding: 6px 8px; border-radius: 4px; cursor: pointer; }
#q-list li[aria-selected="true"] { background: var(--band); }
#q-list .k { color: var(--muted); font-size: .8em; margin-left: 6px; }
.kid { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.kid button { font: inherit; font-size: .9rem; padding: 5px 12px; border: 0; background: var(--paper); color: var(--ink); cursor: pointer; }
.kid button[aria-pressed="true"] { background: var(--accent); color: #fff; }

/* Frame */
.frame { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px; max-width: 1240px; margin: 0 auto; padding: 20px 16px; }
.side ul { list-style: none; margin: 0; padding: 0; position: sticky; top: 16px; }
.side li a { display: block; padding: 4px 8px; border-radius: 4px; text-decoration: none; }
.side li a:hover, .side li a[aria-current="page"] { background: var(--band); }
main { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 28px 28px; min-width: 0; }
main:focus { outline: none; }
footer.site { text-align: center; color: var(--muted); font-size: .85rem; padding: 8px 16px 32px; }

/* Article */
.kind { margin: 0; color: var(--accent); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
h1 { margin: 2px 0 12px; font-size: 2rem; line-height: 1.2; font-family: Georgia, "Times New Roman", serif; font-weight: 600; }
h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 600; font-size: 1.45rem; border-bottom: 1px solid var(--line);
  padding-bottom: 4px; margin: 28px 0 12px; clear: none; }
h3 { font-size: 1.08rem; margin: 18px 0 6px; }
.redirected { color: var(--muted); font-size: .9rem; margin: -8px 0 12px; }
.banner { background: var(--band); border-left: 4px solid var(--accent); padding: 8px 12px; border-radius: 4px; }
.banner.draft { background: var(--draft); border-left-color: var(--draft-line); }
.lead p:first-child { margin-top: 0; }
.coming { color: var(--muted); font-style: italic; }
sup.ref { font-size: .7em; margin-left: 1px; }
sup.ref a { text-decoration: none; }

/* Infobox */
.infobox { float: right; width: 300px; margin: 0 0 16px 24px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg); font-size: .92rem; overflow: hidden; }
.infobox h2 { margin: 0; padding: 8px 12px; font-size: 1.1rem; text-align: center; background: var(--accent); color: #fff; border: 0; }
.infobox figure { margin: 0; }
.infobox img { display: block; width: 100%; height: auto; }
.infobox figcaption { padding: 6px 12px; font-size: .82rem; color: var(--muted); border-bottom: 1px solid var(--line); }
.infobox dl { margin: 0; padding: 4px 12px 8px; }
.infobox dl > div { display: grid; grid-template-columns: 38% 1fr; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.infobox dl > div:last-child { border-bottom: 0; }
.infobox dt { font-weight: 600; }
.infobox dd { margin: 0; overflow-wrap: anywhere; }

/* Contents */
.toc { display: inline-block; border: 1px solid var(--line); background: var(--bg); border-radius: var(--radius); padding: 8px 18px 8px 12px; margin: 8px 0; }
.toc h2 { font-size: 1rem; border: 0; margin: 0 0 4px; padding: 0; font-family: inherit; }
.toc ol { margin: 0; padding-left: 22px; }

/* Transcripts and tables */
.table-wrap { overflow-x: auto; clear: both; }
table { border-collapse: collapse; width: 100%; font-size: .94rem; }
th, td { text-align: left; vertical-align: top; padding: 6px 8px; border-bottom: 1px solid var(--line); }
thead th { background: var(--bg); font-weight: 600; }
.transcript td:first-child { color: var(--muted); width: 2.2em; }
.transcript .who { white-space: nowrap; font-weight: 600; }
.transcript .emo { color: var(--muted); font-size: .85em; }
.transcript tr.direction td { color: var(--muted); }
.transcript tr:target { background: var(--band); }
audio { width: 210px; max-width: 100%; height: 34px; vertical-align: middle; }
.conv { margin-bottom: 18px; }
details.conv { border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 10px; margin-bottom: 8px; }
details.conv summary { cursor: pointer; }
.answers td:first-child { width: 55%; }
table.sortable th button { font: inherit; font-weight: 600; background: none; border: 0; padding: 0; color: inherit; cursor: pointer; }
table.sortable th[aria-sort="ascending"] button::after { content: " ▲"; }
table.sortable th[aria-sort="descending"] button::after { content: " ▼"; }

/* Quotes, lists, gallery */
blockquote.line { margin: 10px 0; padding: 8px 14px; border-left: 4px solid var(--accent); background: var(--bg); border-radius: 0 4px 4px 0; }
blockquote.line p { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.05rem; }
blockquote.line p::before { content: "“"; } blockquote.line p::after { content: "”"; }
blockquote.line footer { color: var(--muted); font-size: .85rem; margin-top: 2px; }
blockquote.line footer::before { content: "— "; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; height: auto; display: block; border-radius: 4px; }
.gallery figcaption { font-size: .85rem; color: var(--muted); margin-top: 4px; }
ul.columns { columns: 2 220px; }
.members li { margin-bottom: 4px; }
.portal { columns: 2 260px; }
.portal h3 { margin-top: 0; break-after: avoid; }
.portal-list { break-inside: avoid; }

/* Bottom of the page */
.navbox { clear: both; margin-top: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.navbox h2 { font-size: 1rem; margin: 0; padding: 6px 12px; text-align: center; background: var(--band); border-bottom: 1px solid var(--line); font-family: inherit; }
.navbox p { margin: 0; padding: 8px 12px; text-align: center; }
.references ol { font-size: .88rem; }
.page-meta { clear: both; margin-top: 28px; padding-top: 12px; border-top: 1px solid var(--line); font-size: .92rem; }
.page-meta details { margin: 6px 0; }
.page-meta summary { cursor: pointer; color: var(--link); }
.cats { background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 6px 10px; }
.cats span { font-weight: 600; }
ul.hist { list-style: none; padding-left: 0; font-size: .9rem; }
ul.hist li { padding: 2px 0; }
ul.hist time { color: var(--muted); margin-right: 6px; }

/* Luke or Sarah */
html[data-kid="boy"] .kid-girl, html[data-kid="girl"] .kid-boy { display: none; }

/* Phones */
@media (max-width: 860px) {
  .frame { grid-template-columns: 1fr; padding: 12px 0; gap: 12px; }
  .side ul { position: static; display: flex; flex-wrap: wrap; gap: 4px; padding: 0 16px; }
  .side li a { background: var(--paper); border: 1px solid var(--line); font-size: .88rem; padding: 3px 10px; }
  main { border-radius: 0; border-left: 0; border-right: 0; padding: 16px; }
  .infobox { float: none; width: 100%; margin: 0 0 16px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  h1 { font-size: 1.6rem; }
}
@media (max-width: 640px) {
  .transcript thead { display: none; }
  .transcript tr { display: grid; grid-template-columns: 2em 1fr; gap: 0 6px; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .transcript td { border: 0; padding: 1px 0; }
  .transcript td:first-child { grid-row: span 4; }
  .transcript .voice audio { width: 100%; }
  .transcript tr.direction { display: table-row; }
}
@media print {
  .top, .side, .kid, footer.site { display: none; }
  .frame { display: block; }
  main { border: 0; }
}
