/* ===========================================================================
   Stranola — Ghost theme
   Design tokens mirror the Stranola landing (assets/landing.html).
   =========================================================================== */

:root {
  --brand: #4f46e5;
  --brand-dark: #3730a3;
  --brand-light: #818cf8;
  --brand-bg: rgba(79, 70, 229, 0.06);
  --dark: #0f172a;
  --gray-900: #1e293b;
  --gray-700: #334155;
  --gray-500: #64748b;
  --gray-300: #cbd5e1;
  --gray-200: #e2e8f0;
  --gray-100: #f1f5f9;
  --white: #fff;
  --green: #10b981;
  --orange: #f59e0b;
  --red: #ef4444;
  --radius: 12px;
  --max-w: 1140px;
  --max-narrow: 720px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Monaco, Consolas, monospace;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--gh-font-body, var(--font-sans));
  color: var(--gray-900);
  background: var(--white);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: var(--brand); text-decoration: none; transition: color .15s; }
a:hover { color: var(--brand-dark); }

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 { font-family: var(--gh-font-heading, var(--font-sans)); color: var(--dark); font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; }

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; width: 100%; }
.container-narrow { max-width: var(--max-narrow); margin: 0 auto; padding: 0 24px; width: 100%; }

.site-main { flex: 1 0 auto; padding-bottom: 80px; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 14px 28px; border-radius: 10px; font-size: 15px; font-weight: 600;
  border: none; cursor: pointer; transition: all .15s; font-family: inherit;
}
.btn-sm { padding: 8px 18px; font-size: 14px; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); color: #fff; transform: translateY(-1px); box-shadow: 0 8px 24px rgba(79,70,229,.25); }
.btn-light { background: #fff; color: var(--brand); font-weight: 700; }
.btn-light:hover { color: var(--brand-dark); transform: translateY(-1px); }

/* ── Header / nav ────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.9); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-100);
}
.site-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 14px 24px; }

.logo { display: flex; align-items: center; gap: 10px; font-size: 1.35rem; font-weight: 800; color: var(--dark); letter-spacing: -0.02em; }
.logo:hover { color: var(--dark); }
.logo-mark {
  width: 34px; height: 34px; flex-shrink: 0; background: var(--brand); border-radius: 9px;
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 17px; font-weight: 900;
}
.logo-light { color: #fff; } .logo-light:hover { color: #fff; }

.site-nav .nav { display: flex; gap: 28px; list-style: none; align-items: center; }
.site-nav .nav a { color: var(--gray-700); font-size: 14px; font-weight: 500; }
.site-nav .nav a:hover, .site-nav .nav .nav-current a { color: var(--brand); }

.site-header-cta { display: flex; align-items: center; gap: 16px; }
.nav-signin { color: var(--gray-700); font-size: 14px; font-weight: 500; }
.nav-signin:hover { color: var(--brand); }

/* ── Hero (home) ─────────────────────────────────────────── */
.hero {
  background: linear-gradient(160deg, var(--dark) 0%, #1e1b4b 100%);
  color: #fff; text-align: center; padding: 96px 0 104px; position: relative; overflow: hidden;
}
.hero::before { content: ""; position: absolute; top: -140px; right: -100px; width: 420px; height: 420px; background: radial-gradient(circle, rgba(129,140,248,.25), transparent 70%); pointer-events: none; }
.hero::after { content: ""; position: absolute; bottom: -160px; left: -120px; width: 420px; height: 420px; background: radial-gradient(circle, rgba(16,185,129,.12), transparent 70%); pointer-events: none; }
.hero-inner { position: relative; z-index: 1; }
.hero-badge { display: inline-block; background: rgba(129,140,248,.15); color: var(--brand-light); font-size: 13px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; padding: 6px 16px; border-radius: 20px; margin-bottom: 18px; }
.hero-title { color: #fff; font-size: clamp(2.2rem, 5vw, 3.4rem); }
.hero-desc { color: var(--gray-300); font-size: clamp(1rem, 2vw, 1.2rem); max-width: 600px; margin: 18px auto 0; }
.hero-subscribe { display: flex; gap: 10px; justify-content: center; margin: 32px auto 0; max-width: 460px; flex-wrap: wrap; }
.hero-input { flex: 1; min-width: 220px; padding: 13px 18px; border-radius: 10px; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.08); color: #fff; font-size: 15px; font-family: inherit; }
.hero-input::placeholder { color: rgba(255,255,255,.55); }
.hero-input:focus { outline: none; border-color: var(--brand-light); }
.hero-note { color: var(--gray-500); font-size: 13px; margin-top: 14px; }

/* ── Archive header (tag / author) ───────────────────────── */
.archive-header { padding: 72px 0 8px; text-align: center; }
.archive-header .hero-badge { background: var(--brand-bg); color: var(--brand); }
.archive-title { font-size: clamp(2rem, 4vw, 2.8rem); }
.archive-desc { color: var(--gray-500); max-width: 600px; margin: 14px auto 0; font-size: 1.05rem; }

/* ── Post grid + cards ───────────────────────────────────── */
.post-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px; margin-top: 56px;
}
.post-card { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; transition: box-shadow .2s, transform .2s, border-color .2s; }
.post-card:hover { box-shadow: 0 16px 40px rgba(15,23,42,.08); transform: translateY(-3px); border-color: var(--brand-light); }
.post-card-link { display: flex; flex-direction: column; height: 100%; color: inherit; }
.post-card-link:hover { color: inherit; }
.post-card-image { aspect-ratio: 16 / 9; overflow: hidden; background: var(--gray-100); }
.post-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.post-card:hover .post-card-image img { transform: scale(1.04); }
.post-card-body { padding: 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.post-card-tag { align-self: flex-start; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--brand); background: var(--brand-bg); padding: 4px 10px; border-radius: 6px; }
.post-card-title { font-size: 1.25rem; line-height: 1.3; }
.post-card-excerpt { color: var(--gray-500); font-size: 14.5px; line-height: 1.6; margin: 0; flex: 1; }
.post-card-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 13px; color: var(--gray-500); margin-top: 6px; }
.post-card-author { color: var(--gray-700); font-weight: 600; }

.empty-state { text-align: center; padding: 80px 0; color: var(--gray-500); }
.empty-state h2 { margin-bottom: 8px; }

/* ── Pagination ──────────────────────────────────────────── */
.pagination { display: flex; align-items: center; justify-content: center; gap: 20px; margin-top: 56px; font-size: 14px; color: var(--gray-500); }
.pagination a { font-weight: 600; }

/* ── Single post ─────────────────────────────────────────── */
.post-header { padding: 72px 24px 0; text-align: center; }
.post-tag { display: inline-block; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--brand); margin-bottom: 16px; }
.post-title { font-size: clamp(2rem, 5vw, 3rem); }
.post-subtitle { color: var(--gray-500); font-size: clamp(1.05rem, 2.5vw, 1.35rem); margin-top: 16px; font-weight: 400; line-height: 1.5; }
.post-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: center; margin-top: 22px; font-size: 14px; color: var(--gray-500); }
.post-meta-author { color: var(--gray-700); font-weight: 600; }

.post-feature-image { margin: 48px auto 0; max-width: 1040px; padding: 0 24px; }
.post-feature-image img { width: 100%; border-radius: 16px; box-shadow: 0 20px 50px rgba(15,23,42,.12); }
.post-feature-image figcaption { text-align: center; font-size: 13px; color: var(--gray-500); margin-top: 12px; }

.post-content { margin-top: 48px; }

.post-footer { margin-top: 56px; }
.post-tags { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 32px; }
.post-tags .post-tag { margin: 0; background: var(--gray-100); padding: 6px 14px; border-radius: 8px; }
.post-cta {
  display: flex; flex-direction: column; gap: 4px; padding: 28px 32px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--brand), var(--brand-dark)); color: #fff;
}
.post-cta:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 12px 32px rgba(79,70,229,.25); }
.post-cta strong { font-size: 1.15rem; }
.post-cta span { opacity: .9; font-size: 15px; }

.post-back { margin-top: 40px; }
.post-back a { font-weight: 600; font-size: 14px; }

/* ===========================================================================
   Post body typography (.gh-content — Koenig editor output)
   =========================================================================== */
.gh-content { font-size: 1.125rem; color: var(--gray-700); }
.gh-content > * { margin: 0 0 1.5em; }
.gh-content > :last-child { margin-bottom: 0; }

.gh-content h2 { font-size: 1.7rem; margin: 1.8em 0 .6em; }
.gh-content h3 { font-size: 1.35rem; margin: 1.6em 0 .5em; }
.gh-content h4 { font-size: 1.15rem; margin: 1.5em 0 .5em; }
.gh-content a { font-weight: 600; text-decoration: underline; text-decoration-color: var(--brand-light); text-underline-offset: 2px; }

.gh-content ul, .gh-content ol { padding-left: 1.4em; }
.gh-content li { margin-bottom: .5em; }

.gh-content blockquote {
  border-left: 3px solid var(--brand); background: var(--brand-bg);
  padding: 16px 24px; border-radius: 0 8px 8px 0; font-size: 1.15rem; color: var(--gray-900); font-style: normal;
}

.gh-content hr { border: none; border-top: 1px solid var(--gray-200); margin: 2.5em 0; }

.gh-content img, .gh-content video { border-radius: 12px; }

.gh-content figcaption { text-align: center; font-size: 13px; color: var(--gray-500); margin-top: 10px; }

/* Inline + block code — echoes the landing's terminal aesthetic */
.gh-content :not(pre) > code {
  font-family: var(--mono); font-size: .9em; background: var(--gray-100);
  color: var(--brand-dark); padding: 2px 6px; border-radius: 5px;
}
.gh-content pre {
  background: var(--dark); color: #e2e8f0; font-family: var(--mono); font-size: .95rem; line-height: 1.6;
  padding: 22px 24px; border-radius: 14px; overflow-x: auto; box-shadow: 0 16px 40px rgba(15,23,42,.18);
}
.gh-content pre code { background: none; color: inherit; padding: 0; font-size: inherit; }

.gh-content table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.gh-content th, .gh-content td { border: 1px solid var(--gray-200); padding: 10px 14px; text-align: left; }
.gh-content thead { background: var(--gray-100); }
.gh-content th { font-weight: 700; color: var(--dark); }

/* Koenig width helpers */
.gh-content .kg-width-wide { width: 85vw; max-width: 1040px; position: relative; left: 50%; transform: translateX(-50%); }
.gh-content .kg-width-full { width: 100vw; max-width: 100vw; position: relative; left: 50%; transform: translateX(-50%); border-radius: 0; }
.gh-content .kg-width-full img { border-radius: 0; }

/* Callout / button cards already styled by Ghost's card_assets; light touch-ups */
.gh-content .kg-callout-card { border-radius: 10px; }

/* ── Footer ──────────────────────────────────────────────── */
.site-footer { flex-shrink: 0; background: var(--gray-900); color: var(--gray-300); padding: 56px 0 40px; }
.site-footer-inner { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; }
.site-footer-tagline { color: var(--gray-500); font-size: 14px; max-width: 460px; }
.site-footer-bottom { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: center; align-items: center; font-size: 13px; color: var(--gray-500); margin-top: 12px; padding-top: 20px; border-top: 1px solid #2b3950; width: 100%; }
.site-footer-bottom a { color: var(--brand-light); }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .site-nav { display: none; }
  .hero { padding: 72px 0 80px; }
  .post-grid { grid-template-columns: 1fr; gap: 22px; margin-top: 40px; }
  .post-header { padding-top: 48px; }
  .gh-content { font-size: 1.0625rem; }
  .gh-content .kg-width-wide { width: 100%; left: 0; transform: none; }
}
