/* ==========================================
   Hardware Hunter — Blog Stylesheet
   Blog-specific styles. Shared base tokens
   and resets come from shared.css.
   ========================================== */

/* ── Blog tokens (override shared.css where blog design differs) ───────── */

:root {
  --surface2: #1c2432;
  --text-secondary: #8892a4;
  --font-heading: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --max-width: 720px;
  --radius-lg: 12px;
}
[data-theme="light"] {
  --surface2: #f0ece4;
  --text-secondary: #6b7280;
}

/* ── Base resets (complement shared.css) ───────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--text);
  font-family: var(--font-body), -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.7;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
.skip-link { position: absolute; top: -100%; left: 1rem; padding: 0.75rem 1.25rem; background: var(--accent); color: #0a0e14; font-weight: 600; font-size: 0.875rem; border-radius: var(--radius); z-index: 10000; transition: top 0.2s; }
.skip-link:focus { top: 1rem; }

/* ── Typography ─────────────────────────────────────────────────────────── */

h1, h2, h3, h4 { font-family: var(--font-heading); line-height: 1.2; letter-spacing: -0.02em; }
h1 { font-size: clamp(1.75rem, 3.5vw, 2.25rem); font-weight: 700; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); font-weight: 700; }
h3 { font-size: 1rem; font-weight: 600; }
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 clamp(1.25rem, 4vw, 2rem); }

/* ── Navigation (blog chrome) ───────────────────────────────────────────── */

.nav {
  position: sticky; top: 0; z-index: 1000;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem clamp(1.25rem, 4vw, 2rem);
  max-width: 1120px; margin: 0 auto;
}
.nav-logo {
  display: flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-heading); font-size: 1.25rem; font-weight: 700;
  text-decoration: none; color: var(--text); letter-spacing: -0.02em;
}
.nav-logo svg { width: 28px; height: 28px; color: var(--accent); }
.nav-logo .logo-hw { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 1.5rem; list-style: none; }
.nav-links a { color: var(--text-secondary); font-size: 0.9rem; font-weight: 500; transition: color 0.15s ease; }
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--accent); }
.nav-actions { display: flex; align-items: center; gap: 0.75rem; }

.theme-toggle {
  background: none; border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text-secondary); cursor: pointer; padding: 0.5rem;
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; transition: border-color 0.15s ease, color 0.15s ease;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle svg { width: 20px; height: 20px; }

.btn-nav {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 1.1rem; background: var(--accent); color: #0a0e14;
  font-weight: 600; font-size: 0.875rem; border: none; border-radius: var(--radius);
  cursor: pointer; text-decoration: none; transition: background 0.15s ease;
  min-height: 40px;
}
.btn-nav:hover { background: var(--accent-hover); color: #0a0e14; }

.hamburger { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; color: var(--text); min-width: 44px; min-height: 44px; }
.hamburger svg { width: 24px; height: 24px; }

@media (max-width: 767px) {
  .hamburger { display: flex; align-items: center; justify-content: center; }
  .nav-links { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--border); flex-direction: column; padding: 1rem; gap: 0.5rem; }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; padding: 0.75rem 1rem; font-size: 1rem; border-radius: var(--radius); }
  .nav-links a:hover { background: var(--surface2); }
  .nav-actions .btn-nav { display: none; }
  .nav-links .btn-nav-mobile { display: inline-flex; width: 100%; justify-content: center; margin-top: 0.5rem; }
}
@media (min-width: 768px) { .nav-links .btn-nav-mobile { display: none; } }

/* ── Footer ─────────────────────────────────────────────────────────────── */

footer {
  border-top: 1px solid var(--border);
  padding: 2rem clamp(1.25rem, 4vw, 2rem); margin-top: 4rem;
  text-align: center;
}
.footer-inner { max-width: 1120px; margin: 0 auto; }
footer p { color: var(--text-secondary); font-size: 0.82rem; margin-bottom: 1rem; }
footer a { color: var(--text-secondary); text-decoration: none; }
footer a:hover { color: var(--accent); }
.footer-agent-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.25rem 1rem; list-style: none; margin-bottom: 1rem; }
.footer-agent-links a { font-size: 0.75rem; font-family: var(--font-mono); }

/* ── Blog index page ────────────────────────────────────────────────────── */

.blog-hero { padding: 3rem 0 2rem; text-align: center; border-bottom: 1px solid var(--border); }
.blog-hero h1 { font-size: clamp(1.75rem, 3.5vw, 2.25rem); font-weight: 700; letter-spacing: -0.03em; margin-bottom: 0.5rem; }
.blog-hero p { color: var(--text-secondary); font-size: 1rem; }

.post-list { padding: 2rem 0; }
.post-card { padding: 2rem 0; border-bottom: 1px solid var(--border); }
.post-card:last-child { border-bottom: none; }

.post-meta { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.6rem; }
.post-meta time { color: var(--text-secondary); font-size: 0.82rem; }
.tags { display: flex; gap: 0.4rem; }
.tag { background: var(--surface2); color: var(--text-secondary); font-size: 0.72rem; font-weight: 500;
        padding: 0.2rem 0.5rem; border-radius: 4px; border: 1px solid var(--border); }

.post-card h2 { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 0.5rem; }
.post-card h2 a { color: var(--text); text-decoration: none; }
.post-card h2 a:hover { color: var(--accent); }

.post-desc { color: var(--text-secondary); font-size: 0.93rem; margin-bottom: 0.75rem; }
.read-more { color: var(--accent); font-size: 0.88rem; font-weight: 600; text-decoration: none; }
.read-more:hover { text-decoration: underline; }
.empty { padding: 3rem 0; color: var(--text-secondary); }

/* ── Blog post page ─────────────────────────────────────────────────────── */

.post-hero { padding: 3rem 0 2rem; border-bottom: 1px solid var(--border); }
.back-link { color: var(--text-secondary); text-decoration: none; font-size: 0.85rem; display: inline-block; margin-bottom: 1.5rem; }
.back-link:hover { color: var(--text); }
.post-hero .post-meta { margin-bottom: 1rem; }
.post-hero h1 { font-size: clamp(1.75rem, 3.5vw, 2.25rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.2; margin-bottom: 0.75rem; }
.post-hero .lede { color: var(--text-secondary); font-size: 1.05rem; max-width: 580px; }

.post-body { padding: 2.5rem 0; }
.post-body h2 { font-family: var(--font-heading); font-size: 1.3rem; font-weight: 700; letter-spacing: -0.02em; margin: 2.5rem 0 0.75rem; color: var(--text); }
.post-body h3 { font-family: var(--font-heading); font-size: 1.05rem; font-weight: 600; margin: 1.75rem 0 0.5rem; color: var(--text); }
.post-body p { color: var(--text-secondary); margin-bottom: 1.1rem; font-size: 0.97rem; }
.post-body strong { color: var(--text); font-weight: 600; }
.post-body a { color: var(--accent); text-decoration: none; }
.post-body a:hover { color: var(--accent-hover); }
.post-body ul { margin: 0.5rem 0 1.1rem 1.25rem; }
.post-body li { color: var(--text-secondary); font-size: 0.97rem; margin-bottom: 0.4rem; }
.post-body code { background: var(--surface2); color: var(--accent); padding: 0.15rem 0.4rem;
                   border-radius: 4px; font-size: 0.88em; font-family: var(--font-mono); }
.post-body pre { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius);
                  padding: 1.25rem; overflow-x: auto; margin-bottom: 1.25rem; }
.post-body pre code { background: none; padding: 0; color: var(--text); }
.table-wrap { overflow-x: auto; margin-bottom: 1.25rem; }
.post-body table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.post-body th { color: var(--text); font-weight: 600; text-align: left; padding: 0.6rem 0.75rem;
                 border-bottom: 1px solid var(--border); background: var(--surface2); font-family: var(--font-heading); }
.post-body td { color: var(--text-secondary); padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border); }

.post-cta { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
             padding: 2rem; margin-top: 3rem; text-align: center; }
.post-cta h3 { font-family: var(--font-heading); font-size: 1.1rem; font-weight: 700; margin-bottom: 0.5rem; }
.post-cta p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 1.25rem; }
.post-cta a { background: var(--accent); color: #0a0e14; font-weight: 700; padding: 0.6rem 1.4rem;
               border-radius: var(--radius); text-decoration: none; font-size: 0.9rem; display: inline-block; }
.post-cta a:hover { background: var(--accent-hover); }

.continue-reading { padding: 2rem 0; border-top: 1px solid var(--border); margin-top: 2rem; }
.continue-reading h2 { font-family: var(--font-heading); font-size: 1.1rem; font-weight: 700; margin-bottom: 1rem; color: var(--text); }
.continue-reading ul { list-style: none; margin: 0; padding: 0; }
.continue-reading li { margin-bottom: 0.6rem; }
.continue-reading a { color: var(--accent); font-weight: 500; text-decoration: none; }
.continue-reading a:hover { text-decoration: underline; }
