:root {
  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; }

body.blog {
  margin: 0;
  min-height: 100vh;
  background: var(--noir);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.65;
  font-size: 16px;
}

a { color: var(--orange); }
a:hover { color: var(--orange-light); }

/* Visible focus everywhere (WCAG 2.2 AA) — never suppressed. */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}

.blog-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(239, 222, 191, 0.12);
}

.blog-wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.04em;
  color: var(--cream);
  text-decoration: none;
}

.blog-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 20px 64px;
}

.blog-eyebrow {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.post-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  line-height: 1.2;
  color: var(--cream);
  margin: 8px 0 20px;
}

.post-hero {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
}

.post-body h2, .post-body h3, .post-body h4, .post-body h5, .post-body h6 {
  font-family: var(--font-display);
  color: var(--cream);
  line-height: 1.3;
  margin: 1.6em 0 0.6em;
  scroll-margin-top: 16px;
}

.post-body p { margin: 0 0 1.1em; }

.post-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin: 0.6em 0;
}

.post-body a { text-decoration: underline; text-underline-offset: 2px; }

.post-body code {
  font-family: var(--font-mono);
  background: var(--panel);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  font-size: 0.92em;
}

.post-body pre {
  background: var(--panel);
  padding: 14px 16px;
  border-radius: var(--radius);
  overflow-x: auto;
}

.post-body blockquote {
  border-left: 3px solid var(--teal-deep);
  margin: 0 0 1.1em;
  padding: 0.2em 0 0.2em 1em;
  color: var(--text-muted);
}

.related-posts {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid rgba(239, 222, 191, 0.12);
}

.related-posts h2 {
  font-family: var(--font-display);
  color: var(--cream);
  font-size: 1.1rem;
}

.related-posts ul { list-style: none; padding: 0; margin: 12px 0 0; }
.related-posts li { margin-bottom: 8px; }

.post-list {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  display: grid;
  gap: 20px;
  /* As many columns as fit (three at full width, one on a phone), so a card's square thumbnail never
     grows past about a third of the page. */
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
}

.post-card {
  border: 1px solid rgba(239, 222, 191, 0.1);
  border-radius: var(--radius-lg);
  padding: 16px;
  background: var(--panel);
}

/* The thumbnail and the title are one link (tools/lib/render.mjs). */
.post-card .post-card-link { display: block; color: var(--cream); text-decoration: none; }
.post-card .post-card-link:hover { color: var(--orange-light); }

/* The post's own hero, which is wide: cropped to its middle square here, never squashed. */
.post-card-thumb {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 12px;
  background: var(--noir-2);
}

.post-card .post-card-title { font-size: 1.05rem; }
.post-card .post-card-meta { color: var(--text-muted); font-size: 0.85rem; margin-top: 6px; }

/* Real Valve game art woven into a post body (tools/lib/game-art.mjs) — an icon inline with the text
   it names, and a hero's card as a supporting figure. */
.game-icon {
  width: 24px;
  height: 24px;
  vertical-align: -0.3em; /* centres a 24px icon on the text line instead of sitting like superscript */
  margin-right: 4px;
  border-radius: 4px;
}

/* Wraps an icon and its name (tools/lib/game-art.mjs) so the two never wrap onto different lines. */
.game-name {
  white-space: nowrap;
}

.hero-card {
  margin: 0 0 1.4em;
  text-align: center;
}

.hero-card img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
}

@media (min-width: 720px) {
  .hero-card {
    float: right;
    margin: 0 0 1em 1.4em;
    max-width: 220px;
  }
}

.blog-footer {
  padding: 24px 20px 40px;
  color: var(--text-muted);
  font-size: 0.82rem;
  text-align: center;
  border-top: 1px solid rgba(239, 222, 191, 0.08);
}
