/* ─────────────────────────────────────────────────────────────
   DCYBORG — retro. monochrome. text-first.
   ───────────────────────────────────────────────────────────── */

@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/webfonts/JetBrainsMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/webfonts/JetBrainsMono-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/webfonts/JetBrainsMono-Italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  --fg: #000000;
  --bg: #ffffff;
  --muted: #666666;
  --rule: #000000;
  --hover-bg: #000000;
  --hover-fg: #ffffff;
  --radius: 0;
  --radius-hover: 6px;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", "Menlo", "Consolas",
          "DejaVu Sans Mono", "Courier New", monospace;
}

/* dark mode */
html[data-theme="dark"] {
  --fg: #ffffff;
  --bg: #000000;
  --muted: #999999;
  --rule: #ffffff;
  --hover-bg: #ffffff;
  --hover-fg: #000000;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.5;
}

body {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px;
}

a {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 2px;
}
a:visited { color: #7a3594; }
a:hover { background: var(--fg); color: var(--bg); }

/* ─── top nav bar ─── */
.topbar {
  padding: 6px 0;
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: center;
}
.topbar .brand { font-weight: bold; letter-spacing: 2px; text-transform: uppercase; }
.topbar .sep { color: var(--muted); }
.topbar .grow { flex: 1; }
.topbar a { text-decoration: none; padding: 2px 6px; }
.topbar a:visited { color: var(--fg); }
.topbar a:hover { background: var(--fg); color: var(--bg); }

/* ─── footer ─── */
footer {
  margin-top: 32px;
  padding-top: 8px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
footer a { color: var(--muted); }
footer a:visited { color: var(--muted); }

/* ─── feed list ─── */
.feed {
  list-style: none;
  padding: 0;
  margin: 0;
}
.feed-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  column-gap: 4px;
  padding: 6px 0;
}
.feed-item:last-child { }

/* rank + vote column */
.feed-rank-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  padding-top: 2px;
}
.feed-rank-col .upvote {
  margin-top: 4px;
}
.feed-rank {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  line-height: 1;
}
.feed-main { min-width: 0; }

.feed-title {
  font-weight: bold;
  word-break: break-word;
}
.feed-title a { text-decoration: none; }
.feed-title a:hover { text-decoration: underline; }

.feed-domain {
  color: var(--muted);
  font-size: 13px;
  font-weight: normal;
  margin-left: 4px;
}

.feed-meta {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}
.feed-meta a { color: var(--muted); }
.feed-meta a:visited { color: var(--muted); }

/* upvote triangle */
.upvote {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1;
  border: 1px solid var(--fg);
  background: var(--bg);
  color: var(--fg);
  padding: 1px 4px;
  text-decoration: none;
  cursor: pointer;
  border-radius: var(--radius);
  transition: border-radius 120ms ease, background 120ms, color 120ms;
}
.upvote:hover {
  background: var(--fg);
  color: var(--bg);
  border-radius: var(--radius-hover);
}

/* ─── tags ─── */
.tag {
  display: inline-block;
  border: 1px solid var(--fg);
  padding: 0 6px;
  margin-right: 4px;
  text-decoration: none;
  font-size: 11px;
  border-radius: var(--radius);
  transition: border-radius 120ms ease, background 120ms, color 120ms;
}
.tag:hover {
  background: var(--fg);
  color: var(--bg);
  border-radius: var(--radius-hover);
}

/* ─── forms / controls ─── */
input[type="text"],
input[type="url"],
input[type="password"],
textarea,
select {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--fg);
  padding: 6px 8px;
  width: 100%;
  border-radius: var(--radius);
  transition: border-radius 120ms ease;
}
input:hover, textarea:hover, select:hover { border-radius: var(--radius-hover); }
input:focus, textarea:focus, select:focus {
  outline: none;
  box-shadow: inset 0 0 0 1px var(--fg);
}

textarea { min-height: 120px; resize: vertical; }

button,
.btn,
input[type="submit"] {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--fg);
  padding: 6px 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  border-radius: var(--radius);
  transition: border-radius 120ms ease, background 120ms, color 120ms;
}
button:hover,
.btn:hover,
input[type="submit"]:hover {
  background: var(--fg);
  color: var(--bg);
  border-radius: var(--radius-hover);
}

.form-row { margin-bottom: 12px; }
.form-row label {
  display: block;
  margin-bottom: 4px;
  font-weight: bold;
  text-transform: lowercase;
}
.form-hint { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* ─── tables (admin) ─── */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th, td {
  border: 1px solid var(--fg);
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}
th { background: var(--fg); color: var(--bg); }

/* ─── utility ─── */
.muted { color: var(--muted); }
.center { text-align: center; }
.stack > * + * { margin-top: 8px; }
.hr {
  border: 0;
  margin: 16px 0;
}
.notice {
  border: 1px solid var(--fg);
  padding: 8px 12px;
  margin-bottom: 16px;
}

/* pagination */
.pager {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  padding-top: 8px;
}

/* ─── post detail ─── */
.post-detail h1 {
  font-size: 18px;
  margin: 0 0 4px;
}
.post-detail .meta { color: var(--muted); font-size: 12px; margin-bottom: 12px; }
.post-body { white-space: pre-wrap; word-break: break-word; }

/* selection */
::selection { background: var(--fg); color: var(--bg); }

/* ─── search ─── */
.search-form { margin-bottom: 16px; }
.search-row {
  display: flex;
  gap: 6px;
}
.search-row input[type="text"] {
  flex: 1;
}
.search-options {
  display: flex;
  gap: 12px;
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}
.search-options label {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 3px;
}
.pager {
  align-items: center;
}

/* ─── theme / view toggles — plain text links ─── */
.theme-toggle {
  font-family: var(--mono);
  font-size: 13px;
  background: none;
  border: none;
  color: var(--fg);
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
  text-decoration: none;
}
.theme-toggle:hover {
  text-decoration: underline;
}

/* ─────────────────────────────────────────────────────────────
   CLASSIFIEDS VIEW — newspaper classified-ads layout
   Activated via html[data-view="classifieds"]
   ───────────────────────────────────────────────────────────── */

html[data-view="classifieds"] body {
  max-width: 1100px;
}

html[data-view="classifieds"] .feed {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}

html[data-view="classifieds"] .feed-item {
  display: block;
  padding: 10px 12px;
}
html[data-view="classifieds"] .feed-item:last-child {
}

/* hide the rank+vote column in classifieds view */
html[data-view="classifieds"] .feed-rank-col {
  display: none;
}

html[data-view="classifieds"] .feed-main {
  min-width: 0;
}

html[data-view="classifieds"] .feed-title {
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.3;
  margin-bottom: 4px;
}
html[data-view="classifieds"] .feed-title a {
  text-decoration: none;
}
html[data-view="classifieds"] .feed-title a:hover {
  text-decoration: underline;
}

html[data-view="classifieds"] .feed-domain {
  display: block;
  font-size: 13px;
  margin-left: 0;
  margin-top: 2px;
  font-style: italic;
}

html[data-view="classifieds"] .feed-meta {
  font-size: 13px;
  line-height: 1.4;
  margin-top: 4px;
}

html[data-view="classifieds"] .tag {
  font-size: 11px;
  padding: 0 4px;
  margin-right: 2px;
  border-width: 1px;
}



/* pager in classifieds */
html[data-view="classifieds"] .pager {
  grid-column: 1 / -1;
  justify-content: center;
  padding: 12px;
}

/* ─── classifieds responsive ─── */
@media (max-width: 768px) {
  html[data-view="classifieds"] .feed {
    grid-template-columns: repeat(2, 1fr);
  }
  html[data-view="classifieds"] body {
    max-width: 100%;
  }
}
@media (max-width: 480px) {
  html[data-view="classifieds"] .feed {
    grid-template-columns: 1fr;
  }
}
