/* ==========================================================================
   THE BLOG
   ==========================================================================
   Ported from isamur.ai's blog in LAYOUT, not in code. That theme is Tailwind
   and ships WOW.js + animate.css for its card entrances; this one has its own
   tokens and already ships a reveal, so the cards use `[data-reveal]` and the
   `.is-in` class that assets/js/gz-depth.js sets. No second animation library.

   COLOUR COMES ENTIRELY FROM THE TOKENS at the top of style.css — --gz-void,
   --gz-surface, --gz-line, --gz-text, --gz-muted, and the magenta/teal/gold
   ramp. There is not one hex value in this file, which is what makes the blog
   follow the rest of the site when the palette moves.
   ========================================================================== */

.gz-blog-head {
  padding-block: clamp(64px, 12vw, 120px) clamp(24px, 4vw, 40px);
  text-align: center;
}

.gz-blog-head h1 {
  margin: 0 0 14px;
  font-size: clamp(2rem, 4.2vw, 3.1rem);
  line-height: 1.1;
}

.gz-blog-sub {
  margin: 0 auto;
  max-width: 60ch;
  color: var(--gz-muted);
  font-size: 1.06rem;
}

.gz-eyebrow {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  /* The brand ramp, on the one word that names the section. */
  background: var(--gz-slick);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.gz-blog-list { padding-block: clamp(28px, 5vw, 48px) clamp(64px, 12vw, 110px); }

/* `auto-fill` with a minimum rather than fixed breakpoints: the grid then
   reflows at every width instead of at three chosen ones, and a two-card
   language index does not stretch its cards to half the screen. */
.gz-blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
  gap: clamp(24px, 3vw, 34px);
}

/* ── ONE CARD ─────────────────────────────────────────────────────────── */

.gz-post-card {
  display: flex;
  flex-direction: column;
  background: var(--gz-surface);
  border: 1px solid var(--gz-line);
  border-radius: var(--gz-r-lg);
  overflow: hidden;
  transition: border-color .25s ease, transform .25s ease;
}

@media (hover: hover) {
  .gz-post-card:hover {
    border-color: color-mix(in srgb, var(--gz-teal) 40%, var(--gz-line));
    transform: translateY(-3px);
  }
}

/* ⚠️ THE ENTRANCE IS NOT DEFINED HERE, AND MUST NOT BE. assets/css/gz-depth.css
   already implements `[data-reveal]`, `.is-in` and the inline `--gz-delay`
   stagger generically — and it scopes every one of those rules under
   `.gz-depth`, a class only the script adds.

   That scoping is a safety contract, not a style choice: if the script is
   blocked or fails, nothing ever sets `.is-in`, and an unscoped
   `opacity: 0` would leave every card on the blog permanently invisible. The
   first draft of this file did exactly that. The markup opts in with
   `data-reveal` plus an inline `--gz-delay`; the behaviour belongs to the
   theme. */

.gz-post-shot {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--gz-surface-hi);
}

.gz-post-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s ease;
}

@media (hover: hover) {
  .gz-post-card:hover .gz-post-shot img { transform: scale(1.06); }
}

.gz-post-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 20px 22px;
}

.gz-post-tags { display: flex; flex-wrap: wrap; gap: 8px; }

.gz-tag {
  display: inline-block;
  padding: 3px 10px;
  border: 1px solid var(--gz-line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--gz-text) 6%, transparent);
  color: var(--gz-muted);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
}

a.gz-tag:hover {
  border-color: color-mix(in srgb, var(--gz-teal) 45%, transparent);
  color: var(--gz-text);
}

.gz-post-title {
  margin: 0;
  font-size: 1.18rem;
  line-height: 1.35;
  font-weight: 700;
}

.gz-post-title a { color: var(--gz-text); text-decoration: none; }
.gz-post-title a:hover { color: var(--gz-teal); }

.gz-post-excerpt {
  margin: 0;
  color: var(--gz-muted);
  font-size: 0.97rem;
  line-height: 1.6;
}

.gz-post-meta {
  margin: 4px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--gz-faint);
  font-size: 0.82rem;
}

/* ── PAGER ────────────────────────────────────────────────────────────── */

.gz-pager { margin-top: clamp(36px, 6vw, 60px); }

.gz-pager .nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.gz-pager .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--gz-line);
  border-radius: 10px;
  color: var(--gz-muted);
  text-decoration: none;
}

.gz-pager .page-numbers:hover { border-color: var(--gz-teal); color: var(--gz-text); }

.gz-pager .page-numbers.current {
  color: var(--gz-void);
  background: var(--gz-slick);
  border-color: transparent;
  font-weight: 700;
}

.gz-pager .screen-reader-text { position: absolute; left: -9999px; }

.gz-blog-empty {
  padding-block: clamp(40px, 8vw, 80px);
  text-align: center;
  color: var(--gz-muted);
}
.gz-blog-empty-alt a { color: var(--gz-teal); }

/* ==========================================================================
   ONE ARTICLE
   ========================================================================== */

/* THE READING COLUMN. 72ch is the measure the body copy is set for; the head
   and the media share it so the article reads as one column rather than as a
   wide page with a narrow paragraph down the middle. */
.gz-article-wrap { max-width: 74ch; }

.gz-article-head {
  padding-block: clamp(56px, 10vw, 104px) clamp(18px, 3vw, 28px);
}

.gz-article-head h1 {
  margin: 12px 0 16px;
  font-size: clamp(1.9rem, 3.8vw, 2.9rem);
  line-height: 1.15;
}

.gz-crumbs {
  display: flex;
  gap: 8px;
  color: var(--gz-faint);
  font-size: 0.86rem;
}
.gz-crumbs a { color: var(--gz-muted); text-decoration: none; }
.gz-crumbs a:hover { color: var(--gz-teal); }

.gz-article-lede {
  margin: 0 0 18px;
  color: var(--gz-muted);
  font-size: 1.14rem;
  line-height: 1.6;
}

.gz-article-meta { margin-top: 0; }

.gz-article-langs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--gz-line);
  font-size: 0.88rem;
}

.gz-article-langs-label { color: var(--gz-faint); }
.gz-article-langs a { color: var(--gz-muted); text-decoration: none; }
.gz-article-langs a:hover { color: var(--gz-teal); text-decoration: underline; }

.gz-article-shot {
  margin: 0 0 clamp(24px, 4vw, 40px);
  border-radius: var(--gz-r-lg);
  overflow: hidden;
  border: 1px solid var(--gz-line);
}
.gz-article-shot img { width: 100%; height: auto; display: block; }

/* ── THE PROSE SCOPE ──────────────────────────────────────────────────────
   Articles are written in the block editor, so this styles whatever tags the
   editor produced rather than a set of classes the theme controls. Everything
   here is a descendant selector for that reason. */

.gz-prose {
  color: var(--gz-text);
  font-size: 1.06rem;
  line-height: 1.75;
}

.gz-prose > * + * { margin-block-start: 1.15em; }

.gz-prose h2 {
  margin-block-start: 2em;
  font-size: clamp(1.45rem, 2.6vw, 1.85rem);
  line-height: 1.25;
}

.gz-prose h3 {
  margin-block-start: 1.6em;
  font-size: clamp(1.18rem, 2vw, 1.35rem);
  line-height: 1.3;
}

.gz-prose a { color: var(--gz-teal); text-underline-offset: 3px; }
.gz-prose a:hover { text-decoration-thickness: 2px; }

.gz-prose ul, .gz-prose ol { padding-inline-start: 1.4em; }
.gz-prose li + li { margin-block-start: 0.5em; }
.gz-prose li::marker { color: var(--gz-faint); }

.gz-prose img,
.gz-prose figure img {
  max-width: 100%;
  height: auto;
  border-radius: var(--gz-r-lg);
}

.gz-prose figure { margin-inline: 0; }
.gz-prose figcaption {
  margin-block-start: 8px;
  color: var(--gz-faint);
  font-size: 0.86rem;
  text-align: center;
}

.gz-prose blockquote {
  margin-inline: 0;
  padding: 4px 0 4px 18px;
  border-inline-start: 2px solid color-mix(in srgb, var(--gz-teal) 55%, transparent);
  color: var(--gz-muted);
}

.gz-prose code {
  padding: 2px 6px;
  border-radius: var(--gz-r-sm);
  background: var(--gz-surface-hi);
  font-size: 0.92em;
}

.gz-prose pre {
  padding: 16px;
  border-radius: var(--gz-r-lg);
  background: var(--gz-surface);
  border: 1px solid var(--gz-line);
  overflow-x: auto;
}
.gz-prose pre code { background: none; padding: 0; }

/* A WIDE TABLE SCROLLS INSIDE ITSELF. The page body must never scroll
   sideways — one table is not a reason to break every other paragraph. */
.gz-prose table {
  width: 100%;
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
}
.gz-prose th, .gz-prose td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--gz-line);
  text-align: start;
}
.gz-prose th { color: var(--gz-text); font-weight: 700; }
.gz-prose td { color: var(--gz-muted); }

.gz-article-tags {
  margin-block-start: clamp(32px, 5vw, 48px);
  padding-block-start: 20px;
  border-top: 1px solid var(--gz-line);
}

.gz-related { padding-block: clamp(48px, 8vw, 90px); }
.gz-related-head {
  margin: 0 0 clamp(20px, 3vw, 30px);
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
}

/* ── RESTRAINT ────────────────────────────────────────────────────────────
   The reveal's own reduced-motion handling lives with the reveal, in
   gz-depth.css. What is left here is this file's OWN motion — the hover lift
   and the thumbnail zoom — which nothing else knows about. */
@media (prefers-reduced-motion: reduce) {
  .gz-post-card,
  .gz-post-shot img { transition: none; }
  .gz-post-card:hover { transform: none; }
  .gz-post-card:hover .gz-post-shot img { transform: none; }
}
