/* ================================================================
   WHITAKR AUTOMATE — BLOG STYLES
   Dark theme, consistent with main site design tokens.
   ================================================================ */

/* ── CUSTOM PROPERTIES ────────────────────────────────── */
:root {
  --black:   #0a0a0a;
  --off:     #111111;
  --surface: #161616;
  --border:  #252525;
  --muted:   #555;
  --body:    #a8a8a8;
  --light:   #e8e4dc;
  --white:   #f5f1eb;
  --accent:  #c8a96e;
  --accent2: #e05c3a;
  --gap:     clamp(60px, 8vw, 120px);
  --content-max: 760px;
  --site-max:    1140px;
}

/* ── RESET & BASE ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--black);
  color: var(--body);
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.85; }

/* ── UTILITY ──────────────────────────────────────────── */
.container { max-width: var(--site-max); margin: 0 auto; padding: 0 clamp(20px, 5vw, 60px); }
.mono { font-family: 'DM Mono', monospace; }

/* ── NAVIGATION ───────────────────────────────────────── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 20px clamp(20px, 5vw, 60px);
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid transparent;
  transition: all 0.4s;
}
nav.scrolled {
  background: rgba(10,10,10,0.95);
  border-bottom-color: var(--border);
  backdrop-filter: blur(12px);
}
.nav-logo {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav-link {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--body);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.2s;
}
.nav-link:hover,
.nav-link.active {
  color: var(--white);
  opacity: 1;
}
.nav-cta {
  background: var(--accent2);
  color: #fff;
  border: none;
  padding: 10px 22px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: opacity 0.2s;
  text-decoration: none;
}
.nav-cta:hover { opacity: 0.85; }

/* ── TYPOGRAPHY ───────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', serif;
  color: var(--white);
  line-height: 1.15;
}
h1 { font-size: clamp(36px, 5vw, 56px); font-weight: 900; letter-spacing: -0.02em; }
h2 { font-size: clamp(28px, 3.5vw, 40px); font-weight: 700; }
h3 { font-size: clamp(22px, 2.5vw, 30px); font-weight: 700; }
h4 { font-size: 20px; font-weight: 700; }

h1 em, h2 em, h3 em {
  font-style: italic;
  color: var(--accent);
}

/* ── BLOG INDEX HERO ──────────────────────────────────── */
.blog-hero {
  padding: calc(120px + var(--gap)) 0 var(--gap);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.blog-hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 40%, rgba(200,169,110,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 80% 80%, rgba(224,92,58,0.03) 0%, transparent 50%);
}
.blog-hero h1 { margin-bottom: 20px; position: relative; }
.blog-hero-sub {
  font-size: 18px;
  color: var(--body);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.65;
  position: relative;
}

/* ── BLOG POST GRID ───────────────────────────────────── */
.blog-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  margin-bottom: var(--gap);
}

/* ── POST CARD ────────────────────────────────────────── */
.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 40px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.3s, transform 0.3s;
}
.post-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}
.post-card-category {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.post-card h3 {
  font-size: 22px;
  margin-bottom: 14px;
  line-height: 1.25;
}
.post-card-hook {
  font-size: 15px;
  color: var(--body);
  line-height: 1.65;
  margin-bottom: 24px;
  flex: 1;
}
.post-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.06em;
}
.post-card-link {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}
.post-card-link:hover {
  color: var(--white);
}

/* ── ARTICLE LAYOUT ───────────────────────────────────── */
.article-wrapper {
  padding-top: calc(100px + var(--gap));
  padding-bottom: var(--gap);
}
.article-content {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 40px);
}

/* ── ARTICLE META ─────────────────────────────────────── */
.article-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.article-category {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid var(--accent);
  padding: 4px 12px;
}
.article-date,
.article-read-time {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.06em;
}
.article-date::after {
  content: '·';
  margin-left: 20px;
}

/* ── ARTICLE BODY TYPOGRAPHY ──────────────────────────── */
.article-body p {
  margin-bottom: 24px;
  font-size: 17px;
  line-height: 1.8;
}
.article-body h2 {
  margin-top: 56px;
  margin-bottom: 20px;
}
.article-body h3 {
  margin-top: 40px;
  margin-bottom: 16px;
}
.article-body ul,
.article-body ol {
  margin: 0 0 24px 24px;
  font-size: 17px;
  line-height: 1.8;
}
.article-body li {
  margin-bottom: 8px;
}
.article-body li::marker {
  color: var(--accent);
}
.article-body strong {
  color: var(--light);
  font-weight: 500;
}

/* ── BLOCKQUOTES ──────────────────────────────────────── */
.article-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 20px 28px;
  margin: 32px 0;
  background: var(--surface);
  font-size: 17px;
  color: var(--light);
  font-style: italic;
}
.article-body blockquote p {
  margin-bottom: 0;
}

/* ── CODE BLOCKS ──────────────────────────────────────── */
.article-body code {
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2px 8px;
  color: var(--accent);
}
.article-body pre {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 24px;
  margin: 32px 0;
  overflow-x: auto;
  line-height: 1.55;
}
.article-body pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
  color: var(--body);
}

/* ── PULL QUOTE ───────────────────────────────────────── */
.pull-quote {
  font-family: 'Playfair Display', serif;
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 700;
  color: var(--white);
  text-align: center;
  padding: 48px 20px;
  margin: 48px 0;
  position: relative;
  line-height: 1.35;
}
.pull-quote::before {
  content: '';
  display: block;
  width: 48px;
  height: 2px;
  background: var(--accent);
  margin: 0 auto 24px;
}
.pull-quote::after {
  content: '';
  display: block;
  width: 48px;
  height: 2px;
  background: var(--accent);
  margin: 24px auto 0;
}

/* ── STAT / CALLOUT BOX ───────────────────────────────── */
.stat-callout {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 40px;
  margin: 40px 0;
  text-align: center;
}
.stat-callout-number {
  font-family: 'DM Mono', monospace;
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 500;
  color: var(--accent);
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 12px;
}
.stat-callout-label {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ── MATH BREAKDOWN ───────────────────────────────────── */
.math-breakdown {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 32px;
  margin: 36px 0;
  font-family: 'DM Mono', monospace;
}
.math-breakdown-title {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.math-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 0;
  font-size: 14px;
  color: var(--body);
  border-bottom: 1px solid var(--border);
}
.math-row:last-child {
  border-bottom: none;
}
.math-row-label { flex: 1; }
.math-row-value {
  color: var(--light);
  font-weight: 500;
  text-align: right;
}
.math-row.math-total {
  border-top: 2px solid var(--accent);
  border-bottom: none;
  margin-top: 8px;
  padding-top: 16px;
}
.math-row.math-total .math-row-value {
  color: var(--accent);
  font-size: 18px;
}

/* ── CTA BANNER / BOX ────────────────────────────────── */
.cta-box {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 48px 40px;
  margin: 56px 0;
  text-align: center;
}
.cta-box h3 {
  margin-bottom: 12px;
}
.cta-box p {
  font-size: 15px;
  color: var(--body);
  margin-bottom: 28px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}
.btn-primary {
  display: inline-block;
  background: var(--accent2);
  color: #fff;
  padding: 14px 32px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: opacity 0.2s;
}
.btn-primary:hover { opacity: 0.85; }

/* ── AUTHOR SECTION ───────────────────────────────────── */
.author-section {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 32px;
  margin: 48px 0;
  background: var(--surface);
  border: 1px solid var(--border);
}
.author-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Mono', monospace;
  font-size: 20px;
  color: var(--accent);
}
.author-info h4 {
  font-size: 16px;
  margin-bottom: 4px;
}
.author-info p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

/* ── SHARE SECTION ────────────────────────────────────── */
.share-section {
  text-align: center;
  padding: 32px 0;
  margin: 40px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.share-label {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.share-links {
  display: flex;
  justify-content: center;
  gap: 16px;
}
.share-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--body);
  font-size: 14px;
  transition: border-color 0.2s, color 0.2s;
  text-decoration: none;
}
.share-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── RELATED POSTS ────────────────────────────────────── */
.related-posts {
  padding: var(--gap) 0;
  border-top: 1px solid var(--border);
}
.related-posts-title {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 32px;
  text-align: center;
}
.related-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  max-width: var(--site-max);
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 60px);
}

/* ── BACK TO BLOG LINK ────────────────────────────────── */
.back-to-blog {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  margin-bottom: 40px;
  transition: color 0.2s;
}
.back-to-blog:hover {
  color: var(--accent);
  opacity: 1;
}
.back-to-blog::before {
  content: '\2190';
  font-size: 14px;
}

/* ── FOOTER ───────────────────────────────────────────── */
footer {
  background: var(--off);
  border-top: 1px solid var(--border);
  padding: 48px 0;
}
.footer-inner {
  display: flex; justify-content: space-between; align-items: center;
}
.footer-left {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
}
.footer-left a { color: var(--accent); text-decoration: none; }
.footer-right {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.06em;
}

/* ── SCROLL-REVEAL ANIMATIONS ─────────────────────────── */
.reveal {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.js-loaded .reveal {
  opacity: 0;
  transform: translateY(28px);
}
.js-loaded .reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ── RESPONSIVE ───────────────────────────────────────── */
@media (max-width: 900px) {
  .blog-grid {
    grid-template-columns: 1fr;
  }
  .related-grid {
    grid-template-columns: 1fr;
  }
  .author-section {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 600px) {
  .footer-inner {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
  .post-card {
    padding: 28px;
  }
  .stat-callout {
    padding: 28px 20px;
  }
  .math-breakdown {
    padding: 20px;
  }
  .cta-box {
    padding: 36px 24px;
  }
  .nav-links {
    gap: 16px;
  }
  .nav-link {
    font-size: 11px;
  }
}
