/* ==========================================================================
   Discourse Static Archive — Design System & Base Styles
   ========================================================================== */

:root {
  --text: #1a1a1a;
  --text-muted: #6b7280;
  --text-faint: #9ca3af;
  --bg: #ffffff;
  --bg-subtle: #f9fafb;
  --bg-hover: #f3f4f6;
  --border: #e5e7eb;
  --border-light: #f0f0f0;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-subtle: #eff6ff;
  --radius: 6px;
  --radius-lg: 10px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --max-width: 1100px;
  --love: #ef4444;
}

/* --- Reset & Base --- */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

/* --- Header --- */

.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  height: 56px;
  gap: 1.5rem;
}

.site-logo { display: flex; align-items: center; text-decoration: none; flex-shrink: 0; }
.logo-img { height: 32px; width: auto; }
.logo-text { font-size: 1.125rem; font-weight: 700; color: var(--text); }

.site-nav { display: flex; align-items: center; gap: 0.125rem; margin-left: auto; }

.nav-link {
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
}

.nav-link:hover { background: var(--bg-hover); color: var(--text); text-decoration: none; }

.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; margin-left: auto; }
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--text); margin: 4px 0; border-radius: 1px; }

/* --- Breadcrumbs --- */

.breadcrumbs { border-bottom: 1px solid var(--border-light); font-size: 0.8125rem; }

.breadcrumbs-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.5rem 1.25rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumb-sep { color: var(--text-faint); margin: 0 0.15rem; }
.breadcrumb-current { color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 400px; }

/* --- Main --- */

.site-main { flex: 1; padding: 1.5rem 0; }

.main-inner { max-width: var(--max-width); margin: 0 auto; padding: 0 1.25rem; }
.topic-page .main-inner { max-width: 860px; }

/* --- Footer --- */

.site-footer { border-top: 1px solid var(--border); padding: 1.5rem 0; margin-top: auto; }

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-faint);
}

/* --- Pagination --- */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.5rem 0;
  margin-top: 1rem;
  border-top: 1px solid var(--border-light);
}

.pagination-prev,
.pagination-next {
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  background: var(--accent);
  color: #fff;
  transition: background 0.15s;
}

.pagination-prev:hover,
.pagination-next:hover { background: var(--accent-hover); text-decoration: none; }

.pagination-info { font-size: 0.8125rem; color: var(--text-faint); }

/* --- Badges --- */

.category-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
}

.category-badge:hover { color: var(--accent); text-decoration: none; }

.category-bullet {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--cat-color, #6b7280);
  flex-shrink: 0;
}

.tag-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.0625rem 0.375rem;
  border-radius: 3px;
  font-size: 0.6875rem;
  font-weight: 500;
  background: var(--bg-hover);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.tag-badge:hover { background: var(--border); text-decoration: none; }

/* --- Avatar --- */

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 600;
  font-size: 1rem;
  flex-shrink: 0;
}

.avatar--letter { background: var(--avatar-color, #6b7280); color: #fff; }
.avatar--image { object-fit: cover; }

/* --- User Link --- */

.user-link { font-weight: 600; color: var(--text); }
.user-link:hover { color: var(--accent); }

/* --- Empty / Error States --- */

.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-faint); font-size: 1rem; }

.error-container { text-align: center; padding: 4rem 1rem; }
.error-container h1 { font-size: 1.75rem; margin-bottom: 0.5rem; }
.error-container p { color: var(--text-muted); margin-bottom: 0.5rem; }

/* --- Page Title --- */

.page-title { font-size: 1.375rem; font-weight: 700; margin-bottom: 1.25rem; }

/* --- List Description --- */

.list-description {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-muted);
  font-size: 1rem;
}

/* --- Search --- */

.search-container { max-width: 800px; margin: 0 auto; }
.search-noscript, .search-unavailable { text-align: center; color: var(--text-muted); padding: 2rem; }
.search-unavailable code { background: var(--bg-hover); padding: 0.15rem 0.4rem; border-radius: 3px; font-size: 0.85em; }

/* --- Archive Banner --- */

.archive-banner {
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
}

.archive-banner-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.25rem 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.archive-banner-icon {
  flex-shrink: 0;
  color: var(--text-faint);
  margin-top: 0.125rem;
}

.archive-banner-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 0.15rem;
}

.archive-banner-description {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.archive-banner-description strong {
  color: var(--text);
  font-weight: 600;
}
