/*
 * karvan public suggestions board — the only stylesheet.
 *
 * Hand-written and short. The admin panel vendors AdminLTE because it needs a sidebar,
 * tables, modals and forms; this page is a list and a card, so a component kit would be
 * ~250 KB of dependency for a layout that is two flex rules. The palette is lifted from
 * landing/index.html (via admin/style.css) so all three surfaces read as one product.
 *
 * WIDE by design — this is a plain web page, full width, with a real second column.
 * It is NOT inside the Flutter bundle's WebMobileFrame letterbox (app/lib/main.dart),
 * which exists to make the phone app look right on a desktop browser and would make a
 * shared link look like a screenshot of a phone.
 */

@font-face {
  font-family: "Vazirmatn";
  src: url("assets/Vazirmatn-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("assets/Vazirmatn-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

:root {
  /* karvan palette (landing/index.html) */
  --night-top: #122036;
  --night: #0f1b2c;
  --night-bottom: #0a1320;
  --abyss: #071019;
  --brand: #00d2b8;
  --gold: #ffc800;
  --saffron: #ffa733;
  --ink: #eaf1f7;
  --ink-dim: #aebccb;
  --hot: #ff6a3a;
  --line: rgba(255, 255, 255, 0.10);
  --card: rgba(255, 255, 255, 0.04);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Vazirmatn", system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, var(--night-top) 0%, var(--night) 40%,
      var(--night-bottom) 70%, var(--abyss) 100%) fixed;
  min-height: 100vh;
  line-height: 1.7;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0 0 .5rem; }
h2 { font-size: 1rem; margin: 0 0 .5rem; color: var(--ink); }
p { margin: 0 0 .75rem; }
.hidden { display: none !important; }

/* An inline glyph, sized to the text it sits in. */
.i { width: 1em; height: 1em; fill: currentColor; vertical-align: -.125em; }

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

/* ── Top bar ─────────────────────────────────────────────────────────────── */

.topbar {
  border-bottom: 1px solid var(--line);
  background: rgba(7, 16, 25, .55);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 2;
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: .75rem;
}
.brand { display: flex; align-items: center; gap: .5rem; color: var(--ink); font-size: 1.05rem; }
.brand:hover { text-decoration: none; }
.brand b { color: var(--brand); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem .9rem;
  border: 1px solid var(--line);
  border-radius: .6rem;
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #04202a; font-weight: 700; }
.btn-primary:hover { background: #4ce6d2; }
.btn-ghost { background: transparent; color: var(--ink); width: 100%; justify-content: center; margin-top: .75rem; }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.block { display: flex; justify-content: center; width: 100%; }

/* ── Two-column board ────────────────────────────────────────────────────── */

.board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20rem;
  gap: 1.5rem;
  padding-block: 1.5rem 2.5rem;
  align-items: start;
}
/* One column on a phone: the aside is context, so it goes UNDER the list, not above it. */
@media (max-width: 900px) {
  .board { grid-template-columns: minmax(0, 1fr); }
  .col-side { order: 2; }
}

.card {
  border: 1px solid var(--line);
  border-radius: .75rem;
  background: var(--card);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}
.card p { color: var(--ink-dim); font-size: .92rem; }

/* ── Toolbar ─────────────────────────────────────────────────────────────── */

.toolbar { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1rem; }
.seg { display: flex; flex-wrap: wrap; gap: .25rem; border: 1px solid var(--line); border-radius: .6rem; padding: .25rem; }
.seg button {
  font: inherit;
  color: var(--ink-dim);
  background: transparent;
  border: 0;
  border-radius: .45rem;
  padding: .3rem .7rem;
  cursor: pointer;
}
.seg button:hover { color: var(--ink); }
.seg button.on { background: rgba(0, 210, 184, .16); color: var(--brand); font-weight: 700; }

/* ── List ────────────────────────────────────────────────────────────────── */

.list { list-style: none; margin: 0; padding: 0; }
.row {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: .75rem;
  background: var(--card);
  padding: .9rem 1rem;
  margin-bottom: .6rem;
}
.row:hover { border-color: rgba(0, 210, 184, .45); }
.votes {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 3rem;
  padding: .35rem 0;
  border: 1px solid var(--line);
  border-radius: .55rem;
  color: var(--ink);
  font-size: .85rem;
}
.votes:hover { text-decoration: none; border-color: var(--brand); color: var(--brand); }
.votes b { font-size: 1rem; }
.row-body { min-width: 0; }
.row-title { display: block; color: var(--ink); font-weight: 700; overflow-wrap: anywhere; }
.row-title:hover { color: var(--brand); text-decoration: none; }

.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem .9rem;
  color: var(--ink-dim);
  font-size: .85rem;
  margin-top: .3rem;
}
.count { display: inline-flex; align-items: center; gap: .25rem; }

.pill { padding: .05rem .5rem; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.s-open { background: rgba(174, 188, 203, .18); color: var(--ink-dim); }
.s-planned { background: rgba(255, 200, 0, .16); color: var(--gold); }
.s-done { background: rgba(0, 210, 184, .16); color: var(--brand); }
.s-declined { background: rgba(255, 106, 58, .16); color: var(--hot); }

.note { color: var(--ink-dim); font-size: .9rem; min-height: 1.2rem; }
.note:empty { min-height: 0; }

.legend { list-style: none; margin: 0; padding: 0; color: var(--ink-dim); font-size: .88rem; }
.legend li { margin-bottom: .4rem; }

/* ── Detail ──────────────────────────────────────────────────────────────── */

.back { display: inline-flex; align-items: center; gap: .35rem; margin-bottom: .9rem; font-size: .9rem; }
.detail h1 { overflow-wrap: anywhere; }
/* pre-wrap keeps the author's own line breaks; the text itself is inserted with
   textContent, so nothing in it is ever parsed as markup. */
.detail .body { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); margin-top: 1rem; }

/* ── Footer ──────────────────────────────────────────────────────────────── */

.foot {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--line);
  padding-block: 1.25rem 2rem;
  color: var(--ink-dim);
  font-size: .88rem;
}
