/* ─── Variables ─────────────────────────────────────────── */
:root {
  --bg:           #0a0a0f;
  --surface:      #12121a;
  --surface2:     #1a1a26;
  --purple:       #9B5DE5;
  --purple-dim:   #6d28d9;
  --yellow:       #FFE600;
  --text:         #f0eef8;
  --text-muted:   #8b86a8;
  --border:       rgba(155,93,229,0.18);
  --max-width:    720px;
  --font:         'Montserrat', sans-serif;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 300;
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Subtle radial bloom */
body::after {
  content: '';
  position: fixed;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 800px; height: 500px;
  background: radial-gradient(ellipse at 50% 0%, rgba(109,40,217,0.14) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

a { color: var(--purple); text-decoration: none; }
a:hover { color: var(--text); }

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

/* ─── Accent rule ───────────────────────────────────────── */
.accent-rule {
  width: 48px;
  height: 2px;
  background: var(--yellow);
  margin: 1.5rem 0;
}

/* ─── Header ────────────────────────────────────────────── */
.site-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.75rem 2rem;
  border-bottom: 1px solid var(--border);
  max-width: 100%;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.site-logo svg {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(155,93,229,0.45));
}

.site-title {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

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

/* Ghost injects <ul> for navigation */
.site-nav .nav {
  display: flex;
  list-style: none;
  gap: 1.5rem;
  align-items: center;
  margin: 0; padding: 0;
}

.site-nav .nav a,
.site-nav .nav-home-link {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.site-nav .nav a:hover,
.site-nav .nav-home-link:hover {
  color: var(--purple);
}

.site-nav .nav-home-link {
  color: var(--text-muted);
  border-left: 1px solid var(--border);
  padding-left: 1.5rem;
}

/* ─── Main ──────────────────────────────────────────────── */
.site-main {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 2rem;
}

/* ─── Feed header ───────────────────────────────────────── */
.post-feed-header {
  margin-bottom: 3rem;
}

.feed-title {
  font-size: clamp(1rem, 3vw, 1.3rem);
  font-weight: 300;
  color: var(--text-muted);
  max-width: 540px;
}

/* ─── Post cards ────────────────────────────────────────── */
.post-feed {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.post-card {
  border-bottom: 1px solid var(--border);
}

.post-card:first-child {
  border-top: 1px solid var(--border);
}

.post-card-link {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  padding: 1.75rem 0;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s;
}

.post-card-link:hover { opacity: 0.8; }
.post-card-link:hover .post-card-read { color: var(--purple); }

.post-card-image {
  width: 120px;
  height: 80px;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
  border-radius: 2px;
  opacity: 0.8;
}

.post-card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.post-card-tag {
  color: var(--purple);
  border: 1px solid rgba(155,93,229,0.3);
  padding: 0.1rem 0.5rem;
  border-radius: 2px;
  font-size: 0.65rem;
}

.post-card-title {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.3;
}

.post-card-excerpt {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.post-card-read {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 0.25rem;
  transition: color 0.2s;
}

/* ─── Pagination ────────────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.pagination a {
  color: var(--purple);
}

/* ─── Post full ─────────────────────────────────────────── */
.post-full-header {
  margin-bottom: 2.5rem;
}

.post-full-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.post-tag {
  color: var(--purple);
  border: 1px solid rgba(155,93,229,0.3);
  padding: 0.1rem 0.5rem;
  border-radius: 2px;
  font-size: 0.65rem;
}

.post-full-title {
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.post-full-excerpt {
  font-size: 1.1rem;
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

.post-full-image {
  margin: 0 0 2.5rem;
  border-radius: 2px;
  overflow: hidden;
}

.post-full-image img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  opacity: 0.85;
}

.post-full-image figcaption {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.5rem;
}

/* ─── Post content (Ghost renders this) ─────────────────── */
.post-full-content {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--text);
}

.post-full-content h1,
.post-full-content h2,
.post-full-content h3,
.post-full-content h4 {
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 2.5rem 0 1rem;
  color: var(--text);
}

.post-full-content h2 { font-size: 1.6rem; }
.post-full-content h3 { font-size: 1.25rem; }
.post-full-content h4 { font-size: 1rem; }

.post-full-content p { margin-bottom: 1.5rem; }

.post-full-content a {
  color: var(--purple);
  text-decoration: underline;
  text-decoration-color: rgba(155,93,229,0.4);
  text-underline-offset: 3px;
}

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

.post-full-content strong { font-weight: 700; color: var(--text); }

.post-full-content em { font-style: italic; }

.post-full-content blockquote {
  border-left: 3px solid var(--purple);
  padding: 0.5rem 0 0.5rem 1.5rem;
  margin: 2rem 0;
  color: var(--text-muted);
  font-style: italic;
}

.post-full-content code {
  background: var(--surface2);
  color: var(--yellow);
  padding: 0.15em 0.4em;
  border-radius: 2px;
  font-family: 'Courier New', monospace;
  font-size: 0.88em;
}

.post-full-content pre {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin: 2rem 0;
}

.post-full-content pre code {
  background: none;
  padding: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.post-full-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

.post-full-content ul,
.post-full-content ol {
  margin: 0 0 1.5rem 1.5rem;
}

.post-full-content li { margin-bottom: 0.4rem; }

.post-full-content img {
  border-radius: 2px;
  margin: 2rem 0;
  opacity: 0.85;
}

.post-full-content figure { margin: 2rem 0; }

.post-full-content figcaption {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.5rem;
}

/* ─── Post footer ───────────────────────────────────────── */
.post-full-footer {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.back-link {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.back-link:hover { color: var(--purple); }

/* ─── Error page ────────────────────────────────────────── */
.error-page {
  text-align: left;
  padding: 4rem 0;
}

.error-code {
  font-size: 6rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--purple);
  line-height: 1;
  opacity: 0.4;
}

.error-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

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

.error-link {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--purple);
}

/* ─── Footer ────────────────────────────────────────────── */
.site-footer {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--border);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.site-footer a {
  color: var(--text-muted);
}

.site-footer a:hover { color: var(--purple); }

/* ─── Koenig editor image width classes ─────────────────── */
.kg-width-wide {
  margin-left: calc(50% - 50vw + 2rem);
  margin-right: calc(50% - 50vw + 2rem);
  max-width: min(900px, calc(100vw - 4rem));
}

.kg-width-full {
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  max-width: 100vw;
}

.kg-width-wide img,
.kg-width-full img {
  width: 100%;
  opacity: 0.85;
}

/* ─── Responsive ────────────────────────────────────────── */
@media (max-width: 600px) {
  .site-header { padding: 1.25rem 1.25rem; }
  .site-main { padding: 2rem 1.25rem; }
  .site-footer { padding: 1.25rem; flex-direction: column; gap: 0.5rem; text-align: center; }
  .site-nav .nav-home-link { display: none; }
  .post-card-image { display: none; }
}
