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

:root {
  --bg:       #07090F;
  --surface:  #0E1119;
  --border:   #1C2133;
  --red:      #C8392B;
  --red-dim:  rgba(200,57,43,0.15);
  --white:    #F4F5F7;
  --mid:      #8A91A8;
  --light:    #C4C9D8;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Fraunces', Georgia, serif;
  --max-w: 800px;
  --wide-w: 1100px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--red); text-decoration: none; }
a:hover { color: var(--white); }
img { max-width: 100%; height: auto; display: block; }

/* ─── Nav ───────────────────────────────────────────────────────── */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 60px;
  background: rgba(7,9,15,0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--white);
  text-decoration: none;
  letter-spacing: 0.02em;
}
.nav-logo span { color: var(--red); }
.nav-logo em {
  font-style: normal;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.75rem;
  color: var(--mid);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-left: 10px;
  border-left: 1px solid var(--border);
  padding-left: 10px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}
.nav-links a {
  color: var(--mid);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color .2s;
}
.nav-links a:hover { color: var(--white); }
.nav-links .nav-cta {
  background: var(--red);
  color: var(--white) !important;
  padding: 7px 18px;
  border-radius: 4px;
}
.nav-links .nav-cta:hover { background: #a82f23; }

.nav-mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-mobile-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--white);
  border-radius: 2px;
}

/* ─── Hero ───────────────────────────────────────────────────────── */
.site-hero {
  min-height: 38vh;
  display: flex;
  align-items: center;
  padding: 130px 60px 60px;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.site-hero--minimal { min-height: 28vh; }

.site-hero-inner { position: relative; z-index: 1; max-width: var(--wide-w); margin: 0 auto; width: 100%; }

.hero-pulse {
  position: absolute;
  top: 50%; left: 30%;
  transform: translate(-50%, -50%);
  width: 700px; height: 700px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200,57,43,0.07) 0%, transparent 70%);
  pointer-events: none;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red);
  border: 1px solid rgba(200,57,43,0.4);
  padding: 5px 14px;
  border-radius: 100px;
  margin-bottom: 20px;
}

.site-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2rem, 4.5vw, 3.8rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
  max-width: 700px;
}

.site-description {
  font-size: 1rem;
  color: var(--light);
  max-width: 560px;
  line-height: 1.6;
}

/* ─── Posts Container ────────────────────────────────────────────── */
.posts-container {
  max-width: var(--wide-w);
  margin: 0 auto;
  padding: 52px 60px 80px;
}

/* ─── Tag Filter ─────────────────────────────────────────────────── */
.tag-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 40px;
}

.tag-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mid);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 5px 14px;
  border-radius: 100px;
  transition: color .2s, border-color .2s;
}
.tag-pill:hover, .tag-pill.active {
  color: var(--white);
  border-color: var(--red);
}

/* ─── Post Grid ──────────────────────────────────────────────────── */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color .2s, transform .2s;
  border-left: 3px solid var(--border);
}
.post-card:hover {
  border-color: rgba(200,57,43,0.5);
  border-left-color: var(--red);
  transform: translateY(-2px);
}

.post-card-link {
  display: block;
  padding: 24px 22px;
  color: inherit;
  text-decoration: none;
  height: 100%;
}

.post-tag {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 10px;
}

.post-card-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 1.15rem;
  line-height: 1.3;
  color: var(--white);
  margin-bottom: 10px;
}

.post-card-excerpt {
  font-size: 0.875rem;
  color: var(--mid);
  line-height: 1.55;
  margin-bottom: 18px;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem;
  color: var(--mid);
}
.post-card-meta span + span::before {
  content: '·';
  margin-right: 10px;
}

/* ─── Pagination ─────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 52px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--mid);
}
.pagination a {
  color: var(--white);
  border: 1px solid var(--border);
  padding: 8px 20px;
  border-radius: 4px;
  transition: border-color .2s;
}
.pagination a:hover { border-color: var(--red); }

/* ─── Single Post ────────────────────────────────────────────────── */
.post-full {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 100px 40px 80px;
}

.post-header { margin-bottom: 40px; }

.post-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.18;
  letter-spacing: -0.01em;
  margin: 16px 0 20px;
  color: var(--white);
}

.post-excerpt {
  font-size: 1.1rem;
  color: var(--light);
  line-height: 1.6;
  margin-bottom: 20px;
  font-style: italic;
}

.post-meta {
  font-size: 0.82rem;
  color: var(--mid);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.post-sep { color: var(--border); }
.post-tag-link { color: var(--mid); transition: color .2s; }
.post-tag-link:hover { color: var(--white); }

.post-feature-image {
  margin: 32px 0 48px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.post-feature-image img { width: 100%; }
.post-feature-image figcaption {
  padding: 10px 16px;
  font-size: 0.8rem;
  color: var(--mid);
  background: var(--surface);
  text-align: center;
}

/* ─── Post Content (Ghost-generated) ────────────────────────────── */
.gh-content { color: var(--light); font-size: 1.05rem; line-height: 1.8; }
.gh-content h2 { font-family: var(--font-display); font-weight: 700; font-size: 1.6rem; color: var(--white); margin: 2.4em 0 0.8em; line-height: 1.25; }
.gh-content h3 { font-family: var(--font-body); font-weight: 600; font-size: 1.1rem; color: var(--white); margin: 2em 0 0.6em; letter-spacing: 0.02em; }
.gh-content h4 { font-size: 1rem; font-weight: 600; color: var(--white); margin: 1.6em 0 0.5em; }
.gh-content p { margin-bottom: 1.5em; }
.gh-content a { color: var(--red); border-bottom: 1px solid rgba(200,57,43,0.35); transition: border-color .2s; }
.gh-content a:hover { border-color: var(--red); color: var(--white); }
.gh-content strong { color: var(--white); font-weight: 600; }
.gh-content em { font-style: italic; color: var(--light); }
.gh-content ul, .gh-content ol { padding-left: 1.5em; margin-bottom: 1.5em; }
.gh-content li { margin-bottom: 0.5em; }
.gh-content ul li::marker { color: var(--red); }
.gh-content blockquote {
  border-left: 3px solid var(--red);
  padding: 16px 24px;
  margin: 2em 0;
  background: var(--surface);
  border-radius: 0 6px 6px 0;
  font-style: italic;
  color: var(--light);
  font-size: 1.05em;
}
.gh-content blockquote p { margin-bottom: 0; }
.gh-content pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 20px 24px;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.6;
  margin-bottom: 1.5em;
}
.gh-content code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.88em;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 3px;
  color: var(--white);
}
.gh-content pre code { background: none; border: none; padding: 0; }
.gh-content hr { border: none; border-top: 1px solid var(--border); margin: 3em 0; }
.gh-content figure { margin: 2em 0; }
.gh-content figcaption { text-align: center; font-size: 0.82rem; color: var(--mid); margin-top: 10px; }
.gh-content img { border-radius: 6px; border: 1px solid var(--border); margin: 0 auto; }
.gh-content table { width: 100%; border-collapse: collapse; margin-bottom: 1.5em; font-size: 0.92rem; }
.gh-content th { text-align: left; padding: 10px 14px; font-weight: 600; color: var(--white); border-bottom: 2px solid var(--border); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; }
.gh-content td { padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--light); }
.gh-content tr:hover td { background: var(--surface); }

/* ─── Post Footer / Author ───────────────────────────────────────── */
.post-footer {
  margin-top: 60px;
  padding-top: 36px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.author-card {}
.author-info { display: flex; align-items: center; gap: 14px; }
.author-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}
.author-avatar-placeholder {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--red);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.1rem; color: var(--white);
}
.author-name { display: block; font-weight: 600; color: var(--white); font-size: 0.9rem; }
.author-bio { display: block; font-size: 0.82rem; color: var(--mid); margin-top: 2px; }

.post-tags-footer { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ─── Subscribe Section ──────────────────────────────────────────── */
.subscribe-section {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 64px 40px;
  text-align: center;
}
.subscribe-inner { max-width: 520px; margin: 0 auto; }
.subscribe-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 2rem;
  margin: 14px 0 12px;
  color: var(--white);
}
.subscribe-desc { color: var(--mid); margin-bottom: 28px; font-size: 0.95rem; }
.subscribe-form { display: flex; gap: 10px; max-width: 420px; margin: 0 auto; }
.subscribe-email {
  flex: 1;
  padding: 10px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.92rem;
  outline: none;
  transition: border-color .2s;
}
.subscribe-email:focus { border-color: var(--red); }
.subscribe-email::placeholder { color: var(--mid); }
.subscribe-btn {
  padding: 10px 22px;
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .2s;
  white-space: nowrap;
}
.subscribe-btn:hover { background: #a82f23; }

/* ─── Related Posts ──────────────────────────────────────────────── */
.related-posts { padding: 52px 40px 80px; max-width: var(--max-w); margin: 0 auto; }
.related-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.related-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: 8px;
  padding: 22px 20px;
  text-decoration: none;
  color: inherit;
  transition: border-color .2s;
  display: block;
}
.related-card:hover { border-color: rgba(200,57,43,0.5); border-left-color: var(--red); color: inherit; }
.related-dir { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--mid); margin-bottom: 8px; }
.related-title { font-family: var(--font-display); font-weight: 300; font-size: 1rem; color: var(--white); line-height: 1.35; }

/* ─── Error Page ─────────────────────────────────────────────────── */
.error-page {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 40px 80px;
}
.error-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 2.4rem;
  margin: 16px 0 14px;
  color: var(--white);
}
.error-desc { color: var(--mid); margin-bottom: 32px; }
.error-cta {
  display: inline-block;
  background: var(--red);
  color: var(--white);
  padding: 10px 24px;
  border-radius: 4px;
  font-size: 0.88rem;
  font-weight: 500;
  transition: background .2s;
}
.error-cta:hover { background: #a82f23; color: var(--white); }

/* ─── Footer ─────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 48px 60px;
  background: var(--surface);
}
.footer-inner { max-width: var(--wide-w); margin: 0 auto; }
.footer-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--white);
  display: inline-block;
  margin-bottom: 10px;
}
.footer-logo span { color: var(--red); }
.footer-desc { font-size: 0.88rem; color: var(--mid); margin-bottom: 20px; }
.footer-desc a { color: var(--mid); text-decoration: underline; }
.footer-links { display: flex; gap: 24px; margin-bottom: 24px; }
.footer-links a { font-size: 0.78rem; color: var(--mid); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500; transition: color .2s; }
.footer-links a:hover { color: var(--white); }
.footer-copy { font-size: 0.78rem; color: var(--border); }

/* ─── Koenig Editor Width Classes (required) ────────────────────── */
.gh-content .kg-width-wide {
  margin-left: calc(50% - 50vw + 60px);
  margin-right: calc(50% - 50vw + 60px);
  max-width: none;
}
.gh-content .kg-width-full {
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  max-width: none;
}
.gh-content .kg-width-wide img,
.gh-content .kg-width-full img {
  width: 100%;
  border-radius: 0;
}

/* ─── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .site-nav { padding: 16px 24px; }
  .nav-links { display: none; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--border); padding: 16px 24px; gap: 14px; }
  .nav-links.open { display: flex; }
  .nav-mobile-toggle { display: flex; }

  .site-hero { padding: 110px 24px 48px; }
  .posts-container { padding: 36px 24px 60px; }
  .posts-grid { grid-template-columns: 1fr; }

  .post-full { padding: 90px 24px 60px; }
  .post-footer { flex-direction: column; }
  .related-inner { grid-template-columns: 1fr; }
  .subscribe-form { flex-direction: column; }

  .site-footer { padding: 40px 24px; }
}
