/*
 * 21 Young Hearts — Single Blog Post Page
 * Styles for the single-yh_blog.php template.
 * Consumes tokens from tokens.css + inherits from base.css & components.css.
 * ─────────────────────────────────────────────────────────────────
 *
 * Table of contents
 * ─────────────────
 *  1. Blog header (breadcrumb + title + meta)
 *  2. Two-column content grid
 *  3. Featured image
 *  4. Body content (WYSIWYG)
 *  5. Post footer (category tag)
 *  6. Sidebar: blog CTA card
 *  7. Sidebar: related posts card
 *  8. More posts section + blog cards
 * ─────────────────────────────────────────────────────────────────
 */


/* ============================================================
   1. BLOG HEADER
   ============================================================ */

.blog-header {
  padding: var(--space-2xl) 0;
  background: var(--color-blue);
  border-bottom: 4px solid var(--color-warm-black);
}

/* Breadcrumb */
.blog-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.blog-breadcrumb__link {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: var(--color-yellow);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}
.blog-breadcrumb__link:hover {
  color: white;
}

.blog-breadcrumb__sep {
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: var(--color-yellow);
  user-select: none;
}

.blog-breadcrumb__current {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--color-yellow);
}

/* Category badge strip */
.blog-header__category {
  margin-bottom: var(--space-md);
}

.blog-header__category-badge {
  --badge-rotate: 0deg;
  text-decoration: none;
  text-transform: none;
  transition: opacity var(--duration-fast) var(--ease-out);
}

a.blog-header__category-badge:hover {
  opacity: 0.82;
}

/* Title */
.blog-header__title {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: var(--weight-black);
  line-height: var(--leading-tight);
  letter-spacing: -0.02em;
  color: white;
  max-width: 780px;
  margin-bottom: var(--space-lg);
}

/* Summary line */
.blog-header__summary {
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
  color: rgba(255, 255, 255, 0.85);
  line-height: var(--leading-relaxed);
  max-width: 720px;
  margin-bottom: var(--space-xl);
}

/* Meta row */
.blog-header__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.blog-header__meta-info {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.blog-header__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: rgba(255, 255, 255, 0.85);
}

.blog-header__meta-item svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.6);
}

.blog-header__meta-sep {
  font-size: var(--text-base);
  color: rgba(255, 255, 255, 0.5);
  user-select: none;
}

@media (min-width: 900px) {
  .blog-header {
    padding: var(--space-4xl) 0;
  }
}

@media (min-width: 600px) {
  .blog-header {
    padding: var(--space-3xl) 0;
  }
}

@media (max-width: 900px) {
  .blog-header__title {
    font-size: var(--text-3xl);
  }
}

@media (max-width: 600px) {
  .blog-header__title {
    font-size: var(--text-2xl);
  }
  .blog-header__summary {
    font-size: var(--text-base);
    margin-bottom: var(--space-lg);
  }
  .blog-header__meta {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }
}


/* ============================================================
   2. TWO-COLUMN CONTENT GRID
   ============================================================ */

.blog-single__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2xl);
  align-items: start;
}

@media (min-width: 900px) {
  .blog-single__grid {
    grid-template-columns: 1fr 340px;
    gap: var(--space-3xl);
  }

  .blog-single__sidebar {
    position: sticky;
    top: calc(76px + var(--space-xl));
  }
}


/* ============================================================
   3. FEATURED IMAGE
   ============================================================ */

.blog-featured-img {
  border: 4px solid var(--color-warm-black);
  border-radius: var(--radius-lg);
  box-shadow: 4px 4px 0 var(--color-warm-black);
  overflow: hidden;
  margin-bottom: var(--space-2xl);
}

.blog-featured-img__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--color-cream);
  overflow: hidden;
}

.blog-featured-img__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  aspect-ratio: auto;
}


/* ============================================================
   4. BODY CONTENT (WYSIWYG)
   ============================================================ */

.blog-body {
  margin-bottom: var(--space-2xl);
}

.blog-body p {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--color-warm-black);
  margin-bottom: var(--space-md);
}

.blog-body p:last-child {
  margin-bottom: 0;
}

.blog-body h2 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: -0.01em;
  color: var(--color-warm-black);
  margin: var(--space-2xl) 0 var(--space-md);
}

.blog-body h3 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  color: var(--color-warm-black);
  margin: var(--space-xl) 0 var(--space-sm);
}

.blog-body h4 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--color-warm-black);
  margin: var(--space-lg) 0 var(--space-sm);
}

.blog-body a {
  color: var(--color-blue);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1.5px;
}

.blog-body a:hover {
  color: var(--color-blue-dark);
}

.blog-body ul,
.blog-body ol {
  padding-left: var(--space-xl);
  margin-bottom: var(--space-md);
}

.blog-body li {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--color-warm-black);
  margin-bottom: var(--space-xs);
}

.blog-body strong,
.blog-body b {
  font-weight: var(--weight-bold);
}

.blog-body em,
.blog-body i {
  font-style: italic;
}

.blog-body blockquote {
  border-left: 4px solid var(--color-red);
  padding: var(--space-md) 0 var(--space-md) var(--space-lg);
  margin: var(--space-xl) 0;
  color: var(--color-grey-dark);
  font-style: italic;
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
}

.blog-body img {
  width: 100%;
  height: auto;
  display: block;
  border: 4px solid var(--color-warm-black);
  border-radius: var(--radius-md);
  box-shadow: 4px 4px 0 var(--color-warm-black);
  margin: var(--space-lg) 0;
}

.blog-body hr {
  border: none;
  border-top: 2px solid var(--color-grey-light);
  margin: var(--space-2xl) 0;
}


/* ============================================================
   5. POST FOOTER (category tag)
   ============================================================ */

.blog-post-footer {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg) 0;
  border-top: 2px solid var(--color-grey-light);
  margin-top: var(--space-lg);
}

.blog-post-footer__label {
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-grey-dark);
}

.blog-post-footer__cat {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: white;
  background: var(--color-blue);
  border: 2px solid var(--color-warm-black);
  border-radius: var(--radius-full);
  padding: 4px 14px;
  text-decoration: none;
  box-shadow: 2px 2px 0 var(--color-warm-black);
  transition: transform var(--duration-fast) var(--ease-bounce),
              box-shadow var(--duration-fast) var(--ease-bounce);
}

@media (hover: hover) and (pointer: fine) {
  .blog-post-footer__cat:hover {
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0 var(--color-warm-black);
  }
}


/* ============================================================
   6. SIDEBAR: BLOG CTA CARD
   ============================================================ */

.blog-sidebar-cta {
  background: var(--color-blue);
  border: 4px solid var(--color-warm-black);
  border-radius: var(--radius-lg);
  box-shadow: 4px 4px 0 var(--color-warm-black);
  padding: var(--space-lg) var(--space-xl);
  margin-bottom: var(--space-xl);
}

.blog-sidebar-cta__heading {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: white;
  line-height: var(--leading-tight);
  margin-bottom: var(--space-md);
}

.blog-sidebar-cta__body {
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: rgba(255, 255, 255, 0.85);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-xl);
}

.blog-sidebar-cta__btn {
  display: block;
  width: 100%;
  text-align: center;
}


/* ============================================================
   7. SIDEBAR: RELATED POSTS CARD
   ============================================================ */

.blog-sidebar-related {
  background: white;
  border: 4px solid var(--color-warm-black);
  border-radius: var(--radius-lg);
  box-shadow: 4px 4px 0 var(--color-warm-black);
  overflow: hidden;
}

.blog-sidebar-related__label {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-blue);
  padding: var(--space-lg) var(--space-xl) var(--space-md);
  border-bottom: 2px solid var(--color-grey-light);
}

.blog-sidebar-related__list {
  list-style: none;
}

.blog-sidebar-related__item {
  border-bottom: 2px solid var(--color-grey-light);
}

.blog-sidebar-related__item:last-child {
  border-bottom: none;
}

.blog-sidebar-related__link {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-xl);
  text-decoration: none;
  transition: background var(--duration-fast) var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .blog-sidebar-related__link:hover {
    background: var(--color-blue-light);
  }
}

.blog-sidebar-related__link:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 3px var(--color-blue);
}

/* Thumbnail */
.blog-sidebar-related__thumb {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border: 2px solid var(--color-warm-black);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-cream);
}

.blog-sidebar-related__thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  aspect-ratio: auto;
  height: 100%; /* override base.css img height:auto */
}

.blog-sidebar-related__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.blog-sidebar-related__title {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: var(--color-warm-black);
  line-height: var(--leading-tight);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-sidebar-related__date {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-grey-dark);
}

.blog-sidebar-related__more {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  border-top: 2px solid var(--color-grey-light);
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  text-decoration: none;
}


/* ============================================================
   8. MORE POSTS SECTION + BLOG CARDS
   ============================================================ */

.blog-more {
  background: var(--color-blue-light);
}

.blog-more__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
}

.blog-more__header .section-heading {
  margin-bottom: 0;
}

.blog-more__header .arrow-link {
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .blog-more__header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }
}

/* Three-column card grid */
.blog-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}

@media (max-width: 900px) {
  .blog-cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
  }
}

@media (max-width: 600px) {
  .blog-cards-grid {
    grid-template-columns: 1fr;
  }
}

/* Blog card base + inner element styles live in components.css (always loaded).
   Only blog-page-specific overrides belong here. */


/* ============================================================
   9. BLOG ARCHIVE — header, latest post card, filter, grid
   ============================================================ */

/* ── Archive header (blue bg) ────────────────────────────────────────────── */

.blog-archive-header {
  padding: var(--space-3xl) 0;
  background: var(--color-blue);
  border-bottom: 4px solid var(--color-warm-black);
}

.blog-archive-header__eyebrow {
  margin-bottom: var(--space-sm);
}

.blog-archive-header__title {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: var(--weight-black);
  line-height: var(--leading-tight);
  letter-spacing: -0.02em;
  color: white;
  margin-bottom: var(--space-lg);
}

.blog-archive-header__intro {
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
  color: rgba(255, 255, 255, 0.82);
  line-height: var(--leading-relaxed);
  max-width: 640px;
}

@media (min-width: 900px) {
  .blog-archive-header {
    padding: var(--space-4xl) 0;
  }
}

@media (max-width: 900px) {
  .blog-archive-header__title {
    font-size: var(--text-3xl);
  }
}

@media (max-width: 600px) {
  .blog-archive-header {
    padding: var(--space-2xl) 0;
  }
  .blog-archive-header__title {
    font-size: var(--text-2xl);
  }
  .blog-archive-header__intro {
    font-size: var(--text-base);
  }
}

/* ── Section eyebrow labels ──────────────────────────────────────────────── */

.blog-archive-section-label {
  margin-bottom: var(--space-lg);
}

.blog-archive-section-label--grid {
  margin-top: var(--space-3xl);
}

/* ── Latest post featured split card ─────────────────────────────────────── */

.blog-latest {
  display: grid;
  grid-template-columns: 5fr 7fr;
  background: white;
  border: 4px solid var(--color-warm-black);
  border-radius: var(--radius-xl);
  box-shadow: 4px 4px 0 var(--color-warm-black);
  overflow: hidden;
  text-decoration: none;
  margin-bottom: var(--space-xl);
  transition: transform var(--duration-normal) var(--ease-bounce),
              box-shadow var(--duration-normal) var(--ease-bounce);
}

@media (hover: hover) and (pointer: fine) {
  .blog-latest:hover {
    transform: translate(-3px, -3px);
    box-shadow: 7px 7px 0 var(--color-warm-black);
  }

  .blog-latest:hover .blog-latest__img {
    transform: scale(1.04);
  }
}

.blog-latest:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring), 4px 4px 0 var(--color-warm-black);
}

/* Image panel */
.blog-latest__img-wrap {
  position: relative;
  overflow: hidden;
  background: var(--color-cream);
  border-right: 4px solid var(--color-warm-black);
  min-height: 340px;
}

.blog-latest__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  aspect-ratio: auto;
  transition: transform var(--duration-slow) var(--ease-out);
}

.blog-latest__img-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-grey-mid);
}

.blog-latest__img-placeholder svg {
  width: 56px;
  height: 56px;
}

/* Content panel */
.blog-latest__content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-2xl);
  gap: var(--space-lg);
}

.blog-latest__cat-badge {
  align-self: flex-start;
  margin-bottom: 0;
}

.blog-latest__title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--weight-black);
  line-height: var(--leading-tight);
  letter-spacing: -0.02em;
  color: var(--color-warm-black);
}

.blog-latest__summary {
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--color-warm-black);
  line-height: var(--leading-relaxed);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-latest__date {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--color-grey-dark);
}

.blog-latest__date svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.blog-latest__btn {
  align-self: flex-start;
}

@media (max-width: 900px) {
  .blog-latest {
    grid-template-columns: 1fr 1fr;
  }

  .blog-latest__img-wrap {
    min-height: 280px;
  }

  .blog-latest__content {
    padding: var(--space-xl);
  }

  .blog-latest__title {
    font-size: var(--text-xl);
  }
}

@media (max-width: 600px) {
  .blog-latest {
    grid-template-columns: 1fr;
  }

  .blog-latest__img-wrap {
    min-height: 220px;
    border-right: none;
    border-bottom: 4px solid var(--color-warm-black);
  }

  .blog-latest__content {
    padding: var(--space-lg);
    gap: var(--space-md);
  }

  .blog-latest__title {
    font-size: var(--text-lg);
  }
}

/* ── Category filter pills ──────────────────────────────────────────────── */

.blog-filter {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-2xl);
}

.blog-filter__btn {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--color-warm-black);
  background: white;
  border: 2px solid var(--color-warm-black);
  border-radius: var(--radius-full);
  padding: 6px 18px;
  line-height: 1.4;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 2px 2px 0 var(--color-warm-black);
  transition: transform var(--duration-fast) var(--ease-bounce),
              box-shadow var(--duration-fast) var(--ease-bounce),
              background var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .blog-filter__btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0 var(--color-warm-black);
  }
}

.blog-filter__btn.is-active {
  background: var(--color-red);
  color: white;
  border-color: var(--color-warm-black);
}

@media (hover: hover) and (pointer: fine) {
  .blog-filter__btn.is-active:hover {
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0 var(--color-warm-black);
  }
}

.blog-filter__btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring), 2px 2px 0 var(--color-warm-black);
}

/* ── Grid loading state ──────────────────────────────────────────────────── */

.blog-archive-grid[aria-busy="true"] {
  opacity: 0.55;
  pointer-events: none;
  transition: opacity var(--duration-fast) var(--ease-out);
}

/* ── Empty state ──────────────────────────────────────────────────────────── */

.blog-archive-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  padding: var(--space-3xl) 0;
  text-align: center;
}

.blog-archive-empty svg {
  width: 36px;
  height: 36px;
  color: var(--color-grey-mid);
}

.blog-archive-empty p {
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--color-grey-dark);
}

/* ── Load More ────────────────────────────────────────────────────────────── */

.blog-load-more {
  display: flex;
  justify-content: center;
  margin-top: var(--space-2xl);
}

.blog-load-more__btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
}

.blog-load-more__btn.is-hidden {
  display: none;
}

.blog-load-more__spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: bl-spin 0.65s linear infinite;
  flex-shrink: 0;
}

.blog-load-more__btn.is-loading .blog-load-more__label {
  opacity: 0.6;
}

.blog-load-more__btn.is-loading svg[data-lucide] {
  display: none;
}

.blog-load-more__btn.is-loading .blog-load-more__spinner {
  display: block;
}

@keyframes bl-spin {
  to { transform: rotate(360deg); }
}


/* ============================================================
   10. BLOG CATEGORY ARCHIVE — header, card footer, category nav
   ============================================================ */

/* ── Category header additions ──────────────────────────────────────────── */

/* Eyebrow + count badge on same row */
.blog-cat-header__top {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-sm);
}

.blog-cat-header__top .blog-archive-header__eyebrow {
  margin-bottom: 0;
}

/* Post count badge — yellow accent pill */
.blog-cat-count {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--color-warm-black);
  background: var(--color-yellow);
  border: 2px solid var(--color-warm-black);
  border-radius: var(--radius-full);
  padding: 3px 12px;
  box-shadow: 2px 2px 0 var(--color-warm-black);
  white-space: nowrap;
}

/* Breadcrumb inside blue header */
.blog-cat-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

.blog-cat-breadcrumb__link {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: var(--color-yellow);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

.blog-cat-breadcrumb__link:hover {
  color: white;
}

.blog-cat-breadcrumb__sep {
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: rgba(255, 255, 255, 0.45);
  user-select: none;
}

.blog-cat-breadcrumb__current {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: rgba(255, 255, 255, 0.7);
}

/* Back to all posts link */
.blog-cat-back {
  margin-top: var(--space-xl);
}

.blog-cat-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: var(--color-yellow);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

.blog-cat-back-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  transition: transform var(--duration-fast) var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .blog-cat-back-link:hover {
    color: white;
  }

  .blog-cat-back-link:hover svg {
    transform: translateX(-4px);
  }
}

.blog-cat-back-link:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 3px;
}

/* ── Latest card: author + date meta row ────────────────────────────────── */

.blog-latest__meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.blog-latest__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--color-grey-dark);
}

.blog-latest__meta-item svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--color-grey-mid);
}

.blog-latest__meta-sep {
  font-size: var(--text-base);
  color: var(--color-grey-mid);
  user-select: none;
}

/* ── Blog card footer: author + date side-by-side ───────────────────────── */

.blog-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: var(--space-md);
  border-top: 2px solid var(--color-grey-light);
}

.blog-card__author {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--color-warm-black);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 50%;
}

/* Override .blog-card__date margin when inside .blog-card__footer */
.blog-card__footer .blog-card__date {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

/* ── Empty category state ───────────────────────────────────────────────── */

.blog-cat-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  padding: var(--space-4xl) 0;
  text-align: center;
}

.blog-cat-empty svg {
  width: 48px;
  height: 48px;
  color: var(--color-grey-mid);
}

.blog-cat-empty p {
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
  color: var(--color-grey-dark);
}

/* ── Other categories strip ──────────────────────────────────────────────── */

.blog-cat-other {
  border-top: 4px solid var(--color-warm-black);
  padding-top: var(--space-2xl);
  margin-top: var(--space-3xl);
}

.blog-cat-other__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.blog-cat-other__heading {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--color-warm-black);
  line-height: var(--leading-tight);
  letter-spacing: -0.01em;
}

.blog-cat-other__header .arrow-link {
  white-space: nowrap;
  flex-shrink: 0;
}

/* Category pill links */
.blog-cat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.blog-cat-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-body);
  font-weight: var(--weight-bold);
  color: var(--color-warm-black);
  background: white;
  border: 2px solid var(--color-warm-black);
  border-radius: var(--radius-full);
  padding: 10px 20px;
  text-decoration: none;
  box-shadow: 3px 3px 0 var(--color-warm-black);
  transition: transform var(--duration-fast) var(--ease-bounce),
              box-shadow var(--duration-fast) var(--ease-bounce),
              background var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out);
}

.blog-cat-pill__name {
  font-size: var(--text-base);
}

/* Post count — subdued number after the name */
.blog-cat-pill__count {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--color-grey-dark);
  background: var(--color-cream);
  border: 2px solid var(--color-warm-black);
  border-radius: var(--radius-full);
  padding: 1px 9px;
  line-height: 1.5;
  transition: background var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .blog-cat-pill:hover {
    background: var(--color-blue);
    color: white;
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0 var(--color-warm-black);
  }

  .blog-cat-pill:hover .blog-cat-pill__count {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-color: rgba(255, 255, 255, 0.4);
  }
}

.blog-cat-pill:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring), 3px 3px 0 var(--color-warm-black);
}

@media (max-width: 600px) {
  .blog-cat-other__header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }

  .blog-cat-other__header .arrow-link {
    align-self: flex-start;
  }

  .blog-cat-pill {
    padding: 8px 16px;
  }
}

/* Gallery immediately after article body — reduce top gap */
.blog-single + .pgg { padding-top: var(--space-lg); }
