/* ==========================================================================
   Feed — category chip carousel, "Recent Posts" bar, post cards, embeds,
   sponsored card, pagination.
   Rendered by assets/js/components/feed.js into #pb-feed.
   ========================================================================== */

/* ── Category chips ─────────────────────────────────────────────────────── */
.pb-chips { position: relative; margin: 0 -12px; }
.pb-chips__row {
  display: flex; gap: 10px; overflow-x: auto; padding: 4px 12px 8px; scroll-behavior: smooth; scroll-snap-type: x proximity;
  scroll-padding-left: 12px; scrollbar-width: none;
}
.pb-chips__row::-webkit-scrollbar { display: none; }
.pb-chip {
  flex: none; scroll-snap-align: start; height: 44px; padding: 0 20px; border: 0; border-radius: 24px; white-space: nowrap;
  display: flex; align-items: center; gap: 10px; background: #fff; color: var(--pb-text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .06); font-family: var(--pb-font-head); font-weight: 700; font-size: 15.5px;
  transition: background .15s, color .15s;
}
.pb-chip i { font-size: 15px; }
.pb-chip:hover { background: #f6f3ea; }
.pb-chip.is-active { background: var(--pb-primary); color: #fff; }
.pb-chips__arrow {
  position: absolute; top: 0; bottom: 4px; width: 72px; display: none; align-items: center; pointer-events: none;
}
.pb-chips__arrow button {
  pointer-events: auto; width: 40px; height: 40px; border: 1px solid #ececec; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .1); font-size: 13px; color: var(--pb-text);
}
.pb-chips__arrow--l { left: 0; padding-left: 16px; background: linear-gradient(90deg, var(--pb-bg) 45%, rgba(250, 250, 248, 0)); }
.pb-chips__arrow--r { right: 0; justify-content: flex-end; padding-right: 16px; background: linear-gradient(270deg, var(--pb-bg) 45%, rgba(250, 250, 248, 0)); }
.pb-chips.can-left .pb-chips__arrow--l, .pb-chips.can-right .pb-chips__arrow--r { display: flex; }
@media (min-width: 900px) {
  .pb-chips { margin: 0 -4px; }
  .pb-chips__row { padding: 4px 4px 8px; scroll-padding-left: 4px; }
  .pb-chip.is-active { background: #141414; }
}

/* ── "Recent Posts" bar ─────────────────────────────────────────────────── */
.pb-feed-bar { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 0 12px; }
.pb-feed-bar__title { font-family: var(--pb-font-head); font-weight: 700; font-size: 19px; color: var(--pb-text-3); }
.pb-feed-bar__title small { margin-left: 8px; font-family: var(--pb-font-body); font-weight: 600; font-size: 14px; color: var(--pb-text-faint); }
.pb-select { position: relative; }
.pb-select > button {
  height: 42px; padding: 0 16px; display: flex; align-items: center; gap: 14px; border: 1px solid #f0f0f0; border-radius: 12px;
  background: #fff; font-size: 16px; font-weight: 600; color: var(--pb-text);
}
.pb-select > button i { font-size: 12px; }
.pb-select__menu {
  position: absolute; right: 0; top: 46px; z-index: 20; min-width: 160px; padding: 6px; display: none;
  background: #fff; border: 1px solid #efece4; border-radius: 14px; box-shadow: var(--pb-shadow-pop);
}
.pb-select.is-open .pb-select__menu { display: block; }
.pb-select__menu button { width: 100%; height: 40px; padding: 0 12px; border: 0; border-radius: 10px; background: none; text-align: left; font-size: 15px; font-weight: 600; }
.pb-select__menu button:hover, .pb-select__menu button.is-active { background: var(--pb-amber-soft); color: #6d5000; }

/* ── Feed list ──────────────────────────────────────────────────────────── */
#pb-feed { display: flex; flex-direction: column; gap: 22px; }
.pb-feed-note { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-radius: 12px; background: #fef3c7; font-weight: 700; font-size: 14px; color: #b45309; }
.pb-feed-note a { margin-left: auto; font-size: 13px; color: #b45309; }
.pb-feed-empty { padding: 48px 20px; text-align: center; color: var(--pb-text-muted); }
.pb-feed-empty i { display: block; margin-bottom: 12px; font-size: 32px; color: var(--pb-amber); }
.pb-feed-empty button { margin-top: 14px; }

/* ── Post card ──────────────────────────────────────────────────────────── */
.pb-post { padding: 14px; animation: pb-fade-up .3s ease both; }
.pb-post__head { display: flex; align-items: flex-start; gap: 12px; }
.pb-post__who { flex: 1; min-width: 0; }
.pb-post__top { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 10px; }
.pb-post__top > div:first-child { flex: 1 1 140px; }
.pb-post__author { font-family: var(--pb-font-head); font-weight: 700; font-size: 17px; color: var(--pb-text); }
.pb-post__author a { color: inherit; }
.pb-post__author a:hover { text-decoration: none; color: inherit; }
.pb-post__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 3px; font-size: 14px; color: var(--pb-text-muted); }
.pb-post__meta i { margin-right: 6px; font-size: 12px; color: #2b2b30; }
.pb-post__tags { flex: none; display: flex; align-items: center; gap: 8px; }
.pb-post__tags .pb-tag { height: 30px; padding: 0 12px; font-size: 12.5px; }
.pb-post__more { width: 32px; height: 32px; border: 0; background: none; font-size: 18px; color: #2b2b30; }
.pb-post__title { margin-top: 12px; font-family: var(--pb-font-head); font-weight: 800; font-size: 18px; line-height: 1.3; }
.pb-post__text { margin-top: 12px; font-size: 16px; line-height: 1.5; color: var(--pb-text); white-space: pre-line; word-wrap: break-word; overflow-wrap: anywhere; }
.pb-post__text button { border: 0; background: none; padding: 0; font-family: var(--pb-font-head); font-weight: 800; font-size: 15.5px; color: var(--pb-text); }
.pb-post__text button:hover { text-decoration: none; }
.pb-post__text mark, .pb-post__title mark { background: #fff3cd; border-radius: 2px; padding: 0 2px; }
/* Photo: always shown whole (never cropped) — scaled down to fit the card, centred on a soft backdrop. */
.pb-post__media { margin-top: 12px; border-radius: 12px; background: #f4f1ea; text-align: center; line-height: 0; }
.pb-post__imgwrap { position: relative; display: inline-block; max-width: 100%; vertical-align: top; }
.pb-post__media img { display: inline-block; max-width: 100%; max-height: min(640px, 82vh); width: auto; height: auto; border-radius: 12px; cursor: zoom-in; }

/* Product tags on the photo — Facebook-style: hidden until the "N products" badge is tapped (or the photo is
   hovered on desktop); each label has an arrow pointing at the tagged spot and is kept inside the photo. */
.pb-post__imgwrap { overflow: hidden; border-radius: 12px; }
.pb-tagbadge {
  position: absolute; left: 8px; bottom: 8px; z-index: 6; height: 28px; padding: 0 11px 0 9px; display: inline-flex; align-items: center; gap: 6px;
  border: 0; border-radius: 14px; background: rgba(20,20,20,.72); color: #fff; font-family: var(--pb-font-head); font-weight: 800; font-size: 12.5px; line-height: 1;
  cursor: pointer; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.pb-tagbadge i { font-size: 12px; }
.pb-tagbadge:hover, .pb-post__imgwrap.is-tags .pb-tagbadge { background: var(--pb-orange-2, #e08a00); }
.pb-pins { position: absolute; inset: 0; pointer-events: none; visibility: hidden; opacity: 0; transition: opacity .15s; }
.pb-post__imgwrap.is-tags .pb-pins { visibility: visible; opacity: 1; }
@media (hover: hover) { .pb-post__imgwrap:hover .pb-pins { visibility: visible; opacity: 1; } }
.pb-pin { position: absolute; width: 0; height: 0; z-index: 2; }
.pb-pin:hover, .pb-pin:focus-within { z-index: 5; }
.pb-pin::before { /* arrow tip, sits exactly on the tagged spot */
  content: ""; position: absolute; left: -5px; top: 5px; width: 10px; height: 10px; background: rgba(20,20,20,.9); transform: rotate(45deg);
}
.pb-pin--above::before { top: auto; bottom: 5px; }
.pb-pin__tag {
  position: absolute; left: 0; top: 10px; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: max-content; box-sizing: border-box;
  max-width: 200px; padding: 6px 11px; border-radius: 9px; background: rgba(20,20,20,.9); color: #fff; line-height: 1.25; text-align: left;
  transform: translateX(calc(-50% + var(--dx, 0px))); pointer-events: auto; box-shadow: 0 3px 12px rgba(0,0,0,.3);
}
.pb-pin--above .pb-pin__tag { top: auto; bottom: 10px; }
.pb-pin__tag:hover { color: #fff; background: #000; }
.pb-pin__name { max-width: 100%; font-weight: 700; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-pin__price { font-family: var(--pb-font-head); font-weight: 800; font-size: 12.5px; color: #ffc857; }
.pb-embed { position: relative; height: 0; padding-bottom: 56.25%; margin-top: 12px; border-radius: 12px; overflow: hidden; background: #000; }
.pb-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.pb-post__video { display: block; width: 100%; max-height: 440px; margin-top: 12px; border-radius: 12px; background: #000; }

.pb-post__actions { display: flex; align-items: center; gap: 22px; margin-top: 12px; }
.pb-post__actions .pb-spacer { flex: 1; }
.pb-act {
  display: flex; align-items: center; gap: 10px; padding: 6px 0; border: 0; background: none;
  font-size: 16px; font-weight: 600; color: var(--pb-text); transition: transform .15s;
}
.pb-act i { font-size: 21px; }
.pb-act--paw i { color: #b5b2aa; }
.pb-act--paw.is-on i { color: var(--pb-orange-2); }
.pb-act--paw:hover i { color: var(--pb-orange); }
.pb-act--share i { font-size: 18px; }
.pb-act:disabled { opacity: .6; }
@media (min-width: 900px) {
  .pb-post { padding: 16px; }
  .pb-post__author { font-size: 18.5px; }
}

/* Link / shoppable embeds */
.pb-link-card {
  display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 12px 14px;
  border: 1px solid var(--pb-border-3); border-radius: 12px; background: #fcfbf8; color: var(--pb-text);
}
.pb-link-card:hover { background: #f8f4ea; color: var(--pb-text); }
.pb-link-card__ico { flex: none; width: 38px; height: 38px; border-radius: 10px; background: var(--pb-surface-warm); color: var(--pb-primary); display: flex; align-items: center; justify-content: center; }
.pb-link-card__body { flex: 1; min-width: 0; }
.pb-link-card__src { font-family: var(--pb-font-head); font-weight: 800; font-size: 14px; }
.pb-link-card__url { display: block; font-size: 12.5px; color: var(--pb-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-link-card > i:last-child { color: var(--pb-text-faint); font-size: 13px; }

.pb-post-products { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pb-pp-chip {
  display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; max-width: 100%;
  border: 1px solid #f1f1f1; border-radius: 12px; background: #fff; color: var(--pb-text);
}
.pb-pp-chip:hover { border-color: #ecdcb2; color: var(--pb-text); }
.pb-pp-chip img, .pb-pp-chip__noimg { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex: none; background: var(--pb-amber-soft); display: flex; align-items: center; justify-content: center; color: var(--pb-orange-2); }
.pb-pp-chip__name { font-weight: 700; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.pb-pp-chip__price { font-family: var(--pb-font-head); font-weight: 800; font-size: 13.5px; color: var(--pb-link); }

/* Sponsored card */
.pb-sponsored { display: flex; align-items: center; gap: 14px; padding: 14px; background: linear-gradient(90deg, #fff8e6, #fff); border: 1px solid #f6e3b4; }
.pb-sponsored__img { width: 72px; height: 72px; object-fit: contain; border-radius: 12px; background: #fff; flex: none; }
.pb-sponsored__noimg { width: 72px; height: 72px; border-radius: 12px; background: var(--pb-amber-soft); display: flex; align-items: center; justify-content: center; font-size: 24px; color: var(--pb-orange-2); flex: none; }
.pb-sponsored__body { flex: 1; min-width: 0; }
.pb-sponsored__eyebrow { font-family: var(--pb-font-head); font-weight: 800; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: #b45309; }
.pb-sponsored__name { margin-top: 2px; font-family: var(--pb-font-head); font-weight: 800; font-size: 16px; }
.pb-sponsored__note { font-size: 13.5px; color: var(--pb-text-muted); }
.pb-sponsored__price { margin-top: 2px; font-family: var(--pb-font-head); font-weight: 800; color: var(--pb-link); }

/* Pagination */
.pb-pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 8px 0 4px; }
.pb-pager__btn, .pb-pager__gap {
  min-width: 40px; height: 40px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 12px; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
  font-family: var(--pb-font-head); font-weight: 800; font-size: 15px; color: var(--pb-text);
}
.pb-pager__btn:hover { background: #f6f3ea; }
.pb-pager__btn.is-active { background: var(--pb-primary); color: #fff; cursor: default; }
.pb-pager__btn[disabled] { opacity: .45; cursor: default; }
.pb-pager__gap { background: none; box-shadow: none; }
.pb-pager__info { width: 100%; text-align: center; font-size: 13px; color: var(--pb-text-faint); }

/* ── Phones: compact post cards (denser feed, smaller type) ──────────────── */
@media (max-width: 899px) {
  .pb-content { gap: 16px; }
  .pb-chips { margin: 0 -10px; }
  .pb-chips__row { gap: 6px; padding: 2px 12px 4px; }
  .pb-chip { height: 32px; padding: 0 13px; gap: 7px; font-size: 13px; border-radius: 16px; }
  .pb-chip i { font-size: 12px; }
  .pb-feed-bar { padding-left: 8px; }
  .pb-feed-bar__title { font-size: 15px; }
  .pb-feed-bar__title small { font-size: 12px; margin-left: 6px; }
  .pb-select > button { height: 30px; padding: 0 10px; gap: 8px; font-size: 13px; border-radius: 10px; }
  .pb-select__menu { top: 34px; }
  .pb-select__menu button { height: 36px; font-size: 14px; }
  #pb-feed { gap: 14px; margin-inline: -4px; }

  .pb-post { padding: 10px 12px 8px; border-radius: 14px; }
  .pb-post__head { gap: 10px; }
  .pb-post__head .pb-avatar { width: 38px; height: 38px; font-size: 14px; }
  .pb-post__top { gap: 4px 8px; }
  .pb-post__top > div:first-child { flex-basis: 110px; }
  .pb-post__author { font-size: 14.5px; line-height: 1.25; }
  .pb-post__meta { margin-top: 1px; font-size: 12px; gap: 2px 6px; }
  .pb-post__tags { gap: 6px; }
  .pb-post__tags .pb-tag { height: 22px; padding: 0 8px; gap: 5px; border-radius: 11px; font-size: 10.5px; letter-spacing: .02em; }
  .pb-post__tags .pb-tag i { font-size: 10px; }

  .pb-post__title { margin-top: 8px; font-size: 15.5px; line-height: 1.3; }
  .pb-post__text { margin-top: 3px; font-size: 14px; line-height: 1.45; }
  .pb-post__title + .pb-post__text { margin-top: 3px; }
  .pb-post__text button { font-size: 14px; }
  .pb-post__media, .pb-embed, .pb-post__video, .pb-link-card, .pb-post-products { margin-top: 8px; }

  .pb-post__actions { gap: 18px; margin-top: 6px; }
  .pb-act { gap: 7px; padding: 4px 0; font-size: 14px; }
  .pb-act i { font-size: 18px; }
  .pb-act--share i { font-size: 15px; }
  .pb-link-card { padding: 9px 11px; }
  .pb-pager { padding-top: 4px; }
}
