/* ─── Community Boards — community.css ─────────────────────────────────────
   Inherits tokens from components.css. This file adds community-specific
   layout, tab, card, and teaser patterns only. ───────────────────────────── */

/* ── Page layout ─────────────────────────────────────────────────────────── */
.comm-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.comm-page-header {
  margin-bottom: 24px;
}
.comm-page-title {
  font-size: 20px;
  font-weight: 600;
  color: #E5E7EB;
  margin-bottom: 4px;
}
.comm-page-subtitle {
  font-size: 13px;
  color: var(--color-text-muted);
}

/* ── Tab bar ─────────────────────────────────────────────────────────────── */
.comm-tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 20px;
  overflow-x: auto;
  scrollbar-width: none;
}
.comm-tab-bar::-webkit-scrollbar { display: none; }

.comm-tab-btn {
  flex: 0 0 auto;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--color-text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  min-height: 44px;
  white-space: nowrap;
}
.comm-tab-btn.active {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}
.comm-tab-btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: -2px;
}

/* ── Search + filter row ─────────────────────────────────────────────────── */
.comm-search-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.comm-search-input {
  flex: 1;
  background: #1A1D27;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  color: #E5E7EB;
  font-family: 'IBM Plex Mono', monospace;
  transition: border-color 0.15s;
}
.comm-search-input::placeholder { color: var(--color-text-muted); }
.comm-search-input:focus {
  outline: none;
  border-color: #374151;
}

/* ── Category chip bar ───────────────────────────────────────────────────── */
.comm-chip-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.comm-chip {
  background: #1A1D27;
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.comm-chip:hover { border-color: #374151; color: #E5E7EB; }
.comm-chip.active {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* ── Post list ───────────────────────────────────────────────────────────── */
.comm-post-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.comm-post-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.comm-post-card:hover { border-color: #374151; }

.comm-post-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.comm-post-title {
  font-size: 14px;
  font-weight: 600;
  color: #E5E7EB;
  line-height: 1.4;
  flex: 1;
}
.comm-badge {
  flex: 0 0 auto;
  font-size: 10px;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}
.comm-badge-official {
  background: rgba(245,158,11,0.12);
  color: #F59E0B;
}
.comm-badge-community {
  background: rgba(107,114,128,0.1);
  color: #9CA3AF;
}
.comm-badge-software {
  background: rgba(59,130,246,0.1);
  color: #60A5FA;
}
.comm-badge-hardware {
  background: rgba(245,158,11,0.08);
  color: #FCD34D;
}

.comm-post-meta {
  font-size: 11px;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--color-text-muted);
  margin-bottom: 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.comm-post-excerpt {
  font-size: 13px;
  color: #9CA3AF;
  line-height: 1.5;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.comm-post-footer {
  font-size: 11px;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--color-text-muted);
}

/* ── Cover image thumbnail ───────────────────────────────────────────────── */
.comm-cover-thumb {
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 12px;
  display: block;
}

/* ── Troubleshooting section headers ─────────────────────────────────────── */
.comm-tsect-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0 8px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 12px;
}
.comm-tsect-title {
  font-size: 12px;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.comm-tsect-group {
  margin-bottom: 24px;
}
.comm-tsect-group-label {
  font-size: 11px;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 6px 0 4px;
  margin-bottom: 8px;
  border-bottom: 1px solid #1F2937;
}

/* ── Teaser / detail view ────────────────────────────────────────────────── */
.comm-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--color-text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 0 16px;
  transition: color 0.15s;
}
.comm-back-btn:hover { color: #E5E7EB; }

.comm-teaser-card {
  background: #111318;
  border: 1px solid #1F2937;
  border-radius: 10px;
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.comm-lock-watermark {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 28px;
  opacity: 0.12;
  user-select: none;
  pointer-events: none;
}
.comm-teaser-title {
  font-size: 17px;
  font-weight: 600;
  color: #E5E7EB;
  line-height: 1.4;
  margin-bottom: 8px;
  padding-right: 36px;
}
.comm-teaser-meta {
  font-size: 11px;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--color-text-muted);
  margin-bottom: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.comm-teaser-excerpt {
  font-size: 14px;
  color: #9CA3AF;
  line-height: 1.6;
  margin-bottom: 12px;
}
.comm-teaser-replies {
  font-size: 12px;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--color-text-muted);
  margin-bottom: 20px;
}

/* ── CTA block inside teaser ─────────────────────────────────────────────── */
.comm-cta-block {
  border-top: 1px solid #1F2937;
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.comm-cta-text {
  font-size: 13px;
  color: #9CA3AF;
  line-height: 1.5;
}
.comm-cta-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── States ──────────────────────────────────────────────────────────────── */
.comm-loading {
  padding: 32px 0;
  text-align: center;
  font-size: 13px;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--color-text-muted);
}
.comm-empty {
  padding: 32px 0;
  text-align: center;
  font-size: 14px;
  color: var(--color-text-muted);
}
.comm-error {
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 13px;
  color: #FCA5A5;
  font-family: 'IBM Plex Mono', monospace;
  margin-top: 8px;
}

/* ── Session B: full post body ───────────────────────────────────────────── */
.comm-post-body-wrap {
  border-top: 1px solid #1F2937;
  padding-top: 20px;
  margin-top: 4px;
  margin-bottom: 20px;
}
.comm-post-body {
  font-size: 15px;
  color: #E5E7EB;
  line-height: 1.75;
}
.comm-post-body h1, .comm-post-body h2, .comm-post-body h3 {
  color: #F9FAFB;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}
.comm-post-body h2 { font-size: 17px; }
.comm-post-body h3 { font-size: 15px; }
.comm-post-body p  { margin-bottom: 1em; }
.comm-post-body ul, .comm-post-body ol {
  padding-left: 1.5em;
  margin-bottom: 1em;
}
.comm-post-body li { margin-bottom: 0.25em; }
.comm-post-body strong { color: #F9FAFB; }
.comm-post-body code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  background: #111827;
  border: 1px solid #374151;
  border-radius: 4px;
  padding: 1px 5px;
}
.comm-post-body pre {
  background: #111827;
  border: 1px solid #374151;
  border-radius: 6px;
  padding: 14px 16px;
  overflow-x: auto;
  margin-bottom: 1em;
}
.comm-post-body pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
}
.comm-content-unavailable {
  font-size: 13px;
  color: var(--color-text-muted);
  font-family: 'IBM Plex Mono', monospace;
  padding: 12px 0;
}

/* ── Session B: comment section ──────────────────────────────────────────── */
.comm-comment-section {
  border-top: 1px solid #1F2937;
  padding-top: 20px;
  margin-top: 4px;
}
.comm-limit-indicator {
  font-size: 11px;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--color-text-muted);
  margin-bottom: 12px;
}
.comm-comment {
  border-bottom: 1px solid #111827;
  padding: 12px 0;
}
.comm-comment:last-child { border-bottom: none; }
.comm-comment-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}
.comm-comment-author {
  font-size: 13px;
  font-weight: 600;
  color: #E5E7EB;
}
.comm-comment-meta {
  font-size: 11px;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--color-text-muted);
}
.comm-comment-body {
  font-size: 14px;
  color: #D1D5DB;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.comm-composer {
  padding-top: 16px;
  margin-top: 8px;
}
.comm-comment-input {
  width: 100%;
  background: #111827;
  border: 1px solid #374151;
  border-radius: 6px;
  color: #E5E7EB;
  font-size: 14px;
  font-family: inherit;
  padding: 10px 12px;
  resize: vertical;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.comm-comment-input:focus {
  outline: none;
  border-color: #F59E0B;
}
.comm-comment-input:disabled { opacity: 0.6; cursor: not-allowed; }
.comm-error-inline {
  font-size: 12px;
  font-family: 'IBM Plex Mono', monospace;
  color: #FCA5A5;
  margin-top: 6px;
}
