/* ============================================================
   THE VIBE — shared card grid (ported from `VibeCardStyles` in
   `vibe-data.jsx`, mounted on every page that renders a `.vb-card`) plus
   the index/listing page's own chrome (ported from `vibe.jsx`'s inline
   <style>). couple-website-markup repo. Article-only chrome lives in
   `vibe-article.css`.

   INFINITE SCROLL NOTE (Batch 1, 03_PAGE_DATA_CONTRACTS.md §4.2): the
   reference paginates the archive grid client-side (IntersectionObserver,
   batches of 9). This port renders the full catalog in one response
   instead — there's no DB yet (content is static PHP data files) and the
   full catalog is small enough that a single page is simpler and works
   with JS disabled; `.vb-loadzone`/spinner/end-cap markup is dropped with
   it. Can move to real pagination if/when articles move to a DB.
   ============================================================ */

.vb-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--rhythm-56) 24px;
}
.vb-grid[data-cols="2"] { grid-template-columns: repeat(2, 1fr); gap: var(--rhythm-56) 32px; }
/* Home's "Preview of most recent Vibe articles" strip (03_PAGE_DATA_CONTRACTS.md
   §1.1) — the one other page besides the Vibe index that mounts `.vb-card`,
   per this file's header comment. */
.vb-grid[data-cols="4"] { grid-template-columns: repeat(4, 1fr); gap: 24px; }
.vb-card { display: flex; flex-direction: column; text-decoration: none; cursor: pointer; min-width: 0; }
.vb-card-img { position: relative; aspect-ratio: 1 / 1; border-radius: var(--r-card); overflow: hidden; }
.vb-card-img-fill {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  transition: transform 300ms ease;
}
/* Every Vibe photo slot renders a real `<img>` now — either the uploaded
   article photo or the `blog-1.jpg` fallback (`render_vibe_photo()`) — same
   absolutely-positioned fill layer as the (now-unused-here) placeholder div
   above, cropped to cover its wrapper. */
img.vb-card-img-fill.vb-photo {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;
}
.vb-card:hover { text-decoration: none; }
.vb-card:hover .vb-card-img-fill { transform: scale(1.04); }
.vb-ph-label {
  font: 500 12px/1 var(--font-mono);
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--couple-purple-dark);
  opacity: 0.6;
  text-align: center;
  padding: 0 16px;
}
.vb-card-meta { margin: 20px 0 0; }
.vb-card .vibe-title { margin: 10px 0 8px; transition: color 160ms ease; }
.vb-card:hover .vibe-title { color: var(--couple-purple); }
.vb-card .vibe-sub { margin: 0; }
@media (max-width: 1100px) {
  .vb-grid, .vb-grid[data-cols="2"] { grid-template-columns: repeat(2, 1fr); gap: 48px 24px; }

  /* Home's preview strip (data-cols="4") scrolls horizontally from
     tablet widths down instead of collapsing to a 2-col grid — same
     scroll-snap carousel couple-website-markup's own `vibe-footer.jsx`
     ships for this exact component (its `.vibe-grid`/`.vibe-card`
     rules, verbatim in `styles.css` from the Batch 0 design-system
     port, went unused there since this port reuses the Vibe index
     page's `.vb-grid`/`.vb-card` classes for the same component
     instead), adapted to that naming here. Base band below; the 900px
     and 640px bands underneath only override what actually shrinks
     (gap/bleed/card width), mirroring the reference's own three bands. */
  .vb-grid[data-cols="4"] {
    display: flex;
    grid-template-columns: unset;
    gap: 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-left: 56px;
    -webkit-overflow-scrolling: touch;
    padding: 4px 56px 16px;
    margin: 0 -56px;
    scrollbar-width: none;
  }
  .vb-grid[data-cols="4"]::-webkit-scrollbar { display: none; }
  .vb-grid[data-cols="4"] .vb-card {
    flex: 0 0 280px;
    scroll-snap-align: start;
  }
}
@media (max-width: 900px) {
  .vb-grid[data-cols="4"] {
    gap: 16px;
    scroll-padding-left: 48px;
    padding: 4px 48px 16px;
    margin: 0 -48px;
  }
  .vb-grid[data-cols="4"] .vb-card { flex: 0 0 260px; }
}
@media (max-width: 640px) {
  .vb-grid, .vb-grid[data-cols="2"] { grid-template-columns: 1fr; gap: 40px; }

  .vb-grid[data-cols="4"] {
    gap: 14px;
    scroll-padding-left: 20px;
    padding: 4px 20px 16px;
    margin: 0 -20px;
  }
  .vb-grid[data-cols="4"] .vb-card { flex: 0 0 min(78%, 280px); }
}

/* ---------- INDEX PAGE ---------- */
.vb-featured {
  display: grid;
  grid-template-columns: calc(320 * var(--el-px)) 1fr;
  gap: var(--rhythm-56);
  align-items: center;
  text-decoration: none;
  cursor: pointer;
  margin-bottom: var(--rhythm-96);
}
.vb-feat-img {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--r-card-lg);
  overflow: hidden;
}
.vb-featured:hover { text-decoration: none; }
.vb-featured:hover .vb-card-img-fill { transform: scale(1.03); }
.vb-feat-body { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; min-width: 0; }
.vb-feat-title { transition: color 160ms ease; }
.vb-featured:hover .vb-feat-title { color: var(--couple-purple); }
.vb-feat-excerpt {
  font: var(--type-body);
  color: var(--ink-700);
  margin: 8px 0 0;
  max-width: 560px;
  text-wrap: pretty;
}

.vb-shell {
  padding: var(--rhythm-80) 96px var(--rhythm-96);
  max-width: 1440px;
  margin: 0 auto;
}

@media (max-width: 1100px) {
  .vb-shell { padding: 80px 56px 96px; }
  .vb-featured { grid-template-columns: 280px 1fr; gap: 40px; }
}
@media (max-width: 900px) {
  .vb-shell { padding: 64px 48px 80px; }
  .vb-featured { grid-template-columns: 240px 1fr; gap: 28px; }
}
@media (max-width: 768px) {
  .vb-shell { padding: 56px 40px 64px; }
}
@media (max-width: 640px) {
  .vb-shell { padding: 48px 20px 64px; }
  .vb-featured { grid-template-columns: 1fr; margin-bottom: 64px; }
  .vb-feat-img { max-width: 360px; width: 100%; }
}
