/* ============================================================
   blog.css — BLOG section (FIELD NOTES, SPECIMEN pass)
   Mono specimen eyebrow + ONE medium line + serif-italic accent.
   Post rows carry a NOTE_0x readout prefix and ~1.4rem titles, with
   hairline dividers (mono meta, excerpt; hover: lime title + row
   nudge) and a glass reader overlay — same overlay pattern as the
   note card, fixed to the viewport and scrollable for long reads.
   All classes prefixed .blog-* to avoid collisions.
   ============================================================ */

.blog {
  width: min(1100px, 100% - 3rem);
  margin-inline: auto;
  padding-block: clamp(5rem, 14vh, 9rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ---------- Header ---------- */
.blog__head {
  max-width: 46rem;
}

/* .blog__title type comes from .h-medium (base.css) — the ONE medium
   line under the specimen eyebrow */

/* Small serif-italic accent line under the medium title */
.blog__lede {
  margin-top: 0.9rem;
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  line-height: 1.55;
  max-width: 34rem;
  text-shadow: 0 1px 14px rgba(10, 22, 51, 0.75); /* stays legible over the helix glow */
}

/* ---------- Post list ---------- */
.blog__list {
  margin-top: clamp(2.5rem, 6vh, 4.5rem);
}

/* Hairline dividers between rows (and one on top to open the list) */
.blog__item {
  border-top: 1px solid rgba(143, 163, 200, 0.22);
}

.blog__item:last-child {
  border-bottom: 1px solid rgba(143, 163, 200, 0.22);
}

.blog__row {
  display: grid;
  gap: 0.55rem;
  width: 100%;
  padding: clamp(1.5rem, 3vh, 2.25rem) 0.25rem;
  background: none; /* override the base.css lime-pill button default */
  border-radius: 0;
  color: inherit;
  font-weight: 400;
  text-align: left;
  cursor: pointer;
  transition: transform 0.25s ease, padding-left 0.25s ease;
}

/* Hover: row nudge + lime title */
.blog__row:hover {
  transform: translateX(6px);
}

.blog__row-meta {
  /* .mono-label supplies family/size/tracking/color */
}

.blog__row-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.2rem, 1.8vw, 1.4rem); /* SPECIMEN: down from display-row size */
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
  transition: color 0.25s ease;
  text-wrap: balance;
  /* same halo-legibility treatment as connect.css — the universe
     canvas glow passes behind the rows */
  text-shadow: 0 0 22px rgba(10, 22, 51, 0.65);
}

.blog__row:hover .blog__row-title {
  color: var(--pop);
}

.blog__row-excerpt {
  color: var(--muted);
  font-size: clamp(0.95rem, 0.9rem + 0.25vw, 1.05rem);
  line-height: 1.55;
  max-width: 62ch;
  text-shadow: 0 1px 14px rgba(10, 22, 51, 0.75); /* stays legible over the glow */
}

.blog__row-cta {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.6875rem; /* 11px */
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--pop);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.blog__row:hover .blog__row-cta,
.blog__row:focus-visible .blog__row-cta {
  opacity: 1;
  transform: translateX(0);
}

/* Focus visibility for keyboard users */
.blog__row:focus-visible {
  outline: 1px solid rgba(198, 245, 63, 0.6);
  outline-offset: 4px;
}

/* ---------- Reader overlay ---------- */
/* Fixed to the viewport (posts outgrow the stage-sized note card);
   body scroll is locked by JS while open. */
.blog__reader {
  position: fixed;
  inset: 0;
  z-index: 200; /* above chrome nav + HUD, below cursor/preloader */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vh, 3rem) 1.25rem;
}

/* display:flex above beats the UA [hidden] rule — restore it. */
.blog__reader[hidden] {
  display: none;
}

.blog__reader-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 22, 51, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* Frosting + hairline ring come from .glass (base.css). */
.blog__reader-card {
  position: relative;
  width: min(65ch, 100%);
  max-height: 100%;
  overflow-y: auto;
  padding: clamp(1.75rem, 4vw, 3rem);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.08),
    0 24px 60px rgba(0, 0, 0, 0.45);
}

.blog__reader-meta {
  margin-bottom: 0.9rem;
  padding-right: 2.5rem;
}

.blog__reader-title {
  font-size: clamp(1.7rem, 3.4vw, 2.6rem);
  margin-bottom: 1.5rem;
  padding-right: 2rem;
}

.blog__reader-body p {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.7;
}

.blog__reader-body p + p {
  margin-top: 1em;
}

.blog__reader-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  border: 1px solid rgba(143, 163, 200, 0.45);
  border-radius: 50%;
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.blog__reader-close:hover {
  border-color: var(--pop);
  color: var(--pop);
  transform: rotate(90deg);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .blog__row-excerpt {
    max-width: none;
  }

  /* Soft scrim behind the rows: on narrow screens the helix mass can't
     clear the full-width text column, so a left-anchored gradient keeps
     the excerpts legible while the glow still reads on the right. */
  .blog__list {
    position: relative;
    z-index: 0; /* own stacking context so the scrim stays above the fixed canvas */
  }

  .blog__list::before {
    content: '';
    position: absolute;
    inset: -0.5rem -1.25rem;
    background: linear-gradient(
      105deg,
      rgba(10, 22, 51, 0.88) 0%,
      rgba(10, 22, 51, 0.5) 50%,
      rgba(10, 22, 51, 0) 80%
    );
    pointer-events: none;
    z-index: -1;
  }
}
