/* ============================================================================
   Burton v7 — Article feed
   ----------------------------------------------------------------------------
   Recent articles feed. Used on the homepage tail and as a reusable pattern
   on category pages. Dense grid, fast to scan, no giant images.
   ========================================================================= */

.feed {
  padding-block: var(--space-12);
  background: var(--color-bg);
}

@media (min-width: 720px) {
  .feed { padding-block: var(--space-16); }
}

@media (min-width: 900px) {
  .feed { padding-block: var(--space-20); }
}

.feed__header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: var(--space-6);
  margin-bottom: var(--space-10);
  flex-wrap: wrap;
}

.feed__title-wrap {
  max-width: 48ch;
}

.feed__eyebrow {
  margin-bottom: var(--space-4);
}

.feed__title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: var(--fs-3xl);
  line-height: var(--lh-snug);
  letter-spacing: var(--tracking-snug);
  color: var(--color-ink);
  margin-bottom: var(--space-3);
}

.feed__subtitle {
  font-family: var(--font-serif);
  font-size: var(--fs-md);
  line-height: var(--lh-relaxed);
  color: var(--color-ink-muted);
}

.feed__view-all {
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--color-ink);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  white-space: nowrap;
}

.feed__view-all:hover {
  color: var(--color-accent);
  gap: var(--space-3);
}

.feed__view-all svg {
  width: 14px;
  height: 14px;
  transition: transform var(--duration-fast) var(--ease-out);
}

.feed__view-all:hover svg {
  transform: translateX(3px);
}

/* ── Feed grid ───────────────────────────────────────────────────────────────
   5 cards = 1 hero (spans 2 cols) + 4 standard. Total = 6 grid slots.
   We use explicit breakpoint columns (1 / 2 / 3) rather than auto-fit so a
   wide viewport never produces 4 cols (which would orphan the standard
   cards on row 2). 6 ÷ 3 = 2 perfectly filled rows on desktop.            */

.feed__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
}

@media (min-width: 720px) {
  .feed__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-5);
  }
}

@media (min-width: 1100px) {
  .feed__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-6);
  }
}

/* ── Feed item ───────────────────────────────────────────────────────────── */

.feed-item {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  min-height: 220px;
  overflow: hidden;
  transition: transform var(--duration-base) var(--ease-out),
              border-color var(--duration-base) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out);
}

.feed-item:hover {
  transform: translateY(-2px);
  border-color: var(--color-accent);
  box-shadow: var(--shadow-card);
}

.feed-item:focus-visible {
  outline: 0;
  border-color: var(--color-accent);
  box-shadow: var(--shadow-focus);
}

/* Pillar-tinted top stripe — at-a-glance category identification without
   photos. Same tint tokens used on the homepage .path cards for continuity. */
.feed-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--feed-stripe, var(--color-line-strong));
  z-index: 1;
}

.feed-item--treat      { --feed-stripe: #A7F3D0; }
.feed-item--soundproof { --feed-stripe: #BAE6FD; }
.feed-item--gear       { --feed-stripe: #FDE68A; }

/* ── Feed item body (wraps text content so we can swap layout modes) ─── */

.feed-item__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-6);
  flex: 1;
}

.feed-item__meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: var(--fw-medium);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-ink-subtle);
}

.feed-item__category {
  color: var(--color-accent-hover);
}

.feed-item__dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--color-line-strong);
}

.feed-item__title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: var(--fs-lg);
  line-height: var(--lh-snug);
  letter-spacing: var(--tracking-snug);
  color: var(--color-ink);
  margin-bottom: var(--space-1);
  transition: color var(--duration-fast) var(--ease-out);
}

.feed-item:hover .feed-item__title {
  color: var(--color-accent-hover);
}

.feed-item__excerpt {
  font-family: var(--font-serif);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--color-ink-muted);
}

.feed-item__footer {
  margin-top: auto;
  padding-top: var(--space-4);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-ink-subtle);
  display: flex;
  gap: var(--space-3);
}

.feed-item__footer span + span::before {
  content: "·";
  margin-right: var(--space-3);
}

/* ── Hero variant — first card with a featured image ──────────────────────
   Mobile: image on top (16:9), text below. Desktop: 2-column, spans 2 grid
   tracks so it reads as the "lead" story the way an editorial page does. */

.feed-item__image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: var(--color-surface-2);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.feed-item--hero .feed-item__title {
  font-size: var(--fs-xl);
  line-height: 1.25;
}

.feed-item--hero .feed-item__excerpt {
  font-size: var(--fs-md);
}

@media (min-width: 720px) {
  .feed-item--hero {
    grid-column: span 2;
    flex-direction: row;
  }

  .feed-item--hero .feed-item__image {
    aspect-ratio: auto;
    width: 50%;
    flex-shrink: 0;
    min-height: 100%;
  }

  .feed-item--hero .feed-item__body {
    padding: var(--space-8);
    justify-content: center;
    flex: 1;
  }

  .feed-item--hero .feed-item__title {
    font-size: var(--fs-2xl);
  }
}

/* The stripe should span the entire top edge of the hero card, including
   across the image on desktop. Keep z-index high so it sits above the image. */
.feed-item--hero::before {
  z-index: 2;
}
