/* ============================================================
   blog.css -- Shared styles for whittaker.ai blog
   Load via <link rel="stylesheet" href="/blog/assets/blog.css">
   Fonts loaded via <link> tags in the template (no @import here).
   *, *::before, *::after reset stays in the template.
   ============================================================ */

/* --- Tokens --- */
:root {
  --bg: #f7f6f2;
  --text: #1a1a17;
  --muted: #6e6e65;
  --border: #e2e1db;
}

[data-theme="dark"] {
  --bg: #0e0e0c;
  --text: #e8e7e2;
  --muted: #8a8a80;
  --border: #2a2a26;
}

/* --- Base --- */
body {
  font-family: 'Jost', system-ui, sans-serif;
  font-weight: 300;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* --- Nav --- */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem clamp(1.25rem, 4vw, 3rem);
  position: relative;
  z-index: 10;
}

.wordmark {
  font-family: 'Jost', system-ui, sans-serif;
  font-size: 16px;
  font-weight: 300;
  letter-spacing: 0.35em;
  color: var(--text);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-link {
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-link:hover { color: var(--text); }

#theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 14px;
}

/* --- Article header --- */
.article-header {
  padding: clamp(3rem, 8vw, 6rem) clamp(1.25rem, 4vw, 3rem) clamp(2rem, 4vw, 3rem);
  max-width: 720px;
  margin: 0 auto;
}

.article-meta {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.article-header h1 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 1.25rem;
}

.article-header .lede {
  font-size: 1.0625rem;
  color: var(--muted);
  line-height: 1.7;
}

/* --- Divider --- */
.divider {
  width: 40px;
  height: 1px;
  background: var(--border);
  margin: 0 auto;
}

/* --- Article body --- */
.article-body {
  padding: clamp(2rem, 4vw, 3rem) clamp(1.25rem, 4vw, 3rem);
  max-width: 720px;
  margin: 0 auto;
}

.article-body h2 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(1.375rem, 3.5vw, 1.75rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 2.5rem 0 1rem;
}

.article-body h2:first-child { margin-top: 0; }

.article-body p {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.75;
  margin-bottom: 1.25rem;
}

.article-body strong {
  color: var(--text);
  font-weight: 500;
}

/* --- Back link --- */
.back-link {
  display: inline-block;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color 0.2s;
}

.back-link:hover { color: var(--text); }

/* --- Footer --- */
footer {
  text-align: center;
  padding: 3rem clamp(1.25rem, 4vw, 3rem) 3rem;
  font-size: 0.75rem;
  color: var(--muted);
}

/* --- Scroll reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Blog index: page header --- */
.page-header {
  padding: clamp(3rem, 8vw, 6rem) clamp(1.25rem, 4vw, 3rem) clamp(2rem, 4vw, 3rem);
  max-width: 720px;
  margin: 0 auto;
}

.section-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

/* --- Topic tabs --- */
.topic-tabs {
  display: flex;
  gap: 0;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
  max-width: 720px;
  margin: 0 auto 1.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.topic-tabs::-webkit-scrollbar { display: none; }

.topic-tab {
  font-family: 'Jost', system-ui, sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  padding: 0.5rem 0.875rem;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
}

.topic-tab:first-child { padding-left: 0; }

.topic-tab:hover { color: var(--text); }

.topic-tab.active {
  color: var(--text);
  border-bottom-color: var(--text);
}

.topic-tab .tab-count {
  font-size: 0.625rem;
  font-weight: 400;
  opacity: 0.6;
  margin-left: 0.25rem;
}

/* --- Blog index: post list --- */
.post-list {
  padding: clamp(2rem, 4vw, 3rem) clamp(1.25rem, 4vw, 3rem);
  max-width: 720px;
  margin: 0 auto;
}

.post-item {
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
}

.post-item:last-child {
  border-bottom: 1px solid var(--border);
}

.post-date {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.post-item h2 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.375rem;
  font-weight: 400;
  line-height: 1.25;
  margin-bottom: 0.5rem;
}

.post-item h2 a {
  color: var(--text);
  text-decoration: none;
  transition: opacity 0.2s;
}

.post-item h2 a:hover { opacity: 0.6; }

.post-item p {
  font-size: 0.9375rem;
  color: var(--muted);
  line-height: 1.65;
}

/* --- TL;DR block --- */
.tldr {
  border-left: 2px solid var(--border);
  padding: 1rem 0 1rem 1.25rem;
  margin-bottom: 2rem;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--muted);
}

.tldr strong {
  color: var(--text);
  font-weight: 500;
}

/* --- FAQ section --- */
.faq-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.faq-item {
  margin-bottom: 1.5rem;
}

.faq-item h3 {
  font-family: 'Jost', system-ui, sans-serif;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.faq-item p {
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.7;
}

/* --- Related posts --- */
.related-posts {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.related-posts h2 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.125rem;
  font-weight: 400;
  margin-bottom: 0.75rem;
}

.related-posts a {
  display: block;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9375rem;
  padding: 0.375rem 0;
  transition: color 0.2s;
}

.related-posts a:hover {
  color: var(--text);
}

/* --- References / Sources --- */
.references {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.references h2 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--text);
}

.references ol {
  padding-left: 1.5rem;
  list-style-type: decimal;
}

.references li {
  font-size: 0.875rem;
  line-height: 1.6;
  margin-bottom: 0.5rem;
  color: var(--muted);
}

.references a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-word;
  transition: color 0.2s;
}

.references a:hover {
  color: var(--text);
}

/* --- Last reviewed --- */
.last-reviewed {
  margin-left: 0.75rem;
  opacity: 0.7;
}
