/* ============================================
   home-picks.css — sticker and sheet cards on Home (home-picks.js).
   Each card is a post's width (feed.css .feed-card):
   - 3 × 3 and 2 × 2: square tiles, the price under each
   - one sticker: a big square, then name, creator and price
   - one sheet: its cover, then name, sticker count and price
   Same as the app's HomePickViews.swift.
   ============================================ */

.hpk {
  /* A post's width on a computer (feed.css: posts fit the visible height) */
  --hpk-w: calc(min(800px, calc(100vh - 132px)) * 9 / 16);
  width: var(--hpk-w);
  max-width: 100%;
  margin: 8px auto 28px;
}

@media (max-width: 768px) {
  .hpk {
    /* A post's width on a phone (feed.css .feed-card) */
    --hpk-w: min(93vw, calc((100svh - 44px - env(safe-area-inset-top, 0px) - var(--sb-feed-gap-top, 0px) - var(--sb-feed-gap-bottom, 12px)) * 9 / 16));
  }
}

/* No "Suggested for You" / "Suggested Creators" heading over Home's people
   rows either (Oct 2026): each card says why that person is there */
#feed-area .fsugg-row-title {
  display: none;
}

.hpk-title {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 12px;
}

/* Button reset; :where keeps it weaker than the card styles below */
:where(.hpk) button {
  font: inherit;
  color: inherit;
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.hpk button:focus-visible {
  outline: 2px solid #6D28D9;
  outline-offset: 3px;
}

/* Price: the coin, then the number (Shop's .shop-sticker-badge) */
.hpk-price {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--color-text-primary);
  white-space: nowrap;
}
.hpk-price img {
  width: 13px;
  height: 13px;
}

/* ---- 3 × 3 and 2 × 2 ---- */
.hpk-grid {
  display: grid;
  gap: 10px;
}
.hpk-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.hpk-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hpk-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.hpk-tile-art {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 14px;
  border: 1px solid var(--color-border);
  background: var(--color-canvas);
  overflow: hidden;
  transition: transform 0.12s ease-out;
}
.hpk-tile-art img {
  position: absolute;
  inset: 6%;
  width: 88%;
  height: 88%;
  object-fit: contain;
  -webkit-user-drag: none;
}
.hpk-tile:active .hpk-tile-art {
  transform: scale(0.96);
}

/* ---- One sticker or one sheet ---- */
.hpk-big {
  display: block;
  width: 100%;
  text-align: left;
  border-radius: 24px;
  border: 1px solid var(--color-border);
  background: var(--color-canvas);
  overflow: hidden;
}
.hpk-big-art {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 1;
}
.hpk-big-art img {
  position: absolute;
  inset: 7%;
  width: 86%;
  height: 86%;
  object-fit: contain;
  -webkit-user-drag: none;
}
.hpk-sheet-pic {
  display: block;
  position: relative;
  width: 100%;
  /* About a post's height in all, with the title and the line under it */
  height: max(var(--hpk-w), calc(var(--hpk-w) * 16 / 9 - 110px));
}

.hpk-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
}
.hpk-info-text {
  flex: 1;
  min-width: 0;
}
.hpk-info-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hpk-info-line {
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- People rows line up with the posts (phone, Oct 2026) ----
   A row is a post's width: strips show 2 page cards, 3 face cards or 2
   creator cards across exactly that width, starting at the post's left
   edge, with the next card peeking past its right edge. Same as the app.
   On a computer, posts sit beside their comments, so rows stay centered. */
@media (max-width: 768px) {
  #feed-area {
    --sb-post-w: min(93vw, calc((100svh - 44px - env(safe-area-inset-top, 0px) - var(--sb-feed-gap-top, 0px) - var(--sb-feed-gap-bottom, 12px)) * 9 / 16));
  }
  #feed-area .fsugg-row {
    --sb-post-side: calc((100vw - var(--sb-post-w)) / 2);
    width: 100vw;
    max-width: none;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding: 0;
  }
  #feed-area .fsugg-strip {
    gap: 12px;
    padding-left: var(--sb-post-side);
    padding-right: var(--sb-post-side);
    scroll-padding-left: var(--sb-post-side);
    scroll-padding-right: var(--sb-post-side);
  }
  #feed-area .fsugg-strip .fsugg-card--page,
  #feed-area .fsugg-strip .fcreator-card {
    width: calc((var(--sb-post-w) - 12px) / 2);
    box-sizing: border-box;
  }
  #feed-area .fsugg-strip .fsugg-card--face {
    width: calc((var(--sb-post-w) - 24px) / 3);
    box-sizing: border-box;
  }
  #feed-area .fsugg-row .fsugg-list-box,
  #feed-area .fsugg-row .fsugg-grid {
    width: var(--sb-post-w);
    box-sizing: border-box;
    margin-left: auto;
    margin-right: auto;
  }
  #feed-area .fsugg-caught-up {
    width: var(--sb-post-w);
    padding-left: 0;
    padding-right: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hpk-tile-art { transition: none; }
}
