/* ─────────────────────────────────────────────────────────
   BLOG LISTING — editorial publication index
   Page-specific styles for /blog/ and /blog/page/N/
   ───────────────────────────────────────────────────────── */

/* ─── Blog Hero — custom editorial-themed hero ──────────
   Replaces the generic page-hero for blog.
   Adds abstract document SVG bg, archive stamp, unique feel.
   ───────────────────────────────────────────────────────── */
.blog-hero {
  padding-top: clamp(160px, 18vh, 220px);
  padding-bottom: clamp(48px, 6vw, 80px);
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

/* Abstract editorial archive — positioned right */
.blog-hero__bg {
  position: absolute;
  top: 50%;
  right: clamp(-120px, -6vw, -20px);
  transform: translateY(-50%);
  width: clamp(440px, 55vw, 800px);
  height: auto;
  color: var(--ink);
  opacity: 0.07;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

.blog-hero > .container {
  position: relative;
  z-index: 1;
}

.blog-hero .hero-headline {
  max-width: 22ch;
  margin-top: 24px;
}

.blog-hero .lede {
  margin-top: 32px;
  max-width: 60ch;
  font-size: clamp(1.05rem, 0.8vw + 0.85rem, 1.2rem);
  color: var(--ink-soft);
  line-height: 1.55;
}

/* Archive stamp — monospace editorial tag */
.blog-hero__stamp {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 6px 14px;
  border: 1px solid var(--accent);
  border-radius: 2px;
  margin-bottom: 28px;
}
.blog-hero__stamp::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse-dot 2.4s var(--ease-out-strong) infinite;
}

/* Dark mode adjustments */
html.dark .blog-hero__bg {
  opacity: 0.04;
}
html.dark .blog-hero__stamp {
  border-color: oklch(0.6 0.18 258);
  color: oklch(0.6 0.18 258);
}

/* Mobile: hide background SVG at small widths */
@media (max-width: 768px) {
  .blog-hero__bg {
    display: none;
  }
}


/* ── Category filter chips ── */
.blog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 32px;
}
.blog-filter {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
  border: 1px solid var(--rule);
  border-radius: 2px;
  text-decoration: none;
  background: transparent;
  transition:
    border-color 250ms var(--ease-out-strong),
    color 250ms var(--ease-out-strong),
    background 250ms var(--ease-out-strong);
  cursor: pointer;
}
.blog-filter:hover,
.blog-filter.active {
  border-color: var(--accent);
  color: var(--accent);
}
.blog-filter.active {
  background: oklch(0.460 0.180 258 / 0.06);
}

/* ── Essay counter ── */
.blog-counter {
  display: block;
  margin-top: 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-mute);
}

/* ── Featured article — editorial two-column ── */
.blog-featured {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  border: 1px solid var(--rule);
  border-radius: 2px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  background: var(--paper);
  position: relative;
  transition:
    border-color 300ms var(--ease-out-strong),
    transform 300ms var(--ease-out-strong),
    box-shadow 300ms var(--ease-out-strong);
}
.blog-featured:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px -10px oklch(0 0 0 / 0.10);
}

/* Accent bar on featured */
.blog-featured::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px;
  height: 100%;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 500ms cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 2;
}
.blog-featured:hover::before {
  transform: scaleY(1);
}

.blog-featured__img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: cover;
  object-position: center;
  background: oklch(0.10 0.025 260);
}

.blog-featured__body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: clamp(28px, 3vw, 48px);
}

.blog-featured__body .blog-card__cat {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.blog-featured__body h3 {
  font-family: var(--font-sans);
  font-size: clamp(1.4rem, 1.6vw + 0.5rem, 2rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 600;
  color: var(--ink);
}

.blog-featured__body p {
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.6;
  max-width: 52ch;
}

.blog-featured__meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-mute);
  margin-top: 4px;
}
.blog-featured__meta .sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--rule);
}

.blog-featured__body .read-essay {
  margin-top: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.02em;
  transition: letter-spacing 300ms var(--ease-out-strong);
}
.blog-featured:hover .read-essay {
  letter-spacing: 0.06em;
}

/* ── Blog card — standard grid unit ── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 56px;
}

.blog-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--paper);
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  transition:
    border-color 300ms var(--ease-out-strong),
    transform 300ms var(--ease-out-strong),
    box-shadow 300ms var(--ease-out-strong);
}
.blog-card:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px -8px oklch(0 0 0 / 0.08);
}

/* Accent bar — reveals from top on hover */
.blog-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px;
  height: 100%;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 500ms cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 2;
}
.blog-card:hover::before {
  transform: scaleY(1);
}

.blog-card__img {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: cover;
  object-position: center;
  background: oklch(0.10 0.025 260);
}

.blog-card__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 28px 28px 16px;
  flex: 1;
}

.blog-card__num {
  position: absolute;
  top: 16px;
  right: 16px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--ink-mute);
  opacity: 0.5;
  z-index: 1;
}

.blog-card__cat {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.blog-card__body h3 {
  font-family: var(--font-sans);
  font-size: clamp(1.15rem, 0.6vw + 0.8rem, 1.35rem);
  line-height: 1.28;
  letter-spacing: -0.016em;
  font-weight: 600;
  color: var(--ink);
}

.blog-card__body p {
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.6;
  max-width: 56ch;
}

.blog-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px 24px;
  margin-top: auto;
}

.blog-card__foot .read-link {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.02em;
  transition: letter-spacing 300ms var(--ease-out-strong);
}
.blog-card:hover .read-link {
  letter-spacing: 0.04em;
}

.blog-card__foot .date-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
}

/* ── Section header area ── */
.blog-section-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  flex-wrap: wrap;
  gap: 24px;
}

.blog-section-aside {
  max-width: 40ch;
  color: var(--ink-mute);
  font-size: 14.5px;
  line-height: 1.55;
}

/* ── Divider spacing ── */
.blog-divider {
  margin-top: clamp(48px, 6vw, 72px);
  margin-bottom: 0;
}

/* ── Page 2 heading adjustments ── */
.blog-page-counter {
  display: block;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-mute);
}


/* ─────────────────────────────────────────────────────────
   DARK MODE
   ───────────────────────────────────────────────────────── */
html.dark .blog-filter {
  border-color: oklch(0.248 0.016 260);
}
html.dark .blog-filter:hover,
html.dark .blog-filter.active {
  border-color: oklch(0.6 0.18 258);
  color: oklch(0.6 0.18 258);
}
html.dark .blog-filter.active {
  background: oklch(0.6 0.18 258 / 0.08);
}

html.dark .blog-featured {
  border-color: oklch(0.248 0.016 260);
}
html.dark .blog-featured:hover {
  border-color: oklch(0.40 0.02 260);
  box-shadow: 0 6px 24px -10px oklch(0 0 0 / 0.3);
}

html.dark .blog-featured__img,
html.dark .blog-card__img {
  background: oklch(0.06 0.015 260);
}

html.dark .blog-card {
  border-color: oklch(0.248 0.016 260);
}
html.dark .blog-card:hover {
  border-color: oklch(0.40 0.02 260);
  box-shadow: 0 4px 16px -8px oklch(0 0 0 / 0.2);
}


/* ─────────────────────────────────────────────────────────
   RESPONSIVE
   ───────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .blog-featured {
    grid-template-columns: 1fr;
  }
  .blog-featured__img {
    min-height: 200px;
    max-height: 240px;
  }
  .blog-grid {
    grid-template-columns: 1fr;
  }
  .blog-filters {
    gap: 6px;
  }
  .blog-filter {
    padding: 5px 10px;
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .blog-featured::before,
  .blog-card::before { transition: none; }
  .blog-featured,
  .blog-card { transition: none; }
  .blog-featured .read-essay,
  .blog-card__foot .read-link { transition: none; }
}
