/* ==========================================================================
   Scryglass site — the blog: the post index and what a post adds on top of
   the article shell.
   Depends on tokens.css, site.css and components.css, in that order. Post
   pages also load article.css first, so `.crumbs` and `.article__*` are
   already styled and nothing below redefines them.
   ========================================================================== */

/* --- Index hero ------------------------------------------------------------
   The same slab as `.support-hero`: 64px of padding, a hairline under it.   */

.blog-hero {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 64px var(--page-gutter);
  border-bottom: 1px solid var(--hairline);
}

.blog-hero__title {
  font-size: 52px;
  font-weight: 700;
  letter-spacing: -.03em;
  color: var(--text-primary);
}

.blog-hero__sub {
  max-width: 620px;
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* --- Index list ------------------------------------------------------------
   One column at the article measure. content-box for the same reason as
   `.doc__body`: 820px is the width of the text, not of the padded column.  */

.blog-list {
  display: flex;
  flex-direction: column;
  box-sizing: content-box;
  max-width: 820px;
  padding: 40px var(--page-gutter) 56px;
}

.blog-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 26px 0;
  border-bottom: 1px solid var(--hairline);
}

.blog-card:last-child {
  border-bottom: 0;
}

/* Lift the title rather than underline all three lines of the card. */
.blog-card:hover {
  text-decoration: none;
}

.blog-card:hover .blog-card__title {
  color: var(--accent-pink);
}

.blog-card:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 3px;
}

.blog-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
}

.blog-card__title {
  font-size: 26px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--text-primary);
}

.blog-card__desc {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.blog-list__empty {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
}

/* --- Post body ---------------------------------------------------------------
   Layout is `.doc__body`, from article.css — the post layout now sits in the
   same sidebar grid as a support article, so nothing post-specific is needed
   here.                                                                      */

/* The draft pill sits in `.article__meta` on a post and in `.blog-card__meta`
   on the index; both are mono meta rows, so it needs no per-context rule.  */
.post__draft {
  padding: 2px 6px;
  border: 1px solid var(--accent-pink);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .12em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--accent-pink);
}

/* --- Prev / next -------------------------------------------------------------
   Two explicit columns so a lone "next" still lands on the right when there
   is no "prev" to push it there. The all-posts link spans the row below.   */

.post__nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 40px;
  padding-top: 26px;
  border-top: 1px solid var(--hairline);
}

.post__nav-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.post__nav-link--prev {
  grid-column: 1;
  text-align: left;
}

.post__nav-link--next {
  grid-column: 2;
  text-align: right;
}

.post__nav-link:hover {
  text-decoration: none;
}

.post__nav-link:hover .post__nav-title {
  color: var(--accent-pink);
}

.post__nav-link:focus-visible,
.post__nav-all:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 3px;
}

.post__nav-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.post__nav-title {
  font-size: 16px;
  line-height: 1.4;
  font-weight: 600;
  color: var(--text-primary);
}

/* Same voice as `.arrow-link` in components.css, placed in the grid. */
.post__nav-all {
  grid-column: 1 / -1;
  justify-self: start;
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent-cyan);
}

/* ==========================================================================
   WP9 — responsive
   See the breakpoint table at the foot of site.css. Nothing here matches at
   1240px or wider.
   ========================================================================== */

/* The floor is the 900px value, reached at 950, so there is no step across
   either boundary. */
@media (max-width: 1239px) {
  .blog-hero__title { font-size: clamp(40px, 4.21vw, 52px); }
}

@media (max-width: 900px) {
  .blog-hero {
    gap: 14px;
    padding: 48px var(--page-gutter);
  }

  .blog-list { padding: 30px var(--page-gutter) 48px; }
}

@media (max-width: 620px) {
  .blog-hero__title { font-size: 32px; }

  .blog-card__title { font-size: 22px; }

  /* One column: "next" drops under "prev" and both read left to right. */
  .post__nav {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .post__nav-link--prev,
  .post__nav-link--next {
    grid-column: 1;
    text-align: left;
  }

  .post__nav-all { margin-top: 8px; }
}
