/* ─────────────────────────────────────────────────────────────────────────────
   style.css — Share page visuals. Mirrors the app's design tokens
   (src/theme/tokens.ts) and the VerticalCard / ListDetailScreen layout so a
   recipient sees a near-continuous experience between the share link and
   the in-app view of the same list.
   ───────────────────────────────────────────────────────────────────────── */

:root {
  /* Tokens — kept in sync with app/src/theme/tokens.ts. */
  --bg: #F8F8F8;
  --card-bg: #FFFFFF;
  --ink: #1a1a1a;
  --ink-subtle: rgb(140, 133, 123);
  --separator: rgba(0, 0, 0, 0.08);
  --gold: #E6A817;
  --error: #FF3B30;
  --shadow: 0 2px 4px rgba(60, 50, 40, 0.05);
  --shadow-lg: 0 4px 14px rgba(0, 0, 0, 0.07);

  /* Image well — matches the list-detail's polaroid styling
     (light-grey backdrop, white border around the photo). */
  --image-well: #F0F0F0;
  --image-border: #FFFFFF;
  --image-border-w: 20px;

  --radius-card: 14px;
  --radius-lg: 22px;

  /* Fonts mirror Manrope (body) + EB Garamond (display) used in the app. */
  --font-body: 'Manrope', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  --font-display: 'EB Garamond', Georgia, 'Times New Roman', serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }

.root {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 16px 80px;
  min-height: 100vh;
}

/* ── Loading + error states ─────────────────────────────────────────────── */

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 0;
}
.loading-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid var(--separator);
  border-top-color: var(--ink);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error-card {
  margin: 64px auto 0;
  max-width: 380px;
  padding: 28px 24px;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.error-card .title {
  font-family: var(--font-display);
  font-size: 26px;
  margin: 0 0 8px;
}
.error-card .body {
  font-size: 14px;
  color: var(--ink-subtle);
  line-height: 1.4;
  margin: 0;
}

/* ── Header ─────────────────────────────────────────────────────────────── */

.head {
  margin: 8px 0 24px;
}
.shared-by {
  font-size: 12px;
  color: var(--ink-subtle);
  letter-spacing: 0.3px;
  text-transform: uppercase;
  margin: 0 0 6px;
}
.list-title {
  font-family: var(--font-display);
  font-size: 36px;
  line-height: 1.1;
  letter-spacing: -0.3px;
  margin: 0 0 10px;
  color: var(--ink);
}
.list-desc {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-subtle);
  margin: 0 0 14px;
}

/* Countdown chip — same geometry as the RN CountdownChip (small pill
   with a clock icon). Only shown when the list has a dueDate. */
.due-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 8px;
  border-radius: 100px;
  background: rgba(26, 26, 26, 0.06);
  font-size: 12px;
  color: var(--ink);
  font-weight: 600;
}
.due-chip svg { display: block; }

/* "Open in app" pill — disabled placeholder until iOS deep-linking lands. */
.app-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
  padding: 6px 14px;
  border-radius: 100px;
  background: var(--ink);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  opacity: 0.4;
  cursor: not-allowed;
}

.meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.item-count {
  font-size: 12.5px;
  color: var(--ink-subtle);
}

/* ── Item grid ──────────────────────────────────────────────────────────── */

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 8px;
}
@media (min-width: 560px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

/* Image well — polaroid look: light-grey backdrop, wide white border
   wrapping the image, zoomed/cover-fit per ImgPlaceholder. */
.image-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--image-well);
  border: var(--image-border-w) solid var(--image-border);
  overflow: hidden;
}
.image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.image-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: var(--ink-subtle);
  font-family: var(--font-display);
}

/* OOS strip — matches RN VerticalCard.footBar (dark band over image foot). */
.oos-foot {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 5px 10px;
  background: rgba(26, 26, 26, 0.82);
  color: #F5F1EA;
  font-size: 9.5px;
  text-align: center;
  font-weight: 600;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}

/* Card body */
.body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.body .name {
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.25;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.body .brand {
  font-size: 11.5px;
  color: var(--ink-subtle);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.body .price {
  font-size: 13px;
  color: var(--ink);
  font-weight: 600;
  margin-top: 4px;
}
.body .price-empty {
  color: var(--ink-subtle);
  font-weight: 400;
}

/* "Buy" link sits at the bottom of the card */
.buy-link {
  margin-top: 10px;
  padding: 8px 12px;
  background: var(--ink);
  color: #fff;
  border-radius: 100px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
  align-self: stretch;
}
.buy-link:hover { background: #000; }

/* Removed / unavailable card — greyed out, non-tappable. */
.card.removed {
  opacity: 0.55;
  pointer-events: none;
}

/* ── Footer ─────────────────────────────────────────────────────────────── */

.foot {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--separator);
  text-align: center;
  font-size: 11px;
  color: var(--ink-subtle);
  letter-spacing: 0.3px;
}
.foot a { color: var(--ink); font-weight: 600; }
