/* ============================================
   ROBERT — Ghost Theme CSS
   ============================================ */

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

:root {
  --bg:           #0d0d0d;
  --bg2:          #141414;
  --bg3:          #1c1c1c;
  --white:        #f0ede8;
  --white-dim:    rgba(240,237,232,0.6);
  --white-faint:  rgba(240,237,232,0.18);
  --red:          #e63946;
  --amber:        #f4a261;
  --border:       rgba(240,237,232,0.1);
  --border-solid: #2a2a2a;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--white);
  font-family: 'IBM Plex Serif', Georgia, serif;
  font-size: 18px;
  line-height: 1.78;
  -webkit-font-smoothing: antialiased;
}

/* ── Progress bar ── */
#bar {
  position: fixed; top: 0; left: 0;
  height: 2px; width: 0%;
  background: var(--red);
  z-index: 999;
  transition: width 0.08s linear;
}

/* ── Nav ── */
.site-nav {
  position: sticky; top: 0;
  background: rgba(13,13,13,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 52px;
  display: flex; align-items: center; justify-content: space-between;
  z-index: 100;
  transition: transform 0.3s ease;
}
.nav-logo {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--red);
  text-decoration: none;
}
.nav-right { display: flex; gap: 12px; align-items: center; }
.nav-sub, .nav-member {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 7px 16px;
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: 2px;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.2s;
  display: inline-block;
}
.nav-sub:hover, .nav-member:hover { opacity: 0.82; }

/* ── Shared ── */
.section-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 20px;
}
.hero-kicker, .post-kicker {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 20px;
  display: flex; align-items: center; gap: 12px;
}
.kicker-line {
  display: inline-block;
  width: 28px; height: 1px;
  background: var(--red);
  flex-shrink: 0;
}

/* ============================================
   HOMEPAGE
   ============================================ */
.home-header {
  padding: 72px 0 48px;
  border-bottom: 1px solid var(--border);
}
.home-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px;
}
.home-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  font-weight: 400;
  line-height: 0.97;
  letter-spacing: 0.02em;
  color: var(--white);
  margin-top: 16px;
}

.post-feed-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 56px 32px 80px;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1px;
  background: var(--border-solid);
  border: 1px solid var(--border-solid);
}
.post-card {
  background: var(--bg);
  text-decoration: none;
  display: flex; flex-direction: column;
  transition: background 0.2s;
}
.post-card:hover { background: var(--bg2); }
.post-card-img {
  height: 200px;
  background-size: cover;
  background-position: center;
}
.post-card-body {
  padding: 24px 22px 28px;
  flex: 1; display: flex; flex-direction: column;
}
.card-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 10px;
}
.post-card-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.55rem;
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: 0.02em;
  color: var(--white);
  flex: 1;
  margin-bottom: 14px;
}
.post-card-excerpt {
  font-size: 0.88rem;
  color: var(--white-dim);
  line-height: 1.6;
  margin-bottom: 16px;
  font-style: italic;
}
.card-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--white-faint);
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
}
.card-dot { opacity: 0.4; }
.card-author { color: var(--white-dim); font-weight: 500; }

/* Pagination */
.pagination {
  display: flex; justify-content: center; gap: 12px;
  padding: 48px 0 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
}
.pagination a {
  color: var(--white-dim);
  text-decoration: none;
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 2px;
  transition: border-color 0.2s, color 0.2s;
}
.pagination a:hover { border-color: var(--red); color: var(--red); }
.pagination .page-number { color: var(--white-faint); padding: 8px 4px; }

/* ============================================
   POST / PAGE
   ============================================ */
.post-wrap { min-height: 80vh; }

.post-hero {
  min-height: 80vh;
  position: relative;
  display: flex; align-items: flex-end;
  background: var(--bg);
}
.post-hero.no-image {
  min-height: 50vh;
  background:
    radial-gradient(ellipse 60% 50% at 80% 20%, rgba(230,57,70,0.07) 0%, transparent 60%),
    repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(240,237,232,0.018) 39px, rgba(240,237,232,0.018) 40px);
}
.post-hero-bg {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
}
.post-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(13,13,13,1) 0%, rgba(13,13,13,0.55) 50%, rgba(13,13,13,0.3) 100%);
}
.post-hero-content {
  position: relative; z-index: 1;
  max-width: 860px;
  padding: 0 32px 60px;
}
.post-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2.8rem, 7vw, 5.8rem);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: 0.02em;
  color: var(--white);
  margin-bottom: 24px;
}
.post-deck {
  font-family: 'IBM Plex Serif', serif;
  font-style: italic;
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--white-dim);
  max-width: 640px;
  margin-bottom: 32px;
}
.post-meta {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.meta-author { display: flex; align-items: center; gap: 10px; }
.meta-avatar-img {
  width: 32px; height: 32px;
  border-radius: 50%; object-fit: cover;
}
.meta-avatar-init {
  width: 32px; height: 32px;
  background: var(--red);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1rem;
  color: var(--white);
  flex-shrink: 0;
}
.meta-name {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px; color: var(--white); font-weight: 500;
}
.meta-sep { color: var(--white-faint); }
.meta-date, .meta-read {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px; color: var(--white-dim); letter-spacing: 0.06em;
}

/* ── Article content ── */
.post-content {
  max-width: 700px;
  margin: 0 auto;
  padding: 64px 32px 80px;
}

.gh-content p {
  margin-bottom: 1.55rem;
  color: rgba(240,237,232,0.82);
}
.gh-content > p:first-of-type::first-letter {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 5.2rem;
  font-weight: 400;
  float: left;
  line-height: 0.78;
  margin: 8px 12px -4px 0;
  color: var(--red);
}
.gh-content strong { color: var(--white); font-weight: 500; }
.gh-content em { color: var(--amber); font-style: italic; }

.gh-content h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: 0.03em;
  color: var(--white);
  margin: 64px 0 20px;
}
.gh-content h3 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red);
  margin: 40px 0 16px;
}
.gh-content h4 {
  font-family: 'IBM Plex Serif', serif;
  font-weight: 500;
  font-size: 1.1rem;
  color: var(--white);
  margin: 32px 0 12px;
}

.gh-content a {
  color: var(--amber);
  text-decoration: underline;
  text-decoration-color: rgba(244,162,97,0.35);
  transition: text-decoration-color 0.2s;
}
.gh-content a:hover { text-decoration-color: var(--amber); }

.gh-content ul, .gh-content ol {
  padding-left: 24px;
  margin-bottom: 1.55rem;
  color: rgba(240,237,232,0.82);
}
.gh-content li { margin-bottom: 0.5rem; }

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

/* Blockquote → pull quote */
.gh-content blockquote {
  border-left: 2px solid var(--red);
  padding: 18px 24px;
  margin: 36px 0;
  background: var(--bg2);
}
.gh-content blockquote p {
  font-style: italic;
  font-size: 1.18rem;
  line-height: 1.55;
  color: var(--white);
  margin: 0;
}

/* Code */
.gh-content code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85em;
  background: var(--bg3);
  color: var(--amber);
  padding: 2px 6px;
  border-radius: 2px;
}
.gh-content pre {
  background: var(--bg2);
  border: 1px solid var(--border);
  padding: 22px 24px;
  border-radius: 4px;
  overflow-x: auto;
  margin: 28px 0;
}
.gh-content pre code { background: transparent; padding: 0; color: var(--white-dim); }

/* ── Ghost Koenig card classes ── */

/* Image cards - width variants */
.gh-content figure { margin: 36px 0; }
.gh-content figure img { width: 100%; display: block; border-radius: 2px; }
.gh-content figcaption {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--white-faint);
  text-align: center;
  margin-top: 10px;
}

/* Required by Ghost: kg-width-wide and kg-width-full */
.kg-width-wide {
  position: relative;
  width: 85vw;
  min-width: 100%;
  margin: 36px auto;
  transform: translateX(calc(350px - 42.5vw));
}
.kg-width-full {
  position: relative;
  width: 100vw;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  margin-top: 36px;
  margin-bottom: 36px;
}
.kg-width-full img, .kg-width-wide img {
  width: 100%;
  display: block;
}

/* Callout card */
.kg-callout-card {
  display: flex;
  padding: 22px 26px;
  margin: 36px 0;
  border-radius: 2px;
  background: var(--red);
  gap: 16px;
  align-items: flex-start;
}
.kg-callout-emoji { font-size: 1.2rem; flex-shrink: 0; margin-top: 2px; }
.kg-callout-text {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--white);
  letter-spacing: 0.02em;
}
.kg-callout-card-accent { background: var(--amber); }
.kg-callout-card-accent .kg-callout-text { color: var(--bg); }
.kg-callout-card-grey { background: var(--bg3); border: 1px solid var(--border); }
.kg-callout-card-grey .kg-callout-text { color: var(--white-dim); }

/* Toggle card */
.kg-toggle-card {
  border: 1px solid var(--border);
  background: var(--bg2);
  margin: 28px 0;
  border-radius: 2px;
  padding: 16px 20px;
}
.kg-toggle-heading {
  display: flex; justify-content: space-between; align-items: center;
  cursor: pointer;
}
.kg-toggle-heading-text {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.05em;
  color: var(--white);
  font-weight: 500;
}
.kg-toggle-card-icon { color: var(--red); }
.kg-toggle-content { padding-top: 12px; }
.kg-toggle-content p { color: rgba(240,237,232,0.72); font-size: 0.95rem; margin-bottom: 0.8rem; }

/* Bookmark card */
.kg-bookmark-card {
  border: 1px solid var(--border);
  background: var(--bg2);
  margin: 28px 0;
  border-radius: 2px;
}
.kg-bookmark-container {
  display: flex; text-decoration: none; color: inherit;
}
.kg-bookmark-content { flex: 1; padding: 20px; }
.kg-bookmark-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px; font-weight: 500;
  color: var(--white); margin-bottom: 6px;
}
.kg-bookmark-description { font-size: 0.88rem; color: var(--white-dim); }
.kg-bookmark-metadata {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px; color: var(--white-faint); margin-top: 10px;
}
.kg-bookmark-thumbnail {
  width: 120px;
  background-size: cover; background-position: center; flex-shrink: 0;
}

/* Video card */
.kg-video-card { margin: 36px 0; }
.kg-video-card video { width: 100%; display: block; border-radius: 2px; }

/* Divider */
.kg-divider { border: none; border-top: 1px solid var(--border); margin: 52px 0; }

/* Button card */
.kg-button-card {
  display: flex; justify-content: center;
  margin: 36px 0;
}
.kg-btn {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 12px 28px;
  background: var(--red); color: var(--white);
  text-decoration: none; border-radius: 2px;
  transition: opacity 0.2s;
}
.kg-btn:hover { opacity: 0.85; }
.kg-btn-accent { background: var(--amber); color: var(--bg); }

/* Header card */
.kg-header-card {
  background: var(--bg2);
  border: 1px solid var(--border-solid);
  padding: 48px 32px;
  text-align: center;
  margin: 36px 0;
}
.kg-header-card h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.4rem;
  color: var(--white);
  margin-bottom: 16px;
}
.kg-header-card p { color: var(--white-dim); margin-bottom: 24px; }

/* Gallery card */
.kg-gallery-container { margin: 36px 0; }
.kg-gallery-row { display: flex; gap: 4px; margin-bottom: 4px; }
.kg-gallery-image { flex: 1; }
.kg-gallery-image img { width: 100%; display: block; }

/* ── Post bottom ── */
.post-tags-wrap {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 32px 32px;
}
.post-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag-pill {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--white-dim);
  border: 1px solid var(--border);
  padding: 5px 12px; border-radius: 2px;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
}
.tag-pill:hover { border-color: var(--red); color: var(--red); }

.post-author-block {
  max-width: 700px;
  margin: 0 auto;
  padding: 32px 32px 40px;
  border-top: 1px solid var(--border);
  display: flex; gap: 18px; align-items: flex-start;
}
.author-block-img {
  width: 52px; height: 52px;
  border-radius: 50%; object-fit: cover; flex-shrink: 0;
}
.author-block-init {
  width: 52px; height: 52px;
  background: var(--red); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Bebas Neue', sans-serif; font-size: 1.5rem;
  color: var(--white); flex-shrink: 0;
}
.author-block-info { flex: 1; }
.author-block-name {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 500; font-size: 14px;
  color: var(--white); margin-bottom: 4px; letter-spacing: 0.05em;
}
.author-block-bio {
  font-size: 13px; color: var(--white-dim);
  line-height: 1.6; font-style: italic;
}

/* Subscribe CTA */
.subscribe-cta {
  max-width: 700px;
  margin: 0 auto 56px;
  padding: 40px 32px;
  background: var(--bg2);
  border: 1px solid var(--border-solid);
  border-left: 3px solid var(--red);
  text-align: center;
}
.cta-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--red); margin-bottom: 12px;
}
.cta-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem; font-weight: 400;
  letter-spacing: 0.03em; color: var(--white); margin-bottom: 24px;
}
.cta-btn {
  display: inline-block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 12px 28px;
  background: var(--red); color: var(--white);
  text-decoration: none; border-radius: 2px;
  transition: opacity 0.2s;
}
.cta-btn:hover { opacity: 0.85; }

/* Related posts */
.related-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px 80px;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1px;
  background: var(--border-solid);
  border: 1px solid var(--border-solid);
  margin-top: 16px;
}
.related-card {
  background: var(--bg);
  text-decoration: none;
  display: flex; flex-direction: column;
  transition: background 0.2s;
}
.related-card:hover { background: var(--bg2); }
.related-img { height: 160px; background-size: cover; background-position: center; }
.related-body { padding: 20px; flex: 1; }
.related-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.4rem; font-weight: 400;
  line-height: 1.08; letter-spacing: 0.02em;
  color: var(--white); margin: 8px 0 12px;
}

/* ── Archive pages ── */
.archive-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 64px 32px 80px;
}
.archive-header {
  text-align: center;
  padding: 48px 0 52px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
}
.archive-avatar {
  width: 80px; height: 80px;
  border-radius: 50%;
  margin: 0 auto 20px;
  display: block; object-fit: cover;
}
.archive-avatar-init {
  width: 80px; height: 80px;
  background: var(--red); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Bebas Neue', sans-serif; font-size: 2.2rem;
  color: var(--white);
  margin: 0 auto 20px;
}
.archive-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 400; letter-spacing: 0.03em;
  color: var(--white); margin-bottom: 16px;
}
.archive-bio {
  font-style: italic; color: var(--white-dim);
  max-width: 520px; margin: 0 auto;
  font-size: 1rem; line-height: 1.65;
}

/* ── Error ── */
.error-wrap {
  min-height: 70vh;
  display: flex; align-items: center; justify-content: center;
}
.error-inner { text-align: center; padding: 32px; }
.error-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2rem, 6vw, 3.8rem);
  font-weight: 400; letter-spacing: 0.03em;
  color: var(--white); margin: 12px 0 16px;
}
.error-msg { color: var(--white-dim); font-style: italic; margin-bottom: 28px; }

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 32px;
}
.footer-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--white-faint);
}
.footer-title { color: var(--red); font-weight: 500; }
.footer-sep { opacity: 0.3; }
.site-footer a { color: var(--white-faint); text-decoration: none; }
.site-footer a:hover { color: var(--white-dim); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  body { font-size: 17px; }
  .site-nav { padding: 0 20px; }
  .post-feed-wrap, .archive-wrap { padding: 40px 20px 60px; }
  .post-hero-content { padding: 0 20px 48px; }
  .post-content { padding: 48px 20px 60px; }
  .post-author-block, .post-tags-wrap, .related-section { padding-left: 20px; padding-right: 20px; }
  .subscribe-cta { margin-left: 20px; margin-right: 20px; padding: 28px 20px; }
  .kg-width-wide { width: 100%; transform: none; }
  .kg-width-full { margin-left: -20px; margin-right: -20px; width: calc(100% + 40px); }
}
@media (max-width: 480px) {
  .post-title { font-size: 2.5rem; }
  .post-grid, .related-grid { grid-template-columns: 1fr; }
}

/* Ghost navigation helper output */
.site-nav .nav-right .nav {
  display: flex;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav .nav-right .nav li a {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--white-dim);
  text-decoration: none;
  padding: 0 12px;
  transition: color 0.2s;
}
.site-nav .nav-right .nav li a:hover { color: var(--white); }

/* Ghost secondary navigation in footer */
.site-footer .nav {
  display: flex;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-footer .nav li a {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--white-faint);
  text-decoration: none;
  padding: 0 8px;
}
.site-footer .nav li a:hover { color: var(--white-dim); }

/* Ghost post upgrade / paywall CTA */
.gh-post-upgrade-cta {
  max-width: 700px;
  margin: 40px auto;
  padding: 36px 32px;
  background: var(--bg2);
  border: 1px solid var(--border-solid);
  border-left: 3px solid var(--red);
  text-align: center;
}

/* Ghost native comments */
.gh-comments {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 32px 56px;
}
