/* ==========================================================================
   Field of Thoughts — modern dark theme
   ========================================================================== */

:root {
  --bg: #0d1117;
  --surface: #161b22;
  --surface-2: #1d242e;
  --surface-3: #242c38;
  --border: #2b3441;
  --border-soft: #222a35;
  --text: #cdd6e0;
  --text-bright: #f0f4f8;
  --text-dim: #8b96a3;
  --text-faint: #5c6773;
  --accent: #58a6ff;
  --accent-strong: #1f6feb;
  --accent-soft: rgba(88, 166, 255, 0.12);
  --agree: #3fb950;
  --agree-soft: rgba(63, 185, 80, 0.10);
  --agree-border: rgba(63, 185, 80, 0.35);
  --disagree: #f47067;
  --disagree-soft: rgba(248, 81, 73, 0.10);
  --disagree-border: rgba(248, 81, 73, 0.35);
  --comment: #d4a72c;
  --comment-soft: rgba(212, 167, 44, 0.08);
  --comment-border: rgba(212, 167, 44, 0.30);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  background-image: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(31, 111, 235, 0.12), transparent);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--text-bright); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--accent); }

img { max-width: 100%; }

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --------------------------------------------------------------------------
   Top navigation
   -------------------------------------------------------------------------- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
}

.site-nav .nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.nav-brand { display: flex; align-items: center; flex-shrink: 0; }
.nav-brand img { display: block; height: 44px; width: auto; }

.nav-actions { display: flex; align-items: center; gap: 14px; }

.nav-search {
  display: flex;
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 4px 2px 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.nav-search:focus-within {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.nav-search input[type="text"] {
  background: transparent;
  border: 0;
  outline: none;
  color: var(--text-bright);
  font-family: var(--font);
  font-size: 14px;
  width: 170px;
  padding: 7px 0;
}

.nav-search input[type="text"]::placeholder { color: var(--text-faint); }

.nav-search .search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  opacity: 0.7;
  transition: opacity 0.15s ease;
}
.nav-search .search-btn:hover { opacity: 1; }
.nav-search .search-btn img { width: 18px; height: 18px; }

.nav-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-link:hover { background: var(--surface-2); color: var(--text-bright); }

/* --------------------------------------------------------------------------
   Hero / page intro
   -------------------------------------------------------------------------- */

.hero {
  text-align: center;
  padding: 56px 16px 40px;
}

.hero .subforum-name {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(88, 166, 255, 0.3);
  border-radius: 999px;
  padding: 4px 14px;
  margin-bottom: 18px;
}

.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(26px, 4.5vw, 40px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-bright);
  line-height: 1.2;
}

.hero p {
  margin: 0 auto;
  max-width: 560px;
  color: var(--text-dim);
  font-size: 16px;
}

.page-title {
  margin: 40px 0 8px;
  font-size: clamp(22px, 3.5vw, 30px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-bright);
}

.page-subtitle { color: var(--text-dim); margin: 0 0 24px; }

/* --------------------------------------------------------------------------
   Topic cards (home page grid)
   -------------------------------------------------------------------------- */

.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
  padding-bottom: 48px;
}

.topic-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 22px;
  min-height: 170px;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.topic-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-strong);
  box-shadow: var(--shadow);
}

.topic-card .topic-title {
  font-size: 16.5px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text-bright);
}

.topic-card .topic-title a:hover { color: var(--accent); }

.topic-card .topic-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: var(--text-dim);
}

.topic-card .topic-author {
  font-style: normal;
  color: var(--text-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-dim);
  white-space: nowrap;
}
.pill img { width: 15px; height: 15px; opacity: 0.75; }

/* --------------------------------------------------------------------------
   Panels (generic card sections)
   -------------------------------------------------------------------------- */

.cols-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  align-items: stretch;
  padding: 8px 0 48px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.panel-head {
  padding: 14px 20px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-bright);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-soft);
}

.panel-body { padding: 20px; flex: 1; font-size: 14px; color: var(--text); }
.panel-body p:first-child { margin-top: 0; }
.panel-body p:last-child { margin-bottom: 0; }

/* Stance-coloured variants */
.panel-disagree { border-color: var(--disagree-border); }
.panel-disagree .panel-head { color: var(--disagree); background: var(--disagree-soft); border-bottom-color: var(--disagree-border); }

.panel-agree { border-color: var(--agree-border); }
.panel-agree .panel-head { color: var(--agree); background: var(--agree-soft); border-bottom-color: var(--agree-border); }

.panel-comment .panel-head { color: var(--text-dim); }

/* --------------------------------------------------------------------------
   Discussion thread (backtrack breadcrumb)
   -------------------------------------------------------------------------- */

.thread { padding: 32px 0 8px; }

.thread-node {
  position: relative;
  padding: 10px 14px;
  margin-bottom: 6px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--border);
  border-radius: var(--radius-sm);
  max-width: 780px;
}

.thread-node.node-agree { border-left-color: var(--agree); }
.thread-node.node-disagree { border-left-color: var(--disagree); }
.thread-node.node-comment { border-left-color: var(--comment); }
.thread-node.node-op { border-left-color: var(--accent); background: var(--surface-2); }

.thread-node .node-label {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 4px;
  padding: 1px 7px;
  margin-right: 8px;
  vertical-align: 1px;
}

.node-op .node-label { color: var(--accent); background: var(--accent-soft); }
.node-agree .node-label { color: var(--agree); background: var(--agree-soft); }
.node-disagree .node-label { color: var(--disagree); background: var(--disagree-soft); }
.node-comment .node-label { color: var(--comment); background: var(--comment-soft); }

.thread-node .node-text { font-size: 15px; font-weight: 500; color: var(--text-bright); }
.thread-node.node-op .node-text { font-size: 17px; font-weight: 650; }

.thread-node .node-meta {
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-faint);
}

.thread-node .node-meta img { vertical-align: middle; border-radius: 4px; }

/* --------------------------------------------------------------------------
   Reply lists inside stance panels
   -------------------------------------------------------------------------- */

.reply-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-soft);
}
.reply-item:first-child { padding-top: 0; }
.reply-item:last-child { border-bottom: 0; padding-bottom: 0; }

.reply-item .reply-text {
  display: block;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--text-bright);
  margin-bottom: 8px;
}
.reply-item .reply-text:hover { color: var(--accent); }

.reply-item .reply-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.reply-item .reply-author {
  font-size: 12px;
  font-style: normal;
  color: var(--text-faint);
}

.reply-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  color: var(--text-dim);
}

.reply-actions .action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--text-dim);
  transition: background 0.15s ease;
}
.reply-actions .action:hover { background: var(--surface-3); color: var(--text-bright); }
.reply-actions .action img { width: 16px; height: 16px; opacity: 0.8; }

/* thumbs vote buttons (inline POST forms) styled to match plain actions */
.vote-form { display: inline-flex; align-items: center; gap: 4px; margin: 0; }
button.action { background: none; border: 0; font: inherit; font-size: 12.5px; }

/* "Sign in with Google" button — per Google branding guidelines.
   White surface + 4-colour G reads as Google on any background. */
.gbtn {
  display: inline-flex;
  align-items: center;
  gap: 20px;                      /* logo <-> text spacing (+10) */
  background: #131314;            /* black — Google dark theme */
  border: 1px solid #747775;
  border-radius: var(--radius-sm);
  padding: 9px 16px 10px 14px;    /* extra 1px along the bottom */
  text-decoration: none;
  transition: background .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.gbtn:hover  { background: #1f1f20; box-shadow: 0 1px 4px rgba(0,0,0,.5); }
.gbtn:active { background: #2a2a2b; }
.gbtn-icon { display: flex; align-items: center; }
.gbtn-label {
  color: #e3e3e3;
  font-family: "Roboto", var(--font);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .1px;
  white-space: nowrap;
}
.gbtn:hover .gbtn-label,
.gbtn:active .gbtn-label { color: #e3e3e3; }   /* override global a:hover colour */

/* compact variant for the nav bar */
.gbtn-compact { gap: 14px; padding: 6px 12px 9px 12px; }
.gbtn-compact .gbtn-label { font-size: 13px; }

/* honeypot field — hidden from humans, tempting to bots. Never display. */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  top: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */

textarea,
input[type="text"] {
  width: 100%;
  background: var(--surface-2);
  color: var(--text-bright);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: var(--font);
  font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea { min-height: 140px; resize: vertical; line-height: 1.5; }

textarea:focus,
input[type="text"]:focus {
  outline: none;
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.btn,
input[type="submit"] {
  display: inline-block;
  background: var(--surface-3);
  color: var(--text-bright);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.btn:hover,
input[type="submit"]:hover { border-color: var(--text-faint); background: #2b3543; }
.btn:active,
input[type="submit"]:active { transform: translateY(1px); }

.btn-primary,
input[type="submit"].btn-primary {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #fff;
}
.btn-primary:hover,
input[type="submit"].btn-primary:hover { background: #388bfd; border-color: #388bfd; }

input[type="submit"].btn-agree {
  background: rgba(63, 185, 80, 0.15);
  border-color: var(--agree-border);
  color: var(--agree);
}
input[type="submit"].btn-agree:hover { background: rgba(63, 185, 80, 0.28); }

input[type="submit"].btn-disagree {
  background: rgba(248, 81, 73, 0.13);
  border-color: var(--disagree-border);
  color: var(--disagree);
}
input[type="submit"].btn-disagree:hover { background: rgba(248, 81, 73, 0.26); }

.form-row { margin-bottom: 14px; }
.form-hint { font-size: 12.5px; color: var(--text-faint); margin: 6px 0 0; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-dim); margin: 16px 0 6px; }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text-dim);
  margin: 12px 0;
}
.checkbox-row input[type="checkbox"] { accent-color: var(--accent-strong); width: 15px; height: 15px; }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

/* --------------------------------------------------------------------------
   History / search flat lists
   -------------------------------------------------------------------------- */

.list-panel { margin-bottom: 48px; }

.list-thread {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 14px;
}

.list-item { padding: 8px 0; }
.list-item.indented { margin-left: 34px; padding-left: 14px; border-left: 2px solid var(--border); }

.list-item .list-title {
  display: block;
  font-size: 14.5px;
  font-weight: 550;
  color: var(--text-bright);
}
.list-item .list-title:hover { color: var(--accent); }
.list-thread .list-item:first-child .list-title { font-size: 16px; font-weight: 650; }

.list-item .list-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.empty-note { color: var(--text-faint); font-style: italic; padding: 8px 0; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.footer {
  border-top: 1px solid var(--border-soft);
  background: #0a0d12;
  padding: 48px 0 32px;
  margin-top: 32px;
  color: var(--text-faint);
  font-size: 13px;
  line-height: 1.65;
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-bottom: 32px;
}

.footer-cols h4 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.footer-cols p { margin: 0; }

.footer .copyright {
  text-align: center;
  padding-top: 24px;
  border-top: 1px solid var(--border-soft);
  color: #3d4650;
  font-size: 12px;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media screen and (max-width: 900px) {
  .cols-3 { grid-template-columns: 1fr; }
  .footer-cols { grid-template-columns: 1fr; gap: 20px; }
}

@media screen and (max-width: 560px) {
  .site-nav .nav-inner { justify-content: center; }
  .nav-search input[type="text"] { width: 120px; }
  .hero { padding: 36px 8px 28px; }
  .container { padding: 0 16px; }
}
