/* ============================================================
   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`.

   LOADS AS YOU SCROLL — FF-56 (2026-10-07, docs/FF_56_PLAN.md §6): the
   Batch-1 note that stood here dropped the reference's client-side paging
   because the Vibe had no database then. It has had one since 2026-07-10,
   so the loadzone's rules (the loading row, the spinner, the end-cap, the
   sentinel) are ported below the index chrome, each with the vibe.jsx line
   it comes from; the pages themselves are server-rendered (/vibe/?p={n})
   and vibe-index.js lifts their cards. 03_PAGE_DATA_CONTRACTS.md §4.2.
   ============================================================ */

.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;
}

/* ---------- LOADZONE (FF-56, 2026-10-07 — vibe.jsx:154-188 and :236-251) ----------
   Appended here, after the index chrome and BEFORE the tier blocks below
   (RESPONSIVE_DESIGN_REVIEW.md §2-A): no tier names any of these, so source
   order cannot defeat them. The "Older articles" link is a `.cta-link`, whose
   `[hidden]` override already lives in styles.css beside its base rule. */
/* vibe.jsx:154-161 */
.vb-loadzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: var(--rhythm-64) 0 0;
  min-height: 88px;
}
/* vibe.jsx:162-168 */
.vb-loading {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font: var(--type-body-sm);
  color: var(--ink-500);
}
/* Lesson 2 / §2-C: the author `inline-flex` above beats the UA [hidden] rule,
   so the server-rendered `hidden` row needs its own (the
   `#su-matches-loading` precedent in signup-matches.css). */
.vb-loading[hidden] { display: none; }
/* vibe.jsx:169-175 */
.vb-spinner {
  width: 22px; height: 22px;
  border-radius: 999px;
  border: 3px solid var(--lavender-border);
  border-top-color: var(--couple-purple);
  animation: vb-spin 800ms linear infinite;
}
/* vibe.jsx:176-178 */
@media (prefers-reduced-motion: reduce) {
  .vb-spinner { animation: none; }
}
/* vibe.jsx:179 */
@keyframes vb-spin { to { transform: rotate(360deg); } }
/* vibe.jsx:180-188 */
.vb-endcap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  font: var(--type-body-sm);
  color: var(--ink-500);
  text-align: center;
}
/* vibe.jsx:247's inline style on the heart logo (Lesson 2). */
.vb-endcap-logo { height: 26px; display: block; }
/* vibe.jsx:238's inline 1 × 1 sentinel (Lesson 2): the script adds the class
   and sets no style attribute. */
.vb-sentinel { width: 1px; height: 1px; }

@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%; }
}
