/* =============================================================
   Oberbean — Lenny's Newsletter layout, monkey palette
   ============================================================= */

:root {
  --bg:         #ffffff;
  --surface:    #f7f5f2;
  --cream:      #ede0c4;
  --border:     rgba(0, 0, 0, 0.09);
  --border-md:  rgba(0, 0, 0, 0.16);
  --brown:      #6b3319;
  --brown-lt:   #8b4a22;
  --amber:      #b8712a;
  --text:       #1c0e06;
  --muted:      #6b5040;
  --hint:       #9a7a60;
  --script:     'Dancing Script', cursive;
  --serif:      'Lora', Georgia, serif;
  --sans:       'Inter', system-ui, sans-serif;
  --max:        1200px;
  --prose:      680px;
  --pad:        32px;
}

html.dark {
  --bg:        #0f0a07;
  --surface:   #1a1109;
  --cream:     #241808;
  --border:    rgba(255, 255, 255, 0.08);
  --border-md: rgba(255, 255, 255, 0.14);
  --brown:     #c97a4a;
  --brown-lt:  #e8a84a;
  --amber:     #e8a84a;
  --text:      #f2e8d9;
  --muted:     #b89a7a;
  --hint:      #7a5f45;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
body { overflow-x: hidden; }
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
.site-wrapper { min-height: 100vh; display: flex; flex-direction: column; }
.site-main { flex: 1; }

/* ── Navigation ─────────────────────────────────────────── */
.site-nav {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
  height: 64px;
}
.nav-top-left { display: flex; align-items: center; gap: 12px; }
.nav-top-right { display: flex; align-items: center; gap: 14px; justify-content: flex-end; }

.nav-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}
.nav-icon-btn:hover { color: var(--text); }

.nav-theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border-md);
  border-radius: 6px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  color: var(--muted);
  transition: color 0.15s, border-color 0.15s;
  padding: 0;
}
.nav-theme-toggle:hover { color: var(--text); border-color: var(--amber); }
.nav-theme-toggle .icon-moon { display: block; }
.nav-theme-toggle .icon-sun  { display: none; }
html.dark .nav-theme-toggle .icon-moon { display: none; }
html.dark .nav-theme-toggle .icon-sun  { display: block; }

.nav-logo {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  line-height: 1;
  letter-spacing: -0.3px;
  white-space: nowrap;
}
.nav-logo img { height: 40px; width: auto; }

.nav-logo-animated { position: relative; display: inline-block; }
.nav-logo-text { display: inline-flex; overflow: hidden; }
.nav-logo-letter {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.6em);
  animation: nav-logo-letter 0.5s cubic-bezier(0.2, 0.8, 0.25, 1) forwards;
}
@keyframes nav-logo-letter {
  to { opacity: 1; transform: translateY(0); }
}
.nav-logo-underline {
  position: absolute;
  left: 50%;
  bottom: -4px;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--brown) 0%, var(--amber) 50%, var(--brown-lt) 100%);
  animation: nav-logo-underline 0.7s ease-out forwards;
}
@keyframes nav-logo-underline {
  to { left: 0; width: 100%; }
}
.nav-logo-static .nav-logo-letter { opacity: 1; transform: none; animation: none; }
.nav-logo-static .nav-logo-underline { left: 0; width: 100%; animation: none; }
.nav-monkey { display: flex; align-items: center; }
.nav-monkey img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }

.nav-subscribe-btn {
  font-size: 13px;
  font-weight: 500;
  background: var(--brown);
  color: #fdf8f2;
  border-radius: 6px;
  padding: 8px 18px;
  text-decoration: none;
  transition: background 0.15s;
  white-space: nowrap;
}
.nav-subscribe-btn:hover { background: var(--brown-lt); }

.nav-signin {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}
.nav-signin:hover { color: var(--text); }

.nav-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border-md);
  border-radius: 6px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  color: var(--muted);
  padding: 0;
}
.nav-hamburger .icon-close { display: none; }
.nav-hamburger.open .icon-burger { display: none; }
.nav-hamburger.open .icon-close { display: block; }

.nav-links-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
  border-top: 1px solid var(--border);
  height: 44px;
}
.nav-links-row a {
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  padding: 0 16px;
  height: 44px;
  display: flex;
  align-items: center;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.nav-links-row a:hover { color: var(--text); }
.nav-links-row a.active {
  color: var(--text);
  font-weight: 500;
  border-bottom-color: var(--text);
}

/* ── Utilities ──────────────────────────────────────────── */
.eyebrow {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1.3px;
  color: var(--amber);
  margin-bottom: 10px;
}
.dot { opacity: 0.35; margin: 0 3px; }

/* ── Hero ───────────────────────────────────────────────── */
.hero-wrap {
  display: grid;
  grid-template-columns: 55fr 45fr;
  gap: 40px;
  align-items: center;
  max-width: var(--max);
  margin: 0 auto;
  padding: 32px var(--pad);
  border-bottom: 1px solid var(--border);
}
.hero-img-col {
  display: block;
  overflow: hidden;
  border-radius: 8px;
  flex-shrink: 0;
}
.hero-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}
.hero-text-col { display: flex; flex-direction: column; gap: 14px; }
.hero-title {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.2px;
  color: var(--text);
}
.hero-title a { text-decoration: none; color: var(--text); }
.hero-title a:hover { color: var(--brown); }
.hero-excerpt {
  font-size: 16px;
  line-height: 1.65;
  color: var(--muted);
}
.hero-meta { font-size: 13px; color: var(--hint); display: flex; align-items: center; gap: 10px; }
.hero-meta-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.hero-meta-text { display: inline; }

/* ── Most Popular ───────────────────────────────────────── */
.popular-section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px var(--pad);
  border-bottom: 1px solid var(--border);
}
.popular-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 20px;
}
.popular-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.popular-viewall {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1px;
  color: var(--hint);
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.popular-viewall:hover { color: var(--muted); }
.popular-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.popular-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 0 20px;
  border-right: 1px solid var(--border);
}
.popular-item:first-child { padding-left: 0; }
.popular-item:last-child { border-right: none; padding-right: 0; }
.popular-text { flex: 1; min-width: 0; }
.popular-title {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text);
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.popular-title a { text-decoration: none; color: var(--text); }
.popular-title a:hover { color: var(--brown); }
.popular-meta { font-size: 12px; color: var(--hint); }
.popular-thumb {
  display: block;
  flex-shrink: 0;
  width: 70px;
  height: 55px;
  border-radius: 6px;
  overflow: hidden;
}
.popular-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ── Content Layout (latest + sidebar) ─────────────────── */
.content-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 0;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
  align-items: start;
}
.content-main {
  padding: 28px 40px 48px 0;
  border-right: 1px solid var(--border);
}
.content-sidebar {
  padding: 28px 0 48px 36px;
  position: sticky;
  top: 110px;
}

/* ── Tab Bar ────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  align-items: center;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}
.tab {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--hint);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px 16px 10px 0;
  margin-right: 8px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s;
}
.tab:first-child { padding-left: 0; }
.tab.active {
  color: var(--text);
  font-weight: 500;
  border-bottom-color: var(--text);
}
.tab:hover { color: var(--muted); }

.latest-grid.tab-panel { display: none; }
.latest-grid.tab-panel.active { display: grid; }
.tab-empty { font-size: 15px; color: var(--muted); padding: 8px 0 24px; grid-column: 1 / -1; }

/* ── Latest Grid ────────────────────────────────────────── */
.latest-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.post-card { display: flex; flex-direction: column; gap: 10px; }
.card-img-wrap {
  display: block;
  overflow: hidden;
  border-radius: 6px;
}
.card-img-empty {
  background: var(--cream);
  height: 140px;
}
.card-img {
  width: 100%;
  height: auto;
  display: block;
}
.card-title {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text);
}
.card-title a { text-decoration: none; color: var(--text); }
.card-title a:hover { color: var(--brown); }
.card-text { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.card-meta { font-size: 12px; color: var(--hint); }

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar-brand { margin-bottom: 16px; }
.sidebar-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 10px;
}
.sidebar-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.sidebar-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 14px;
}
.sidebar-subscribe { margin-bottom: 24px; }
.sidebar-sub-btn {
  display: block;
  font-size: 14px;
  font-weight: 500;
  background: var(--brown);
  color: #fdf8f2;
  border-radius: 6px;
  padding: 10px 20px;
  text-decoration: none;
  text-align: center;
  transition: background 0.15s;
}
.sidebar-sub-btn:hover { background: var(--brown-lt); }
.sidebar-nav { border-top: 1px solid var(--border); padding-top: 20px; }
.sidebar-nav-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}
.sidebar-nav-link {
  display: block;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  padding: 5px 0;
  transition: color 0.15s;
}
.sidebar-nav-link:hover { color: var(--text); }

/* ── Newsletter CTA ─────────────────────────────────────── */
.nl-section {
  max-width: calc(var(--max) - 80px);
  margin: 0 auto 48px;
  padding: 44px 60px;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border-md);
  text-align: center;
}
.nl-eyebrow {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1.3px;
  color: var(--amber);
  margin-bottom: 14px;
}
.nl-title {
  font-family: var(--script);
  font-size: 34px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}
.nl-body {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.65;
  max-width: 440px;
  margin: 0 auto 28px;
}
.nl-btn {
  display: inline-block;
  font-size: 14px;
  font-weight: 500;
  background: var(--brown);
  color: #fdf8f2;
  border-radius: 6px;
  padding: 12px 30px;
  text-decoration: none;
  transition: background 0.15s;
}
.nl-btn:hover { background: var(--brown-lt); }

/* ── Footer ─────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 48px var(--pad) 0;
}
.footer-top {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.6fr;
  gap: 40px;
  padding-bottom: 40px;
}
.footer-brand-col { max-width: 280px; }
.footer-icon { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; margin-bottom: 12px; }
.footer-name { font-family: var(--serif); font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.footer-desc { font-size: 13px; color: var(--muted); line-height: 1.5; margin-bottom: 16px; }
.footer-social { display: flex; gap: 10px; }
.footer-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border-md);
  border-radius: 8px;
  color: var(--muted);
  transition: color 0.15s, border-color 0.15s;
}
.footer-social-link:hover { color: var(--amber); border-color: var(--amber); }
.footer-col-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--hint);
  margin-bottom: 14px;
}
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-links a { font-size: 14px; color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--brown-lt); }
.footer-sub-desc { font-size: 13px; color: var(--muted); line-height: 1.5; margin-bottom: 14px; }
.footer-sub-form { display: flex; gap: 8px; }
.footer-sub-input {
  flex: 1;
  min-width: 0;
  font-family: var(--sans);
  font-size: 14px;
  padding: 10px 12px;
  border: 1px solid var(--border-md);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  outline: none;
}
.footer-sub-input:focus { border-color: var(--amber); }
.footer-sub-input::placeholder { color: var(--hint); }
.footer-sub-btn {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  background: var(--brown);
  color: #fdf8f2;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.footer-sub-btn:hover { background: var(--brown-lt); }
.footer-sub-form.success .footer-sub-input { display: none; }
.footer-sub-form.success::before { content: "Thanks! Check your inbox."; font-size: 13px; color: var(--brown-lt); }
.footer-bottom {
  max-width: var(--max);
  margin: 0 auto;
  border-top: 1px solid var(--border);
  padding: 20px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer-brand { font-size: 13px; color: var(--hint); }
.footer-built { font-size: 13px; color: var(--hint); }

/* ── Post Page ──────────────────────────────────────────── */
.post-full {
  max-width: var(--prose);
  margin: 0 auto;
  padding: 52px 24px 72px;
}
.post-header { margin-bottom: 36px; }
.post-title {
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 600;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 16px;
}
.post-meta { font-size: 13px; color: var(--hint); display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.post-excerpt {
  font-size: 19px;
  line-height: 1.65;
  color: var(--muted);
  font-style: italic;
  border-left: 3px solid var(--cream);
  padding-left: 20px;
  margin-top: 20px;
}
.post-feature-img {
  max-width: 900px;
  margin: 0 auto 52px;
  padding: 0 24px;
}
.post-feature-img img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
}

/* ── Post Content ───────────────────────────────────────── */
.gh-content { font-size: 18px; line-height: 1.8; color: var(--text); }
.gh-content p { margin: 0 0 1.4em; }
.gh-content h2 { font-family: var(--serif); font-size: 26px; font-weight: 600; line-height: 1.25; margin: 2.5em 0 0.6em; }
.gh-content h3 { font-family: var(--serif); font-size: 21px; font-weight: 600; line-height: 1.3; margin: 2em 0 0.5em; }
.gh-content h4 { font-size: 16px; font-weight: 600; margin: 1.8em 0 0.4em; }
.gh-content a { color: var(--brown); text-decoration: underline; text-underline-offset: 2px; }
.gh-content a:hover { color: var(--brown-lt); }
.gh-content strong { font-weight: 600; }
.gh-content blockquote {
  border-left: 3px solid var(--cream);
  padding: 4px 0 4px 24px;
  margin: 2em 0;
  color: var(--muted);
  font-style: italic;
  font-size: 19px;
}
.gh-content code {
  font-family: 'Courier New', monospace;
  font-size: 0.87em;
  background: var(--surface);
  border: 1px solid var(--border-md);
  padding: 2px 7px;
  border-radius: 4px;
  color: var(--brown);
}
.gh-content pre {
  background: var(--surface);
  border: 1px solid var(--border-md);
  border-radius: 8px;
  padding: 22px 26px;
  overflow-x: auto;
  margin: 2em 0;
}
.gh-content pre code { background: none; border: none; padding: 0; font-size: 14px; line-height: 1.65; color: var(--text); }
.gh-content ul, .gh-content ol { padding-left: 1.6em; margin: 0 0 1.4em; }
.gh-content li { margin-bottom: 0.4em; }
.gh-content img { max-width: 100%; border-radius: 8px; margin: 2em 0; }
.gh-content figure { margin: 2em 0; }
.gh-content figcaption { font-size: 13px; color: var(--hint); text-align: center; margin-top: 8px; font-style: italic; }
.gh-content hr { border: none; border-top: 1px solid var(--border); margin: 3em 0; }
.gh-content table { width: 100%; border-collapse: collapse; font-size: 16px; margin: 2em 0; }
.gh-content th { text-align: left; font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--hint); padding: 8px 12px; border-bottom: 1px solid var(--border-md); }
.gh-content td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }

.gh-content .kg-card { margin: 2em 0; }
.gh-content .kg-image-card img { border-radius: 8px; }
.gh-content .kg-width-full {
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  max-width: none;
  width: 100vw;
}
.gh-content .kg-width-wide {
  margin-left: -80px;
  margin-right: -80px;
  max-width: none;
}
.gh-content .kg-bookmark-card { border: 1px solid var(--border-md); border-radius: 8px; overflow: hidden; }
.gh-content .kg-bookmark-container { display: flex; text-decoration: none; color: var(--text); }
.gh-content .kg-bookmark-content { padding: 16px 20px; flex: 1; }
.gh-content .kg-bookmark-title { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.gh-content .kg-bookmark-description { font-size: 13px; color: var(--muted); margin-bottom: 8px; line-height: 1.5; }
.gh-content .kg-bookmark-metadata { font-size: 12px; color: var(--hint); display: flex; align-items: center; gap: 6px; }
.gh-content .kg-bookmark-icon { width: 16px; height: 16px; }
.gh-content .kg-bookmark-thumbnail { width: 140px; flex-shrink: 0; }
.gh-content .kg-bookmark-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.gh-content .kg-callout-card { background: var(--surface); border-left: 3px solid var(--amber); border-radius: 0 8px 8px 0; padding: 18px 22px; display: flex; gap: 14px; }
.gh-content .kg-callout-emoji { font-size: 20px; }
.gh-content .kg-callout-text { font-size: 16px; line-height: 1.65; }

/* ── Post Footer ────────────────────────────────────────── */
/* ── Post subscribe CTA ─────────────────────────────────── */
.post-cta {
  margin-top: 56px;
  padding: 36px 32px;
  background: var(--surface);
  border: 1px solid var(--border-md);
  border-radius: 14px;
  text-align: center;
}
.post-cta-eyebrow { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--amber); margin-bottom: 8px; }
.post-cta-title { font-family: var(--serif); font-size: 26px; font-weight: 600; color: var(--text); line-height: 1.2; margin-bottom: 10px; }
.post-cta-body { font-size: 15px; color: var(--muted); line-height: 1.5; max-width: 420px; margin: 0 auto 22px; }
.post-cta-form { max-width: 440px; margin: 0 auto; }
.post-cta-fields { display: flex; gap: 10px; }
.post-cta-input {
  flex: 1;
  font-family: var(--sans);
  font-size: 15px;
  padding: 12px 16px;
  border: 1px solid var(--border-md);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  outline: none;
  min-width: 0;
}
.post-cta-input:focus { border-color: var(--amber); }
.post-cta-input::placeholder { color: var(--hint); }
.post-cta-btn {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  background: var(--brown);
  color: #fdf8f2;
  border: none;
  border-radius: 8px;
  padding: 12px 22px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.post-cta-btn:hover { background: var(--brown-lt); }
.post-cta-success, .post-cta-error { display: none; font-size: 14px; margin-top: 16px; }
.post-cta-success { color: var(--brown); }
.post-cta-error { color: #c0392b; }
.post-cta-form.success .post-cta-fields { display: none; }
.post-cta-form.success .post-cta-success { display: block; }
.post-cta-form.error .post-cta-error { display: block; }
@media (max-width: 600px) {
  .post-cta { padding: 28px 20px; border-radius: 12px; }
  .post-cta-title { font-size: 22px; }
  .post-cta-fields { flex-direction: column; }
  .post-cta-btn { padding: 12px; }
}

.post-footer { margin-top: 64px; padding-top: 32px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 24px; }
.author-row { display: flex; align-items: center; gap: 14px; }
.author-avatar { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.author-avatar-placeholder { width: 46px; height: 46px; border-radius: 50%; background: var(--cream); display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 600; color: var(--brown); flex-shrink: 0; }
.author-name { font-size: 15px; font-weight: 600; color: var(--text); }
.author-bio { font-size: 13px; color: var(--muted); line-height: 1.5; margin-top: 2px; }
.post-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag-pill { font-size: 12px; color: var(--brown); background: var(--surface); border: 1px solid var(--border-md); border-radius: 999px; padding: 4px 14px; text-decoration: none; }
.tag-pill:hover { background: var(--cream); }

/* ── Reading progress bar ───────────────────────────────── */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
  z-index: 200;
  pointer-events: none;
}
.reading-progress-bar {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--brown), var(--amber));
}

/* ── Table of contents ──────────────────────────────────── */
.post-toc {
  max-width: var(--prose);
  margin: 0 auto 8px;
  padding: 18px 24px;
}
.post-toc-inner, .post-toc {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.post-toc-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--hint);
  margin-bottom: 10px;
}
.post-toc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.post-toc-list a { font-size: 14px; color: var(--muted); text-decoration: none; line-height: 1.4; }
.post-toc-list a:hover { color: var(--brown-lt); }

/* ── Series box ─────────────────────────────────────────── */
.series-box {
  max-width: var(--prose);
  margin: 0 auto 32px;
  padding: 20px 24px;
  border: 1px solid var(--border-md);
  border-radius: 12px;
  background: var(--surface);
}
.series-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--amber);
  margin-bottom: 12px;
}
.series-list { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.series-item a { font-size: 15px; color: var(--muted); text-decoration: none; line-height: 1.4; }
.series-item a:hover { color: var(--brown-lt); }
.series-item.current { color: var(--text); font-weight: 600; }
.series-item.current a { color: var(--text); font-weight: 600; pointer-events: none; }

/* ── Related posts ──────────────────────────────────────── */
.related-posts { max-width: var(--max); margin: 0 auto; padding: 8px var(--pad) 56px; }
.related-title {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 24px;
}
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.related-card { display: flex; flex-direction: column; gap: 10px; }
.related-img-wrap { display: block; border-radius: 10px; overflow: hidden; aspect-ratio: 16/10; background: var(--surface); }
.related-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.related-img-empty { background: var(--cream); }
.related-card-title { font-family: var(--serif); font-size: 17px; font-weight: 600; line-height: 1.3; }
.related-card-title a { color: var(--text); text-decoration: none; }
.related-card-title a:hover { color: var(--brown); }
.related-meta { font-size: 12px; color: var(--hint); }

/* ── Start Here page ────────────────────────────────────── */
.start-here { max-width: var(--max); margin: 0 auto; padding: 52px var(--pad) 72px; }
.start-here-header { max-width: var(--prose); margin: 0 auto 32px; }
.start-here-title { font-family: var(--serif); font-size: 42px; font-weight: 600; letter-spacing: -0.5px; color: var(--text); margin-top: 8px; }
.start-here-intro { max-width: var(--prose); margin: 0 auto 48px; }
.start-here-section { margin-bottom: 52px; }
.start-here-section-title { font-family: var(--serif); font-size: 24px; font-weight: 600; color: var(--text); margin-bottom: 24px; }
.start-here-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.start-here-topics { display: flex; flex-wrap: wrap; gap: 10px; }
.start-here-subscribe { max-width: var(--prose); }

/* ── Post share buttons ─────────────────────────────────── */
.post-share { display: flex; align-items: center; gap: 10px; }
.post-share-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--hint);
  margin-right: 2px;
}
.post-share-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-md);
  border-radius: 8px;
  background: none;
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
}
.post-share-btn:hover { color: var(--amber); border-color: var(--amber); }
.post-share-copied {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  font-size: 11px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
.post-share-copy.copied .post-share-copied { opacity: 1; }

/* ── Post Nav ───────────────────────────────────────────── */
.post-nav { max-width: var(--prose); margin: 0 auto; padding: 0 24px 64px; }
.post-nav-inner { display: flex; justify-content: space-between; gap: 32px; padding-top: 28px; border-top: 1px solid var(--border); }
.nav-prev { max-width: 48%; }
.nav-next { max-width: 48%; text-align: right; margin-left: auto; }
.nav-direction { font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: 1px; color: var(--hint); margin-bottom: 6px; }
.nav-title { font-family: var(--serif); font-size: 15px; font-weight: 500; line-height: 1.4; color: var(--text); text-decoration: none; }
.nav-title:hover { color: var(--brown); }

/* ── Archive pages ──────────────────────────────────────── */
.archive-header { border-bottom: 1px solid var(--border); padding: 48px var(--pad) 32px; }
.archive-header-inner { max-width: var(--max); margin: 0 auto; }
.author-hero-avatar { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; margin-bottom: 14px; }
.archive-title { font-family: var(--serif); font-size: 30px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.archive-desc { font-size: 15px; color: var(--muted); line-height: 1.6; }
.archive-grid { max-width: var(--max); margin: 0 auto; padding: 40px var(--pad); display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }

/* ── Pagination ─────────────────────────────────────────── */
.pagination { max-width: var(--max); margin: 0 auto; padding: 8px var(--pad) 52px; display: flex; justify-content: center; align-items: center; gap: 12px; }
.pagination a { font-size: 14px; color: var(--brown); text-decoration: none; padding: 8px 18px; border: 1px solid var(--border-md); border-radius: 6px; }
.pagination a:hover { background: var(--surface); }
.pagination .page-number { font-size: 13px; color: var(--hint); }

/* ── Page / Error ───────────────────────────────────────── */
.page-full { max-width: var(--prose); margin: 0 auto; padding: 52px 24px 72px; }
.page-title { font-family: var(--serif); font-size: 36px; font-weight: 600; margin-bottom: 36px; color: var(--text); }
.error-page { max-width: var(--prose); margin: 80px auto; padding: 0 24px; text-align: center; }
.error-monkey { width: 180px; height: auto; margin: 0 auto 8px; display: block; }
.error-code { font-family: var(--script); font-size: 100px; font-weight: 700; color: var(--cream); line-height: 1; margin-bottom: 16px; }
.error-title { font-family: var(--serif); font-size: 28px; font-weight: 600; color: var(--text); margin-bottom: 12px; }
.error-desc { font-size: 16px; color: var(--muted); margin-bottom: 28px; }
.error-popular { list-style: none; margin: 0 auto 32px; padding: 0; max-width: 440px; text-align: left; }
.error-popular li { padding: 10px 0; border-bottom: 1px solid var(--border); }
.error-popular li:last-child { border-bottom: none; }
.error-popular a { font-family: var(--serif); font-size: 16px; color: var(--text); text-decoration: none; }
.error-popular a:hover { color: var(--brown); }
.read-more { font-size: 14px; font-weight: 500; color: var(--brown); text-decoration: none; }
.read-more:hover { text-decoration: underline; }

/* ── List section (counter) ─────────────────────────────── */
.list-section { counter-reset: list-counter; max-width: var(--max); margin: 0 auto; padding: 40px var(--pad) 0; }
.list-item { counter-increment: list-counter; display: flex; gap: 20px; align-items: flex-start; padding: 20px 0; border-bottom: 1px solid var(--border); }
.list-num { font-size: 13px; color: var(--hint); min-width: 22px; padding-top: 2px; flex-shrink: 0; }
.list-num::before { content: counter(list-counter); }
.list-body { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.list-title { font-family: var(--serif); font-size: 16px; font-weight: 500; line-height: 1.38; color: var(--text); }
.list-title a { text-decoration: none; color: var(--text); }
.list-title a:hover { color: var(--brown); }
.list-thumb { display: block; width: 88px; height: 66px; border-radius: 8px; overflow: hidden; flex-shrink: 0; border: 1px solid var(--border); }
.list-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 1024px) {
  .hero-wrap { grid-template-columns: 1fr 1fr; gap: 28px; }
  .popular-grid { grid-template-columns: repeat(2, 1fr); }
  .popular-item:nth-child(2) { border-right: none; }
  .popular-item:nth-child(3) { padding-left: 0; border-top: 1px solid var(--border); padding-top: 16px; margin-top: 4px; }
  .popular-item:nth-child(4) { border-top: 1px solid var(--border); padding-top: 16px; margin-top: 4px; }
  .content-layout { grid-template-columns: 1fr 260px; }
}

@media (max-width: 900px) {
  :root { --pad: 24px; }
  .nav-top { height: 56px; }
  .hero-wrap { grid-template-columns: 1fr; }
  .hero-img-col { order: -1; }
  .content-layout { grid-template-columns: 1fr; }
  .content-main { border-right: none; padding-right: 0; }
  .content-sidebar { padding-left: 0; border-top: 1px solid var(--border); padding-top: 32px; position: static; }
  .latest-grid { grid-template-columns: repeat(2, 1fr); }
  .archive-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-links-row { justify-content: flex-start; }
  .nav-signin { display: none; }
}

@media (max-width: 600px) {
  :root { --pad: 16px; }

  /* Nav */
  .nav-logo { font-size: 20px; }
  .nav-subscribe-btn { display: none; }
  .nav-signin { display: none; }
  .nav-top-right { gap: 8px; }
  .nav-monkey img { width: 30px; height: 30px; }
  .nav-hamburger { display: flex; }
  .nav-icon-btn,
  .nav-theme-toggle,
  .nav-hamburger { width: 34px; height: 34px; border: 1px solid var(--border-md); border-radius: 6px; }
  .nav-links-row {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    z-index: 200;
    height: auto;
    padding: 8px 0;
  }
  .nav-links-row.open { display: flex; }
  .nav-links-row a { height: 48px; padding: 0 var(--pad); font-size: 16px; border-bottom: 1px solid var(--border); justify-content: flex-start; }
  .nav-links-row a:last-child { border-bottom: none; }
  .nav-links-row a.active { color: var(--amber); }

  /* Hero: stack image above text, full width */
  .hero-wrap { grid-template-columns: 1fr; gap: 16px; padding: 20px var(--pad); }
  .hero-img-col { border-radius: 8px; overflow: hidden; }
  .hero-title { font-size: 22px; line-height: 1.25; }
  .hero-excerpt { font-size: 14px; }
  .hero-meta { font-size: 12px; }

  /* Popular: single column, horizontal card layout */
  .popular-grid { grid-template-columns: 1fr; gap: 0; }
  .popular-item {
    display: grid;
    grid-template-columns: 1fr 64px;
    gap: 12px;
    align-items: center;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
    margin: 0;
  }
  .popular-item:last-child { border-bottom: none; }
  .popular-item:nth-child(3),
  .popular-item:nth-child(4) { border-top: none; padding-top: 12px; margin-top: 0; }
  .popular-thumb { width: 64px; height: 64px; }
  .popular-thumb img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; }
  .popular-title { font-size: 13px; }
  .popular-meta { font-size: 11px; }
  .popular-label { font-size: 11px; }

  /* Latest + Archive: single column, horizontal card rows */
  .latest-grid { grid-template-columns: 1fr; gap: 0; }
  .archive-grid { grid-template-columns: 1fr; gap: 0; }
  .post-card {
    display: flex;
    flex-direction: row;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
  }
  .card-img-wrap {
    width: 80px;
    height: 70px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
  }
  .card-img { width: 80px; height: 70px; object-fit: cover; }
  .card-img-empty { width: 80px; height: 70px; flex-shrink: 0; }
  .post-card .eyebrow { font-size: 10px; margin-bottom: 4px; }
  .card-title { font-size: 14px; line-height: 1.3; margin-bottom: 4px; }
  .card-meta { font-size: 11px; }

  /* Sidebar: compact on mobile */
  .content-sidebar { padding-top: 24px; }
  .sidebar-brand { padding: 16px; }
  .sidebar-nav { display: none; }

  /* Post */
  .post-full { padding: 24px var(--pad) 48px; }
  .gh-content { font-size: 17px; }
  .post-title { font-size: 26px; line-height: 1.2; }
  .post-nav-inner { flex-direction: column; gap: 16px; }
  .nav-next { text-align: left; margin-left: 0; max-width: 100%; }

  .related-grid { grid-template-columns: 1fr; gap: 20px; }
  .related-card { flex-direction: row; }
  .related-img-wrap { width: 96px; aspect-ratio: 1; flex-shrink: 0; }
  .related-card-title { font-size: 15px; }
  .start-here-title { font-size: 32px; }
  .start-here-grid { grid-template-columns: 1fr; gap: 18px; }
  .post-toc { padding: 16px 18px; }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 28px; }
  .footer-brand-col { grid-column: 1 / -1; max-width: 100%; }
  .footer-subscribe-col { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
}
