/* OpenFactstore Website Styles */

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

:root {
  --nav-bg: #1a2332;
  --nav-width: 240px;
  --accent: #0969da;
  --accent-hover: #0550ae;
  --text: #1f2328;
  --text-muted: #57606a;
  --border: #d0d7de;
  --bg: #ffffff;
  --bg-subtle: #f6f8fa;
  --code-bg: #f6f8fa;
  --success: #1a7f37;
  --warning: #9a6700;
  --danger: #cf222e;
  --radius: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,0.12);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar Nav ─────────────────────────────────────────── */

.sidebar {
  width: var(--nav-width);
  background: var(--nav-bg);
  color: #c9d1d9;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  text-decoration: none;
}

.sidebar-brand-icon {
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.sidebar-brand-name {
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.2;
}

.sidebar-brand-sub {
  font-size: 11px;
  color: #8b949e;
  line-height: 1.2;
}

nav {
  padding: 12px 0;
  flex: 1;
}

nav a {
  display: block;
  padding: 8px 16px;
  color: #c9d1d9;
  text-decoration: none;
  font-size: 14px;
  border-radius: 0;
  transition: background 0.15s, color 0.15s;
  border-left: 3px solid transparent;
}

nav a:hover {
  background: rgba(255,255,255,0.08);
  color: #ffffff;
}

nav a.active {
  background: rgba(9,105,218,0.2);
  color: #ffffff;
  border-left-color: var(--accent);
  font-weight: 500;
}

nav a.external {
  color: #8b949e;
  font-size: 13px;
}

nav .nav-section {
  padding: 16px 16px 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6e7681;
}

/* ── Mobile nav toggle ───────────────────────────────────── */

.nav-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  background: var(--nav-bg);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  width: 40px;
  height: 40px;
  font-size: 20px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

/* ── Main Content ────────────────────────────────────────── */

.content {
  margin-left: var(--nav-width);
  flex: 1;
  min-width: 0;
}

.page-inner {
  max-width: 880px;
  padding: 40px 48px;
}

/* ── Hero ────────────────────────────────────────────────── */

.hero {
  background: linear-gradient(135deg, var(--nav-bg) 0%, #0d1b2a 100%);
  color: #ffffff;
  padding: 64px 48px;
}

.hero-badge {
  display: inline-block;
  background: rgba(9,105,218,0.25);
  color: #79c0ff;
  border: 1px solid rgba(9,105,218,0.4);
  border-radius: 20px;
  padding: 3px 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
  text-transform: uppercase;
}

.hero h1 {
  font-size: 48px;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 16px;
  color: #ffffff;
}

.hero-tagline {
  font-size: 20px;
  color: #8b949e;
  max-width: 600px;
  margin-bottom: 32px;
  line-height: 1.5;
}

.btn-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
  cursor: pointer;
  border: none;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}

.btn-primary:hover { background: var(--accent-hover); }

.btn-outline {
  background: transparent;
  color: #c9d1d9;
  border: 1px solid rgba(255,255,255,0.3);
}

.btn-outline:hover {
  background: rgba(255,255,255,0.1);
  color: #ffffff;
}

/* ── Sections ────────────────────────────────────────────── */

section {
  padding: 48px 48px;
  border-bottom: 1px solid var(--border);
}

section:last-child { border-bottom: none; }

h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}

h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text);
}

h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

p { margin-bottom: 14px; }
p:last-child { margin-bottom: 0; }

/* ── Feature Grid ────────────────────────────────────────── */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.feature-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.feature-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.feature-icon {
  font-size: 24px;
  margin-bottom: 10px;
  display: block;
}

.feature-card h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.feature-card p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

/* ── Tech Stack ──────────────────────────────────────────── */

.stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.stack-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}

.stack-card h4 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.stack-card ul {
  list-style: none;
  padding: 0;
}

.stack-card li {
  font-size: 13px;
  padding: 2px 0;
  color: var(--text);
}

.stack-card li::before {
  content: "▸ ";
  color: var(--accent);
}

/* ── Code blocks ─────────────────────────────────────────── */

pre, code {
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

code {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 13px;
}

pre {
  background: #0d1117;
  color: #c9d1d9;
  border-radius: var(--radius);
  padding: 20px 24px;
  overflow-x: auto;
  margin: 16px 0;
  font-size: 13px;
  line-height: 1.6;
  border: 1px solid #30363d;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

.code-comment { color: #8b949e; }
.code-string  { color: #a5d6ff; }
.code-key     { color: #79c0ff; }
.code-value   { color: #a8ff7f; }

/* ── Steps ───────────────────────────────────────────────── */

.steps {
  counter-reset: step;
  margin: 24px 0;
}

.step {
  display: flex;
  gap: 16px;
  margin-bottom: 32px;
}

.step-num {
  counter-increment: step;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.step-content { flex: 1; }

/* ── Tables ──────────────────────────────────────────────── */

.table-wrap {
  overflow-x: auto;
  margin: 20px 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead {
  background: var(--bg-subtle);
}

th {
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-subtle); }

td code { font-size: 12px; }

/* ── Callouts ────────────────────────────────────────────── */

.callout {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border-left: 4px solid;
  margin: 16px 0;
  font-size: 14px;
}

.callout-icon { font-size: 18px; flex-shrink: 0; }

.callout-info    { background: #ddf4ff; border-color: #54aeff; color: #0550ae; }
.callout-warning { background: #fff8c5; border-color: #d4a72c; color: #7d4e00; }
.callout-danger  { background: #ffebe9; border-color: #ff8182; color: #a40e26; }
.callout-success { background: #dafbe1; border-color: #4ac26b; color: #116329; }

/* ── Issues list ─────────────────────────────────────────── */

.issue-list { margin: 24px 0; }

.issue-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}

.issue-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
}

.issue-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.badge-limitation { background: #ffebe9; color: #a40e26; }
.badge-security   { background: #fff8c5; color: #7d4e00; }
.badge-planned    { background: #dafbe1; color: #116329; }

.issue-title {
  font-weight: 600;
  font-size: 15px;
}

.issue-body {
  padding: 14px 16px;
  font-size: 14px;
  color: var(--text);
}

.issue-body p { margin-bottom: 8px; }
.issue-body p:last-child { margin-bottom: 0; }

/* ── Prereq list ─────────────────────────────────────────── */

.prereq-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.prereq-item {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 14px;
}

.prereq-item strong { display: block; margin-bottom: 2px; }
.prereq-item span   { color: var(--text-muted); font-size: 13px; }

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  .sidebar.open { transform: translateX(0); }

  .nav-toggle { display: flex; }

  .content { margin-left: 0; }

  .hero { padding: 72px 24px 40px; }
  .hero h1 { font-size: 32px; }
  .hero-tagline { font-size: 16px; }

  section { padding: 32px 24px; }

  .page-inner { padding: 24px; }
}
