/* ===================================================
   GPLetters Ghost Theme — screen.css
   =================================================== */

/* --- Custom Properties --- */
:root {
  --bg:           #120F39;
  --bg-card:      #120F39;
  --bg-dark:      #120F39;
  --bg-nav:       #120F39;
  --fg:           #E4D5A1;
  --fg-muted:     #c4b782;
  --fg-light:     #E4D5A1;
  --fg-light-dim: #8FA0D8;
  --border:       rgba(143, 160, 216, 0.25);
  --primary:      #CC4011;
  --primary-dim:  rgba(204, 64, 17, 0.55);
  --primary-soft: rgba(204, 64, 17, 0.12);

  --font-sans:  'Hanken Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'Barlow', sans-serif;
  --font-body:  'Hanken Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:  'IBM Plex Mono', 'Courier New', monospace;

  --radius: 0px;
  --container: 1280px;
  --header-h: 72px;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  background-color: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 1.125rem; /* body: 18px */
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a { color: inherit; text-decoration: none; }

/* --- Header --- */
.site-header {
  background: transparent;
  border-bottom: none;
}

.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 2rem;
  height: 7rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 2rem;
}

.header-spacer { grid-column: 1; }

.site-logo-link {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-right {
  grid-column: 3;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2rem;
}
.site-logo { height: 5rem; width: auto; display: block; }

.site-title {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--fg);
  transition: color 0.2s;
  flex-shrink: 0;
}
.site-title:hover { color: var(--primary); }

.site-nav { display: flex; align-items: center; gap: 2rem; }

.nav-subscribe-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 1.25rem;
  background: #CC4011;
  color: #fff !important;
  border: 2px solid hsl(15, 75%, 32%);
  font-size: 0.875rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none !important;
  transition: opacity 0.2s;
  white-space: nowrap;
}
.nav-subscribe-btn:hover { opacity: 0.9; }

.site-nav .nav a,
.site-nav a {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.75);
  transition: color 0.2s;
}
.site-nav .nav a:hover,
.site-nav a:hover { color: #fff; }

/* Ghost outputs <ul class="nav"> inside {{navigation}} */
.nav { display: flex; align-items: center; gap: 2rem; list-style: none; }

.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.mobile-menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--fg);
  transition: all 0.2s;
}

.mobile-nav {
  display: none;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--border);
  padding: 0.5rem 2rem 1rem;
}
.mobile-nav.is-open { display: flex; }
.mobile-nav .nav { flex-direction: column; align-items: flex-start; gap: 0; }
.mobile-nav .nav a,
.mobile-nav a {
  display: block;
  padding: 0.6rem 0;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

/* --- Hero Section --- */
.hero {
  display: flex;
  align-items: stretch;
  min-height: 100vh;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background: var(--bg-dark);
  position: relative;
  cursor: pointer;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 5%;
  right: 5%;
  height: 2px;
  background: #FAF7CC;
  z-index: 2;
}

.hero-text {
  flex: 1;
  padding: 2rem 4rem 6rem 5%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
}

.hero-tag {
  font-family: var(--font-mono);
  font-size: 0.875rem; /* kicker: 12px mono */
  font-weight: 500;
  letter-spacing: 0.22em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 1.25rem;
}

.hero-title-link { display: block; }
.hero-title-link:hover .hero-title { color: var(--primary); }

/* Stretch title link to make the whole hero clickable */
.hero-title-link::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* Keep image wrap above the overlay so image link still works */
.hero-image-wrap {
  position: relative;
  z-index: 1;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.969rem, 6.875vw, 5rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--fg-light);
  margin-bottom: 6.25rem;
  transition: color 0.2s;
}

.hero-excerpt {
  font-size: 1.72rem; /* lede +25%: 27.5px */
  font-weight: 400;
  color: var(--fg-light-dim);
  line-height: 1.5;
  letter-spacing: 0;
  max-width: 600px;
  margin-top: 0;
  margin-bottom: 2rem;
}

.hero-byline { display: flex; flex-direction: column; gap: 0.25rem; }

.hero-author {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--fg-light);
}

.hero-photo-credit {
  font-size: 0.825rem;
  color: var(--fg-light-dim);
}

.hero-image-wrap {
  position: relative;
  flex-shrink: 0;
  width: 50%;
  display: block;
  overflow: hidden;
}

.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-image-overlay {
  display: none;
}

.hero-image-wrap--placeholder {
  background: var(--border);
}

/* --- Home Feed --- */
/* --- Home Sections --- */
.home-latest {
  background: #FAF7CC;
  border-bottom: 1px solid hsl(47, 30%, 60%);
}

.home-latest .section-heading {
  color: #120F39;
  font-size: 2.25rem;
}

.home-latest .post-card-title {
  color: #120F39;
}

.home-latest .post-card-title:hover {
  color: #CC4011;
}

.home-latest .post-card-excerpt {
  color: #000;
  opacity: 1;
  font-size: 1.3rem;
}

/* Latest Letters — card boxes */
.home-latest .post-card {
  position: relative;
  background: transparent;
  border: none;
  padding-bottom: 0;
  gap: 0;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.15s;
  cursor: pointer;
}

.home-latest .post-card:last-of-type {
  border-right: none;
}

.home-latest .post-card:hover {
  box-shadow: 0 6px 24px rgba(18, 15, 57, 0.13);
  transform: translateY(-2px);
}

/* Image flush to top of card */
.home-latest .post-card-image-wrap {
  margin-bottom: 0;
}

/* Pad the text content */
.home-latest .post-card-content {
  padding: 1.25rem 1.5rem 1.5rem;
}

/* Stretch the title link to cover the whole card */
.home-latest .post-card .post-card-content > a {
  position: static;
}
.home-latest .post-card .post-card-content > a::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* Keep tag + author links above the overlay */
.home-latest .post-card .post-card-tag,
.home-latest .post-card .post-card-author,
.home-latest .post-card .post-card-image-wrap {
  position: relative;
  z-index: 1;
}

/* Title size for 3-col layout */
.home-latest .post-card-title {
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: 2rem;
  border-bottom: 1px dashed rgba(18, 15, 57, 0.35);
  padding-bottom: 0.6rem;
  margin-bottom: 0.6rem;
}

.home-latest .post-card-tag {
  color: #CC4011;
}

.home-latest .post-card-author,
.home-latest .post-card-date {
  color: #120F39;
}

.home-section-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 4rem 2rem;
}

.home-latest .home-section-inner {
  max-width: none;
  padding: 3rem 1.5rem;
}

.home-popular {
  background: #120F39;
  border-bottom: 1px solid rgba(143, 160, 216, 0.25);
}

.home-newsletter {
  padding: 5rem 2rem;
}

.home-newsletter-inner {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.home-newsletter-heading {
  font-family: var(--font-sans);
  font-size: 2.25rem; /* H2: 36px */
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: 0;
  margin-bottom: 0.75rem;
}

.home-newsletter-sub {
  font-size: 0.95rem;
  color: var(--fg-muted);
  margin-bottom: 2rem;
}

.newsletter-form--centered {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 480px;
  margin: 0 auto;
}

/* --- Letters Grid (3-col: 2 articles + subscribe in row 1; 3 articles in row 2) --- */
.letters-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}
/* Pin subscribe box to row 1, col 3 so posts auto-fill around it */
.letters-grid .subscribe-box {
  grid-column: 3;
  grid-row: 1;
}

/* --- Popular Grid (2-col text-only) --- */
.popular-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
}

.popular-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.75rem 2rem;
  border-bottom: 1px solid rgba(228, 213, 161, 0.15);
  border-right: 1px solid rgba(228, 213, 161, 0.15);
}
.popular-card:nth-child(even) { border-right: none; }
.popular-card:nth-last-child(-n+2) { border-bottom: none; }

.popular-card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.rising-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
}

.popular-card-title {
  font-family: var(--font-sans);
  font-size: 2.25rem; /* H2: 36px */
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: 0;
  color: #8FA0D8;
  transition: color 0.2s;
}
.popular-card a:hover .popular-card-title { color: #fff; }

.popular-card-excerpt {
  font-size: 1.125rem; /* body: 18px */
  line-height: 1.65;
  color: #E4D5A1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.popular-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(228, 213, 161, 0.15);
}

.popular-card-author-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.popular-card-stats {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.popular-stat {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.875rem;
  color: #E4D5A1;
}

.home-popular .section-heading,
.home-popular .post-card-tag,
.home-popular .post-card-author,
.home-popular .post-card-date {
  color: #E4D5A1;
}
.home-popular .section-heading {
  border-color: var(--primary);
  font-size: 2.25rem;
}
.home-popular .post-card-author,
.home-popular .post-card-date {
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}

/* --- Subscribe Box (3rd column) --- */
.subscribe-box {
  background: var(--bg-dark);
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 320px;
}

.subscribe-box-label {
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 1.25rem;
}

.subscribe-box-heading {
  font-family: var(--font-sans);
  font-size: 2.25rem; /* H2: 36px */
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: 0;
  color: var(--fg-light);
  margin-bottom: 1rem;
}

.subscribe-box-sub {
  font-size: 1.25rem;
  line-height: 1.65;
  color: var(--fg-light-dim);
  margin-bottom: 2rem;
}

.subscribe-box-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.subscribe-box-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.25);
  color: var(--fg-light);
  outline: none;
  transition: border-color 0.2s;
}
.subscribe-box-input::placeholder { color: var(--fg-light-dim); }
.subscribe-box-input:focus { border-color: var(--primary); }

.subscribe-box-btn {
  width: 100%;
  padding: 1rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 0;
  cursor: pointer;
  transition: opacity 0.2s;
}
.subscribe-box-btn:hover { opacity: 0.9; }

.section-heading {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 900;
  line-height: 1.3;
  letter-spacing: -0.01em;
  border-bottom: 4px solid var(--primary);
  padding-bottom: 0.5rem;
  display: inline-block;
  margin-bottom: 2.5rem;
}

/* --- Post List --- */
.post-list { display: flex; flex-direction: column; gap: 3rem; }

/* --- Post Card --- */
.post-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border-bottom: 1px solid hsla(22, 70%, 22%, 0.5);
  padding-bottom: 2rem;
}
.post-card:last-child { border-bottom: none; }

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.post-card-tag {
  font-family: var(--font-mono);
  font-size: 0.875rem; /* kicker: 12px mono */
  font-weight: 500;
  letter-spacing: 0.22em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--primary);
  transition: opacity 0.2s;
}
.post-card-tag:hover { opacity: 0.7; }

.post-card-meta-sep {
  font-size: 0.875rem;
  color: hsla(25, 15%, 68%, 0.5);
}

.post-card-reading-time {
  font-size: 0.875rem;
  color: var(--fg-muted);
}

.post-card-image-wrap {
  display: block;
  overflow: hidden;
  margin-bottom: 1rem;
}
.post-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}
.post-card:hover .post-card-image { transform: scale(1.04); }

.post-card-title {
  font-family: var(--font-sans);
  font-size: 2.25rem; /* H2: 36px */
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: 0;
  color: var(--fg);
  transition: color 0.2s;
}
.post-card a:hover .post-card-title { color: var(--primary); }

.post-card-excerpt {
  font-size: 1.125rem; /* body: 18px */
  color: var(--fg-muted);
  line-height: 1.65;
}

.post-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid hsla(22, 70%, 22%, 0.3);
}

.post-card-author-wrap { display: flex; flex-direction: column; gap: 0.1rem; }

.post-card-author {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--fg);
}

.post-card-author-title {
  font-size: 0.875rem;
  color: var(--fg-muted);
}

.post-card-date {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}


/* --- Newsletter Form --- */
.newsletter-form { display: flex; flex-direction: column; gap: 0.75rem; }

.newsletter-input {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 0.75rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}
.newsletter-input::placeholder { color: var(--fg-muted); }
.newsletter-input:focus { border-color: var(--primary); }

.newsletter-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.2s;
}
.newsletter-btn:hover { opacity: 0.85; }

.newsletter-success,
.newsletter-error { font-size: 0.85rem; margin-top: 0.25rem; }
.newsletter-success { color: var(--primary); }
.newsletter-error { color: hsl(0, 84%, 60%); }

/* --- Pagination --- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2rem 0 0;
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  font-size: 0.825rem;
  color: var(--fg-muted);
}

.pagination .newer-posts,
.pagination .older-posts {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: 0.04em;
  transition: color 0.2s;
}
.pagination a:hover { color: var(--primary); }

/* --- Post Page --- */
.post-page {
  width: 100%;
  background: #FAF7CC;
  color: #231f1a;
  min-height: 60vh;
}

.post-page-header {
  max-width: 820px;
  margin: 0 auto;
  padding: 4rem 2rem 2rem;
}

.post-page-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  color: #120F39;
  margin-bottom: 1rem;
}

.post-page-excerpt {
  font-size: 1.15rem;
  color: #231f1a;
  line-height: 1.6;
}

.post-page-image {
  max-width: 820px;
  margin: 0 auto 2rem;
  padding: 0 2rem;
}
.post-page-image img { width: 100%; border-radius: 4px; }

.post-page-content {
  max-width: 820px;
  margin: 0 auto;
  padding: 2rem 2rem 6rem;
  font-size: 1.125rem;
  line-height: 1.75;
  color: #231f1a;
}

.post-page-content h1,
.post-page-content h2,
.post-page-content h3,
.post-page-content h4 {
  font-family: var(--font-serif);
  color: #120F39;
  margin: 2rem 0 0.75rem;
}

.post-page-content a { color: var(--primary); }
.post-page-content a:hover { text-decoration: underline; }

.post-wrap { max-width: 820px; margin: 0 auto; padding: 0 2rem; }

/* Dark header section */
.post-header-section {
  background: var(--bg-card);
  color: var(--fg);
  padding-bottom: 3rem;
}

.post-header {
  max-width: 820px;
  margin: 0 auto;
  padding: 4rem 0 0;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}

.post-tag,
.post-card-tag,
.popular-card-meta .post-card-tag {
  display: none;
}

.post-meta-sep { color: var(--border); }

.post-date,
.post-reading-time {
  font-family: var(--font-sans);
  font-size: 1.035rem;
  font-weight: 400;
  color: #231f1a;
}

.post-title {
  font-family: var(--font-serif);
  font-size: clamp(2.672rem, 6.1875vw, 4.5rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--fg);
  margin-bottom: 2.645rem;
}

.post-excerpt {
  font-size: 1.55rem;
  font-weight: 400;
  color: var(--fg-muted);
  line-height: 1.5;
  letter-spacing: 0;
  margin-bottom: 2rem;
  border-left: 3px solid var(--primary);
  padding-left: 1.25rem;
}

.post-byline {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

/* Dark-header posts: tan author + date to match section text */
.post-header-section .author-name {
  color: #E4D5A1;
}
.post-header-section .post-date {
  color: #E4D5A1;
  margin-left: auto;
}


.author-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.author-avatar-placeholder {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.author-info { display: flex; flex-direction: column; gap: 0.15rem; }

.author-name {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.035rem;
  color: #231f1a;
}

.author-title { font-family: var(--font-sans); font-size: 0.8rem; color: var(--fg-muted); }

/* Light body section */
.post-body-section {
  background: #FAF7CC;
  color: #231f1a;
}

.post-feature-image {
  width: 100%;
  margin: 0 0 3rem;
  overflow: hidden;
  position: relative;
}
.post-feature-image img { width: 100%; height: auto; display: block; }

.photo-credit {
  flex: 1;
  text-align: center;
  color: var(--fg-muted);
  font-size: 1.035rem;
  font-family: var(--font-sans);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.4;
}

/* --- Tag: Profile (light hero variant) --- */
/* Ghost adds tag-profile to <body> when primary tag slug is "profile" */
.tag-profile .post-header-section {
  background: #FAF7CC;
  color: #120F39;
  border-bottom: 1px solid rgba(18, 15, 57, 0.12);
}

.tag-profile .post-title {
  color: #120F39;
}

.tag-profile .post-excerpt {
  color: hsl(232, 35%, 38%);
  font-weight: 600;
  border-left-color: var(--primary);
}

.tag-profile .post-byline {
  border-top-color: rgba(18, 15, 57, 0.15);
}

.tag-profile .author-name {
  color: #231f1a;
  font-weight: 700;
}

.tag-profile .author-title,
.tag-profile .post-reading-time {
  color: hsl(232, 35%, 50%);
}

.tag-profile .post-date {
  color: #231f1a;
  font-weight: 400;
  margin-left: auto;
}

.tag-profile .photo-credit {
  color: hsl(232, 35%, 50%);
}

.tag-profile .post-meta-sep {
  color: rgba(18, 15, 57, 0.25);
}

/* --- Post Engagement Bar --- */
.post-engagement-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 0;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid hsl(24, 40%, 80%);
}

.engagement-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.engagement-right {
  display: flex;
  align-items: center;
}

.engagement-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  border: 1.5px solid hsl(24, 40%, 72%);
  background: transparent;
  color: #231f1a;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  white-space: nowrap;
}

.engagement-btn:hover {
  border-color: #CC4011;
  color: #CC4011;
}

.engagement-btn.is-liked {
  border-color: #CC4011;
  background: #CC4011;
  color: #8FA0D8;
}

.engagement-btn.is-liked .like-heart path {
  fill: currentColor;
  stroke: currentColor;
}

/* Light hero variant (Profile posts) keeps same bar styling */
.tag-profile .post-engagement-bar {
  border-bottom-color: hsl(24, 40%, 78%);
}

/* --- Post Content (Typography) --- */
.post-content {
  max-width: 720px;
  margin: 0 auto;
  font-family: var(--font-body);
  font-size: 1.302rem; /* body +15.5%: ~20.8px */
  font-weight: 400;
  line-height: 1.485;
  color: #231f1a;
}

.post-content p { margin-bottom: 1.4em; }

.post-content > p:first-of-type::first-letter {
  float: left;
  font-family: var(--font-serif);
  font-size: 5.2em;
  font-weight: 700;
  line-height: 0.82;
  color: var(--primary);
  margin-right: 0.08em;
  margin-top: 0.06em;
}

.post-opener-words {
  color: #CC4011;
  font-weight: 700;
}

.post-content h2 {
  font-family: var(--font-sans);
  font-size: 2.25rem; /* H2: 36px */
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: 0;
  margin: 2.5em 0 0.75em;
  color: #120F39;
}

.post-content h3 {
  font-family: var(--font-sans);
  font-size: 1.5rem; /* H3: 24px */
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0;
  margin: 2em 0 0.6em;
  color: #120F39;
}

.post-content a { color: var(--primary); text-decoration: underline; text-decoration-thickness: 1px; }
.post-content a:hover { opacity: 0.8; }

.post-content blockquote,
.post-content .kg-pullquote-card {
  border-left: 5px solid var(--primary);
  padding: 1.5rem 2.5rem 1.5rem 3.5rem;
  margin: 1.125em -2rem;
  font-family: var(--font-serif);
  font-size: 1.6875rem;
  font-weight: 700;
  font-style: normal;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: #120F39 !important;
  background: rgba(143, 160, 216, 0.15);
}

.post-content ul, .post-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.75em;
}
.post-content li { margin-bottom: 0.5em; }

.post-content strong { font-weight: 700; color: #231f1a; }
.post-content em { font-style: italic; }

.post-content pre {
  background: hsl(24, 55%, 88%);
  border: 1px solid hsl(24, 40%, 78%);
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.6;
  margin-bottom: 1.75em;
  color: #1c0c03;
}

.post-content code {
  background: hsl(24, 55%, 88%);
  padding: 0.15em 0.4em;
  font-size: 0.875em;
  border: 1px solid hsl(24, 40%, 78%);
  color: #1c0c03;
}

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

.post-content hr {
  border: none;
  border-top: 2px solid #8FA0D8;
  margin: 3em 0;
}

.post-content img { max-width: 100%; margin: 2em auto; }
/* Cancel the global image margin for images inside figures */
.post-content figure img { margin: 0; display: block; }

.post-content figure { margin: 2em 0; }
.post-content figcaption {
  font-size: 1rem; /* caption: 16px */
  font-weight: 600;
  font-style: normal;
  line-height: 1.45;
  color: #8FA0D8;
  text-align: center;
  margin-top: 1.25rem; /* ~20px */
  letter-spacing: 0.02em;
}

/* Ghost card styles */
.gh-content .kg-card { margin: 2em 0; }

/* --- Ghost Paywall / Upgrade CTA --- */
.gh-post-upgrade-cta {
  background: #CC4011 !important;
  border-radius: 4px;
  margin: 3em 0;
}
.gh-post-upgrade-cta-content {
  background: transparent !important;
  padding: 2.5rem 2rem !important;
}
.gh-post-upgrade-cta-content h2 {
  font-family: var(--font-serif);
  font-weight: 700;
  color: #fff !important;
  font-size: 0 !important;
  line-height: 0 !important;
  margin-bottom: 0 !important;
}
.gh-post-upgrade-cta-content h2::after {
  content: "Keep reading for free by joining GPLetters";
  display: block;
  font-size: 1.5rem;
  line-height: 1.3;
  margin-bottom: 1.5rem;
}
.gh-post-upgrade-cta-content a.gh-post-upgrade-cta-action {
  background: #fff !important;
  color: #CC4011 !important;
  font-family: var(--font-sans);
  font-weight: 800 !important;
  letter-spacing: 0.08em !important;
  border-radius: 2px !important;
  border: none !important;
}
.gh-post-upgrade-cta-content a.gh-post-upgrade-cta-action:hover {
  opacity: 0.9;
}
.gh-post-upgrade-cta-content p,
.gh-post-upgrade-cta-content p a {
  color: rgba(255,255,255,0.8) !important;
}
.gh-post-upgrade-cta-content p a {
  text-decoration: underline !important;
}

/* Required Ghost width classes */
.kg-width-wide {
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  width: min(85vw, 1200px);
  margin-top: 2em;
  margin-bottom: 2em;
}

.kg-width-full {
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  margin-top: 2em;
  margin-bottom: 2em;
}

.kg-width-wide img,
.kg-width-full img {
  width: 100%;
  height: auto;
  display: block;
  max-width: none;
}
.gh-content .kg-image { max-width: 100%; }
.gh-content .kg-image-card img { width: 100%; }
.gh-content .kg-embed-card { display: flex; justify-content: center; }
.gh-content .kg-bookmark-card {
  border: 1px solid hsl(24, 40%, 78%);
  background: hsl(24, 55%, 88%);
  overflow: hidden;
}
.gh-content .kg-bookmark-container { display: flex; flex-direction: row; }
.gh-content .kg-bookmark-content { padding: 1.25rem; flex: 1; }
.gh-content .kg-bookmark-title { font-weight: 600; color: #1c0c03; margin-bottom: 0.3rem; }
.gh-content .kg-bookmark-description { font-size: 0.85rem; color: hsl(0, 35%, 35%); }
.gh-content .kg-callout-card {
  display: block;
  position: relative;
  margin: 2.25em -2rem;
  padding: 2rem 2.5rem 2rem 3.5rem;
  background: rgba(143, 160, 216, 0.15);
  border: none;
  border-left: 5px solid var(--primary);
  border-radius: 0 !important;
  color: #120F39 !important;
}

.gh-content .kg-callout-emoji {
  display: none;
}

.gh-content .kg-callout-text {
  font-family: var(--font-serif) !important;
  font-size: 1.6875rem !important;
  font-style: normal !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
  color: #120F39 !important;
  letter-spacing: -0.01em !important;
}

.gh-content .kg-callout-text::before {
  display: none;
}

/* --- Post Footer --- */
.post-footer {
  max-width: 720px;
  margin: 3rem auto 3rem;
  padding-top: 2rem;
  border-top: 1px solid hsl(24, 40%, 80%);
}

.post-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 2.5rem; }

.post-tag-pill {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #1c0c03;
  border: 1px solid hsl(24, 40%, 72%);
  padding: 0.3rem 0.75rem;
  transition: border-color 0.2s, color 0.2s;
}
.post-tag-pill:hover { border-color: var(--primary); color: var(--primary); }

.post-author-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: #CC4011;
  border: none;
  padding: 1.75rem;
}

.author-card-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.3);
}

.author-card-label {
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.65);
  margin-bottom: 0.25rem;
}

.author-card-name {
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  display: block;
  margin-bottom: 0.4rem;
  transition: color 0.2s;
  text-decoration: none;
}
.author-card-name:hover { color: #E4D5A1; }

.author-card-bio { font-size: 0.875rem; color: rgba(255,255,255,0.85); line-height: 1.6; }

/* ── Related Posts ── */
.related-posts-section {
  background: #120F39;
  border-top: 2px solid var(--primary);
  padding: 4rem 2rem 5rem;
}

.related-posts-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.related-posts-label {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--primary);
}

.related-posts-category {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 800;
  color: #E4D5A1;
  line-height: 1;
}

.related-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
}

.related-post-card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(228, 213, 161, 0.2);
}

.related-post-date {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(228, 213, 161, 0.45);
}

.related-post-link {
  text-decoration: none;
}

.related-post-title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.25;
  color: #E4D5A1;
  transition: color 0.15s ease;
}

.related-post-link:hover .related-post-title {
  color: var(--primary);
}

.related-post-excerpt {
  font-family: var(--font-sans);
  font-size: 1.125rem;
  line-height: 1.6;
  color: rgba(143, 160, 216, 0.9);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- Tag Page --- */
.tag-page { max-width: var(--container); margin: 0 auto; padding: 0 2rem 6rem; }

.tag-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  margin: 0 -2rem 3rem;
  padding: 0 2rem;
}

.tag-header-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 3rem 0;
}

.tag-image {
  width: 100px;
  height: 100px;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}

.tag-label {
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--primary);
  display: block;
  margin-bottom: 0.5rem;
}

.tag-title {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--fg);
  margin-bottom: 0.5rem;
}

.tag-description { font-size: 1rem; color: var(--fg-muted); max-width: 560px; }

.tag-count { font-size: 0.825rem; color: var(--fg-muted); margin-top: 0.5rem; }

.tag-feed { max-width: 820px; }

/* --- Author Page --- */
.author-page { max-width: var(--container); margin: 0 auto; padding: 0 2rem 6rem; }

.author-header {
  background: #CC4011;
  margin: 0 -2rem 3rem;
  padding: 0 2rem;
}

.author-header-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 3rem;
  padding: 3rem 0;
}

.author-header-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-shrink: 0;
}

.author-header-right {
  border-left: 1px solid rgba(255,255,255,0.25);
  padding-left: 3rem;
}

.author-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 3px solid rgba(255,255,255,0.35);
}

.author-page-label {
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.65);
  display: block;
  margin-bottom: 0.5rem;
}

.author-page-name {
  font-family: var(--font-serif);
  font-size: 3rem;
  font-weight: 800;
  color: #120F39;
  margin-bottom: 0.5rem;
}

.author-page-bio {
  font-size: 1.2rem;
  color: rgba(255,255,255,0.85);
  max-width: 560px;
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

.author-page-count {
  font-size: 0.825rem;
  color: rgba(255,255,255,0.65);
  margin-top: 0.25rem;
}

.author-page-website {
  display: inline-block;
  font-size: 0.825rem;
  color: #E4D5A1;
  margin-top: 0.5rem;
  text-decoration: none;
  transition: color 0.2s;
}
.author-page-website:hover { color: #fff; }

.author-feed { max-width: 820px; }

/* --- Error Page --- */
.error-page {
  min-height: calc(100vh - var(--header-h));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
}

.error-code {
  font-family: var(--font-serif);
  font-size: 7rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 1rem;
}

.error-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.error-message { color: var(--fg-muted); margin-bottom: 2rem; }

.error-home-link {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.75rem 2rem;
  transition: opacity 0.2s;
}
.error-home-link:hover { opacity: 0.85; }

/* --- Footer --- */
.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
}

.footer-inner { max-width: var(--container); margin: 0 auto; padding: 0 2rem; }

/* Subscribe banner */
.footer-subscribe-banner {
  background: hsla(232, 46%, 39%, 0.06);
  border-bottom: 1px solid hsla(232, 46%, 39%, 0.15);
  padding: 5rem 0;
}

.footer-subscribe-inner {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}

.footer-subscribe-label {
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 1rem;
}

.footer-subscribe-heading {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--fg);
  margin-bottom: 0.75rem;
}

.footer-subscribe-sub {
  font-size: 1.25rem;
  color: var(--fg-muted);
  margin-bottom: 2rem;
  line-height: 1.6;
}

.footer-subscribe-form {
  display: flex;
  gap: 0;
  max-width: 540px;
  margin: 0 auto;
}

.footer-subscribe-input {
  flex: 1;
  height: 3.5rem;
  padding: 0 1.25rem;
  font-size: 1rem;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-right: none;
  color: var(--fg);
  outline: none;
}
.footer-subscribe-input::placeholder { color: var(--fg-muted); }
.footer-subscribe-input:focus { border-color: var(--primary); }

.footer-subscribe-btn {
  height: 3.5rem;
  padding: 0 2.5rem;
  background: var(--primary);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 2px solid hsl(15, 75%, 32%);
  border-radius: 0;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s;
}
.footer-subscribe-btn:hover { opacity: 0.9; }

/* Lower footer */
.footer-lower {
  padding: 3rem 0 2rem;
}

.footer-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.footer-logo { height: 2.25rem; width: auto; }
.footer-logo-text {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--fg);
}

.footer-nav-inline .nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 2rem;
  list-style: none;
}
.footer-nav-inline .nav a,
.footer-nav-inline a {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  transition: color 0.2s;
}
.footer-nav-inline .nav a:hover,
.footer-nav-inline a:hover { color: var(--primary); }

.footer-secondary-nav {
  margin-left: auto;
}

.footer-secondary-nav .nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-secondary-nav .nav a,
.footer-secondary-nav a {
  font-size: 1rem;
  color: #8FA0D8;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-secondary-nav .nav a:hover,
.footer-secondary-nav a:hover { color: #fff; }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-copy { font-size: 0.875rem; color: hsla(22, 60%, 70%, 0.45); }

.footer-nav .nav { display: flex; gap: 1.5rem; list-style: none; }
.footer-nav .nav a,
.footer-nav a {
  font-size: 0.775rem;
  color: var(--fg-muted);
  transition: color 0.2s;
}
.footer-nav .nav a:hover,
.footer-nav a:hover { color: var(--fg); }

/* --- Responsive --- */
@media (max-width: 1024px) {
  .letters-grid { grid-template-columns: repeat(2, 1fr); }
  .related-posts-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-top { grid-template-columns: 1fr; gap: 2.5rem; }
}

@media (max-width: 768px) {
  :root { --header-h: 60px; }

  .site-nav { display: none; }
  .mobile-menu-toggle { display: flex; }

  .header-inner { padding: 0 1.25rem; }

  .hero { flex-direction: column; min-height: auto; }
  .hero-text { padding: 2.5rem 1.25rem; }
  .hero-image-wrap { width: 100%; height: 280px; position: relative; }
  .hero-image { position: relative; width: 100%; height: 280px; }

  .home-section-inner { padding: 2.5rem 1.25rem; }
  .letters-grid { grid-template-columns: 1fr; }

  .post-header { padding: 2.5rem 0 2rem; }
  .tag-header { margin: 0 -1.25rem 2rem; padding: 0 1.25rem; }

  .related-posts-grid { grid-template-columns: 1fr; }
  .related-posts-section { padding: 3rem 1.25rem 4rem; }

  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 2rem; }
  .post-title { font-size: 1.75rem; }
}

/* --- Koenig button card --- */
.kg-button-card a.kg-btn,
.kg-button-card .kg-btn {
  display: inline-block;
  background: hsl(24, 95%, 53%) !important;
  color: hsl(355, 72%, 18%) !important;
  border: 2px solid hsl(355, 72%, 18%) !important;
  border-radius: 0 !important;
  padding: 1rem 2.5rem !important;
  font-size: 0.9rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  text-decoration: none !important;
  transition: opacity 0.2s !important;
}
.kg-button-card a.kg-btn:hover,
.kg-button-card .kg-btn:hover { opacity: 0.9 !important; }
