/* ── OBERHAHN Ghost Theme ──────────────────────────────────────────────── */

/* FONTS */
@font-face { font-family:'ABC Diatype'; src:url('../fonts/ABCDiatype-Light-Trial.otf') format('opentype'); font-weight:300; font-style:normal; font-display:swap; }
@font-face { font-family:'ABC Diatype'; src:url('../fonts/ABCDiatype-Regular-Trial.otf') format('opentype'); font-weight:400; font-style:normal; font-display:swap; }
@font-face { font-family:'ABC Diatype'; src:url('../fonts/ABCDiatype-RegularItalic-Trial.otf') format('opentype'); font-weight:400; font-style:italic; font-display:swap; }
@font-face { font-family:'ABC Diatype'; src:url('../fonts/ABCDiatype-Medium-Trial.otf') format('opentype'); font-weight:500; font-style:normal; font-display:swap; }
@font-face { font-family:'ABC Diatype'; src:url('../fonts/ABCDiatype-Bold-Trial.otf') format('opentype'); font-weight:700; font-style:normal; font-display:swap; }
@font-face { font-family:'ABC Diatype'; src:url('../fonts/ABCDiatype-Heavy-Trial.otf') format('opentype'); font-weight:800; font-style:normal; font-display:swap; }

/* TOKENS */
:root {
  --cream:  #f2ebe0;
  --cream2: #ebe2d2;
  --ink:    #1a1612;
  --ink2:   #5a4e3e;
  --navy:   #0d1f4e;
  --blue:   #1a4fd6;
  --rule:   #ccc0a8;
  --muted:  #8a7a68;
  --max:    1080px;
}

/* RESET */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--cream);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* ── HEADER ── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(242,235,224,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}
.header-inner {
  max-width: var(--max); margin: 0 auto; padding: 0 40px;
  height: 52px; display: flex; align-items: center; justify-content: space-between;
}
.site-logo { display: flex; align-items: center; gap: 9px; }
.logo-mark {
  width: 24px; height: 24px; background: var(--navy); border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
}
.logo-mark svg { width: 13px; height: 13px; fill: white; }
.logo-name {
  font-family: 'ABC Diatype', sans-serif;
  font-size: 13px; font-weight: 700; color: var(--navy); letter-spacing: 0.09em;
}
.site-nav { display: flex; align-items: center; gap: 24px; }
.site-nav .nav { display: flex; gap: 24px; list-style: none; }
.site-nav .nav a {
  font-family: 'ABC Diatype', sans-serif;
  font-size: 13px; font-weight: 400; color: var(--muted); letter-spacing: 0.02em;
  transition: color 0.15s;
}
.site-nav .nav a:hover { color: var(--ink); }
.nav-cta {
  font-family: 'ABC Diatype', sans-serif;
  font-size: 11px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
  background: var(--navy); color: var(--cream) !important;
  padding: 8px 18px;
}
.nav-cta:hover { background: var(--ink); }

/* ── MASTHEAD ── */
.home-masthead {
  border-bottom: 2px solid var(--ink);
  padding: 52px 40px 40px;
}
.masthead-inner { max-width: var(--max); margin: 0 auto; }
.masthead-edition {
  font-family: 'ABC Diatype', sans-serif;
  font-size: 9px; font-weight: 300; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 16px;
}
.masthead-title {
  font-family: 'ABC Diatype', sans-serif;
  font-size: 42px; font-weight: 700; color: var(--navy);
  line-height: 1.1; letter-spacing: -0.02em; margin-bottom: 10px;
}
.masthead-desc {
  font-size: 16px; color: var(--ink2); max-width: 520px;
  font-style: italic; line-height: 1.7;
}

/* ── POST FEED ── */
.home-wrap { max-width: var(--max); margin: 0 auto; padding: 48px 40px 80px; }

.post-feed {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  border-top: 1px solid var(--rule);
}
.post-card { border-bottom: 1px solid var(--rule); }
.post-card:nth-child(3n+1),
.post-card:nth-child(3n+2) { border-right: 1px solid var(--rule); }

.post-card-link { display: block; padding: 28px 24px; }
.post-card-link:hover .post-card-title { color: var(--blue); }

.post-card-image {
  height: 180px; background-size: cover; background-position: center;
  margin-bottom: 18px;
}
.post-card-tag {
  font-family: 'ABC Diatype', sans-serif;
  font-size: 9px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--blue); display: block; margin-bottom: 8px;
}
.post-card-title {
  font-family: 'ABC Diatype', sans-serif;
  font-size: 20px; font-weight: 700; color: var(--navy);
  line-height: 1.2; letter-spacing: -0.01em; margin-bottom: 10px;
  transition: color 0.15s;
}
.post-card-excerpt {
  font-size: 13px; color: var(--ink2); line-height: 1.65;
  margin-bottom: 16px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.post-card-footer {
  display: flex; align-items: center; gap: 10px;
  font-family: 'ABC Diatype', sans-serif;
  font-size: 9px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted);
}

/* ── PAGINATION ── */
.pagination {
  display: flex; align-items: center; justify-content: center; gap: 20px;
  padding: 48px 0 0;
  font-family: 'ABC Diatype', sans-serif;
  font-size: 11px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted);
}
.pagination .page-number { color: var(--navy); font-weight: 700; }
.older-posts, .newer-posts {
  background: var(--navy); color: var(--cream) !important;
  padding: 9px 20px;
  transition: background 0.15s;
}
.older-posts:hover, .newer-posts:hover { background: var(--ink); }

/* ── SINGLE POST ── */
.post-full { max-width: var(--max); margin: 0 auto; padding: 0 40px 80px; }

.post-header {
  padding: 52px 0 36px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 36px;
}
.post-header-inner { max-width: 720px; }

.post-tag {
  font-family: 'ABC Diatype', sans-serif;
  font-size: 9px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--blue); display: inline-block; margin-bottom: 14px;
}

.post-title {
  font-family: 'ABC Diatype', sans-serif;
  font-size: 44px; font-weight: 700; color: var(--navy);
  line-height: 1.08; letter-spacing: -0.02em; margin-bottom: 16px;
}
.post-excerpt {
  font-size: 18px; color: var(--ink2); line-height: 1.65;
  font-style: italic; margin-bottom: 20px; max-width: 600px;
}
.post-meta {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-family: 'ABC Diatype', sans-serif;
  font-size: 10px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted);
}
.post-meta a { color: var(--navy); }
.post-sep { color: var(--rule); }

.post-image { margin-bottom: 36px; }
.post-image img { width: 100%; height: auto; display: block; }
.post-image figcaption {
  font-size: 12px; color: var(--muted); text-align: center;
  padding: 10px 0; font-style: italic;
}

/* ── POST CONTENT ── */
.post-content,
.gh-content {
  font-size: 17px;
  line-height: 1.8;
  color: var(--ink);
  max-width: 720px;
}
.gh-content > * { margin-bottom: 1.5em; }
.gh-content h2 {
  font-family: 'ABC Diatype', sans-serif;
  font-size: 28px; font-weight: 700; color: var(--navy);
  line-height: 1.2; letter-spacing: -0.015em;
  border-top: 1px solid var(--rule); padding-top: 28px; margin-top: 44px;
}
.gh-content h3 {
  font-family: 'ABC Diatype', sans-serif;
  font-size: 22px; font-weight: 700; color: var(--navy);
  line-height: 1.25; letter-spacing: -0.01em; margin-top: 36px;
}
.gh-content h4 {
  font-family: 'ABC Diatype', sans-serif;
  font-size: 17px; font-weight: 600; color: var(--navy); margin-top: 28px;
}
.gh-content p { margin-bottom: 1.6em; }
.gh-content p:first-of-type::first-letter {
  font-family: 'ABC Diatype', sans-serif;
  font-size: 52px; font-weight: 800; color: var(--navy);
  float: left; line-height: 0.85; margin-right: 7px; margin-top: 7px;
}
.gh-content a { color: var(--blue); border-bottom: 1px solid currentColor; }
.gh-content a:hover { color: var(--navy); }
.gh-content strong { font-weight: 700; color: var(--navy); }
.gh-content em { font-style: italic; }
.gh-content blockquote {
  border-left: 3px solid var(--blue); padding-left: 20px;
  font-family: 'ABC Diatype', sans-serif; font-style: italic;
  font-size: 18px; color: var(--navy); margin: 32px 0;
}
.gh-content ul, .gh-content ol {
  padding-left: 24px; margin-bottom: 1.4em;
}
.gh-content li { margin-bottom: 0.5em; }
.gh-content code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 14px; background: var(--cream2); padding: 2px 6px; border-radius: 3px;
}
.gh-content pre {
  background: var(--navy); color: var(--cream);
  padding: 24px; overflow-x: auto; margin: 28px 0;
}
.gh-content pre code { background: none; padding: 0; color: inherit; font-size: 14px; }
.gh-content figure { margin: 36px 0; }
.gh-content figcaption {
  font-size: 12px; color: var(--muted); text-align: center;
  padding-top: 10px; font-style: italic;
}
.gh-content hr {
  border: none; border-top: 1px solid var(--rule); margin: 44px 0;
}

/* ── POST FOOTER ── */
.post-footer { max-width: 720px; margin-top: 52px; }
.post-footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
  border-top: 1px solid var(--ink); padding-top: 20px; margin-bottom: 52px;
}
.post-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.post-tag-link {
  font-family: 'ABC Diatype', sans-serif;
  font-size: 9px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--rule); padding: 4px 10px;
  transition: all 0.15s;
}
.post-tag-link:hover { color: var(--navy); border-color: var(--navy); }
.post-share { display: flex; gap: 14px; }
.post-share a {
  font-family: 'ABC Diatype', sans-serif;
  font-size: 10px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); border-bottom: 1px solid var(--rule);
}
.post-share a:hover { color: var(--navy); border-color: var(--navy); }

/* ── MACHINE SECTION (post footer + site footer) ── */
.post-machine {
  display: flex; align-items: center; gap: 28px;
  background: var(--cream2); padding: 28px 24px;
  border-top: 1px solid var(--rule);
}
.machine-img { width: 100px; height: auto; flex-shrink: 0; }
.machine-caption { display: flex; flex-direction: column; gap: 4px; }
.machine-name {
  font-family: 'ABC Diatype', sans-serif;
  font-size: 14px; font-weight: 700; color: var(--navy); letter-spacing: 0.04em;
}
.machine-tag {
  font-family: 'ABC Diatype', sans-serif;
  font-size: 10px; font-weight: 400; color: var(--muted);
  letter-spacing: 0.06em; font-style: italic;
}

/* ── SITE FOOTER ── */
.site-footer {
  border-top: 2px solid var(--ink);
  background: var(--cream2);
  overflow: hidden;
}
.footer-machine {
  text-align: center; padding: 36px 40px 0;
  opacity: 0.35;
}
.footer-machine-img {
  height: 120px; width: auto; margin: 0 auto;
  filter: sepia(20%) contrast(1.1);
}
.footer-inner {
  max-width: var(--max); margin: 0 auto;
  padding: 24px 40px 32px;
  display: flex; align-items: flex-end; justify-content: space-between;
  border-top: 1px solid var(--rule);
  margin-top: 24px;
}
.footer-logo {
  font-family: 'ABC Diatype', sans-serif;
  font-size: 13px; font-weight: 700; color: var(--navy); letter-spacing: 0.08em;
}
.footer-tagline {
  font-size: 12px; color: var(--muted); font-style: italic; margin-top: 4px;
}
.footer-nav .nav { display: flex; gap: 20px; list-style: none; margin-bottom: 8px; justify-content: flex-end; }
.footer-nav .nav a {
  font-family: 'ABC Diatype', sans-serif;
  font-size: 11px; font-weight: 400; color: var(--muted); letter-spacing: 0.06em;
  text-transform: uppercase;
}
.footer-nav .nav a:hover { color: var(--navy); }
.footer-copy {
  font-size: 11px; color: var(--muted); text-align: right;
}
.footer-copy a { color: var(--navy); }

/* ── ERROR ── */
.error-page {
  min-height: 60vh; display: flex; align-items: center; justify-content: center;
  padding: 40px;
}
.error-inner { text-align: center; }
.error-code {
  font-family: 'ABC Diatype', sans-serif;
  font-size: 96px; font-weight: 800; color: var(--navy);
  line-height: 1; margin-bottom: 16px;
}
.error-msg {
  font-size: 18px; color: var(--ink2); margin-bottom: 28px;
}
.error-link {
  font-family: 'ABC Diatype', sans-serif;
  font-size: 12px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--navy); border-bottom: 1px solid var(--rule);
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .post-feed { grid-template-columns: 1fr 1fr; }
  .post-card:nth-child(3n+1),
  .post-card:nth-child(3n+2) { border-right: none; }
  .post-card:nth-child(2n+1) { border-right: 1px solid var(--rule); }
}
@media (max-width: 640px) {
  .header-inner { padding: 0 20px; }
  .site-nav .nav { display: none; }
  .home-masthead { padding: 36px 20px 28px; }
  .masthead-title { font-size: 28px; }
  .home-wrap { padding: 32px 20px 60px; }
  .post-feed { grid-template-columns: 1fr; }
  .post-card:nth-child(n) { border-right: none; }
  .post-full { padding: 0 20px 60px; }
  .post-title { font-size: 30px; }
  .gh-content p:first-of-type::first-letter { font-size: 40px; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 20px; }
  .footer-nav .nav { justify-content: flex-start; }
  .footer-copy { text-align: left; }
}

/* ── KOENIG EDITOR REQUIRED CLASSES ── */
.kg-width-wide {
  position: relative;
  width: 85vw;
  min-width: 100%;
  margin: auto calc(50% - 50vw * 0.85);
}
.kg-width-full {
  position: relative;
  width: 100vw;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}
.kg-width-wide img,
.kg-width-full img { width: 100%; }

.kg-image-card { margin: 32px 0; }
.kg-image-card img { margin: 0 auto; }
.kg-gallery-card { margin: 32px 0; }
.kg-gallery-container { display: flex; flex-wrap: wrap; gap: 4px; }
.kg-gallery-row { display: flex; gap: 4px; width: 100%; }
.kg-gallery-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.kg-video-card { margin: 32px 0; }
.kg-video-card video { width: 100%; }
.kg-audio-card { margin: 32px 0; background: var(--cream2); border: 1px solid var(--rule); padding: 16px; }
.kg-file-card { margin: 32px 0; border: 1px solid var(--rule); padding: 16px; }
.kg-bookmark-card { margin: 32px 0; border: 1px solid var(--rule); }
.kg-bookmark-container { display: flex; text-decoration: none; }
.kg-bookmark-content { padding: 16px; flex: 1; }
.kg-bookmark-title { font-family: 'ABC Diatype', sans-serif; font-weight: 700; color: var(--navy); }
.kg-bookmark-description { font-size: 13px; color: var(--ink2); margin-top: 4px; }
.kg-bookmark-thumbnail { width: 140px; flex-shrink: 0; }
.kg-bookmark-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.kg-callout-card { margin: 28px 0; display: flex; gap: 14px; padding: 20px; background: var(--cream2); border-left: 3px solid var(--blue); }
.kg-callout-emoji { font-size: 20px; flex-shrink: 0; }
.kg-toggle-card { margin: 28px 0; border: 1px solid var(--rule); }
.kg-toggle-heading { padding: 14px 18px; cursor: pointer; font-family: 'ABC Diatype', sans-serif; font-weight: 600; color: var(--navy); }
.kg-toggle-content { padding: 0 18px 14px; font-size: 14px; color: var(--ink2); }
.kg-button-card { margin: 28px 0; text-align: center; }
.kg-button-card a { display: inline-block; background: var(--navy); color: var(--cream); font-family: 'ABC Diatype', sans-serif; font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; padding: 13px 28px; text-decoration: none; }
.kg-divider-card { margin: 40px 0; border: none; border-top: 1px solid var(--rule); }

/* ── FOOTER NEWSLETTER ── */
.footer-subscribe {
  background: var(--navy);
  padding: 52px 40px;
  border-top: 2px solid var(--ink);
}
.footer-subscribe-inner {
  max-width: var(--max); margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center;
}
.footer-subscribe-label {
  font-family: 'ABC Diatype', sans-serif;
  font-size: 9px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(255,255,255,0.35); margin-bottom: 10px;
}
.footer-subscribe-title {
  font-family: 'ABC Diatype', sans-serif;
  font-size: 22px; font-weight: 700; color: var(--cream);
  line-height: 1.2; letter-spacing: -0.01em; margin-bottom: 8px;
}
.footer-subscribe-desc {
  font-size: 14px; color: rgba(255,255,255,0.45);
  font-style: italic; line-height: 1.6;
}
.footer-subscribe-form {
  display: flex; gap: 0;
}
.footer-subscribe-input {
  flex: 1;
  padding: 12px 16px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-right: none;
  color: var(--cream);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  outline: none;
}
.footer-subscribe-input::placeholder { color: rgba(255,255,255,0.3); }
.footer-subscribe-input:focus { border-color: var(--blue); background: rgba(255,255,255,0.12); }
.footer-subscribe-btn {
  background: #c9a66b; color: white;
  font-family: 'Inter', sans-serif;
  font-size: 13px; font-weight: 600;
  padding: 12px 22px; border: none; cursor: pointer; white-space: nowrap;
}
.footer-subscribe-btn:hover { background: #b8924f; }

@media(max-width:640px){
  .footer-subscribe-inner { grid-template-columns: 1fr; gap: 24px; }
  .footer-subscribe { padding: 40px 24px; }
}

/* ── POST NAVIGATION ── */
.post-nav {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
}
.post-nav-back,
.post-nav-next {
  font-family: 'ABC Diatype', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.55;
  transition: opacity 0.2s, color 0.2s;
  max-width: 50%;
  line-height: 1.5;
}
.post-nav-back:hover,
.post-nav-next:hover {
  opacity: 0.85;
  color: var(--navy);
}
.post-nav-next { text-align: right; }

/* ── NAV LOGO IMAGE ── */
.nav-logo-img { height: 28px; width: auto; display: block; }
