/* base.css — forum layout, skin-agnostic. Colors come entirely from the
   CSS custom properties each skins/*.css file defines (--bg, --text,
   --accent, etc. — see skinService.js). Swapping the <link id="skin-link">
   href is the whole mechanism; nothing here hardcodes a color. */

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Lato', system-ui, sans-serif;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); text-decoration: underline; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-panel);
}

.site-header .brand { font-family: 'Cinzel', serif; font-size: 1.25rem; color: var(--text); }

main { max-width: 960px; margin: 0 auto; padding: 1.5rem; }

.category-list, .topic-list, .post-list { list-style: none; margin: 0; padding: 0; }

.category-item, .topic-item {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 0.5rem;
  background: var(--bg-panel);
}

.category-item.locked::after, .topic-item.locked-badge::after { content: ' 🔒'; }
.topic-item.pinned { border-color: var(--accent-dim, var(--accent)); }

.category-children { margin-left: 1.5rem; margin-top: 0.5rem; }

/* Category/topic stat rows (thread count, post count, last post) — kept as
   a plain row under the existing list-item layout rather than a table;
   see design-026-forum.md's "Layout direction" note re: a dense phpBB-style
   table layout being a separate, not-yet-locked decision. */
.item-header { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.item-stats {
  display: flex;
  gap: 1rem;
  margin-top: 0.4rem;
  color: var(--text-dim);
  font-size: 0.82rem;
  flex-wrap: wrap;
}
.item-stats .stat-count strong { color: var(--text); font-weight: 600; }
.item-stats .last-post { white-space: nowrap; }

.post {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 1rem;
  background: var(--bg-panel);
}
.post-meta { color: var(--text-dim); font-size: 0.85rem; margin-bottom: 0.5rem; }
.post-body :first-child { margin-top: 0; }
.post-main { flex: 1; min-width: 0; }

/* Post author sidebar — avatar, display name, forum title, post count
   (design-026's common-forum-features pass). */
.post-author {
  flex: 0 0 9rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.25rem;
}
.post-author .avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
  background: var(--bg-hover, var(--bg));
}
.post-author .avatar-placeholder {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid var(--border);
  background: var(--bg-hover, var(--bg));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--text-dim);
}
.post-author .author-name { font-weight: 600; word-break: break-word; }
.post-author .author-title { font-size: 0.78rem; color: var(--accent-dim, var(--accent)); }
.post-author .author-post-count { font-size: 0.78rem; color: var(--text-dim); }

.pagination { display: flex; gap: 0.5rem; margin-top: 1.5rem; }
.pagination a, .pagination span {
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 4px;
}
.pagination .current { background: var(--accent-dim, var(--bg-hover)); }

.walled-badge { color: var(--error); font-size: 0.8rem; margin-left: 0.5rem; }

/* Write-path forms (design-026 Phase 3) — functional, not final layout;
   see design-026-forum.md's "Layout direction" note before restyling. */
.toolbar { display: flex; gap: 0.25rem; margin-bottom: 0.5rem; flex-wrap: wrap; }
.toolbar button {
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-panel);
  color: var(--text);
  cursor: pointer;
}
.toolbar button.is-active { background: var(--accent-dim, var(--bg-hover)); }

.editor-surface {
  min-height: 8rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-panel);
}
.editor-surface .ProseMirror { outline: none; }

.form-actions { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.5rem; }
.form-actions button, .post-actions button {
  padding: 0.5rem 1.25rem;
  border: none;
  border-radius: 4px;
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  cursor: pointer;
}
.post-actions { display: flex; gap: 0.5rem; margin-top: 0.75rem; }
.post-actions button { padding: 0.3rem 0.9rem; font-weight: 400; }

.status-msg.error { color: var(--error); }

#title { width: 100%; padding: 0.6rem; margin-bottom: 0.75rem; border: 1px solid var(--border); border-radius: 4px; background: var(--bg-panel); color: var(--text); }

/* Age-gate overlay — see partials/age-gate-overlay.ejs */
#age-gate-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}
#age-gate-overlay[hidden] { display: none; }
#age-gate-overlay .modal {
  max-width: 420px;
  padding: 2rem;
  border: 1px solid var(--border-light, var(--border));
  border-radius: 8px;
  background: var(--bg-panel);
  text-align: center;
}
#age-gate-overlay button {
  margin-top: 1rem;
  padding: 0.6rem 1.5rem;
  border: none;
  border-radius: 4px;
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  cursor: pointer;
}
