/* ============================================================
 * Public blog — index + post detail.
 * Loaded ONLY by blog.html and blog-post.html. Reuses brand
 * tokens from style.css (cream background, ink black foreground,
 * accent lime, Outfit / Hanken typography) without redeclaring
 * them so the site stays cohesive.
 * ============================================================ */

/* Section wrapper sits below the about-hero on the index. */
.blog-section {
  padding: 24px 5vw 96px;
  max-width: 1400px;
  margin: 0 auto;
}

/* Status placeholder (loading / empty / error). */
.blog-status {
  text-align: center;
  padding: 60px 16px;
  font-size: 15px;
  color: rgba(14, 14, 14, 0.7);
  font-family: 'Hanken Grotesk', system-ui, sans-serif;
}
.blog-status--error { color: #b04a3b; }

/* -----------------------------------------------------------
 * Language tabs above the grid
 * --------------------------------------------------------- */
.blog-tabs {
  display: inline-flex;
  gap: 4px;
  border-bottom: 1px solid rgba(14, 14, 14, 0.12);
  margin-bottom: 36px;
  width: 100%;
}
.blog-tab {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 12px 18px;
  font-family: 'Hanken Grotesk', system-ui, sans-serif;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: rgba(14, 14, 14, 0.6);
  cursor: pointer;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color 0.2s ease;
}
.blog-tab:hover { color: #0e0e0e; }
.blog-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  background: rgba(14, 14, 14, 0.08);
  color: rgba(14, 14, 14, 0.7);
}
.blog-tab--active {
  color: #0e0e0e;
  font-weight: 600;
}
.blog-tab--active::after {
  /* Underline that visually sits ON the section border to read as
   * "selected" without a separate pill. */
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -1px;
  height: 2px;
  background: #0e0e0e;
  border-radius: 999px;
}
.blog-tab--active .blog-tab-count {
  background: #0e0e0e;
  color: #DEE777;
}

/* -----------------------------------------------------------
 * Index grid
 * --------------------------------------------------------- */
.blog-grid {
  /* The grid container now holds tabs + inner card grid. The actual
   * card layout lives on `.blog-grid-inner`. */
}
.blog-grid-inner {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
}

.blog-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid rgba(14, 14, 14, 0.08);
  border-radius: 18px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.blog-card:hover {
  transform: translateY(-3px);
  border-color: rgba(14, 14, 14, 0.35);
  box-shadow: 0 22px 40px -28px rgba(14, 14, 14, 0.25);
}

.blog-card-cover {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #f5f1c9 center/cover no-repeat;
}
.blog-card-cover--empty {
  background:
    radial-gradient(80% 60% at 30% 30%, rgba(222, 231, 119, 0.55), transparent),
    linear-gradient(135deg, #f5f1c9 0%, #f9f6da 100%);
}

.blog-card-body {
  padding: 22px 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.blog-card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 500;
  line-height: 1.2;
  margin: 0;
  color: #0e0e0e;
}

.blog-card-excerpt {
  font-family: 'Hanken Grotesk', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(14, 14, 14, 0.7);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-meta {
  font-family: 'Hanken Grotesk', system-ui, sans-serif;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: rgba(14, 14, 14, 0.55);
  margin-top: auto;
  text-transform: uppercase;
}
.blog-card-author { margin-left: 6px; text-transform: none; letter-spacing: 0; }

/* -----------------------------------------------------------
 * Post detail
 * --------------------------------------------------------- */
.blog-post {
  max-width: 760px;
  /* Extra top breathing room so the title doesn't collide with the
   * fixed nav — the landing's <nav.nav> sits ~80px tall and we want a
   * comfortable 24-32px gap below it. */
  margin: 112px auto 48px;
  padding: 0 5vw;
}
@media (max-width: 720px) {
  .blog-post { margin-top: 88px; }
}

.blog-post-header {
  /* Roomy gap between the meta line and the start of the article so
   * the title block reads as its own visual section before the body
   * (including any first inline image) takes over. */
  margin-bottom: 64px;
}
@media (max-width: 720px) {
  .blog-post-header { margin-bottom: 40px; }
}
.blog-post-eyebrow {
  font-family: 'Hanken Grotesk', system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 11px;
  color: rgba(14, 14, 14, 0.6);
  margin: 0 0 14px;
}
.blog-post-title {
  font-family: 'Outfit', sans-serif;
  /* Heavier weight (700 / bold) — Outfit's 500 was reading too light
   * for a magazine-style hero title. */
  font-weight: 700;
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 0 18px;
  color: #0e0e0e;
}
.blog-post-meta {
  font-family: 'Hanken Grotesk', system-ui, sans-serif;
  font-size: 13px;
  color: rgba(14, 14, 14, 0.6);
  margin: 0;
}

.blog-post-cover {
  margin: 0 0 32px;
  overflow: hidden;
}
.blog-post-cover img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* Editor-produced HTML — Tiptap default extensions emit standard
 * tags (p, h1–h6, ul/ol, blockquote, img, a, code, pre). Style
 * each so a clean post reads well without the editor having to
 * hand-tune anything. */
.blog-post-body {
  font-family: 'Hanken Grotesk', system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.7;
  color: rgba(14, 14, 14, 0.86);
}
.blog-post-body p { margin: 0 0 1.2em; }
.blog-post-body h2,
.blog-post-body h3,
.blog-post-body h4 {
  font-family: 'Outfit', sans-serif;
  font-weight: 500;
  color: #0e0e0e;
  line-height: 1.2;
  margin: 2em 0 0.6em;
}
.blog-post-body h2 { font-size: 30px; }
.blog-post-body h3 { font-size: 24px; }
.blog-post-body h4 { font-size: 19px; }
.blog-post-body ul,
.blog-post-body ol { margin: 0 0 1.2em 1.2em; padding: 0; }
.blog-post-body li { margin: 0.25em 0; }
.blog-post-body blockquote {
  margin: 1.6em 0;
  padding: 12px 22px;
  border-left: 3px solid #DEE777;
  background: rgba(222, 231, 119, 0.18);
  color: #0e0e0e;
  font-size: 17px;
  border-radius: 0 12px 12px 0;
}
.blog-post-body img {
  max-width: 100%;
  height: auto;
  margin: 1.4em 0;
}
/* Resize + alignment options the editor sets on inline images.
 * Width is stamped as inline style (e.g. style="width: 50%;") by
 * Tiptap, so no rule needed for the size itself — we just respect
 * whatever the author chose. Alignment is `data-align` so we can
 * target it cleanly here without a class collision. */
.blog-post-body img[data-align="center"],
.blog-post-body img:not([data-align]) {
  display: block;
  margin-left: auto;
  margin-right: auto;
  clear: both;
}
.blog-post-body img[data-align="left"] {
  float: left;
  margin: 0.4em 1.4em 0.8em 0;
  clear: left;
}
.blog-post-body img[data-align="right"] {
  float: right;
  margin: 0.4em 0 0.8em 1.4em;
  clear: right;
}
/* Make sure the next block-level element (paragraph / heading / list)
 * clears the float before we move on, so wrap text doesn't bleed into
 * the next section uncomfortably. */
.blog-post-body h2,
.blog-post-body h3,
.blog-post-body h4,
.blog-post-body blockquote,
.blog-post-body pre,
.blog-post-body hr { clear: both; }
.blog-post-body a {
  color: #0e0e0e;
  text-decoration: underline;
  text-decoration-color: #DEE777;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.blog-post-body code {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.92em;
  background: #f5f1c9;
  padding: 1px 6px;
  border-radius: 4px;
}
.blog-post-body pre {
  background: #0e0e0e;
  color: #FBF7D1;
  padding: 18px 22px;
  border-radius: 14px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.55;
  margin: 1.4em 0;
}
.blog-post-body pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.blog-back {
  max-width: 760px;
  margin: 0 auto 96px;
  padding: 0 5vw;
}
.blog-back a {
  font-family: 'Hanken Grotesk', system-ui, sans-serif;
  font-size: 14px;
  color: #0e0e0e;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}
.blog-back a:hover { color: #4a4a4a; }
