/* =========================================================================
   RRB Forum – Tailwind custom base (loaded after Tailwind CDN play)
   All layout/component styles are now handled via Tailwind utility classes.
   Only bespoke overrides that cannot be expressed as utilities live here.
   =========================================================================

/* Tailwind base reset */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif; }

/* ---------- Prose content (discussion body / reply body) --------------- */
.rrb-prose p  { margin-bottom: 1em; }
.rrb-prose h2,
.rrb-prose h3 { font-weight: 700; margin: 1.25em 0 0.5em; }
.rrb-prose ul { list-style: disc;     padding-left: 1.5em; margin-bottom: 1em; }
.rrb-prose ol { list-style: decimal;  padding-left: 1.5em; margin-bottom: 1em; }
.rrb-prose code {
  background: #f1f5f9; padding: 0.1em 0.35em;
  border-radius: 0.25rem; font-size: 0.875em;
}
.rrb-prose blockquote {
  border-left: 3px solid #cbd5e1; padding: 0.5em 1em;
  color: #64748b; font-style: italic; margin: 1em 0;
}
.rrb-prose a { color: #3b82f6; text-decoration: underline; }

/* ---------- Page content (page.php – WP editor output) ---------------- */
.page-content { color: #374151; font-size: 1rem; line-height: 1.75; }

/* Headings */
.page-content h1,
.page-content h2,
.page-content h3,
.page-content h4,
.page-content h5,
.page-content h6 {
  font-weight: 700; line-height: 1.3; color: #111827;
  margin-top: 1.75em; margin-bottom: 0.5em;
}
.page-content h1 { font-size: 2rem; }
.page-content h2 { font-size: 1.5rem; border-bottom: 2px solid #e5e7eb; padding-bottom: 0.35em; }
.page-content h3 { font-size: 1.25rem; }
.page-content h4 { font-size: 1.1rem; }
.page-content h5,
.page-content h6 { font-size: 1rem; color: #374151; }

/* First heading needs no top margin */
.page-content > *:first-child { margin-top: 0 !important; }

/* Paragraphs */
.page-content p { margin-bottom: 1.25em; }

/* Links */
.page-content a {
  color: #2563eb; text-decoration: underline;
  text-underline-offset: 3px; transition: color .15s;
}
.page-content a:hover { color: #1d4ed8; }

/* Lists */
.page-content ul { list-style: disc;    padding-left: 1.75em; margin-bottom: 1.25em; }
.page-content ol { list-style: decimal; padding-left: 1.75em; margin-bottom: 1.25em; }
.page-content li { margin-bottom: 0.35em; }
.page-content li > ul,
.page-content li > ol { margin-top: 0.35em; margin-bottom: 0.35em; }

/* Images */
.page-content img {
  max-width: 100%; height: auto; display: block;
  border-radius: 0.75rem; margin: 1.5em auto;
}
.page-content figure { margin: 1.5em 0; text-align: center; }
.page-content figcaption { font-size: 0.85rem; color: #6b7280; margin-top: 0.5em; }

/* Blockquote */
.page-content blockquote {
  border-left: 4px solid #2563eb; padding: 0.75em 1.25em;
  background: #eff6ff; border-radius: 0 0.5rem 0.5rem 0;
  color: #1e3a8a; font-style: italic; margin: 1.5em 0;
}
.page-content blockquote p { margin-bottom: 0; }

/* Inline code */
.page-content code {
  background: #f1f5f9; padding: 0.15em 0.4em;
  border-radius: 0.3rem; font-size: 0.875em;
  color: #be123c; font-family: ui-monospace, 'Cascadia Code', monospace;
}

/* Code blocks */
.page-content pre {
  background: #1e293b; color: #e2e8f0;
  padding: 1.25em 1.5em; border-radius: 0.75rem;
  overflow-x: auto; margin: 1.5em 0; font-size: 0.875em;
  line-height: 1.65;
}
.page-content pre code {
  background: none; color: inherit; padding: 0;
  border-radius: 0; font-size: inherit;
}

/* Tables */
.page-content table {
  width: 100%; border-collapse: collapse;
  margin: 1.5em 0; font-size: 0.9rem; overflow: hidden;
  border-radius: 0.75rem; border: 1px solid #e5e7eb;
}
.page-content thead { background: #f9fafb; }
.page-content th {
  text-align: left; font-weight: 600; color: #374151;
  padding: 0.65em 1em; border-bottom: 2px solid #e5e7eb;
}
.page-content td {
  padding: 0.6em 1em; border-bottom: 1px solid #f3f4f6; color: #4b5563;
}
.page-content tbody tr:last-child td { border-bottom: none; }
.page-content tbody tr:hover { background: #f9fafb; }

/* Horizontal rule */
.page-content hr {
  border: none; border-top: 2px solid #e5e7eb;
  margin: 2em 0;
}

/* Strong / em */
.page-content strong { font-weight: 700; color: #111827; }
.page-content em     { font-style: italic; }

/* WordPress alignment helpers */
.page-content .alignleft  { float: left;  margin: 0.5em 1.5em 1em 0; }
.page-content .alignright { float: right; margin: 0.5em 0 1em 1.5em; }
.page-content .aligncenter { display: block; margin-left: auto; margin-right: auto; }
.page-content .wp-caption { max-width: 100%; }
.page-content .wp-caption-text { font-size: 0.85rem; color: #6b7280; text-align: center; margin-top: 0.4em; }

/* Clearfix for floated images */
.page-content::after { content: ''; display: table; clear: both; }

/* ---------- Threaded reply nesting ------------------------------------- */
.rrb-reply-nested { margin-left: 2.5rem; position: relative; }
.rrb-reply-nested::before {
  content: ''; position: absolute; left: -1.25rem; top: 0; bottom: 0;
  width: 2px; background: #e2e8f0; border-radius: 2px;
}

/* ---------- Animations ------------------------------------------------- */
@keyframes rrb-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.rrb-fade-in { animation: rrb-fade-in 0.25s ease; }

@keyframes rrb-spin { to { transform: rotate(360deg); } }
.rrb-spinner {
  display: inline-block; width: 1rem; height: 1rem;
  border: 2px solid #e2e8f0; border-top-color: #3b82f6;
  border-radius: 50%; animation: rrb-spin 0.6s linear infinite;
  vertical-align: middle;
}

/* ---------- Category nav (hide scrollbar) ------------------------------ */
.rrb-cat-nav::-webkit-scrollbar { display: none; }
.rrb-cat-nav { scrollbar-width: none; }

/* ---------- Mobile nav ------------------------------------------------- */
#rrb-mobile-nav { display: none; }
#rrb-mobile-nav.open { display: block; }

/* ---------- Password strength bar -------------------------------------- */
.pw-strength-bar { height: 4px; border-radius: 2px; transition: width .3s, background .3s; }

/* =========================================================================
   LEGACY VARS BELOW – kept only so nothing below this block breaks until
   every template is converted.  Remove when migration is complete.
   =========================================================================

/* --- Custom Properties -------------------------------------------------- */
:root {
  --primary:       #1e3a5f;
  --primary-dark:  #132840;
  --primary-light: #2d5a9c;
  --accent:        #e65c00;
  --accent-hover:  #cc4e00;
  --success:       #27ae60;
  --danger:        #e74c3c;
  --warning:       #f39c12;
  --bg:            #f0f2f5;
  --bg-card:       #ffffff;
  --border:        #dde3ea;
  --text:          #2d3748;
  --text-muted:    #6c757d;
  --text-light:    #a0aec0;
  --radius:        8px;
  --radius-lg:     12px;
  --shadow:        0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:     0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg:     0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.07);
  --transition:    .2s ease;
  --font:          'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* --- Reset / Base -------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--primary-light); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent); }

img { max-width: 100%; height: auto; display: block; }

ul, ol { list-style: none; }

button { cursor: pointer; font-family: var(--font); }

/* --- Layout ------------------------------------------------------------- */
.site-wrapper { display: flex; flex-direction: column; min-height: 100vh; }

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.content-area {
  flex: 1;
  padding: 2rem 0;
}

.forum-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.5rem;
  align-items: start;
}

.forum-main { min-width: 0; }
.forum-sidebar { min-width: 0; }

/* --- Site Header --------------------------------------------------------- */
.site-header {
  background: var(--primary);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .75rem 1rem;
  max-width: 1200px;
  margin: 0 auto;
}

.site-branding { display: flex; align-items: center; gap: .75rem; flex: 1; }

.site-logo {
  width: 44px;
  height: 44px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.site-title {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
}

.site-title a { color: inherit; }
.site-title a:hover { color: #ffd180; }

.site-tagline { font-size: .75rem; color: rgba(255,255,255,.7); line-height: 1; }

/* Primary Nav */
.primary-nav { display: flex; align-items: center; gap: .25rem; }

.primary-nav a {
  color: rgba(255,255,255,.85);
  padding: .5rem .75rem;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}

.primary-nav a:hover,
.primary-nav .current-menu-item > a {
  background: rgba(255,255,255,.15);
  color: #fff;
}

/* Header Actions */
.header-actions { display: flex; align-items: center; gap: .5rem; }

.header-search { position: relative; }

.header-search input {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 20px;
  color: #fff;
  padding: .4rem .9rem .4rem 2rem;
  width: 180px;
  font-size: .8rem;
  transition: background var(--transition), width var(--transition);
}

.header-search input::placeholder { color: rgba(255,255,255,.6); }
.header-search input:focus {
  outline: none;
  background: rgba(255,255,255,.2);
  width: 220px;
}

.header-search .search-icon {
  position: absolute;
  left: .6rem;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,.7);
  font-size: .8rem;
  pointer-events: none;
}

.btn-new-discussion {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: .45rem 1rem;
  font-size: .8rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}

.btn-new-discussion:hover { background: var(--accent-hover); color: #fff; }

/* User login/avatar in header */
.header-user { display: flex; align-items: center; gap: .5rem; }

.header-user img { width: 32px; height: 32px; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); }

.header-user a { color: rgba(255,255,255,.85); font-size: .8rem; }
.header-user a:hover { color: #fff; }

/* -- Category Nav Bar ---------------------------------------------------- */
.category-nav {
  background: var(--primary-dark);
  border-top: 1px solid rgba(255,255,255,.08);
}

.category-nav-inner {
  display: flex;
  gap: .25rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.category-nav-inner::-webkit-scrollbar { display: none; }

.category-nav-inner a {
  color: rgba(255,255,255,.75);
  font-size: .8rem;
  font-weight: 500;
  padding: .55rem .75rem;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}

.category-nav-inner a:hover,
.category-nav-inner .current-cat {
  color: #fff;
  border-bottom-color: var(--accent);
}

/* --- Breadcrumbs --------------------------------------------------------- */
.breadcrumbs {
  font-size: .8rem;
  color: var(--text-muted);
  padding: .75rem 0;
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
}

.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--primary-light); }
.breadcrumbs .sep { color: var(--text-light); }

/* --- Cards / Panels ----------------------------------------------------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.card-header h2, .card-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
}

.card-body { padding: 1.25rem; }

/* --- Hero Banner (Homepage) --------------------------------------------- */
.hero-banner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 60%, #3a7bd5 100%);
  color: #fff;
  padding: 3rem 1rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-content { position: relative; max-width: 640px; margin: 0 auto; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 20px;
  padding: .3rem .8rem;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.hero-title {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: .75rem;
}

.hero-subtitle { font-size: 1rem; color: rgba(255,255,255,.8); margin-bottom: 1.75rem; }

.hero-cta-group { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }

.btn-hero-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 25px;
  padding: .7rem 1.75rem;
  font-size: .9rem;
  font-weight: 700;
  text-decoration: none;
  transition: background var(--transition), transform var(--transition);
}

.btn-hero-primary:hover { background: var(--accent-hover); color: #fff; transform: translateY(-1px); }

.btn-hero-secondary {
  background: rgba(255,255,255,.15);
  color: #fff;
  border: 2px solid rgba(255,255,255,.4);
  border-radius: 25px;
  padding: .65rem 1.5rem;
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  transition: background var(--transition);
}

.btn-hero-secondary:hover { background: rgba(255,255,255,.25); color: #fff; }

/* Hero Stats */
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,.15);
}

.hero-stat { text-align: center; }
.hero-stat-number { font-size: 1.5rem; font-weight: 800; line-height: 1; }
.hero-stat-label  { font-size: .75rem; color: rgba(255,255,255,.7); margin-top: .2rem; }

/* --- Category Cards (Homepage) ------------------------------------------ */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: .6rem;
  text-decoration: none;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}

.category-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--primary-light);
  color: var(--text);
}

.cat-icon {
  font-size: 2rem;
  line-height: 1;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f4ff;
  border-radius: 50%;
}

.cat-name { font-weight: 700; font-size: .9rem; color: var(--primary); }
.cat-count { font-size: .75rem; color: var(--text-muted); }
.cat-desc  { font-size: .75rem; color: var(--text-muted); line-height: 1.4; }

/* --- Discussion List ---------------------------------------------------- */
.discussions-list { display: flex; flex-direction: column; gap: .5rem; }

.discussion-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: box-shadow var(--transition), border-color var(--transition);
}

.discussion-item:hover {
  box-shadow: var(--shadow-md);
  border-color: #b8c8e0;
}

.discussion-item.is-pinned { border-left: 3px solid var(--accent); }

/* Vote column */
.discussion-vote {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .15rem;
  min-width: 44px;
}

.vote-number {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.vote-number.positive { color: var(--success); }
.vote-number.negative { color: var(--danger); }
.vote-label { font-size: .65rem; color: var(--text-light); text-transform: uppercase; letter-spacing: .05em; }

/* Replies count block */
.discussion-replies {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .15rem;
  min-width: 44px;
}

.discussion-replies .count { font-size: 1.1rem; font-weight: 700; color: var(--primary); line-height: 1; }
.discussion-replies .label { font-size: .65rem; color: var(--text-light); text-transform: uppercase; letter-spacing: .05em; }

/* Main content of discussion item */
.discussion-info { flex: 1; min-width: 0; }

.discussion-title {
  font-size: .95rem;
  font-weight: 600;
  margin-bottom: .35rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.discussion-title a { color: var(--text); }
.discussion-title a:hover { color: var(--primary-light); }

.discussion-meta {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
  font-size: .75rem;
  color: var(--text-muted);
}

.discussion-meta .avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  vertical-align: middle;
}

.discussion-meta .author { color: var(--primary-light); font-weight: 500; }
.discussion-meta .date   { color: var(--text-light); }

/* Status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  border-radius: 4px;
  padding: .1rem .45rem;
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.status-badge.open   { background: #e6f9ee; color: var(--success); }
.status-badge.closed { background: #fdecea; color: var(--danger); }
.status-badge.pinned { background: #fff3e0; color: var(--warning); }

/* Category badge */
.cat-badge {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  background: #eef2ff;
  color: var(--primary-light);
  border-radius: 4px;
  padding: .1rem .45rem;
  font-size: .7rem;
  font-weight: 600;
  text-decoration: none;
  transition: background var(--transition);
}

.cat-badge:hover { background: #d6e1ff; color: var(--primary); }

/* --- Archive / Taxonomy Header ------------------------------------------ */
.archive-header {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.archive-icon { font-size: 2.5rem; }

.archive-header-info { flex: 1; }
.archive-header-info h1 { font-size: 1.4rem; font-weight: 800; color: var(--primary); margin-bottom: .25rem; }
.archive-header-info p  { color: var(--text-muted); font-size: .875rem; }

/* Sort / filter toolbar */
.discussions-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.toolbar-count { font-size: .85rem; color: var(--text-muted); }

.sort-links { display: flex; gap: .25rem; }

.sort-links a, .sort-links button {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 6px;
  padding: .3rem .65rem;
  font-size: .78rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.sort-links a:hover, .sort-links button:hover,
.sort-links a.active, .sort-links button.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* --- Single Discussion -------------------------------------------------- */
.discussion-header-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.discussion-header-card h1 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.3;
  margin-bottom: .75rem;
}

.discussion-header-meta {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border);
}

.discussion-header-meta img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

.discussion-header-meta .author { font-weight: 600; color: var(--primary-light); }

.discussion-body {
  font-size: .925rem;
  line-height: 1.8;
  color: var(--text);
}

.discussion-body p  { margin-bottom: 1em; }
.discussion-body h2, .discussion-body h3 { margin: 1.25em 0 .5em; font-weight: 700; }
.discussion-body ul, .discussion-body ol { padding-left: 1.5em; margin-bottom: 1em; list-style: disc; }
.discussion-body ol { list-style: decimal; }
.discussion-body code { background: #f0f4f8; padding: .1em .35em; border-radius: 4px; font-size: .9em; }
.discussion-body blockquote {
  border-left: 3px solid var(--border);
  margin: 1em 0;
  padding: .5em 1em;
  color: var(--text-muted);
  font-style: italic;
}
.discussion-body a { color: var(--primary-light); text-decoration: underline; }
.discussion-body a:hover { color: var(--accent); }

/* Discussion footer actions */
.discussion-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
  padding-top: 1rem;
  margin-top: 1rem;
  border-top: 1px solid var(--border);
}

/* Vote group (discussion + reply) */
.vote-group {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: #f5f7fa;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: .2rem .4rem;
}

.vote-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: .8rem;
  padding: .2rem .5rem;
  border-radius: 15px;
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  transition: background var(--transition), color var(--transition);
}

.vote-btn:hover   { background: var(--border); color: var(--text); }
.vote-btn.active.upvote   { color: var(--success); }
.vote-btn.active.downvote { color: var(--danger); }

/* Share buttons */
.discussion-share { display: flex; align-items: center; gap: .5rem; }
.discussion-share span { font-size: .8rem; color: var(--text-muted); }
.share-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 6px;
  padding: .3rem .6rem;
  font-size: .75rem;
  cursor: pointer;
  transition: background var(--transition);
}
.share-btn:hover { background: var(--border); color: var(--text); }

/* --- Replies Section ---------------------------------------------------- */
.replies-section { margin-top: 1.5rem; }

.replies-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.replies-count-label { font-size: 1rem; font-weight: 700; color: var(--primary); }

.forum-reply {
  display: flex;
  gap: .75rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  animation: fadeIn .25s ease;
}

.forum-reply:last-child { border-bottom: none; }

.forum-reply.reply-nested { margin-left: 2.5rem; position: relative; }
.forum-reply.reply-nested::before {
  content: '';
  position: absolute;
  left: -1.25rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
  border-radius: 2px;
}

.reply-avatar img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
}

.reply-body { flex: 1; min-width: 0; }

.reply-meta {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .4rem;
  flex-wrap: wrap;
}

.reply-author { font-weight: 600; font-size: .875rem; color: var(--primary); }
.reply-date   { font-size: .75rem; color: var(--text-light); }
.reply-badge  { font-size: .65rem; }

.reply-content {
  font-size: .875rem;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: .5rem;
}

.reply-content p { margin-bottom: .5em; }

.reply-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

.reply-toggle-btn, .delete-reply-btn {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: .75rem;
  padding: .15rem .4rem;
  border-radius: 4px;
  transition: color var(--transition), background var(--transition);
}

.reply-toggle-btn:hover { color: var(--primary-light); background: #eef2ff; }
.delete-reply-btn:hover { color: var(--danger); background: #fdecea; }

.replies-children { margin-top: .5rem; }

/* Inline reply form */
.inline-reply-form { margin-top: .75rem; }

/* --- Post / Reply Forms -------------------------------------------------- */
.reply-form-card, .new-discussion-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: 1.5rem;
}

.reply-form-card .card-header, .new-discussion-card .card-header {
  background: #f8fafc;
}

.ajax-reply-form, .new-discussion-form { padding: 0; }

.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: .4rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group select,
.form-group textarea,
.reply-textarea {
  width: 100%;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .6rem .9rem;
  font-family: var(--font);
  font-size: .875rem;
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.reply-textarea:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(45, 90, 156, .12);
}

.reply-textarea { min-height: 100px; resize: vertical; }

.reply-form-actions { display: flex; gap: .5rem; margin-top: .6rem; }

.reply-form-notice {
  margin-top: .5rem;
  font-size: .8rem;
  min-height: 1.2em;
}

.reply-form-notice.success { color: var(--success); }
.reply-form-notice.error   { color: var(--danger); }

/* --- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-family: var(--font);
  font-weight: 600;
  font-size: .875rem;
  border-radius: var(--radius);
  padding: .55rem 1.1rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  line-height: 1.2;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; box-shadow: var(--shadow-md); }

.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-hover); color: #fff; }

.btn-ghost {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.btn-ghost:hover { background: var(--border); color: var(--text); }

.btn-sm { font-size: .78rem; padding: .35rem .75rem; }
.btn-lg { font-size: 1rem; padding: .7rem 1.4rem; }

/* --- Sidebar ------------------------------------------------------------ */
.sidebar-widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 1rem;
}

.widget-title {
  font-size: .875rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .85rem 1.1rem;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
  margin: 0;
}

/* Recent discussions widget */
.widget-recent-discussions { padding: .5rem 0; }

.widget-discussion-item {
  display: flex;
  gap: .6rem;
  padding: .55rem 1rem;
  border-bottom: 1px solid #f0f2f5;
  transition: background var(--transition);
}

.widget-discussion-item:last-child { border-bottom: none; }
.widget-discussion-item:hover { background: #f8fafc; }

.widget-discussion-item a {
  font-size: .8rem;
  font-weight: 500;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
  flex: 1;
}

.widget-discussion-item a:hover { color: var(--primary-light); }

.widget-discussion-item .meta { font-size: .7rem; color: var(--text-light); margin-top: .2rem; }

/* Categories widget */
.widget-categories { padding: .5rem 0; }

.widget-cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .5rem 1rem;
  border-bottom: 1px solid #f0f2f5;
  font-size: .8rem;
  transition: background var(--transition);
}

.widget-cat-item:last-child { border-bottom: none; }
.widget-cat-item:hover { background: #f8fafc; }

.widget-cat-item a { color: var(--text); font-weight: 500; text-decoration: none; display: flex; align-items: center; gap: .4rem; flex: 1; }
.widget-cat-item a:hover { color: var(--primary-light); }
.widget-cat-count { background: #e8edf5; color: var(--primary); font-size: .7rem; font-weight: 700; border-radius: 10px; padding: .1rem .45rem; min-width: 20px; text-align: center; }

/* --- WordPress default sidebar widget body styles ---------------------- */

/* Strip default list chrome */
#forum-sidebar .widget ul,
#forum-sidebar .widget ol {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Each list item row */
#forum-sidebar .widget li {
  padding: .55rem 1rem !important;
  border-bottom: 1px solid #f1f5f9 !important;
  font-size: .8125rem !important;
  color: #374151 !important;
  line-height: 1.45 !important;
}
#forum-sidebar .widget li:last-child { border-bottom: none !important; }
#forum-sidebar .widget li:hover { background: #f8fafc !important; }

/* Links inside default widgets */
#forum-sidebar .widget a {
  color: #374151;
  text-decoration: none;
  transition: color .15s;
}
#forum-sidebar .widget a:hover { color: #2563eb; }

/* Post date shown by Recent Posts widget */
#forum-sidebar .widget .post-date {
  display: block;
  font-size: .7rem;
  color: #94a3b8;
  margin-top: .15rem;
}

/* ---- Search widget ---------------------------------------------------- */

/* Hide the <label> – the widget title "Search" already labels the field */
#forum-sidebar .widget_search label {
  display: none;
}

#forum-sidebar .widget_search form {
  display: flex;
  gap: .5rem;
  padding: .75rem 1rem;
  align-items: center;
}

#forum-sidebar .widget_search input[type="search"],
#forum-sidebar .widget_search input[type="text"] {
  flex: 1;
  min-width: 0;
  padding: .4rem .7rem;
  border: 1px solid #e2e8f0 !important;
  border-radius: .5rem !important;
  font-size: .8125rem;
  background: #fff !important;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
#forum-sidebar .widget_search input[type="search"]:focus,
#forum-sidebar .widget_search input[type="text"]:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}

#forum-sidebar .widget_search button[type="submit"],
#forum-sidebar .widget_search input[type="submit"] {
  padding: .4rem .9rem !important;
  background: #2563eb !important;
  color: #fff !important;
  border: none !important;
  border-radius: .5rem !important;
  font-size: .8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
  flex-shrink: 0;
}
#forum-sidebar .widget_search button[type="submit"]:hover,
#forum-sidebar .widget_search input[type="submit"]:hover {
  background: #1d4ed8 !important;
}

/* ---- Recent Comments – .recentcomments class is on both ul AND li ---- */
#forum-sidebar .widget_recent_comments ul.recentcomments {
  padding: 0 !important;
}
#forum-sidebar .widget_recent_comments li.recentcomments {
  line-height: 1.5 !important;
}

/* --- Pagination --------------------------------------------------------- */
.forum-pagination { margin-top: 1.5rem; }

.forum-pagination ul {
  display: flex;
  gap: .3rem;
  flex-wrap: wrap;
  justify-content: center;
}

.forum-pagination li a,
.forum-pagination li span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .8rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0 .5rem;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.forum-pagination li a:hover,
.forum-pagination li span.current {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.forum-pagination li span.dots { border: none; color: var(--text-light); }

/* --- Search Results ------------------------------------------------------ */
.search-results-header { margin-bottom: 1rem; }
.search-results-header h1 { font-size: 1.2rem; font-weight: 700; color: var(--primary); }
.search-results-header p  { color: var(--text-muted); font-size: .875rem; }

.no-results {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
}

.no-results .no-results-icon { font-size: 3rem; margin-bottom: 1rem; }
.no-results h2 { font-size: 1.1rem; font-weight: 700; color: var(--primary); margin-bottom: .5rem; }
.no-results p  { color: var(--text-muted); font-size: .875rem; }

/* --- 404 ----------------------------------------------------------------- */
.page-404 { text-align: center; padding: 4rem 1rem; }
.page-404 .icon { font-size: 4rem; margin-bottom: 1rem; }
.page-404 h1 { font-size: 2rem; font-weight: 800; color: var(--primary); margin-bottom: .75rem; }
.page-404 p  { color: var(--text-muted); margin-bottom: 1.5rem; }

/* --- Login Notice ------------------------------------------------------- */
.login-notice {
  background: #fffbf0;
  border: 1px solid #ffe4a0;
  border-radius: var(--radius);
  padding: .75rem 1rem;
  font-size: .875rem;
  color: #7a6200;
}

.login-notice a { color: var(--primary-light); font-weight: 600; }

/* Closed discussion notice */
.discussion-closed-notice {
  background: #fdecea;
  border: 1px solid #f5c6c2;
  border-radius: var(--radius);
  padding: .75rem 1rem;
  font-size: .875rem;
  color: var(--danger);
  display: flex;
  align-items: center;
  gap: .5rem;
}

/* --- Alert / Notice banners --------------------------------------------- */
.alert {
  border-radius: var(--radius);
  padding: .75rem 1rem;
  font-size: .875rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: .5rem;
}

.alert-success { background: #e6f9ee; border: 1px solid #b2dfca; color: #1a7340; }
.alert-error   { background: #fdecea; border: 1px solid #f5c6c2; color: #c62828; }
.alert-info    { background: #e3f2fd; border: 1px solid #b3d7f5; color: #1565c0; }
.alert-warning { background: #fff8e1; border: 1px solid #ffe082; color: #7a5a00; }

/* --- Site Footer -------------------------------------------------------- */
.site-footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,.75);
  padding: 2.5rem 1rem 1rem;
  margin-top: auto;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.footer-brand .site-title-footer {
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: .5rem;
}

.footer-brand p { font-size: .8rem; line-height: 1.6; }

.footer-links h4 { font-size: .85rem; font-weight: 700; color: #fff; margin-bottom: .75rem; text-transform: uppercase; letter-spacing: .05em; }

.footer-links ul { display: flex; flex-direction: column; gap: .4rem; }

.footer-links a { font-size: .8rem; color: rgba(255,255,255,.65); text-decoration: none; transition: color var(--transition); }
.footer-links a:hover { color: #fff; }

.footer-bottom {
  max-width: 1200px;
  margin: 1rem auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .75rem;
  flex-wrap: wrap;
  gap: .5rem;
}

.footer-bottom a { color: rgba(255,255,255,.5); }
.footer-bottom a:hover { color: #fff; }

/* --- Animations --------------------------------------------------------- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn .3s ease; }

/* --- Loading spinner ---------------------------------------------------- */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--primary-light);
  border-radius: 50%;
  animation: spin .6s linear infinite;
  vertical-align: middle;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* --- Responsive --------------------------------------------------------- */
@media (max-width: 900px) {
  .forum-layout {
    grid-template-columns: 1fr;
  }

  .forum-sidebar { display: none; }

  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 700px) {
  .header-inner { flex-wrap: wrap; gap: .6rem; }
  .primary-nav  { display: none; }

  .hero-banner { padding: 2rem 1rem; }

  .categories-grid { grid-template-columns: repeat(2, 1fr); }

  .discussion-item { flex-direction: column; }
  .discussion-vote, .discussion-replies { flex-direction: row; gap: .5rem; }

  .footer-inner { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .categories-grid { grid-template-columns: 1fr 1fr; }
  .hero-stats      { gap: 1rem; }
}
