/*
  Aligxo Forum - Improved Styles
  Modern, minimal, carpenter-inspired palette with enhanced forum features
*/

:root {
  --primary: #183C6E;
  --primary-dark: #0f2a4b;
  --primary-light: #2a5285;
  --accent: #c47a2c;
  --accent-soft: #f2e1cf;
  --accent-hover: #d68b3d;
  --danger: #b3261e;
  --danger-light: #f8e9e9;
  --success: #1b5e3b;
  --success-light: #e9f5ee;
  --ink: #0f1720;
  --ink-light: #2f3845;
  --muted: #6b7280;
  --muted-light: #9ca3af;
  --bg: #f6f2ec;
  --surface: #ffffff;
  --surface-alt: #fdf8f2;
  --border: #d6d1c8;
  --border-light: rgba(24, 60, 110, 0.08);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-md: 14px;
  --shadow: 0 18px 40px rgba(15, 23, 32, 0.12);
  --shadow-sm: 0 4px 12px rgba(15, 23, 32, 0.08);
  --shadow-md: 0 10px 24px rgba(15, 23, 32, 0.1);
  --max-width: 1140px;
  --transition: 0.2s ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Montserrat", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}

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

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(92%, var(--max-width));
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--primary);
  color: #fff;
  padding: 10px 14px;
  border-radius: 6px;
  z-index: 999;
}

.skip-link:focus {
  left: 10px;
  top: 10px;
}

/* ==================== HEADER ==================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(246, 242, 236, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  color: var(--primary);
}

.brand-logo {
  width: 150px;
  height: 60px;
}

.brand-logo.small {
  width: 75px;
  height: 32px;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.nav-link {
  font-weight: 500;
  color: var(--primary-dark);
  position: relative;
  transition: color var(--transition);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width var(--transition);
}

.nav-link:hover,
.nav-link:focus {
  color: var(--primary);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 6px;
}

.nav-toggle-bar {
  display: block;
  width: 26px;
  height: 2px;
  background: var(--primary);
  margin: 5px 0;
  transition: transform var(--transition);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ==================== PAGE HERO ==================== */
.page-hero {
  padding: 60px 0 40px;
  background: linear-gradient(180deg, rgba(24, 60, 110, 0.12), rgba(246, 242, 236, 0.2));
}

.page-hero h1 {
  font-size: clamp(2rem, 3vw, 2.8rem);
  line-height: 1.1;
  margin-bottom: 12px;
  color: var(--primary-dark);
}

.lead {
  font-size: 1.1rem;
  color: var(--muted);
  margin-bottom: 24px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 14px;
  font-weight: 600;
}

/* ==================== AUTH BAR ==================== */
.auth-bar {
  margin-top: 24px;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: var(--surface-alt);
  border: 1px solid var(--border-light);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

.auth-bar.is-hidden {
  display: none;
}

.auth-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.auth-user-name {
  font-weight: 600;
  color: var(--ink);
  font-size: 0.95rem;
}

.auth-status-text {
  font-size: 0.85rem;
  color: var(--muted);
}

.auth-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid transparent;
  transition: all var(--transition);
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.9rem;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(24, 60, 110, 0.2);
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(24, 60, 110, 0.3);
}

.btn-ghost {
  border-color: var(--primary);
  color: var(--primary);
  background: transparent;
}

.btn-ghost:hover,
.btn-ghost:focus {
  background: rgba(24, 60, 110, 0.08);
  transform: translateY(-1px);
}

.btn-danger {
  border-color: var(--danger);
  color: var(--danger);
  background: transparent;
}

.btn-danger:hover,
.btn-danger:focus {
  background: var(--danger-light);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-icon:hover,
.btn-icon:focus {
  background: var(--surface-alt);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
}

.btn-icon-danger:hover,
.btn-icon-danger:focus {
  border-color: var(--danger);
  color: var(--danger);
  background: var(--danger-light);
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 24px;
  transition: all var(--transition);
  font-family: inherit;
}

.btn-back:hover,
.btn-back:focus {
  background: var(--surface-alt);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateX(-4px);
}

.btn-create-topic {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  border: none;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 12px rgba(196, 122, 44, 0.3);
  font-family: inherit;
}

.btn-create-topic:hover,
.btn-create-topic:focus {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(196, 122, 44, 0.4);
}

.btn-create-topic svg {
  width: 20px;
  height: 20px;
}

/* ==================== SECTION ==================== */
.section {
  padding: 50px 0 70px;
}

/* ==================== FORUM CONTAINER ==================== */
.forum-container {
  max-width: 980px;
  margin: 0 auto;
}

/* ==================== FORUM LIST ==================== */
.forum-main {
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.forum-list-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.forum-title-group h2 {
  font-size: clamp(1.8rem, 2.5vw, 2.2rem);
  color: var(--primary-dark);
  margin-bottom: 6px;
}

.forum-subtitle {
  color: var(--muted);
  font-size: 0.95rem;
}

/* ==================== EMPTY STATE ==================== */
.topic-empty-state {
  text-align: center;
  padding: 80px 20px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 2px dashed var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.empty-icon {
  color: var(--muted-light);
  opacity: 0.5;
}

.empty-message {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 400px;
  line-height: 1.5;
}

/* ==================== TOPIC LIST ==================== */
.topic-list {
  display: grid;
  gap: 16px;
}

.topic-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  overflow: hidden;
  transition: all var(--transition);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

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

.topic-card.is-closed {
  opacity: 0.7;
  background: #fafaf8;
}

.topic-card.is-closed::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--muted);
}

.topic-card-inner {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: 20px;
  align-items: start;
  padding: 20px;
  position: relative;
}

.topic-thumbnail {
  width: 140px;
  height: 100px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: linear-gradient(135deg, #f3efe8 0%, #e8e4dc 100%);
  border: 1px solid var(--border-light);
}

.topic-card-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.topic-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.topic-status {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.topic-status.is-open {
  background: var(--success-light);
  color: var(--success);
}

.topic-status.is-closed {
  background: var(--danger-light);
  color: var(--danger);
}

.topic-status.is-hidden {
  background: #f3f4f6;
  color: var(--muted);
}

.topic-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
  line-height: 1.3;
}

.topic-card-excerpt {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.topic-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--muted);
  flex-wrap: wrap;
}

.topic-card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.topic-card-meta svg {
  width: 14px;
  height: 14px;
  opacity: 0.7;
}

.topic-card-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

.topic-votes {
  display: flex;
  gap: 6px;
  align-items: center;
}

.vote-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--surface-alt);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
}

.vote-count svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
}

.vote-count.dislike svg {
  color: var(--muted);
}

/* ==================== TOPIC DETAIL ==================== */
.forum-detail {
  animation: fadeIn 0.4s ease;
}

.topic-detail-container {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 32px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow);
}

.topic-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.topic-detail-status {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.topic-detail-meta {
  font-size: 0.9rem;
  color: var(--muted);
}

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

/* Topic Image */
.topic-detail-image-container {
  position: relative;
  margin-bottom: 24px;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.topic-detail-image {
  width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: cover;
  display: block;
}

.btn-change-image {
  position: absolute;
  bottom: 16px;
  right: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border);
  color: var(--ink);
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-change-image:hover,
.btn-change-image:focus {
  background: #fff;
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* Topic Content */
.topic-detail-title {
  font-size: clamp(1.6rem, 2.2vw, 2rem);
  color: var(--primary-dark);
  margin-bottom: 16px;
  line-height: 1.2;
}

.topic-detail-body {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink-light);
  margin-bottom: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border-light);
  white-space: pre-line;
}

/* Topic Engagement */
.topic-engagement {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.engagement-buttons {
  display: flex;
  gap: 10px;
}

.btn-vote {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all var(--transition);
  font-family: inherit;
}

.btn-vote:hover,
.btn-vote:focus {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.btn-vote-up:hover,
.btn-vote-up:focus {
  background: var(--success-light);
  border-color: var(--success);
  color: var(--success);
}

.btn-vote-up.active {
  background: var(--success-light);
  border-color: var(--success);
  color: var(--success);
}

.btn-vote-down:hover,
.btn-vote-down:focus {
  background: var(--danger-light);
  border-color: var(--danger);
  color: var(--danger);
}

.btn-vote-down.active {
  background: var(--danger-light);
  border-color: var(--danger);
  color: var(--danger);
}

.btn-vote svg {
  width: 18px;
  height: 18px;
}

.engagement-stats {
  display: flex;
  gap: 20px;
}

.engagement-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

.engagement-stat svg {
  width: 16px;
  height: 16px;
}

/* ==================== COMMENTS ==================== */
.comments-section {
  margin-bottom: 32px;
}

.comments-title {
  font-size: 1.3rem;
  color: var(--ink);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent);
}

.comments-list {
  display: grid;
  gap: 16px;
}

.comment {
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  padding: 16px;
  border-left: 3px solid var(--accent);
  transition: all var(--transition);
}

.comment:hover {
  box-shadow: var(--shadow-sm);
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.comment-author-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.comment-author {
  font-weight: 600;
  color: var(--ink);
  font-size: 0.95rem;
}

.comment-date {
  font-size: 0.8rem;
  color: var(--muted);
}

.comment-actions-top {
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn-comment-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-comment-action:hover,
.btn-comment-action:focus {
  background: var(--surface-alt);
  border-color: var(--danger);
  color: var(--danger);
}

.btn-comment-action svg {
  width: 14px;
  height: 14px;
}

.comment-body {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--ink-light);
  margin-bottom: 12px;
}

.comment-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.comment-votes {
  display: flex;
  gap: 8px;
}

.btn-comment-vote {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all var(--transition);
  font-family: inherit;
}

.btn-comment-vote:hover,
.btn-comment-vote:focus {
  transform: translateY(-1px);
}

.btn-comment-vote.like:hover,
.btn-comment-vote.like:focus {
  background: var(--success-light);
  border-color: var(--success);
  color: var(--success);
}

.btn-comment-vote.like.active {
  background: var(--success-light);
  border-color: var(--success);
  color: var(--success);
}

.btn-comment-vote.dislike:hover,
.btn-comment-vote.dislike:focus {
  background: var(--danger-light);
  border-color: var(--danger);
  color: var(--danger);
}

.btn-comment-vote.dislike.active {
  background: var(--danger-light);
  border-color: var(--danger);
  color: var(--danger);
}

.btn-comment-vote svg {
  width: 14px;
  height: 14px;
}

.btn-reply {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--primary);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all var(--transition);
  font-family: inherit;
}

.btn-reply:hover,
.btn-reply:focus {
  background: rgba(24, 60, 110, 0.08);
  border-color: var(--primary);
}

.btn-reply svg {
  width: 14px;
  height: 14px;
}

/* Nested Replies */
.comment-reply {
  margin-left: 28px;
  margin-top: 12px;
  padding-left: 16px;
  border-left: 2px solid var(--border);
}

.comment-reply .comment {
  border-left-color: var(--muted-light);
  background: #fff;
}

/* ==================== FORMS ==================== */
.comment-form,
.topic-form {
  display: grid;
  gap: 18px;
}

.comment-form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.comment-form-header h4 {
  font-size: 1.1rem;
  color: var(--ink);
}

.btn-cancel-reply {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--transition);
  font-family: inherit;
}

.btn-cancel-reply:hover,
.btn-cancel-reply:focus {
  background: var(--danger-light);
  border-color: var(--danger);
  color: var(--danger);
}

.reply-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  border: 1px solid var(--border-light);
  color: var(--ink);
  font-size: 0.9rem;
}

.reply-indicator svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
}

.form-row {
  display: grid;
  gap: 16px;
}

.form-row-2 {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.form-group {
  display: grid;
  gap: 8px;
}

.form-label {
  font-weight: 600;
  color: var(--ink);
  font-size: 0.9rem;
}

.form-input,
.form-textarea {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--ink);
  transition: all var(--transition);
  line-height: 1.5;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(24, 60, 110, 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.form-note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  border: 1px solid var(--border-light);
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.4;
}

.form-note svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.form-status {
  min-height: 20px;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
}

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

.form-status.success {
  color: var(--success);
}

/* ==================== MODAL ==================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.is-open {
  display: flex;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 32, 0.6);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

.modal-card {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 32px;
  width: min(100%, 580px);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 48px rgba(15, 23, 32, 0.2);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.modal-header h3 {
  font-size: 1.5rem;
  color: var(--primary-dark);
}

.btn-close-modal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-close-modal:hover,
.btn-close-modal:focus {
  background: var(--danger-light);
  border-color: var(--danger);
  color: var(--danger);
  transform: rotate(90deg);
}

/* ==================== FOOTER ==================== */
.site-footer {
  background: var(--primary-dark);
  color: #fff;
  padding: 50px 0;
  margin-top: 80px;
}

.footer-grid {
  display: grid;
  gap: 32px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.footer-title {
  font-weight: 600;
  margin-bottom: 12px;
}

.site-footer a {
  display: block;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 8px;
  transition: color var(--transition);
}

.site-footer a:hover,
.site-footer a:focus {
  color: #fff;
}

/* ==================== UTILITY CLASSES ==================== */
[hidden] {
  display: none !important;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 900px) {
  .primary-nav {
    position: absolute;
    right: 4%;
    top: 70px;
    background: var(--surface);
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 18px;
    border-radius: 16px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow);
    transform: translateY(-10px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition), transform var(--transition);
  }

  .primary-nav.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .nav-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
  }

  .topic-card-inner {
    grid-template-columns: 100px 1fr;
  }

  .topic-card-actions {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .topic-thumbnail {
    width: 100px;
    height: 75px;
  }

  .topic-detail-container {
    padding: 24px 20px;
  }

  .comment-reply {
    margin-left: 16px;
  }
}

@media (max-width: 600px) {
  .page-hero h1 {
    font-size: 1.8rem;
  }

  .forum-list-header {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-create-topic {
    width: 100%;
    justify-content: center;
  }

  .topic-card-inner {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .topic-thumbnail {
    width: 100%;
    height: 180px;
  }

  .topic-engagement {
    flex-direction: column;
    align-items: stretch;
  }

  .engagement-buttons {
    width: 100%;
  }

  .btn-vote {
    flex: 1;
    justify-content: center;
  }

  .modal-card {
    padding: 24px 20px;
  }

  .form-row-2 {
    grid-template-columns: 1fr;
  }
}
