/* ===========================
   PELLETHEADS BBQ FORUM
   Main Stylesheet
   =========================== */

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --orange:      #e85d04;
  --orange-dark: #c44a00;
  --orange-light:#ffd0a0;
  --brown:       #3e1c00;
  --smoke:       #2a2a2a;
  --ash:         #444444;
  --light-ash:   #f5f0eb;
  --border:      #ddd0c8;
  --white:       #ffffff;
  --text:        #222222;
  --text-muted:  #777777;
  --link:        #c44a00;
  --link-hover:  #e85d04;
  --success:     #2e7d32;
  --badge-bg:    #e85d04;
  --badge-text:  #ffffff;
  --header-h:    64px;
}

html { font-size: 16px; }

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--light-ash);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

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

img { max-width: 100%; display: block; }

/* ===========================
   HEADER / NAV
   =========================== */
header {
  background: var(--brown);
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-icon {
  font-size: 28px;
  line-height: 1;
}

.logo-text {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--orange);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.logo-text span {
  color: var(--white);
  font-weight: 400;
}

nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

nav a {
  color: #ccc;
  font-size: 0.9rem;
  padding: 6px 14px;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}

nav a:hover {
  background: rgba(255,255,255,0.1);
  color: var(--white);
  text-decoration: none;
}

nav a.active {
  color: var(--orange);
  font-weight: 600;
}

.nav-btn {
  background: var(--orange) !important;
  color: var(--white) !important;
  font-weight: 600 !important;
  border-radius: 5px;
  padding: 7px 18px !important;
  margin-left: 8px;
  transition: background 0.15s !important;
}

.nav-btn:hover {
  background: var(--orange-dark) !important;
  text-decoration: none !important;
}

/* ===========================
   PAGE WRAPPER
   =========================== */
.page-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 16px 60px;
}

/* ===========================
   BREADCRUMB
   =========================== */
.breadcrumb {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}
.breadcrumb a { color: var(--link); }
.breadcrumb span { margin: 0 5px; }

/* ===========================
   HERO BANNER (index only)
   =========================== */
.hero {
  background: linear-gradient(135deg, var(--brown) 0%, #6b2d00 100%);
  border-radius: 10px;
  padding: 36px 40px;
  margin-bottom: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.hero-text h1 {
  color: var(--white);
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1.2;
}
.hero-text h1 span { color: var(--orange); }

.hero-text p {
  color: #d0b090;
  margin-top: 8px;
  font-size: 1rem;
}

.hero-emoji {
  font-size: 70px;
  line-height: 1;
  flex-shrink: 0;
}

.hero-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

/* ===========================
   BUTTONS
   =========================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.15s;
  text-decoration: none;
}

.btn-primary {
  background: var(--orange);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--orange-dark);
  color: var(--white);
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  color: var(--orange-light);
  border-color: var(--orange-light);
}
.btn-outline:hover {
  background: rgba(255,255,255,0.1);
  color: var(--white);
  text-decoration: none;
}

.btn-ghost {
  background: transparent;
  color: var(--ash);
  border-color: var(--border);
}
.btn-ghost:hover {
  background: var(--border);
  text-decoration: none;
  color: var(--text);
}

.btn-sm {
  padding: 5px 13px;
  font-size: 0.8rem;
}

/* ===========================
   STATS BAR
   =========================== */
.stats-bar {
  display: flex;
  gap: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 24px;
  overflow: hidden;
}

.stat-item {
  flex: 1;
  padding: 14px 20px;
  text-align: center;
  border-right: 1px solid var(--border);
}
.stat-item:last-child { border-right: none; }

.stat-number {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--orange);
  line-height: 1;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===========================
   SECTION HEADERS
   =========================== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--brown);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 7px;
}

/* ===========================
   CATEGORY CARDS
   =========================== */
.category-block {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 20px;
  overflow: hidden;
}

.category-header {
  background: var(--brown);
  color: var(--white);
  padding: 11px 20px;
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.forum-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  transition: background 0.12s;
}

.forum-row:hover { background: #fdf7f2; }

.forum-icon {
  font-size: 26px;
  width: 36px;
  text-align: center;
  flex-shrink: 0;
}

.forum-info h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.forum-info p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.forum-count {
  text-align: right;
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.forum-count strong {
  display: block;
  color: var(--text);
  font-size: 1rem;
}

.forum-last {
  text-align: right;
  font-size: 0.78rem;
  color: var(--text-muted);
  min-width: 140px;
}

.forum-last a {
  display: block;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--link);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

/* ===========================
   THREAD LIST TABLE
   =========================== */
.thread-table {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 20px;
}

.thread-table-header {
  display: grid;
  grid-template-columns: 1fr 90px 80px 160px;
  gap: 12px;
  padding: 10px 20px;
  background: #f0e8e0;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ash);
  border-bottom: 1px solid var(--border);
}

.thread-row {
  display: grid;
  grid-template-columns: 1fr 90px 80px 160px;
  gap: 12px;
  align-items: center;
  padding: 13px 20px;
  border-top: 1px solid var(--border);
  transition: background 0.12s;
}

.thread-row:hover { background: #fdf7f2; }

.thread-row:first-child { border-top: none; }

.thread-meta {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.thread-status-icon {
  font-size: 20px;
  margin-top: 2px;
  flex-shrink: 0;
}

.thread-title-wrap h3 {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
}

.thread-title-wrap h3 a { color: var(--text); }
.thread-title-wrap h3 a:hover { color: var(--link); }

.thread-byline {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.thread-byline a { color: var(--link); }

.thread-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.tag {
  background: var(--orange-light);
  color: var(--orange-dark);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.tag-pinned {
  background: #fff3cd;
  color: #856404;
}

.tag-hot {
  background: #fde8e8;
  color: #c0392b;
}

.thread-count {
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.thread-count strong {
  display: block;
  font-size: 1rem;
  color: var(--text);
}

.thread-last-post {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.thread-last-post a {
  font-weight: 600;
  color: var(--link);
}

.thread-last-post time {
  display: block;
  margin-top: 2px;
  font-size: 0.72rem;
}

/* ===========================
   PAGINATION
   =========================== */
.pagination {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 20px;
}

.pagination a,
.pagination span {
  padding: 6px 12px;
  border-radius: 5px;
  font-size: 0.88rem;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.12s;
}

.pagination a:hover {
  background: var(--orange);
  color: var(--white);
  border-color: var(--orange);
  text-decoration: none;
}

.pagination .current {
  background: var(--orange);
  color: var(--white);
  border-color: var(--orange);
  font-weight: 700;
}

/* ===========================
   SINGLE THREAD / POST
   =========================== */
.thread-page-header {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 22px 28px;
  margin-bottom: 20px;
}

.thread-page-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--brown);
  margin-bottom: 8px;
}

.thread-page-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.thread-page-meta span { display: flex; align-items: center; gap: 4px; }

.post-card {
  display: grid;
  grid-template-columns: 160px 1fr;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 14px;
  overflow: hidden;
}

.post-author {
  background: #fdf7f0;
  border-right: 1px solid var(--border);
  padding: 22px 16px;
  text-align: center;
}

.author-avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: var(--orange);
  color: var(--white);
  font-size: 1.8rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
}

.author-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--brown);
}

.author-title {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.author-stats {
  margin-top: 12px;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.8;
}

.author-stats strong { color: var(--text); }

.post-content {
  padding: 20px 24px;
}

.post-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.post-timestamp {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.post-actions {
  display: flex;
  gap: 8px;
}

.post-body {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text);
}

.post-body p { margin-bottom: 12px; }
.post-body p:last-child { margin-bottom: 0; }

.post-footer {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  align-items: center;
}

.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s;
}

.like-btn:hover {
  border-color: var(--orange);
  color: var(--orange);
}

/* Quote box */
.quote-box {
  background: #fdf0e8;
  border-left: 4px solid var(--orange);
  border-radius: 0 6px 6px 0;
  padding: 10px 16px;
  margin: 10px 0;
  font-size: 0.9rem;
  color: var(--ash);
}

.quote-box cite {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--orange-dark);
  margin-bottom: 4px;
  font-style: normal;
}

/* ===========================
   REPLY FORM
   =========================== */
.reply-form-wrap {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px 28px;
  margin-top: 20px;
}

.reply-form-wrap h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--brown);
  margin-bottom: 16px;
}

/* ===========================
   FORMS
   =========================== */
.form-group {
  margin-bottom: 18px;
}

label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ash);
  margin-bottom: 5px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
select,
textarea {
  width: 100%;
  padding: 9px 13px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.92rem;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.15);
}

textarea { resize: vertical; min-height: 130px; line-height: 1.6; }

.toolbar {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  background: #f5f0eb;
  border: 1px solid var(--border);
  border-bottom: none;
  padding: 6px 8px;
  border-radius: 6px 6px 0 0;
}

.toolbar + textarea {
  border-radius: 0 0 6px 6px;
}

.toolbar-btn {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 9px;
  font-size: 0.82rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--ash);
  transition: background 0.12s;
}
.toolbar-btn:hover { background: var(--orange-light); }

.form-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ===========================
   LOGIN / REGISTER
   =========================== */
.auth-wrap {
  max-width: 860px;
  margin: 40px auto;
  padding: 0 16px;
}

.auth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.auth-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 32px 30px;
}

.auth-card h2 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--brown);
  margin-bottom: 4px;
}

.auth-card p.sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 22px;
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

.remember-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.remember-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 400;
  margin: 0;
  cursor: pointer;
}

.remember-row input[type="checkbox"] {
  width: auto;
}

/* ===========================
   NEW POST PAGE
   =========================== */
.new-post-wrap {
  max-width: 860px;
  margin: 0 auto;
}

.new-post-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 32px 36px;
}

.new-post-card h2 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--brown);
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--border);
}

/* ===========================
   SIDEBAR WIDGETS
   =========================== */
.two-col {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  align-items: start;
}

.widget {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 20px;
}

.widget-title {
  background: var(--brown);
  color: var(--white);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 16px;
}

.widget-body { padding: 14px 16px; }

.widget-list { list-style: none; }

.widget-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  line-height: 1.4;
}

.widget-list li:last-child { border-bottom: none; padding-bottom: 0; }

.widget-list li a { font-weight: 600; }

.widget-list .meta {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.online-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #2e7d32;
  border-radius: 50%;
  margin-right: 5px;
}

/* ===========================
   FOOTER
   =========================== */
footer {
  background: var(--brown);
  color: #a08060;
  text-align: center;
  padding: 22px 16px;
  font-size: 0.82rem;
  margin-top: auto;
}

footer a { color: var(--orange-light); }
footer strong { color: var(--orange); }

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
  .auth-grid { grid-template-columns: 1fr; }
  .forum-row { grid-template-columns: auto 1fr auto; }
  .forum-last { display: none; }
  .thread-table-header,
  .thread-row { grid-template-columns: 1fr 80px 130px; }
  .thread-table-header > *:nth-child(3),
  .thread-row > *:nth-child(3) { display: none; }
}

@media (max-width: 640px) {
  header { padding: 0 14px; }
  .logo-text { font-size: 1rem; }
  nav a { display: none; }
  nav a.nav-btn { display: inline-flex; }
  .hero { flex-direction: column; padding: 24px 20px; }
  .hero-emoji { font-size: 48px; }
  .stats-bar { flex-wrap: wrap; }
  .stat-item { min-width: 50%; }
  .post-card { grid-template-columns: 1fr; }
  .post-author { border-right: none; border-bottom: 1px solid var(--border); display: flex; gap: 14px; align-items: center; text-align: left; padding: 14px 18px; }
  .author-avatar { width: 48px; height: 48px; font-size: 1.2rem; margin: 0; }
  .form-row { grid-template-columns: 1fr; }
  .new-post-card { padding: 20px; }
}
