/*
  Blog stylesheet — static, served as-is (not injected via JS like the
  home page's <style> string in src/App.jsx). The color tokens below are
  DUPLICATED from the :root custom properties defined in the `styles`
  string inside src/App.jsx. If the home theme changes, update both.
*/

:root {
  --bg: #0a0a0f;
  --border: #1e1e2e;
  --accent: #00ff88;
  --accent-rgb: 0, 255, 136;
  --accent2: #ff6b35;
  --accent3: #7c3aed;
  --text: #e8e8f0;
  --muted: #666680;
  --card: #13131d;
  --on-accent: #04140c;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);

  --text-secondary: #9090a8;
  --text-post-body: #cbcbe0;
  --text-post-em: #d8d8f0;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f7f7fb;
    --border: #e2e2ea;
    --accent: #0a7d3c;
    --accent-rgb: 10, 125, 60;
    --accent2: #b34700;
    --accent3: #5b21b6;
    --text: #15151f;
    --muted: #63637a;
    --card: #ffffff;
    --on-accent: #ffffff;
    --shadow: 0 4px 20px rgba(20, 20, 35, 0.12);

    --text-secondary: #55556e;
    --text-post-body: #33334a;
    --text-post-em: #3d3d52;
  }
}

:root[data-theme="light"] {
  --bg: #f7f7fb;
  --border: #e2e2ea;
  --accent: #0a7d3c;
  --accent-rgb: 10, 125, 60;
  --accent2: #b34700;
  --accent3: #5b21b6;
  --text: #15151f;
  --muted: #63637a;
  --card: #ffffff;
  --on-accent: #ffffff;
  --shadow: 0 4px 20px rgba(20, 20, 35, 0.12);

  --text-secondary: #55556e;
  --text-post-body: #33334a;
  --text-post-em: #3d3d52;
}

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

html {
  background: var(--bg);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Syne', sans-serif;
  min-height: 100vh;
  transition: background-color 0.2s, color 0.2s;
}

a {
  color: var(--accent);
}

a:hover,
a:focus-visible {
  opacity: 0.85;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ---------- Shared header/footer ---------- */

.site-header {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.site-header a {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 1px;
  text-decoration: none;
  color: var(--muted);
}

.site-header a:hover {
  color: var(--accent);
}

.site-header-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.theme-toggle-btn {
  font-size: 14px;
  line-height: 1;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--muted);
}

.site-footer {
  max-width: 720px;
  margin: 60px auto 0;
  padding: 24px 24px 48px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: var(--muted);
}

.site-footer a {
  color: var(--muted);
}

.site-footer a:hover {
  color: var(--accent);
}

/* ---------- Post list ---------- */

.blog-wrapper {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 24px 0;
}

.blog-eyebrow {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.blog-title {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(32px, 6vw, 48px);
  line-height: 1.1;
  letter-spacing: -1px;
  margin-bottom: 32px;
}

.post-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.post-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 22px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s;
}

.post-card:hover,
.post-card:focus-visible {
  border-color: var(--accent);
  opacity: 1;
}

.post-card-date {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.post-card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.3;
}

.post-card-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.post-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.post-card-tag {
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.08);
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  padding: 2px 8px;
  border-radius: 3px;
}

/* ---------- Post page ---------- */

.post-wrapper {
  max-width: 680px;
  margin: 0 auto;
  padding: 40px 24px 0;
}

.post-meta {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 16px;
}

.post-header-title {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(28px, 5vw, 42px);
  line-height: 1.15;
  letter-spacing: -0.5px;
  margin-bottom: 20px;
}

.post-translation-link {
  display: inline-block;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 14px;
  color: var(--accent);
  margin-bottom: 40px;
}

.post-translation-link:hover {
  border-color: var(--accent);
  opacity: 1;
}

.post-content {
  font-size: 17px;
  line-height: 1.75;
  color: var(--text-post-body);
  padding-bottom: 40px;
}

.post-content p {
  margin-bottom: 22px;
}

.post-content h2 {
  font-family: 'Syne', sans-serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  margin: 44px 0 18px;
  line-height: 1.25;
}

.post-content h3 {
  font-family: 'Syne', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin: 32px 0 14px;
}

.post-content strong {
  color: var(--text);
  font-weight: 700;
}

.post-content em {
  color: var(--text-post-em);
}

.post-content a {
  text-decoration: underline;
  text-underline-offset: 3px;
  color: var(--accent);
}

.post-content ul,
.post-content ol {
  margin: 0 0 22px 22px;
}

.post-content li {
  margin-bottom: 8px;
}

.post-content blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 20px;
  margin: 0 0 22px;
  color: var(--muted);
}

.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 40px 0;
}

.post-content code {
  font-family: 'Space Mono', monospace;
  font-size: 0.9em;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
}

.post-content pre {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
  overflow-x: auto;
  margin: 0 0 22px;
}

.post-content pre code {
  background: none;
  border: none;
  padding: 0;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
