/* US Vantage styles. Clean, simple, fast. No webfonts, no images.
   For/Against use teal and amber on purpose: never red vs blue, so the
   two sides never read as political parties. Both sides get equal weight. */

:root {
  --bg: #faf8f4;
  --surface: #ffffff;
  --ink: #23272e;
  --muted: #5d6570;
  --line: #e4ded2;
  --brand: #0f4c4c;
  --link: #0e7490;
  --for: #0f766e;
  --for-bg: #e7f4f1;
  --for-line: #bfe3dd;
  --against: #b45309;
  --against-bg: #fdf3e3;
  --against-line: #f0dcb8;
  --danger: #b42318;
  --radius: 12px;
  --max: 1060px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
}

a { color: var(--link); }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--link);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ------------------------------------------------------------ header */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 800;
  font-size: 21px;
  letter-spacing: 0.04em;
  line-height: 1;
}

.wordmark .mark {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 7px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.wordmark .mark i { display: block; }
.wordmark .mark i:first-child { background: var(--for); }
.wordmark .mark i:last-child { background: var(--against); }

.site-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.site-nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  padding: 7px 11px;
  border-radius: 8px;
}
.site-nav a:hover { background: var(--bg); }
.site-nav a[aria-current="page"] { background: var(--bg); box-shadow: inset 0 -2px 0 var(--brand); }

.handle-slot { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.handle-slot .who { font-weight: 700; font-size: 15px; }
.handle-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.handle-form label { font-size: 13px; color: var(--muted); font-weight: 600; }

/* -------------------------------------------------------------- layout */

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 26px 18px 60px;
  min-height: calc(100svh - 220px);
}

.narrow { max-width: 720px; margin: 0 auto; }

h1 { font-size: 30px; line-height: 1.2; margin: 6px 0 10px; letter-spacing: -0.01em; }
h2 { font-size: 21px; line-height: 1.3; margin: 28px 0 8px; }
h3 { font-size: 17px; margin: 20px 0 6px; }
p { margin: 8px 0; }
.lede { color: var(--muted); font-size: 18px; margin-top: 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* ------------------------------------------------------------- notices */

.notice {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: 8px;
  padding: 12px 16px;
  margin: 16px 0;
}
.notice.error { border-left-color: var(--danger); }
.notice p { margin: 0; }
.notice[hidden] { display: none; }

/* --------------------------------------------------------------- forms */

label { display: block; font-weight: 700; font-size: 15px; margin: 16px 0 6px; }
.hint { font-weight: 400; color: var(--muted); font-size: 14px; margin: 2px 0 0; }

input[type="text"],
input[type="search"],
select,
textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
}
textarea { min-height: 120px; resize: vertical; }
input[type="text"].inline,
input[type="search"].inline { width: auto; }

button,
.button {
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 10px 18px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  background: var(--brand);
  color: #fff;
}
button:hover, .button:hover { filter: brightness(1.08); }
button:disabled { opacity: 0.55; cursor: wait; }

.button-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}
.button-small { padding: 6px 12px; font-size: 14px; }
.button-danger { background: var(--surface); color: var(--danger); border-color: #f0c6c2; }

.form-error { color: var(--danger); font-weight: 600; font-size: 14px; margin: 8px 0 0; }
.form-error:empty { display: none; }
.char-count { font-size: 13px; color: var(--muted); text-align: right; margin-top: 4px; }

.side-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.side-pick label {
  margin: 0;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  text-align: center;
  font-size: 17px;
}
.side-pick input { position: absolute; opacity: 0; pointer-events: none; }
.side-pick label:has(input:checked) { border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 1px var(--brand); }
.side-pick label:has(input:focus-visible) { outline: 3px solid var(--link); outline-offset: 2px; }
.side-pick .for-label { background: var(--for-bg); }
.side-pick .against-label { background: var(--against-bg); }
.side-pick .sub { display: block; font-weight: 400; font-size: 13px; color: var(--muted); margin-top: 2px; }

/* -------------------------------------------------------------- filter */

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: end;
  margin: 20px 0 6px;
}
.filters .field { flex: 1 1 160px; }
.filters label { margin-top: 0; font-size: 13px; color: var(--muted); }
.filters input,
.filters select { margin-top: 0; }

/* ------------------------------------------------------------ feed cards */

.feed { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 14px; }

.debate-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.debate-card h2 { margin: 0 0 6px; font-size: 20px; }
.debate-card h2 a { color: var(--ink); text-decoration: none; }
.debate-card h2 a:hover { text-decoration: underline; }
.debate-card .context {
  color: var(--muted);
  margin: 0 0 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta { font-size: 14px; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.category-tag {
  display: inline-block;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

/* vote bars: equal visual weight, counts labelled, no winner language */
.votebar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--line); }
.votebar .seg-for { background: var(--for); }
.votebar .seg-against { background: var(--against); }
.votebar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
  margin-top: 6px;
}
.votebar-labels .for-label { color: var(--for); }
.votebar-labels .against-label { color: var(--against); }

/* ---------------------------------------------------------- debate page */

.debate-head .category-tag { margin-bottom: 8px; }
.debate-head .context { font-size: 18px; color: var(--ink); max-width: 760px; }
.debate-head .meta { color: var(--muted); font-size: 14px; }

.columns { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 22px; align-items: start; }
.column h2 {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 18px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.column-for h2 { background: var(--for-bg); color: var(--for); border: 1px solid var(--for-line); }
.column-against h2 { background: var(--against-bg); color: var(--against); border: 1px solid var(--against-line); }
.column h2 .count { font-size: 14px; font-weight: 600; }
.column .empty { color: var(--muted); font-size: 15px; padding: 6px 2px; }

.argument {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.argument .body { white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0 10px; }
.argument .byline { font-size: 14px; color: var(--muted); }
.argument .byline a { color: var(--ink); font-weight: 700; text-decoration: none; }
.argument .byline a:hover { text-decoration: underline; }
.argument .edited { font-style: italic; }
.argument .placeholder { color: var(--muted); font-style: italic; margin: 6px 0 10px; }

.arg-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.vote-btn { background: var(--surface); color: var(--ink); border-color: var(--line); }
.vote-btn[aria-pressed="true"] { background: var(--brand); color: #fff; border-color: var(--brand); }
.link-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  padding: 6px 4px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.link-btn:hover { color: var(--ink); }

.replies { margin: 12px 0 0 12px; padding-left: 12px; border-left: 3px solid var(--line); display: grid; gap: 10px; }
.reply { font-size: 15px; }
.reply .body { white-space: pre-wrap; overflow-wrap: anywhere; margin: 2px 0 4px; }
.reply .byline { font-size: 13px; color: var(--muted); }
.reply .byline a { color: var(--ink); font-weight: 700; text-decoration: none; }
.reply .placeholder { color: var(--muted); font-style: italic; margin: 2px 0 4px; }

.reply-form, .report-form, .edit-form { margin-top: 10px; }
.reply-form textarea { min-height: 70px; }
.report-form select { width: auto; }
.inline-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-row .grow { flex: 1; }

.post-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-top: 26px;
}
.post-box h2 { margin-top: 0; }

/* ------------------------------------------------------------- profile */

.stat-row { display: flex; gap: 22px; flex-wrap: wrap; margin: 14px 0 6px; }
.stat { font-size: 15px; color: var(--muted); }
.stat strong { display: block; font-size: 26px; color: var(--ink); line-height: 1.1; }

.profile-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 12px; }
.profile-list li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.profile-list .body { white-space: pre-wrap; overflow-wrap: anywhere; margin: 4px 0; }
.profile-list .meta { font-size: 14px; color: var(--muted); }

/* -------------------------------------------------------------- footer */

.site-footer { border-top: 1px solid var(--line); background: var(--surface); }
.footer-inner { max-width: var(--max); margin: 0 auto; padding: 26px 18px 40px; }
.footer-inner nav { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 12px; }
.footer-inner nav a { color: var(--ink); font-weight: 600; font-size: 15px; text-decoration: none; }
.footer-inner nav a:hover { text-decoration: underline; }
.footer-inner p { color: var(--muted); font-size: 14px; margin: 4px 0; max-width: 720px; }

/* ------------------------------------------------------------ skeleton */

.loading { color: var(--muted); padding: 24px 0; }

/* ------------------------------------------------------------ responsive */

@media (max-width: 760px) {
  body { font-size: 16px; }
  h1 { font-size: 25px; }
  .columns { grid-template-columns: 1fr; }
  .handle-slot { margin-left: 0; width: 100%; }
  .header-inner { gap: 10px; }
  main { padding-top: 20px; }
  .side-pick { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
