/* Feedlog slice — Graphite & Ember. Tokens mirror theserverless.dev and the hub. */

:root {
  --ember: #c2410c;
  --ember-2: #e2622e;
  --ember-rgb: 194, 65, 12;
  --font-heading: "Bricolage Grotesque", "Space Grotesk", system-ui, sans-serif;
  --font-body: "Hanken Grotesk", system-ui, -apple-system, sans-serif;
  --radius-sm: 6px;
  --radius: 12px;
  --fast: 0.16s cubic-bezier(0.4, 0, 0.2, 1);
  --topbar-h: 59px;
}

:root, [data-theme="dark"] {
  --bg: #0e0e11;
  --surface: #141418;
  --surface-2: #1b1b20;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);
  --text: #c9c9c4;
  --text-strong: #e8e8e4;
  --muted: #8a8a85;
  --accent-text: #e2622e;
  --ok: #5aa877;
  --ok-soft: rgba(90, 168, 119, 0.12);
  --warn: #d19a2a;
  --warn-soft: rgba(209, 154, 42, 0.12);
  --danger: #d0533f;
  --danger-soft: rgba(208, 83, 63, 0.12);
}

[data-theme="light"] {
  --ember: #b23a0a;
  --ember-2: #c2410c;
  --ember-rgb: 178, 58, 10;
  --bg: #faf9f6;
  --surface: #ffffff;
  --surface-2: #f3f1eb;
  --border: rgba(23, 23, 26, 0.1);
  --border-strong: rgba(23, 23, 26, 0.2);
  --text: #3d3a34;
  --text-strong: #17171a;
  --muted: #6b675e;
  --accent-text: #b23a0a;
  --ok: #2f7d4f;
  --ok-soft: rgba(47, 125, 79, 0.1);
  --warn: #a86f0a;
  --warn-soft: rgba(168, 111, 10, 0.1);
  --danger: #b43d2b;
  --danger-soft: rgba(180, 61, 43, 0.1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
h1, h2 { font-family: var(--font-heading); color: var(--text-strong); letter-spacing: -0.02em; line-height: 1.15; }
a { color: var(--text-strong); text-decoration: none; }
a:hover { color: var(--accent-text); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.icon { width: 18px; height: 18px; display: block; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45em;
  height: 34px; padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  color: var(--text-strong);
  font-weight: 600; font-size: 13px; white-space: nowrap;
}
.btn:hover { border-color: rgba(var(--ember-rgb), 0.6); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--ember); border-color: var(--ember); color: #fff; }
.btn-primary:hover { background: var(--ember-2); border-color: var(--ember-2); color: #fff; }
.btn-ghost { border-color: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--border); }
.btn-icon { width: 34px; padding: 0; }

.eyebrow {
  font: 600 11px/1 var(--font-body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.hint { font-size: 13px; color: var(--muted); }
.hint[data-tone="error"] { color: var(--danger); }
.hint[data-tone="ok"] { color: var(--ok); }

.topbar {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px;
  height: var(--topbar-h); padding: 0 20px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
}
.compose-toggle { display: none; }
.brand { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--accent-text); font: 600 13px/1 var(--font-body); }
.brand span { color: var(--text); }
.brand__mark { display: block; color: var(--accent-text); }
.topbar__title { display: flex; align-items: baseline; gap: 14px; min-width: 0; }
.topbar__title h1 { font-size: 20px; font-weight: 700; }
.topbar__title p { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__actions { display: flex; align-items: center; gap: 6px; }

.tabs {
  display: flex; gap: 6px; padding: 10px 20px;
  border-bottom: 1px solid var(--border);
}
.tabs a {
  height: 30px; padding: 0 12px; border-radius: 999px;
  border: 1px solid transparent; color: var(--muted); font-size: 13px; font-weight: 650;
  display: inline-flex; align-items: center;
}
.tabs a[aria-current="page"] {
  border-color: var(--ember); color: var(--accent-text); background: rgba(var(--ember-rgb), 0.1);
}

.strip {
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 13px; color: var(--text);
  background: var(--surface);
}

.page { width: min(1120px, calc(100% - 32px)); margin: 22px auto 40px; }
.section-head { margin-bottom: 16px; }
.section-head h2 { font-size: 28px; margin-top: 6px; }

.board { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); gap: 18px; align-items: start; }
.compose-col { display: grid; gap: 12px; position: sticky; top: 76px; }
.compose, .admin, .column, .post, .entry, .detail {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.compose, .admin { padding: 16px; }
.compose h2, .section-head h2 { font-weight: 680; }
.compose h2 { font-size: 22px; margin: 6px 0 12px; }

.field { display: grid; gap: 6px; margin-bottom: 10px; font-size: 13px; font-weight: 600; color: var(--text-strong); }
.field em { font-style: normal; font-weight: 500; color: var(--muted); }
.field input, .field textarea, .field select, .status-select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 9px 11px;
  font-weight: 450;
  color: var(--text-strong);
}
.field textarea { resize: vertical; min-height: 96px; }
.field input[type="file"] { padding: 8px; font-size: 13px; }

.turnstile { min-height: 0; margin-bottom: 8px; }
.row { display: flex; gap: 8px; margin-top: 8px; }
.similar { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.similar ul { list-style: none; display: grid; gap: 8px; margin-top: 8px; }
.similar a {
  display: flex; justify-content: space-between; gap: 8px; align-items: baseline;
  padding: 8px 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border);
}
.similar a strong { font-weight: 620; font-size: 13px; }
.similar a span { color: var(--muted); font-size: 12px; white-space: nowrap; }

.list-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.list-head h2 { font-size: 18px; margin-right: 4px; }
.count {
  font-size: 12px; color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px; padding: 0 8px; height: 22px;
  display: inline-flex; align-items: center;
}
.filters, .sorts { display: flex; flex-wrap: wrap; gap: 4px; }
.sorts { margin-left: auto; }
.filter {
  height: 26px; padding: 0 8px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--muted); font-size: 12px; font-weight: 600;
}
.filter.is-on { border-color: var(--ember); color: var(--accent-text); background: rgba(var(--ember-rgb), 0.1); }

#posts { display: grid; gap: 10px; }
.post { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px; padding: 14px; }
.post__title {
  display: inline-flex; align-items: center; min-height: 44px;
  font-size: 16px; font-weight: 680; color: var(--text-strong);
}
.post__title:hover { color: var(--accent-text); }
.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.post__body {
  margin-top: 4px; color: var(--text); font-size: 14px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.post__meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; color: var(--muted); font-size: 12px; }
.post__image { margin-top: 10px; max-width: 100%; max-height: 180px; border-radius: 8px; border: 1px solid var(--border); object-fit: cover; }

.vote {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-strong); min-height: 72px;
}
.vote:hover { border-color: rgba(var(--ember-rgb), 0.7); }
.vote.is-on { border-color: var(--ember); background: rgba(var(--ember-rgb), 0.12); color: var(--accent-text); }
.vote b { font-family: var(--font-heading); font-size: 18px; font-weight: 700; }
.vote small { font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

.chip {
  font-size: 11px; font-weight: 700; letter-spacing: 0.02em;
  border-radius: 999px; padding: 2px 8px; background: var(--surface-2); color: var(--muted);
}
.chip[data-status="open"] { color: var(--text-strong); }
.chip[data-status="planned"] { color: var(--warn); background: var(--warn-soft); }
.chip[data-status="in_progress"] { color: var(--accent-text); background: rgba(var(--ember-rgb), 0.12); }
.chip[data-status="done"] { color: var(--ok); background: var(--ok-soft); }
.chip[data-status="closed"] { color: var(--muted); }
.chip[data-kind="duplicate"] { color: var(--danger); background: var(--danger-soft); }

.status-select { width: auto; height: 28px; padding: 0 8px; font-size: 12px; }

.roadmap { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.column { padding: 12px; min-height: 220px; }
.column h3 { font-family: var(--font-heading); font-size: 16px; margin-bottom: 10px; }
.column ol { list-style: none; display: grid; gap: 8px; }
.card {
  display: grid; gap: 4px; padding: 10px; border-radius: 8px; background: var(--bg); border: 1px solid var(--border);
}
.card b { font-weight: 650; color: var(--text-strong); }
.card span { color: var(--muted); font-size: 12px; }
.empty { color: var(--muted); font-size: 13px; padding: 8px 2px; }

.changelog { list-style: none; display: grid; gap: 12px; margin-top: 16px; }
.entry { padding: 16px 18px; }
.entry time { color: var(--muted); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }
.entry h3 { font-size: 20px; margin: 4px 0 8px; }
.entry p { white-space: pre-wrap; }

.changelog-form { margin-bottom: 16px; }
.back { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: 12px; color: var(--muted); font-weight: 650; font-size: 13px; }
.detail { padding: 18px; }
.detail h2 { font-size: 28px; margin: 8px 0; }
.detail__row { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px; }
.detail .post__body { -webkit-line-clamp: unset; display: block; white-space: pre-wrap; }
.detail .post__image { max-height: 360px; }

.admin summary { cursor: pointer; font-weight: 700; color: var(--text-strong); min-height: 44px; display: flex; align-items: center; }
.admin[open] summary { margin-bottom: 8px; }

.foot { border-top: 1px solid var(--border); padding: 18px 20px 28px; color: var(--muted); font-size: 13px; }
.foot a { color: var(--text-strong); display: inline-flex; align-items: center; min-height: 44px; }
.noscript { padding: 12px 20px; color: var(--danger); }

@media (max-width: 860px) {
  .topbar {
    position: static;
    height: auto;
    grid-template-columns: 1fr auto;
    padding: 8px 12px;
    gap: 8px;
  }
  .topbar__title { min-width: 0; }
  .topbar__title p { display: none; }
  .topbar__actions { justify-content: flex-end; }
  .board { display: flex; flex-direction: column; }
  .roadmap { grid-template-columns: 1fr; }
  .compose-toggle {
    display: inline-flex;
    order: -2;
    min-height: 44px;
    width: 100%;
    margin: 0 0 8px;
  }
  .compose-col { display: none; order: -1; position: static; }
  .list-col { order: 0; }
  .compose-open:checked ~ .compose-col { display: grid; }
  .column { min-height: 0; }
  .page { width: min(1120px, calc(100% - 20px)); }
  .post, .detail__row { grid-template-columns: 64px minmax(0, 1fr); }
  .shows--bar, .strip { padding: 6px 12px; font-size: 12px; }
}

/* Phone layout. Graphite and Ember stay; controls grow to a finger and fields stay at 16px so iOS does not zoom. */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
textarea,
select {
  font-size: 16px;
}
.turnstile { max-width: 100%; overflow: auto; }
@media (max-width: 900px) {
  .btn,
  a.btn,
  .btn-primary,
  .btn-ghost,
  .filter,
  .tabs a {
    min-height: 44px;
  }
  .btn-icon,
  .filter {
    min-width: 44px;
  }
  .btn-icon {
    width: 44px;
    height: 44px;
  }
  .topbar {
    padding-top: max(8px, env(safe-area-inset-top));
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
  .topbar__actions { flex-wrap: wrap; justify-content: flex-end; max-width: 100%; }
}

@media (max-width: 860px) {
  .tabs { flex-wrap: wrap; padding-left: 12px; padding-right: 12px; }
  .tabs a { min-height: 44px; }
  .page { width: min(1120px, calc(100% - 16px)); }
}


.shows {
  margin: 0 0 0.85rem;
  font-size: 0.875rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.shows--bar {
  margin: 0;
  padding: 0.7rem 1rem;
  background: rgba(194, 65, 12, 0.08);
  border-bottom: 1px solid rgba(194, 65, 12, 0.28);
}
.shows__k {
  margin-right: 0.45rem;
  font-family: var(--font-body);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ember);
}
