/* =============================================================
   BLOG — /blog/ hub and /blog/<slug>/ posts (scripts/blog.js)
   Linked only from blog pages, after global.css and pages.css.
   Uses the tokens and fonts from global.css; none are redefined.
   ============================================================= */

/* ----- Navy header band (section.hero from pages.css) ------ */
.blog-hero-inner {
  position: relative;
  max-width: 900px;
  padding: 72px 0 80px;
}
.blog-hero h1.display {
  font-size: clamp(34px, 4.4vw, 56px);
  line-height: 1.08;
  margin-bottom: 20px;
}
.blog-hero .lede {
  margin: 0;
  max-width: 640px;
  font-size: 18px;
  line-height: 1.55;
  color: #C9D2E2;
}
.post-meta {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #C9D2E2;
}
.post-meta span + span::before {
  content: "·";
  margin: 0 10px;
  color: var(--gold);
}

/* Long post titles wrap instead of overflowing the 56px crumb bar */
.blog-page .breadcrumb .wrap {
  height: auto;
  min-height: 56px;
  padding-top: 14px;
  padding-bottom: 14px;
  flex-wrap: wrap;
  row-gap: 4px;
}

/* ----- Article column -------------------------------------- */
.post-col { max-width: 760px; margin: 0 auto; }

/* Fixed landscape frame so any hero shape renders the same; shared with hub cards */
.frame-landscape {
  width: 100%;
  height: auto;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
  background: var(--paper-2);
}
.post-hero { margin: 0 0 48px; }

.prose {
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink-2);
}
.prose > * { margin-top: 0; margin-bottom: 0; }
.prose > * + * { margin-top: 1.15em; }
.prose h2 {
  margin-top: 2.1em;
  font-size: clamp(26px, 2.8vw, 34px);
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--ink);
  scroll-margin-top: 96px;
}
.prose h3 {
  margin-top: 1.7em;
  font-size: clamp(20px, 2vw, 23px);
  line-height: 1.25;
  font-weight: 600;
  color: var(--ink);
  scroll-margin-top: 96px;
}
.prose h2 + *, .prose h3 + * { margin-top: 0.6em; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  transition: color .15s;
}
.prose a:hover { color: var(--gold-2); }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 0.45em; }
.prose li::marker { color: var(--gold); font-weight: 600; }
.prose blockquote {
  margin-left: 0; margin-right: 0;
  border-left: 3px solid var(--gold);
  padding: 4px 0 4px 20px;
  color: var(--ink);
}
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2.4em 0; }
.prose code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.88em;
  background: var(--paper-2);
  padding: 1px 5px;
}

.prose figure { margin: 2.2em 0; }
.prose figure img { max-width: 100%; height: auto; margin: 0 auto; }
.prose figure.fig-upright { max-width: 560px; margin-left: auto; margin-right: auto; }

/* ----- Tables (scroll inside their own box on phones) ------ */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--rule);
  background: #fff;
}
.table-scroll:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.table-scroll table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.55; }
.table-scroll.table-wide table { min-width: 640px; }
.table-scroll th, .table-scroll td {
  padding: 12px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--rule);
}
.table-scroll th {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  background: var(--navy);
}
.table-scroll tr:last-child td { border-bottom: none; }
.table-scroll tbody tr:nth-child(even) td { background: var(--paper); }
.table-scroll td + td, .table-scroll th + th { border-left: 1px solid var(--rule); }
.table-scroll th + th { border-left-color: var(--navy-line); }

/* ----- Related pages --------------------------------------- */
.post-related { margin-top: 64px; }
.post-related .label {
  margin: 0 0 14px;
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.post-related ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.post-related li { border-bottom: 1px solid var(--rule); }
.post-related a {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 18px 4px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  transition: background .15s, padding .15s;
}
.post-related a:hover { background: var(--paper); padding-left: 12px; }
.post-related .num { font-size: 11px; letter-spacing: 0.12em; color: var(--gold); }
.post-related .arrow { color: var(--muted); transition: color .15s, transform .2s; }
.post-related a:hover .arrow { color: var(--gold); transform: translateX(4px); }

/* ----- Hub ------------------------------------------------- */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.post-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--rule);
  background: #fff;
  transition: border-color .15s;
}
.post-card:hover { border-color: var(--ink); }
.post-card-img { display: block; overflow: hidden; }
.post-card-body { padding: 24px 26px 28px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.post-card time { font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.post-card h2 { margin: 0; font-size: 22px; line-height: 1.2; letter-spacing: -0.01em; }
.post-card h2 a:hover { color: var(--gold-2); }
.post-card p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--ink-2); }
.post-card-more {
  margin-top: auto;
  padding-top: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold-2);
}
.post-card-more .arrow { display: inline-block; transition: transform .2s; }
.post-card:hover .post-card-more .arrow { transform: translateX(3px); }
/* The newest post leads as a wide feature card, so a single post reads as deliberate */
.post-card.is-featured { grid-column: 1 / -1; display: grid; grid-template-columns: 1.15fr 1fr; }
.post-card.is-featured .frame-landscape { height: 100%; }
.post-card.is-featured .post-card-body { padding: 44px 48px; justify-content: center; gap: 16px; }
.post-card.is-featured h2 { font-size: clamp(26px, 2.8vw, 34px); }
.post-card.is-featured .post-card-more { margin-top: 8px; }
.hub-empty { margin: 0; font-size: 17px; color: var(--ink-2); }

/* ----- Responsive ------------------------------------------ */
@media (max-width: 1024px) {
  .post-grid { grid-template-columns: repeat(2, 1fr); }
  .post-card.is-featured { grid-template-columns: 1fr; }
  .post-card.is-featured .frame-landscape { height: auto; }
  .post-card.is-featured .post-card-body { padding: 28px 28px 32px; }
}
@media (max-width: 640px) {
  .blog-hero-inner { padding: 48px 0 56px; }
  .blog-hero .lede { font-size: 16px; }
  .post-meta { font-size: 11px; line-height: 1.9; }
  .post-grid { grid-template-columns: 1fr; }
  .prose { font-size: 16px; }
  .post-hero { margin-bottom: 36px; }
  .blog-page .breadcrumb .wrap { font-size: 12px; }
}
