/* Mod Goblins wiki - shared styles. Plain CSS, no external files.
   Palette from the Mod Goblins logo: workshop brown, brass, goblin green. */
:root {
  --bg: #f6f0e4; --surface: #fffaf0; --surface-2: #ede2cd; --line: #d9c9ac;
  --text: #2a2017; --muted: #6b5b47; --brass: #9a5b06; --brass-ink: #fffaf0;
  --green: #476f1c; --note: #fdf0c8; --note-line: #dcbb5e; --code: #efe6d4;
  --wrap: 1040px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #18130e; --surface: #211a13; --surface-2: #2c2319; --line: #3f3226;
    --text: #f3eadc; --muted: #b9a78e; --brass: #e7a83e; --brass-ink: #1b1307;
    --green: #9ccc55; --note: #2e2613; --note-line: #6b5720; --code: #2c2319;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--brass); text-underline-offset: 3px; }
a:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
img { max-width: 100%; height: auto; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }

/* top bar */
.top { border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; background: var(--bg); }
.top .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding-top: 10px; padding-bottom: 10px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 800; font-size: 1.1rem; }
.brand img { width: 40px; height: 40px; display: block; }
.brand small { font-weight: 600; color: var(--muted); font-size: .9rem; border-left: 1px solid var(--line); padding-left: 10px; }
.top nav { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-left: auto; }
.top nav a { color: var(--muted); text-decoration: none; font-weight: 600; }
.top nav a:hover, .top nav a[aria-current="page"] { color: var(--text); }

/* headings and text */
h1 { font-size: clamp(1.8rem, 4.2vw, 2.5rem); line-height: 1.15; letter-spacing: -.01em; margin: 8px 0 10px; }
h2 { font-size: 1.3rem; margin: 40px 0 12px; }
h3 { font-size: 1.05rem; margin: 24px 0 6px; }
.lead { font-size: 1.1rem; color: var(--muted); margin: 0; max-width: 62ch; }
.crumbs { margin: 0 0 4px; color: var(--muted); font-size: .9rem; }
.crumbs a { color: var(--muted); }
main.wrap { padding-top: 32px; padding-bottom: 64px; }
main p, main li { max-width: 75ch; }

/* home hero */
.hero { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 32px; padding-bottom: 8px; }
.hero img { width: 140px; height: 140px; flex: none; }
.hero div { flex: 1 1 320px; }

/* mod list: one card per mod */
.mods { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.mods li { max-width: none; display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--brass); border-radius: 6px; padding: 16px 18px; }
.mods h3 { margin: 0; font-size: 1.12rem; line-height: 1.3; }
.mods h3 a { color: var(--text); text-decoration: none; }
.mods h3 a:hover { color: var(--brass); }
.mods p { margin: 0; color: var(--muted); }
.mods .go { margin-top: auto; padding-top: 12px; display: flex; flex-wrap: wrap; gap: 6px 18px; font-weight: 600; }

/* guide panels on a mod page */
.panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin: 28px 0 0; padding: 0; list-style: none; }
.panel { display: block; height: 100%; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--brass); border-radius: 6px; padding: 16px 18px; color: var(--text); text-decoration: none; }
.panel:hover { background: var(--surface-2); }
.panel strong { display: block; font-size: 1.15rem; }
.panel span { color: var(--muted); }
.panels li { max-width: none; }
.panel .tag { display: inline-block; margin-top: 8px; font-size: .78rem; font-weight: 700; color: var(--green); }
.btn { display: inline-block; padding: 8px 14px; border-radius: 6px; background: var(--brass); color: var(--brass-ink); font-weight: 700; text-decoration: none; }

/* guide layout: contents list + article */
.guide { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 40px; align-items: start; }
.toc { position: sticky; top: calc(var(--head-h, 80px) + 20px); font-size: .95rem; }
.toc strong { display: block; padding: 0 0 6px 14px; border-left: 2px solid var(--line); }
.toc ol { margin: 0; padding: 0; list-style: none; }
.toc { max-height: calc(100vh - var(--head-h, 80px) - 40px); overflow-y: auto; }
.toc li { margin: 0; }
.toc a { display: block; color: var(--muted); text-decoration: none; padding: 3px 0 3px 14px; border-left: 2px solid var(--line); }
.toc a[aria-current] { color: var(--brass); border-left-color: var(--brass); font-weight: 600; }
.toc a:hover { color: var(--brass); }
@media (max-width: 820px) { .guide { grid-template-columns: 1fr; gap: 20px; } .toc { position: static; max-height: none; } }

/* content blocks */
.note { background: var(--note); border: 1px solid var(--note-line); border-radius: 6px; padding: 12px 16px; margin: 16px 0; }
.note p { margin: 0; }
code, kbd { background: var(--code); border-radius: 4px; padding: 1px 6px; font: .92em ui-monospace, Consolas, monospace; }
figure { margin: 22px 0; padding: 10px 10px 0; background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--brass); border-radius: 8px; }
figure a { display: block; cursor: zoom-in; }
figure img { display: block; width: 100%; height: auto; }
figcaption { color: var(--muted); font-size: .9rem; padding: 9px 4px 10px; }
@media (max-width: 600px) { figure { padding: 6px 6px 0; margin-left: -6px; margin-right: -6px; } }
.steps { padding-left: 22px; }
.steps li { margin: 6px 0; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; margin: 14px 0; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: .88rem; }

footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
footer .wrap { padding-top: 18px; padding-bottom: 28px; display: flex; flex-wrap: wrap; gap: 6px 20px; }
footer a { color: var(--muted); }

/* guide pages */
article h2:first-child { margin-top: 0; }
article h2, article h3 { scroll-margin-top: 76px; }
@media (max-width: 600px) { article h2, article h3 { scroll-margin-top: 110px; } }
article h2 { border-top: 1px solid var(--line); padding-top: 28px; }
article h2:first-child { border-top: 0; padding-top: 0; }
article ul { padding-left: 22px; }
article li { margin: 4px 0; }
.guide { margin-top: 28px; }

/* guide pages: fixed top block + one section per view */
.sticky { position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--line); }
.sticky .top { position: static; }
.pagehead .wrap { padding-top: 10px; padding-bottom: 12px; }
.pagehead .crumbs { margin: 0 0 2px; font-size: .88rem; }
.pagehead h1 { margin: 0; font-size: 1.6rem; line-height: 1.2; }
.sticky + main .guide { margin-top: 4px; }
.intro .lead { margin-top: 0; }
.paged article .sec h2 { border-top: 0; padding-top: 0; margin-top: 0; }
.paged article .intro + .sec h2 { margin-top: 28px; }
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); }
.pager:empty { display: none; }
.pager a { display: block; text-decoration: none; color: var(--text); font-weight: 600; max-width: 48%; }
.pager a:hover { color: var(--brass); }
.pager a.next { text-align: right; margin-left: auto; }
.pager small { display: block; color: var(--muted); font-weight: 400; font-size: .82rem; }
@media (max-width: 600px) { .pagehead .crumbs { display: none; } .pagehead h1 { font-size: 1.15rem; } .pagehead .wrap { padding-top: 6px; padding-bottom: 8px; } }

/* the section list never moves: fixed beside the article on wide screens */
@media (min-width: 821px) {
  .paged .toc { position: static; max-height: none; overflow: visible; }
  .paged .toc-in { position: fixed; top: calc(var(--head-h, 140px) + 20px); width: 220px; max-height: calc(100vh - var(--head-h, 140px) - 40px); overflow-y: auto; }
  .paged footer .wrap { padding-left: calc(220px + 40px + var(--gutter, 16px)); }
}
