/* Generated by scripts/build-forum-css.mjs — edit src/styles/global.css
   or src/styles/forum.css instead. */

:root {
  color-scheme: light dark;

  --bg: #f6f6f4;
  --surface: #ffffff;
  --border: #dedbd4;
  --fg: #16150f;
  --muted: #6a6659;
  --accent: #9a1b1b;
  --accent-fg: #ffffff;
  --chip: #efece5;

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --radius: 10px;
  --measure: 68ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131311;
    --surface: #1c1c19;
    --border: #33322d;
    --fg: #ececE6;
    --muted: #a09b8e;
    --accent: #e2483f;
    --accent-fg: #16150f;
    --chip: #26251f;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

.wrap {
  max-width: 78rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: baseline;
  justify-content: space-between;
  padding-block: 1rem;
}

.brand {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.brand span {
  color: var(--accent);
}

.nav {
  display: flex;
  gap: 1.25rem;
  font-size: 0.9rem;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
}

.nav a:hover,
.nav a[aria-current='page'] {
  color: var(--fg);
}

/* Type */
h1 {
  font-size: clamp(1.9rem, 1.3rem + 2vw, 2.9rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.6rem;
}

h2 {
  font-size: 1.3rem;
  letter-spacing: -0.01em;
  margin: 2.5rem 0 1rem;
}

.lede {
  max-width: var(--measure);
  color: var(--muted);
  font-size: 1.08rem;
  margin: 0;
}

main {
  padding-block: 2.5rem 4rem;
}

/* Cards */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  height: 100%;
  padding: 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
}

.card:hover {
  border-color: var(--accent);
}

.card h3 {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.35;
}

.card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.card .vendor {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* Chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: auto;
  padding-top: 0.5rem;
}

.chip {
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--chip);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  white-space: nowrap;
}

.chip.additive {
  background: var(--accent);
  color: var(--accent-fg);
}

/* Filters */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: flex-end;
  padding: 1rem 1.1rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.field label {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.field select {
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--fg);
  font: inherit;
  font-size: 0.9rem;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9rem;
  padding-bottom: 0.35rem;
}

.count {
  margin-left: auto;
  padding-bottom: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.empty {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--muted);
}

[hidden] {
  display: none !important;
}

/* Spec table */
.specs {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.specs th,
.specs td {
  text-align: left;
  vertical-align: top;
  padding: 0.55rem 0.75rem 0.55rem 0;
  border-bottom: 1px solid var(--border);
}

.specs th {
  width: 14rem;
  font-weight: 600;
  color: var(--muted);
}

.table-scroll {
  overflow-x: auto;
}

.prose {
  max-width: var(--measure);
}

.callout {
  padding: 0.85rem 1rem;
  margin: 1.25rem 0;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--surface);
  font-size: 0.9rem;
}

.back {
  display: inline-block;
  margin-bottom: 1.25rem;
  font-size: 0.88rem;
  color: var(--muted);
  text-decoration: none;
}

.sources {
  padding-left: 1.1rem;
  font-size: 0.88rem;
}

.sources li {
  margin-bottom: 0.4rem;
}

.sources .pub {
  color: var(--muted);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding-block: 1.75rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.site-footer p {
  max-width: var(--measure);
  margin: 0 0 0.5rem;
}

.vendor .origin {
  margin-left: 0.35rem;
  font-size: 0.85rem;
  letter-spacing: 0;
}

/* Forum chrome. Loaded only by the Worker-rendered pages, appended to the
   site's global stylesheet by scripts/build-forum-css.mjs so both halves of the
   site share one set of design tokens. */

.forum-bar {
  border-bottom: 1px solid var(--border);
  background: var(--chip);
  font-size: 0.85rem;
}
.forum-bar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}
.forum-bar a { text-decoration: none; }
.forum-bar a:hover { text-decoration: underline; }
.forum-bar .account { display: flex; align-items: center; gap: 0.9rem; }
.forum-bar .who { color: var(--muted); }

button.linkish {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
}
.forum-bar form { display: inline; }

.forum { padding-top: 1.5rem; padding-bottom: 3rem; }
.forum .head { max-width: var(--measure); margin-bottom: 1.75rem; }
.forum .head h1 { margin-top: 0; }
.forum h1 { font-size: 1.7rem; }
.forum .lede { color: var(--muted); margin: 0; }
.forum .muted { color: var(--muted); }

.crumbs {
  margin: 0 0 1.25rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.forum .btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-fg);
  font-size: 0.9rem;
  text-decoration: none;
}

.cats, .threads {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.cat, .thread {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
}
.cat:hover, .thread:hover { border-color: var(--accent); }
.cat h2 { margin: 0; font-size: 1.05rem; border: 0; padding: 0; }
.thread h3 { margin: 0; font-size: 1rem; line-height: 1.35; }
.cat .sub, .thread .sub { margin: 0.2rem 0 0; font-size: 0.83rem; color: var(--muted); }
.cat .counts, .thread .counts {
  margin: 0;
  text-align: right;
  font-size: 0.78rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.post {
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 0.6rem;
}
.post > header {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.7rem;
  padding-bottom: 0.6rem;
  margin-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
}
.post > header .who { font-weight: 600; text-decoration: none; }
.post > header .when { color: var(--muted); text-decoration: none; }
.post > header form { margin-left: auto; }
.post > header button.linkish { font-size: 0.8rem; color: var(--muted); }
.post .body p { margin: 0 0 0.8rem; max-width: var(--measure); overflow-wrap: anywhere; }
.post .body p:last-child { margin-bottom: 0; }
.post .removed { color: var(--muted); font-style: italic; }
.post:target { border-color: var(--accent); }

.form {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin-top: 1.5rem;
}
.form.narrow { max-width: 26rem; }
.form label { font-size: 0.8rem; font-weight: 600; margin-top: 0.5rem; }
.form input, .form textarea, .form select {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--fg);
  font: inherit;
}
.form textarea { resize: vertical; line-height: 1.55; }
.form .hint { margin: 0.1rem 0 0; font-size: 0.78rem; color: var(--muted); max-width: var(--measure); }
.form button[type='submit'] {
  align-self: flex-start;
  margin-top: 1rem;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-fg);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.notice {
  margin: 0 0 1rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--accent);
  border-radius: 6px;
  font-size: 0.88rem;
  max-width: var(--measure);
}

.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin: 1.5rem 0;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}
.pager a, .pager .here {
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
}
.pager a:hover { border-color: var(--accent); }
.pager .here { background: var(--chip); border-color: var(--chip); }
.pager .gap { padding: 0 0.2rem; color: var(--muted); }

@media (max-width: 34rem) {
  .cat, .thread { flex-direction: column; align-items: flex-start; gap: 0.4rem; }
  .cat .counts, .thread .counts { text-align: left; }
}
