/* ——————————————————————————————————————————————————————————————
   Ai GeoLAB — Journal, posts, standalone pages and 404
   Loaded after /style.css on server-rendered pages. Uses the same tokens
   (--deep-bg, --light-bg, --accent, --serif, --sans, --mono, --line…).
   .nav, footer and .post-card are styled by style.css — not here.
   —————————————————————————————————————————————————————————————— */

.blog-page {
  --measure: 700px; /* ≈ 68ch of 18px body copy; px so every column lines up */
  --prose-size: 18px;
  --page-gutter: 40px;
  background: var(--deep-bg);
  color: var(--deep-fg);
}
@media (max-width: 720px) {
  .blog-page { --page-gutter: 20px; }
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--deep-fg);
  color: var(--deep-bg);
  font-size: 14px;
  border-radius: 2px;
}
.skip-link:focus { top: 12px; }

.blog-page a:focus-visible,
.blog-page button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Fixed nav is 68px tall */
.blog-main { padding-top: 68px; min-height: 60vh; }

.blog-preview {
  padding: 12px var(--page-gutter);
  background: color-mix(in srgb, var(--accent-3) 12%, var(--light-bg));
  border-bottom: 1px solid color-mix(in srgb, var(--accent-3) 35%, transparent);
  color: var(--deep-fg);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-align: center;
}

/* ——— Journal index: header ——— */
.blog-hero {
  padding: 96px 0 48px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(ellipse 60% 80% at 85% 0%, var(--hero-grad-1), transparent 70%),
    var(--deep-bg);
}
.blog-title {
  margin-top: 28px;
  max-width: 16ch;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(46px, 7vw, 104px);
  line-height: 0.98;
  letter-spacing: -0.02em;
}
.blog-lead {
  margin-top: 28px;
  max-width: 58ch;
  font-size: 19px;
  line-height: 1.55;
  color: var(--deep-fg-muted);
}

.blog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 40px;
}
.blog-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--deep-fg-muted);
  background: var(--light-bg);
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}
.blog-chip:hover { border-color: var(--accent); color: var(--accent); }
.blog-chip[aria-current="page"] {
  background: var(--deep-fg);
  border-color: var(--deep-fg);
  color: var(--deep-bg);
}
.blog-chip-count {
  font-size: 10px;
  letter-spacing: 0.04em;
}

/* ——— Journal index: list ——— */
.blog-list { padding: 56px 0 112px; }

.blog-feature {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  overflow: hidden;
  margin-bottom: 72px;
  background: var(--light-bg);
  color: var(--light-fg);
  border: 1px solid var(--line-ink);
  border-radius: 4px;
  transition: box-shadow 260ms ease, border-color 260ms ease;
}
.blog-feature:hover {
  border-color: var(--line-ink-strong);
  box-shadow: 0 30px 60px -36px rgba(12, 22, 38, 0.4);
}
.blog-feature-media {
  position: relative;
  min-height: 360px;
  background: var(--light-bg-2);
  border-right: 1px solid var(--line-ink);
  overflow: hidden;
}
.blog-feature-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left top;
  transition: transform 700ms ease;
}
.blog-feature:hover .blog-feature-media img { transform: scale(1.02); }
.blog-feature-body {
  display: flex;
  flex-direction: column;
  padding: 44px 44px 40px;
}
.blog-feature-label {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 28px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--light-fg-muted);
}
.blog-feature-label span:first-child {
  padding: 3px 8px;
  border: 1px solid var(--accent);
  border-radius: 2px;
  color: var(--accent);
}
.blog-feature-label span + span { align-self: center; }
.blog-feature-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(34px, 3.6vw, 52px);
  line-height: 1.02;
  letter-spacing: -0.015em;
  margin-bottom: 18px;
}
.blog-feature-excerpt {
  font-size: 16px;
  line-height: 1.6;
  color: var(--light-fg-muted);
  margin-bottom: 32px;
  max-width: 48ch;
}
.blog-feature .post-card-more { margin-top: auto; }
.blog-feature:hover .post-card-more .arrow { transform: translateX(3px); }

.blog-list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.blog-list-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(30px, 3.4vw, 44px);
  line-height: 1.05;
  letter-spacing: -0.01em;
}
.blog-empty {
  padding: 48px 0;
  font-size: 17px;
  color: var(--deep-fg-muted);
}
.blog-empty a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* ——— Post page ——— */
.post-article { padding: 72px 0 32px; }

.post-header,
.post-body,
.post-series,
.post-pager {
  width: min(var(--measure), calc(100% - 2 * var(--page-gutter)));
  margin-left: auto;
  margin-right: auto;
}
.post-header { width: min(880px, calc(100% - 2 * var(--page-gutter))); text-align: center; }

.post-crumbs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 36px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--deep-fg-faint);
}
.post-crumbs a { color: var(--deep-fg-muted); transition: color 160ms ease; }
.post-crumbs a:hover { color: var(--accent); }

.post-eyebrow {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--deep-fg-faint);
}
.post-eyebrow > * + *::before {
  content: '·';
  margin: 0 12px;
  color: var(--deep-fg-faint);
}
.post-eyebrow-cat { color: var(--accent); }

.post-title {
  margin-top: 24px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(42px, 6vw, 84px);
  line-height: 1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.post-dek {
  margin: 28px auto 0;
  max-width: 54ch;
  font-size: 20px;
  line-height: 1.55;
  color: var(--deep-fg-muted);
  text-wrap: pretty;
}
.post-byline {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 32px;
  font-size: 14px;
  color: var(--deep-fg-muted);
}
.post-byline strong { color: var(--deep-fg); font-weight: 600; }
.post-byline .nav-logo-mark { width: 24px; height: 24px; }
.post-byline .nav-logo-mark svg { width: 24px; height: 24px; }
.post-byline a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent);
  text-underline-offset: 3px;
}
.post-byline a:hover { text-decoration-color: var(--accent); }
.post-byline-sep { color: var(--deep-fg-faint); }

.post-cover {
  width: min(1100px, calc(100% - 2 * var(--page-gutter)));
  margin: 56px auto 64px;
}
.post-cover img {
  width: 100%;
  height: auto;
  background: var(--light-bg-2);
  border: 1px solid var(--line);
  border-radius: 4px;
}
.post-cover figcaption,
.prose-figure figcaption {
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--deep-fg-faint);
}
.post-cover figcaption {
  max-width: var(--measure);
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

/* ——— Prose (rendered markdown) ——— */
.prose {
  font-size: var(--prose-size);
  line-height: 1.7;
  color: var(--deep-fg);
  overflow-wrap: break-word;
}
.prose > * + * { margin-top: 1.15em; }
.prose p { text-wrap: pretty; }
.prose h2 {
  margin-top: 2em;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(30px, 3.2vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.prose h3 {
  margin-top: 2em;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 21px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.prose h2 + *, .prose h3 + * { margin-top: 0.7em; }
.prose h2, .prose h3 { scroll-margin-top: 96px; }
/* Long articles: jump straight to anchors. Smooth scrolling during page load
   races the font swap and lands deep links in the wrong place. */
html:has(body.blog-page) { scroll-behavior: auto; }
.prose > :first-child { margin-top: 0; }
.prose strong { font-weight: 600; }
.prose em { font-style: italic; }

.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  text-underline-offset: 3px;
  transition: text-decoration-color 160ms ease;
}
.prose a:hover { text-decoration-color: var(--accent); }

.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 0.45em; }
.prose li::marker { color: var(--accent); }
.prose ol li::marker { font-family: var(--mono); font-size: 0.85em; }

.prose blockquote {
  margin-left: 0;
  padding: 4px 0 4px 24px;
  border-left: 2px solid var(--accent);
  font-family: var(--serif);
  font-size: 1.35em;
  line-height: 1.4;
  color: var(--deep-fg);
}

.prose hr {
  border: 0;
  height: 1px;
  margin: 3em 0;
  background: var(--line-strong);
}

.prose code {
  padding: 0.1em 0.35em;
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--light-bg-2);
  border: 1px solid var(--line);
  border-radius: 2px;
}
.prose pre {
  overflow-x: auto;
  padding: 18px 20px;
  background: var(--light-bg-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.6;
}
.prose pre code { padding: 0; background: none; border: 0; }

.prose img {
  width: 100%;
  height: auto;
  background: var(--light-bg-2);
  border: 1px solid var(--line);
  border-radius: 4px;
}

/* Figures break out of the text column (up to 920px) */
.prose .prose-figure {
  width: min(920px, calc(100vw - 2 * var(--page-gutter)));
  margin: 2.4em 0 2.4em calc(50% - min(460px, 50vw - var(--page-gutter)));
}
.prose-figure figcaption { max-width: var(--measure); }

.prose-table {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--light-bg);
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.5;
}
.prose th, .prose td {
  padding: 12px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.prose th {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--deep-fg-faint);
  background: var(--light-bg-2);
}
.prose tr:last-child td { border-bottom: 0; }

/* ——— Series box ——— */
.post-series {
  margin-top: 72px;
  padding: 28px 32px 30px;
  background: var(--light-bg);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
}
.post-series-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.post-series-label::before {
  content: '';
  width: 28px;
  height: 1px;
  background: var(--accent);
}
.post-series-list {
  list-style: none;
  margin-top: 18px;
  display: grid;
}
.post-series-list li {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  font-size: 16px;
  line-height: 1.4;
}
.post-series-num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--deep-fg-faint);
}
.post-series-list a {
  color: var(--deep-fg);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: color 160ms ease, text-decoration-color 160ms ease;
}
.post-series-list a:hover { color: var(--accent); text-decoration-color: currentColor; }
.post-series-list .is-current { color: var(--deep-fg-muted); }
.post-series-list .is-current .post-series-num { color: var(--accent); }
.post-series-list em { font-style: normal; font-size: 13px; color: var(--deep-fg-faint); }

/* ——— Prev / next ——— */
.post-pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 32px;
}
.post-pager-link {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 22px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  transition: border-color 160ms ease, background 160ms ease;
}
.post-pager-link:hover { border-color: var(--accent); background: var(--light-bg); }
.post-pager-next { text-align: right; grid-column: 2; }
.post-pager-dir {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.post-pager-title {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.15;
  color: var(--deep-fg);
}

/* ——— Related posts ——— */
.post-related {
  margin-top: 64px;
  padding: 88px 0 104px;
  background: var(--light-bg-2);
  border-top: 1px solid var(--line);
}

/* ——— CTA band (dark) ——— */
.blog-cta {
  padding: 96px 0;
  background: #0c1626;
  color: #f4f1ea;
  background-image:
    radial-gradient(ellipse 50% 90% at 100% 0%, rgba(88, 214, 255, 0.14), transparent 70%),
    radial-gradient(ellipse 40% 70% at 0% 100%, rgba(46, 117, 96, 0.18), transparent 70%);
}
.blog-cta-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 48px;
  align-items: end;
}
.blog-cta .eyebrow { color: #8fc8ff; }
.blog-cta .eyebrow::before { background: #8fc8ff; }
.blog-cta-title {
  margin-top: 22px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(38px, 5vw, 68px);
  line-height: 1;
  letter-spacing: -0.015em;
}
.blog-cta .italic-accent { color: #8fc8ff; }
.blog-cta-lead {
  margin-top: 22px;
  max-width: 52ch;
  font-size: 17px;
  line-height: 1.6;
  color: rgba(244, 241, 234, 0.72);
}
.blog-cta-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
}
.blog-page .blog-cta-btn {
  background: #f4f1ea;
  color: #0c1626;
}
.blog-page .blog-cta-btn:hover { background: #8fc8ff; color: #0c1626; transform: translateY(-1px); }
.blog-cta-link {
  font-size: 14px;
  color: rgba(244, 241, 234, 0.8);
  border-bottom: 1px solid rgba(244, 241, 234, 0.3);
  padding-bottom: 2px;
  transition: color 160ms ease, border-color 160ms ease;
}
.blog-cta-link:hover { color: #fff; border-color: #fff; }

/* ——— Standalone pages ——— */
.page-article { padding: 96px 0 120px; }
.page-header,
.page-body {
  width: min(var(--measure), calc(100% - 2 * var(--page-gutter)));
  margin-left: auto;
  margin-right: auto;
}
.page-header {
  padding-bottom: 40px;
  margin-bottom: 48px;
  border-bottom: 1px solid var(--line);
}
.page-title {
  margin-top: 24px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(44px, 6vw, 80px);
  line-height: 1;
  letter-spacing: -0.02em;
}
.page-lead {
  margin-top: 24px;
  font-size: 20px;
  line-height: 1.55;
  color: var(--deep-fg-muted);
}

/* ——— 404 ——— */
.notfound { padding: 120px 0 120px; }
.notfound-title {
  margin-top: 28px;
  max-width: 14ch;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(48px, 8vw, 112px);
  line-height: 0.98;
  letter-spacing: -0.02em;
}
.notfound-lead {
  margin-top: 28px;
  max-width: 52ch;
  font-size: 19px;
  line-height: 1.55;
  color: var(--deep-fg-muted);
}
.notfound-actions { margin-top: 36px; }
.notfound-recent {
  margin-top: 96px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
}
.notfound-recent .blog-list-title { margin-bottom: 28px; }

/* ——— Responsive ——— */
@media (max-width: 1100px) {
  .blog-feature { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
  .blog-feature-body { padding: 36px 32px 32px; }
}
@media (max-width: 900px) {
  .blog-hero { padding: 64px 0 36px; }
  .blog-list { padding: 40px 0 80px; }
  .blog-feature { grid-template-columns: minmax(0, 1fr); margin-bottom: 56px; }
  .blog-feature-media {
    min-height: 0;
    aspect-ratio: 16 / 10;
    border-right: 0;
    border-bottom: 1px solid var(--line-ink);
  }
  .post-article { padding-top: 48px; }
  .post-cover { margin: 40px auto 48px; }
  .post-related { padding: 64px 0 72px; margin-top: 48px; }
  .blog-cta { padding: 72px 0; }
  .blog-cta-inner { grid-template-columns: minmax(0, 1fr); gap: 32px; align-items: start; }
  .page-article { padding: 64px 0 88px; }
  .notfound { padding: 80px 0; }
}
@media (max-width: 600px) {
  .blog-page { --prose-size: 17px; }
  .blog-lead, .post-dek, .page-lead { font-size: 17px; }
  .blog-filters { margin-top: 28px; gap: 8px; }
  .blog-chip { padding: 8px 14px; }
  .blog-feature-body { padding: 26px 22px 26px; }
  .blog-feature-title { font-size: 32px; }
  .post-crumbs { margin-bottom: 24px; }
  .post-eyebrow { font-size: 10.5px; letter-spacing: 0.1em; }
  .post-eyebrow > * + *::before { margin: 0 8px; }
  .post-header { text-align: left; }
  .post-crumbs, .post-eyebrow, .post-byline { justify-content: flex-start; }
  .post-byline-sep { display: none; }
  .post-byline a { flex-basis: 100%; }
  .post-dek { margin-left: 0; }
  .post-cover { width: 100%; }
  .post-cover img { border-radius: 0; border-left: 0; border-right: 0; }
  .post-cover figcaption { padding: 0 var(--page-gutter); text-align: left; }
  .prose h2 { font-size: 30px; margin-top: 1.8em; }
  .prose .prose-figure { width: 100%; margin-left: 0; }
  .post-series { padding: 22px 20px 24px; }
  .post-pager { grid-template-columns: minmax(0, 1fr); }
  .post-pager-next { grid-column: 1; }
  .post-pager-spacer { display: none; }
  .blog-cta-actions { align-items: stretch; }
  .blog-cta-btn { justify-content: center; }
  .blog-cta-link { align-self: flex-start; }
}

/* ——— Motion ——— */
@media (prefers-reduced-motion: reduce) {
  .blog-feature-media img,
  .blog-feature:hover .blog-feature-media img { transition: none; transform: none; }
  .blog-page .blog-cta-btn:hover { transform: none; }
}

/* ——— Print: just the article ——— */
@media print {
  .nav, footer, .blog-cta, .post-related, .post-pager, .skip-link { display: none !important; }
  .blog-main { padding-top: 0; }
  .prose a { color: inherit; }
}
