/* DETOX Field Guide — the wiki that reads like a real-world manual.
   Layers on top of /style.css (shared palette variables) but stands alone so
   an article page renders fine even before style.css finishes loading.
   The whole design job here: the article body must read as a genuine how-to,
   and the ":::game" callouts must be unmistakably the game speaking without
   feeling bolted on. Phase 3 is where this gets iterated on. */

:root {
  --bg: #07090d;
  --panel-solid: #10141b;
  --ink: #e9e7e2;
  --dim: #8f96a3;
  --accent: #f0a84f;
  --game: #57d9a3;
  --line: #232a35;
}

.wiki-body {
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.7 "Iowan Old Style", Georgia, "Times New Roman", serif;
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

/* Branded top bar — matches the main site so the Field Guide reads as part of
   DETOX, not a separate microsite. */
.wiki-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: 980px;
  margin: 0 auto;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  font-family: system-ui, sans-serif;
}
.wiki-mark {
  font-weight: 800;
  letter-spacing: 0.14em;
  font-size: 1.05rem;
  color: var(--ink);
  text-decoration: none;
}
.wiki-mark b { color: var(--accent); font-weight: 800; }
.wiki-topbar nav { display: flex; gap: 20px; flex-wrap: wrap; }
.wiki-topbar nav a {
  color: var(--dim);
  text-decoration: none;
  font-size: 0.9rem;
}
.wiki-topbar nav a:hover { color: var(--ink); }
.wiki-topbar nav a[aria-current="page"] { color: var(--accent); }

.wiki-article {
  max-width: 720px;
  margin: 0 auto;
  padding: 112px 22px 96px;
}

.wiki-nav,
.wiki-footer {
  font-family: system-ui, sans-serif;
  font-size: 14px;
}
.wiki-nav a,
.wiki-footer a {
  color: var(--dim);
  text-decoration: none;
  letter-spacing: 0.02em;
}
.wiki-nav a:hover,
.wiki-footer a:hover { color: var(--accent); }
.wiki-footer {
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

/* Header ------------------------------------------------------------ */
.wiki-header { margin: 22px 0 30px; }
.wiki-header h1 {
  font-size: 2.35rem;
  line-height: 1.12;
  margin: 10px 0 6px;
  font-weight: 600;
}
.wiki-topic {
  color: var(--dim);
  font-style: italic;
  margin: 0;
}
.wiki-badges { margin-bottom: 4px; }
.wiki-status {
  font-family: system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--dim);
}
.wiki-status-live { color: var(--game); border-color: color-mix(in srgb, var(--game) 45%, transparent); }
.wiki-status-partial { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.wiki-status-planned { color: var(--dim); }

/* Body copy — this is the part that should read like a real manual ---- */
.wiki-content { font-size: 1.06rem; }
.wiki-content h2 {
  font-family: system-ui, sans-serif;
  font-size: 1.25rem;
  margin: 2.2em 0 0.5em;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
}
.wiki-content h3 {
  font-family: system-ui, sans-serif;
  font-size: 1.05rem;
  margin: 1.8em 0 0.4em;
  font-weight: 600;
}
.wiki-content p { margin: 0.9em 0; }
.wiki-content a { color: var(--accent); }
.wiki-content ul,
.wiki-content ol { padding-left: 1.3em; }
.wiki-content li { margin: 0.35em 0; }
.wiki-content strong { color: #fff; }
.wiki-content blockquote {
  margin: 1.2em 0;
  padding: 2px 0 2px 18px;
  border-left: 3px solid var(--line);
  color: var(--dim);
  font-style: italic;
}
.wiki-content code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.86em;
  background: #0d1117;
  padding: 1px 5px;
  border-radius: 4px;
}
.wiki-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.2em 0;
  font-size: 0.95rem;
}
.wiki-content th,
.wiki-content td {
  border: 1px solid var(--line);
  padding: 7px 10px;
  text-align: left;
}
.wiki-content th { background: #0d1117; font-family: system-ui, sans-serif; }

/* :::game — the game speaking. Reality is the default; this is the swerve. */
.wiki-game {
  position: relative;
  margin: 1.6em 0;
  padding: 16px 18px 14px;
  background: color-mix(in srgb, var(--game) 8%, var(--panel-solid));
  border: 1px solid color-mix(in srgb, var(--game) 35%, transparent);
  border-left: 3px solid var(--game);
  border-radius: 8px;
  font-family: system-ui, sans-serif;
  font-size: 0.97rem;
}
.wiki-game > :first-of-type { margin-top: 0; }
.wiki-game > :last-child { margin-bottom: 0; }
.wiki-game p { margin: 0.6em 0; }
.wiki-game-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--game);
  margin-bottom: 8px;
}
.wiki-game a { color: var(--game); }

/* :::detail — opt-in nitty-gritty. Closed until curiosity opens it. */
.wiki-detail {
  margin: 1.4em 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b0f15;
}
.wiki-detail summary {
  cursor: pointer;
  padding: 12px 16px;
  font-family: system-ui, sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--accent);
  list-style: none;
}
.wiki-detail summary::before {
  content: "＋ ";
  color: var(--dim);
  font-weight: 400;
}
.wiki-detail[open] summary::before { content: "－ "; }
.wiki-detail summary::-webkit-details-marker { display: none; }
.wiki-detail-body {
  padding: 0 16px 6px;
  border-top: 1px solid var(--line);
  font-size: 0.98rem;
}

/* Game-system chips -------------------------------------------------- */
.wiki-systems {
  margin-top: 40px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-family: system-ui, sans-serif;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.wiki-systems-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dim);
  margin-right: 4px;
}
.wiki-chip {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  color: var(--ink);
}

/* Index page (wiki.html) -------------------------------------------- */
.wiki-index { max-width: 820px; margin: 0 auto; padding: 120px 22px 96px; }
.wiki-index h1 { font-size: 2.4rem; margin: 0 0 6px; }
.wiki-index .wiki-lede { color: var(--dim); font-style: italic; margin: 0 0 32px; }
.wiki-cards { display: grid; gap: 14px; }
.wiki-card {
  display: block;
  text-decoration: none;
  color: var(--ink);
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 20px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.wiki-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.wiki-card h2,
.wiki-card h3 { margin: 0 0 4px; font-size: 1.2rem; font-family: system-ui, sans-serif; font-weight: 600; }
.wiki-card p { margin: 0; color: var(--dim); font-size: 0.95rem; }
.wiki-card .wiki-status { float: right; margin-left: 12px; }

/* Index search + status filter --------------------------------------- */
.wiki-controls {
  font-family: system-ui, sans-serif;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin: 0 0 28px;
}
.wiki-search {
  flex: 1 1 220px;
  min-width: 200px;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
  padding: 9px 16px;
  outline: none;
}
.wiki-search:focus { border-color: var(--accent); }
.wiki-search::placeholder { color: var(--dim); }
.wiki-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.wiki-filter {
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--dim);
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
}
.wiki-filter:hover { color: var(--ink); border-color: var(--dim); }
.wiki-filter[aria-pressed="true"] {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--accent) 9%, transparent);
}

/* Category groups on the index --------------------------------------- */
.wiki-group { margin: 0 0 34px; }
.wiki-group-title {
  font-family: system-ui, sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--dim);
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

/* Related guides on article pages ------------------------------------ */
.wiki-related { margin-top: 36px; }
.wiki-related h2 {
  font-family: system-ui, sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--dim);
  margin: 0 0 12px;
}
.wiki-related-cards { display: grid; gap: 12px; }
.wiki-related-cards .wiki-card h3 { font-size: 1.05rem; }
.wiki-related-cards .wiki-card p { font-size: 0.9rem; }

@media (max-width: 820px) {
  .wiki-article { padding-top: 148px; }
  .wiki-index { padding-top: 154px; }
}
