/* ============================================================
   MARKETPLACE V4 — "Provisions & Glass" farm-card anatomy
   Source of truth: frontend-redesign/variant-4-provisions-glass/
   provisions-glass.html + DESIGN.md. The marketplace farm cards
   are cream matted frames (gallery-frame construction) sitting on
   the blue marketplace ground. Loaded from index.html AFTER
   style.css; every marketplace-card rule lives here so the shared
   stylesheets stay untouched.
   Emitted by: frontend/js/marketplace.js createFarmCard /
   createCharityFarmCard / renderBadges.
   ============================================================ */

/* ── the card = the matte ─────────────────────────────────────
   1px warm frame line, cream matte ground, warm outer bevel
   (mockup --frame-bevel), soft spring hover with the navy float
   shadow the mockup gives cards on the blue ground. */
.mpv4-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--surface-card);
  border: 1px solid var(--border-warm);
  border-radius: 8px;
  padding: 8px 8px 0;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(253, 251, 247, 0.7), inset 0 -1px 0 rgba(139, 125, 107, 0.16);
  transition: transform 200ms var(--ease-spring), box-shadow 200ms var(--ease-out);
}
.mpv4-card:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(253, 251, 247, 0.7), inset 0 -1px 0 rgba(139, 125, 107, 0.16),
    0 14px 30px rgba(6, 26, 52, 0.45), 0 4px 10px rgba(6, 26, 52, 0.30);
}
@media (prefers-reduced-motion: reduce) {
  .mpv4-card { transition: none; }
  .mpv4-card:hover { transform: none; }
}

/* ── the photo inside the matte ───────────────────────────────
   radius 2, known-ratio box (img absolute inset:0), warm V1 grade,
   fillet ring + inset vignette drawn by ::after. */
.mpv4-photo {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  aspect-ratio: 3 / 2;
  background: var(--surface-linen);
}
.mpv4-photo > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.96) sepia(0.06);
}
.mpv4-photo::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 8px;
  pointer-events: none;
  z-index: 1;
  /* framer's gilt fillet (honey pulled toward brown) + warm inset vignette;
     literal-color first line is the color-mix() fallback */
  box-shadow: inset 0 0 0 1px rgba(172, 127, 63, 0.55), inset 0 0 28px rgba(45, 42, 38, 0.06);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--honey-500) 45%, var(--brown-500)), inset 0 0 28px rgba(45, 42, 38, 0.06);
}

/* no-photo fallback: a plain linen photo well with the centered
   sprout monogram — no fillet, no vignette, nothing else */
.mpv4-photo-empty {
  display: flex;
  align-items: center;
  justify-content: center;
}
.mpv4-photo-empty::after { content: none; }
.mpv4-monogram { color: var(--green-700); }

/* Sale marker stays overlaid top-left ON the photo. The marketplace-scoped
   finish layer turns the shared sale pill into a flat letterpress label. */
.mpv4-photo .fs-sale-pill { z-index: 2; }

/* farm logo: a small framed square resting in the photo's bottom-right */
.mpv4-logo {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 2;
  width: 44px;
  height: 44px;
  padding: 4px;
  background: var(--surface-card);
  border: 1px solid var(--border-warm);
  border-radius: 8px;
}
.mpv4-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ── body: aligned type on the cream matte ──────────────────── */
.mpv4-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  padding: 14px 8px 16px; /* inline padding matches the matte so type aligns with the photo edge */
  text-align: left;
}
.mpv4-name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 21px;
  line-height: 1.3;
  color: var(--text-primary);
  text-wrap: balance;
}

/* small-caps voice — Brygada 1918 600, uppercased + letterspaced
   (mockup .smcp treatment) */
.mpv4-loc,
.mpv4-cats,
.mpv4-note,
.mpv4-badge {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
.mpv4-loc {
  margin: 4px 0 0;
  color: var(--text-secondary);
}

/* the 24px honey hairline between provenance and goods */
.mpv4-rule {
  width: 24px;
  height: 1px;
  background: var(--honey-500);
  margin: 10px 0 0;
}

/* food summary: a plain quiet paragraph, two lines max */
.mpv4-goods {
  margin: 10px 0 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* category line: plain small-caps names " · " separated */
.mpv4-cats {
  margin: 10px 0 0;
  color: var(--text-secondary);
}
.mpv4-cats-more {
  color: var(--text-muted);
  white-space: nowrap;
}

/* badges: quiet small-caps text tokens with a tiny stamp-ring dot */
.mpv4-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 10px 0 0;
}
.mpv4-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-secondary);
}
.mpv4-badge::before {
  content: '';
  flex: none;
  width: 7px;
  height: 7px;
  border: 1.5px solid var(--green-700);
  border-radius: 50%;
}
/* Founding Farm: applied engraved gold seal — a unique stamp, not a token */
.mpv4-founding-seal {
  flex: none;
  align-self: center;
  width: 58px;
  height: 58px;
  margin: -4px 0 -6px;
  transform: rotate(-6deg);
}
.mpv4-founding-seal img { display: block; width: 100%; height: 100%; }

/* charity marker: calm rose ink, no boxes, no gradients */
.mpv4-count-charity {
  margin: 10px 0 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: #9F1239; /* rose-800 — the established charity accent (Tailwind rose) */
}
.mpv4-note {
  margin: 10px 0 0;
  color: var(--green-700);
}

/* ── "Visit Farm Store" — keeps its lake blue (user directive),
   rebuilt in the V4 letterpress construction: radius 6, darker 1px
   bottom bite + a whisper of lift; :active presses down 1px. ── */
.mpv4-visit {
  display: block;
  width: 100%;
  margin-top: 16px;
  border: 0;
  border-radius: 6px;
  padding: 11px 18px;
  background: var(--blue-700);
  color: var(--text-inverse);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.01em;
  text-align: center;
  cursor: pointer;
  /* bottom bite: blue-700 pulled toward ink; literal fallback first */
  box-shadow: inset 0 -1px 0 #334A5A, 0 1px 2px rgba(45, 42, 38, 0.22);
  box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--blue-700) 60%, var(--text-primary)), 0 1px 2px rgba(45, 42, 38, 0.22);
  transition: background-color 150ms var(--ease-out), box-shadow 150ms var(--ease-out), transform 150ms var(--ease-out);
}
.mpv4-visit:hover { background: var(--blue-600); }
.mpv4-visit:active {
  transform: translateY(1px);
  box-shadow: inset 0 -1px 0 #334A5A;
  box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--blue-700) 60%, var(--text-primary));
}
/* the card body already fills the column; keep the button pinned to the
   card's foot so grids of unequal content stay ruled */
.mpv4-body .mpv4-visit { margin-top: auto; }
.mpv4-body > :nth-last-child(2) { margin-bottom: 16px; }
