/* ==========================================================================
   archive-blog.css — /blog/ archive (post archive + blog index route)
   Extracted 2026-05-12 css-master refactor. Conditionally enqueued via
   inc/setup.php on the blog context (is_blog_context()).
   ========================================================================== */

/* ==========================================================================
   /blog/ archive — design review fixes (2026-04-29)
   Topic-facet strip, gold-edge post cards, kill misleading numbered chips,
   tightened section rhythm, pagination styled to match button language.
   ========================================================================== */

/* Kill the misleading "01 / 02 / 03" decimal-leading-zero chips on post
   archives — they imply a curated ranked list but the order is reverse
   chronological. Service archive keeps them because it's strategically
   ordered (Business Website Design at 01 etc.). */
body.blog .card-grid-archive > .card .card-thumbnail::after,
body.blog .card-grid > .card .card-thumbnail::after {
  content: none !important;
}

/* Post archive hero: previously collapsed to single column because the
   right column was empty; with the `thread` sigil now rendering there
   (designer pass 2026-05-12), the post archive uses the same 2-column
   hero rhythm as Services and Portfolio. The header keeps its 60rem
   reading-width cap to stop the lede from wrapping at 18 words/line. */
.archive-hero--post .archive-hero__header {
  max-width: 60rem;
}

/* Topic-facet strip directly under the post-archive hero */
.post-archive-topics {
  padding: 1.25rem 0 0.5rem;
  margin-top: -0.25rem;
}

.post-archive-topics__label {
  margin: 0 0 0.6rem;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--color-muted);
}

.post-archive-topics__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.post-archive-topics__chip {
  /*
   * Gold-edge brand chip: always-visible 3px gold left rule (matches the
   * gold-edge cards on /services/ and the new post-card hover state),
   * navy outline on the rest, slightly bolder weight than a stock filter
   * widget so it reads as editorial, not form-control UI.
   *
   * min-height: 44px enforces the WCAG 2.5.5 (Level AAA) tap-target floor
   * even at the compact ≤540px breakpoint where padding shrinks. flex
   * centring keeps the label visually balanced inside the larger box.
   */
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.55rem 1rem;
  border: 1px solid var(--color-border-strong);
  border-left: 3px solid var(--color-gold);
  background: #ffffff;
  color: var(--color-text);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  text-decoration: none;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.post-archive-topics__chip:hover,
.post-archive-topics__chip:focus-visible {
  background: var(--color-accent-soft);
  border-color: var(--color-accent);
  border-left-color: var(--color-gold);
  color: var(--color-accent);
}

.post-archive-topics__chip.is-current {
  background: var(--color-accent);
  border-color: var(--color-accent);
  border-left-color: var(--color-gold);
  color: #ffffff;
  cursor: default;
}

.post-archive-topics__chip.is-current:hover,
.post-archive-topics__chip.is-current:focus-visible {
  background: var(--color-accent);
  color: #ffffff;
}

/* "All Field Notes" reset chip — same family as peers; active state (navy
   fill) already differentiates it as the reset/clear action */
.post-archive-topics__chip--all {
  font-family: "Sora", sans-serif;
}

@media (max-width: 540px) {
  .post-archive-topics__list {
    gap: 0.4rem;
  }
  .post-archive-topics__chip {
    padding: 0.4rem 0.7rem;
    font-size: 0.85rem;
  }
}

/* Tighten the wide gap between the hero/topic strip and the listing.
   The previous ~200px loose space made the page read as half-finished. */
body.blog .archive-grid-heading {
  margin-top: clamp(2rem, 4vw, 3rem);
}

/* Section heading above the writing list — rendered as a quiet
   uppercase department slug rather than a landmark billboard.
   Signals "list starts here" without competing with the lead above. */
body.blog .archive-grid-heading h2 {
  font-family: "Sora", sans-serif;
  font-size: clamp(0.9rem, 0.75rem + 0.5vw, 1.05rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin: 0;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-border);
}

/* Lead article on the blog archive: editorial spotlight, not a card.
   Removes the card-surface background/border so it breathes against
   the page. The bottom border separates it from the list below. */
body.blog .archive-lead {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--color-border);
  padding-top: 0;
  padding-left: 0;
  padding-right: 0;
}

/*
 * "Updated" sub-line on post cards. When publish and modified differ, the
 * card meta becomes "byline · Apr 12, 2026 · Updated Apr 29, 2026 · 6 min
 * read". Updated whispers: italic, smaller, ~70% muted so the eye lands on
 * "when it was written" first and the update note registers as an aside.
 */

/* "Page N of M" status, injected as a flex sibling inside the pagination
   .nav-links row by thisismyurl_2026_the_pagination() (designer pass
   2026-05-12 revision). Reads as part of the same control surface as
   prev/next/numbers rather than a separate stratum above it. Sized as a
   label, not a heading — the buttons remain the dominant affordance. */
.archive-pagination__status {
  font-family: Manrope, sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
  padding: 0 0.75rem;
  align-self: center;
}

/* Pagination: match the /services/ button language — square corners,
   navy outline default, gold fill on current, plain hover */
.navigation.pagination,
.archive-pagination {
  margin-top: clamp(2rem, 4vw, 3rem);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  border: 0;
}

.navigation.pagination .page-numbers,
.archive-pagination .page-numbers {
  border-radius: 0 !important;
  border: 1px solid var(--color-border) !important;
  background: #ffffff;
  color: var(--color-text);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.005em;
  padding: 0.55rem 0.95rem;
  text-decoration: none;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.navigation.pagination .page-numbers:hover,
.navigation.pagination .page-numbers:focus-visible,
.archive-pagination .page-numbers:hover,
.archive-pagination .page-numbers:focus-visible {
  border-color: var(--color-accent) !important;
  background: var(--color-accent-soft);
  color: var(--color-accent);
}

.navigation.pagination .page-numbers.current,
.archive-pagination .page-numbers.current {
  background: var(--color-gold) !important;
  border-color: var(--color-gold) !important;
  color: var(--color-accent-strong) !important; /* var(--color-accent-strong) on var(--color-gold) = ~5.2:1 — WCAG AA */
}

.navigation.pagination .page-numbers.dots,
.archive-pagination .page-numbers.dots {
  border-color: transparent !important;
  background: transparent;
}

/* ==========================================================================
   BLOG CARD GRID — 3-col bordered design matching /work/ and /projects/
   Scoped to .card-grid-archive within this file (only loaded on blog contexts).
   The lead article (.archive-lead) keeps its existing layout.
   ========================================================================== */

.card-grid-archive {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--color-border);
  margin-top: clamp(1.5rem, 3vw, 2.5rem);
}

@media (max-width: 860px) {
  .card-grid-archive {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 540px) {
  .card-grid-archive {
    grid-template-columns: 1fr;
  }
}

/* Card shell */
.card-grid-archive .card-entry {
  border-top: 3px solid var(--color-accent);
  border-right: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  border-left: none;
  background: #fff;
  display: flex;
  flex-direction: column;
  transition: background 0.15s ease;
}

.card-grid-archive .card-entry:nth-child(3n) {
  border-right: none;
}

.card-grid-archive .card-entry:nth-last-child(-n+3) {
  border-bottom: none;
}

/* Tablet: reset to 2-col border rules */
@media (max-width: 860px) {
  .card-grid-archive .card-entry:nth-child(3n) {
    border-right: 1px solid var(--color-border);
  }

  .card-grid-archive .card-entry:nth-child(even) {
    border-right: none;
  }

  .card-grid-archive .card-entry:nth-last-child(-n+3) {
    border-bottom: 1px solid var(--color-border);
  }

  .card-grid-archive .card-entry:nth-last-child(-n+2) {
    border-bottom: none;
  }
}

/* Mobile: 1-col */
@media (max-width: 540px) {
  .card-grid-archive .card-entry {
    border-right: none;
    border-bottom: 1px solid var(--color-border);
  }

  .card-grid-archive .card-entry:last-child {
    border-bottom: none;
  }

  .card-grid-archive .card-entry:nth-last-child(-n+2),
  .card-grid-archive .card-entry:nth-last-child(-n+3) {
    border-bottom: 1px solid var(--color-border);
  }
}

/* Suppress thumbnails — text-first on the blog card grid */
.card-grid-archive .card-thumbnail {
  display: none;
}

/* Card body */
.card-grid-archive .card-body {
  padding: clamp(2rem, 3.5vw, 3rem);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  flex: 1;
}

/* Title */
.card-grid-archive .card-entry .entry-title {
  font-size: clamp(1rem, 0.9rem + 0.5vw, 1.25rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin: 0;
}

.card-grid-archive .card-entry .entry-title a {
  color: var(--color-text-strong);
  text-decoration: none;
  transition: color 0.15s ease;
}

.card-grid-archive .card-entry .entry-title a:hover,
.card-grid-archive .card-entry .entry-title a:focus-visible {
  color: var(--color-accent);
}

/* Meta (date · author) */
.card-grid-archive .card-entry .entry-meta {
  font-size: 0.75rem;
  color: var(--color-muted);
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
}

/* Excerpt */
.card-grid-archive .card-entry .entry-summary {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--color-text-medium);
  margin: 0;
  flex: 1;
}

/* ==========================================================================
   WRITING INDEX — home.php /writing/ route (.writing-* classes)
   home.php was rewritten to a clean .writing-* class family. These rules
   cover that template only. The .card-grid-archive rules above serve
   archive.php / search.php / tag.php routes that share the old class names.
   Added 2026-06-06.
   ========================================================================== */

/* Hero */
.writing-hero {
  padding: clamp(2.5rem, 5vw, 4.5rem) 0 clamp(2rem, 4vw, 3rem);
  border-bottom: 1px solid var(--color-border);
}

.writing-hero__inner {
  max-width: 64ch;
}

.writing-hero h1 {
  font-size: var(--fs-h1);
  font-weight: 400;
  letter-spacing: var(--tracking-display);
  line-height: 1.04;
  margin: 0 0 0.85rem;
  text-wrap: balance;
}

.writing-hero__lead {
  margin: 0;
  color: var(--color-muted);
  font-size: clamp(1rem, 0.9rem + 0.4vw, 1.15rem);
  line-height: 1.55;
  max-width: 60ch;
}

/* Query container — max-width + centering without site-shell padding.
   The cards' own padding-left (1.25rem, for the gold bar indicator)
   provides the horizontal inset, matching the hero's site-shell gap. */
.writing-query {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
}

/* Grid section */
.writing-grid-section {
  padding: clamp(2.5rem, 5vw, 4rem) 0 clamp(3rem, 6vw, 5rem);
}

/* Card list */
.writing-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Individual card — PHP template: article.writing-card; FSE: li.wp-block-post */
.writing-card,
.writing-grid > li.wp-block-post {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: clamp(1.75rem, 3vw, 2.5rem) 0 clamp(1.75rem, 3vw, 2.5rem) 1.25rem;
  border-bottom: 1px solid var(--color-border);
}

/* No border-top on first card — the hero section's border-bottom already
   provides the separator between the header and the list. */

/* Gold left-bar reveal on hover/focus-within — composited transform, no width flash */
.writing-card::before,
.writing-grid > li.wp-block-post::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--color-gold);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.18s var(--ease-standard);
  pointer-events: none;
}

.writing-card:hover::before,
.writing-card:focus-within::before,
.writing-grid > li.wp-block-post:hover::before,
.writing-grid > li.wp-block-post:focus-within::before {
  transform: scaleX(1);
}

@media (prefers-reduced-motion: reduce) {
  .writing-card::before,
  .writing-grid > li.wp-block-post::before {
    transition: none;
  }
}

/* Meta row: date · category */
.writing-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
  margin: 0 0 0.5rem;
}

.writing-card__date {
  font-size: var(--fs-xs, 0.75rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--color-muted);
}

.writing-card__cat a {
  font-size: var(--fs-xs, 0.75rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-gold-text);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.writing-card__cat a:hover,
.writing-card__cat a:focus-visible {
  color: var(--color-gold-text);
  border-bottom-color: var(--color-gold);
}

/* Title */
.writing-card__title {
  font-size: clamp(1.2rem, 1rem + 1.2vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.18;
  margin: 0 0 0.65rem;
}

.writing-card__title a {
  color: var(--color-text-strong);
  text-decoration: none;
  transition: color 0.15s ease;
}

.writing-card__title a:hover,
.writing-card__title a:focus-visible {
  color: var(--color-accent);
}

/* Excerpt */
.writing-card__excerpt {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--color-text-medium);
  margin: 0;
  max-width: none;
}

/* Read-time label in writing-card meta row.
   Uses a mid-dot separator matching the lead-article treatment. */
.writing-card__read-time {
  font-size: var(--fs-xs, 0.75rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--color-muted);
}

.writing-card__read-time::before {
  content: "·";
  margin-right: 0.35rem;
  opacity: 0.5;
}

/* Pagination */
.writing-pagination {
  margin-top: clamp(2rem, 4vw, 3rem);
}

.writing-pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
}

.writing-pagination .page-numbers {
  border-radius: 0 !important;
  border: 1px solid var(--color-border) !important;
  background: #ffffff;
  color: var(--color-text);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.005em;
  padding: 0.55rem 0.95rem;
  text-decoration: none;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.writing-pagination .page-numbers:hover,
.writing-pagination .page-numbers:focus-visible {
  border-color: var(--color-accent) !important;
  background: var(--color-accent-soft);
  color: var(--color-accent);
}

.writing-pagination .page-numbers.current {
  background: var(--color-gold) !important;
  border-color: var(--color-gold) !important;
  color: var(--color-accent-strong) !important;
}

.writing-pagination .page-numbers.dots {
  border-color: transparent !important;
  background: transparent;
}

/* Empty state */
.writing-empty {
  padding: clamp(2rem, 4vw, 3rem) 0;
  color: var(--color-muted);
  font-size: 1rem;
}

