/* ==========================================================================
   mako-explorer — design tokens
   ========================================================================== */
:root {
  /* colors */
  --paper: #F6F0E2;
  --ink: #2A2620;
  --ink-soft: #4A4536;
  --ink-muted: #7A6E52;
  --border: #D8CDB4;
  --rust: #B5502E;
  --moss: #3B6D57;

  /* type */
  --font-display: var(--gh-font-heading, 'Special Elite'), 'Courier New', monospace;
  --font-body: var(--gh-font-body, 'Spectral'), Georgia, serif;
  --font-meta: 'IBM Plex Mono', monospace;
  --font-code: 'JetBrains Mono', monospace;

  /* spacing (4px base unit) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;

  --radius: 3px;

  --content-width: 1120px;
  --text-column: 680px;
}

/* ==========================================================================
   Reset
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--rust); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--rust); outline-offset: 2px; }
ul, ol, p, h1, h2, h3, h4 { margin: 0; padding: 0; }

/* ==========================================================================
   Layout primitives
   ========================================================================== */
.wrap {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
}
.col-text {
  max-width: var(--text-column);
  margin: 0 auto;
}

.dashed-rule {
  border: none;
  border-top: 1px dashed var(--border);
  margin: var(--space-10) 0;
}

.kicker {
  font-family: var(--font-meta);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* ==========================================================================
   Site header
   ========================================================================== */
.site-header {
  padding: var(--space-8) 0 var(--space-6);
  border-bottom: 1px dashed var(--border);
}
.site-header__inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.site-title {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--ink);
  letter-spacing: 0.01em;
}
.site-title a { color: inherit; }
.site-title a:hover { text-decoration: none; color: var(--rust); }
.site-tagline {
  font-family: var(--font-meta);
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: var(--space-1);
}
.site-nav {
  font-family: var(--font-meta);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-6);
}
.site-nav .nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav .nav li { margin: 0; }
.site-search-trigger {
  font-family: inherit;
  font-size: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  background: none;
  border: none;
  padding: 0;
  color: var(--ink-soft);
  cursor: pointer;
}
.site-search-trigger:hover { color: var(--rust); }
.site-nav a { color: var(--ink-soft); }
.site-nav a:hover { color: var(--rust); }
.site-nav .nav-current a { color: var(--rust); }

/* ==========================================================================
   Homepage — featured hero
   ========================================================================== */
.hero {
  padding: var(--space-10) 0 var(--space-8);
}
.hero__image {
  width: 100%;
  aspect-ratio: 21 / 9;
  max-height: 480px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: var(--space-6);
}
.hero__title {
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1.3;
  color: var(--ink);
  margin-bottom: var(--space-3);
}
.hero__excerpt {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.7;
  color: var(--ink-soft);
  margin-bottom: var(--space-3);
}
.hero__meta {
  font-family: var(--font-meta);
  font-size: 11px;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
}

.archive-header {
  padding: var(--space-10) 0 var(--space-8);
}

/* ==========================================================================
   Post grid
   ========================================================================== */
.post-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-8) var(--space-6);
  padding-bottom: var(--space-12);
}
.post-card--full {
  grid-column: 1 / -1;
}
.post-card__image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: var(--space-3);
}
.post-card__image--hero {
  width: 100%;
  aspect-ratio: 21 / 9;
  max-height: 480px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: var(--space-6);
}
.post-card__title {
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.4;
  color: var(--ink);
  margin-bottom: var(--space-2);
}
.post-card__title a { color: inherit; }
.post-card__title a:hover { color: var(--rust); text-decoration: none; }
.post-card__title--hero {
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1.3;
  color: var(--ink);
  margin-bottom: var(--space-3);
}
.post-card__title--hero a { color: inherit; }
.post-card__title--hero a:hover { color: var(--rust); text-decoration: none; }
.post-card__excerpt {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-soft);
  margin-bottom: var(--space-2);
}
.post-card__excerpt--hero {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.7;
  color: var(--ink-soft);
  margin-bottom: var(--space-3);
}
.post-card__meta {
  font-family: var(--font-meta);
  font-size: 11px;
  color: var(--ink-muted);
  letter-spacing: 0.03em;
}
.post-card--breakout .kicker { color: var(--moss); }

/* ==========================================================================
   Post page
   ========================================================================== */
.post {
  padding: var(--space-10) 0 var(--space-12);
}
.post__header {
  max-width: var(--text-column);
  margin: 0 auto var(--space-8);
}
.post__title {
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1.3;
  color: var(--ink);
  margin: var(--space-3) 0;
}
.post__meta {
  font-family: var(--font-meta);
  font-size: 11px;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
}
.post__feature-image {
  width: 100%;
  max-width: var(--text-column);
  margin: 0 auto var(--space-10);
}
.post__feature-image img {
  width: 100%;
  aspect-ratio: 3 / 2;
  max-height: 500px;
  object-fit: cover;
  border-radius: var(--radius);
}

.post-content {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.8;
  color: var(--ink);
}
.post-content p { margin: 0 0 var(--space-6); }
.post-content h2 {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--ink);
  margin: var(--space-10) 0 var(--space-4);
}
.post-content h3 {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--ink);
  margin: var(--space-8) 0 var(--space-3);
}
.post-content ul,
.post-content ol {
  margin: 0 0 var(--space-6);
  padding-left: var(--space-6);
}
.post-content li {
  margin-bottom: var(--space-2);
}
.post-content li:last-child {
  margin-bottom: 0;
}
.post-content blockquote {
  margin: var(--space-6) 0;
  padding-left: var(--space-5);
  border-left: 2px solid var(--rust);
  color: var(--ink-soft);
  font-style: italic;
}
.post-content img {
  border-radius: var(--radius);
  margin: var(--space-6) auto;
}
.post-content a { text-decoration: underline; text-underline-offset: 2px; }

/* Koenig editor card widths */
.post-content .kg-width-wide {
  max-width: 1000px;
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -500px;
  margin-right: -500px;
}
.post-content .kg-width-full {
  max-width: 1400px;
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -700px;
  margin-right: -700px;
}
@media (max-width: 1000px) {
  .post-content .kg-width-wide,
  .post-content .kg-width-full {
    width: 100%;
    left: auto;
    right: auto;
    margin-left: 0;
    margin-right: 0;
  }
}

/* code blocks stay dark/inverted — not warm-paper toned */
.post-content pre {
  background: #1E1B16;
  color: #E8E2D0;
  font-family: var(--font-code);
  font-size: 12px;
  line-height: 1.6;
  padding: var(--space-5);
  border-radius: var(--radius);
  overflow-x: auto;
  margin: var(--space-6) 0;
}
.post-content code {
  font-family: var(--font-code);
  font-size: 0.85em;
  background: #1E1B16;
  color: #E8E2D0;
  padding: 1px 5px;
  border-radius: var(--radius);
}
.post-content pre code {
  background: none;
  padding: 0;
}

/* dispatch (prev/next) navigation */
.dispatch-nav {
  max-width: var(--text-column);
  margin: var(--space-10) auto 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
  padding-top: var(--space-8);
  border-top: 1px dashed var(--border);
}
.dispatch-nav__item--next { text-align: right; }
.dispatch-nav__label {
  display: block;
  margin-bottom: var(--space-1);
}
.dispatch-nav__title {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--ink);
}
.dispatch-nav__title:hover { color: var(--rust); }

/* subscribe CTA */
.subscribe-cta {
  max-width: var(--text-column);
  margin: var(--space-10) auto 0;
  padding: var(--space-8);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
}
.subscribe-cta__title {
  font-family: var(--font-display);
  font-size: 19px;
  margin-bottom: var(--space-2);
}
.subscribe-cta__copy {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink-soft);
  margin-bottom: var(--space-5);
}
.subscribe-cta__button {
  display: inline-block;
  font-family: var(--font-meta);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: var(--space-3) var(--space-8);
  background: var(--rust);
  color: var(--paper);
  border-radius: var(--radius);
  cursor: pointer;
}
.subscribe-cta__button:hover {
  background: var(--ink);
  text-decoration: none;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  border-top: 1px dashed var(--border);
  padding: var(--space-8) 0;
  font-family: var(--font-meta);
  font-size: 11px;
  color: var(--ink-muted);
}
.site-footer__inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
}
.site-footer a { color: var(--ink-muted); }
.site-footer a:hover { color: var(--rust); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 980px) {
  .post-grid { grid-template-columns: 1fr 1fr; }
  .post-card--full { grid-column: 1 / -1; }
}

@media (max-width: 780px) {
  .post-grid { grid-template-columns: 1fr; }
  .post-card--full { grid-template-columns: 1fr; }
  .hero__title, .post__title { font-size: 24px; }
  .hero__image { aspect-ratio: 4 / 3; max-height: 360px; }
  .post-card__image--hero { aspect-ratio: 4 / 3; max-height: 360px; }
  .post-card__title--hero { font-size: 24px; }
  .post__feature-image img { aspect-ratio: 4 / 3; max-height: 360px; }
  .site-nav .nav { gap: var(--space-4); }
  .dispatch-nav { grid-template-columns: 1fr; }
  .dispatch-nav__item--next { text-align: left; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
