/* Petiht web feed (index.newsfeed.tpl): All / Popular / Discover / Videos.
   Light: white cards, Haiti blue #00209F accents, Haiti red #D21034 CTAs.
   Dark (body.night-mode): yellow #F5C518 titles, icons, chips; white text; red CTAs. */

.pf-feed {
  --pf-blue: #00209F;
  --pf-red: #D21034;
  --pf-yellow: #F5C518;
  --pf-ink: #0f172a;
  --pf-muted: #64748b;
  --pf-line: #e6e9ef;
  --pf-card: #ffffff;
  --pf-hover: #f3f5f8;
}

body.night-mode .pf-feed {
  --pf-ink: #ffffff;
  --pf-muted: #b8c2cc;
  --pf-line: var(--card-dark-divider, #2e3f4d);
  --pf-card: var(--card-dark-color, #262D34);
  --pf-hover: rgba(255, 255, 255, 0.06);
}

/* ---------- feed header ---------- */
.pf-feed .posts-filter:has(> .pf-feedhead) {
  border-bottom: 0;
  padding-bottom: 0;
  line-height: normal;
  font-weight: normal;
}

.pf-feedhead {
  position: relative;
  margin: 4px 0 18px;
  padding: 18px 18px 14px;
  background: var(--pf-card);
  border: 1px solid var(--pf-line);
  border-radius: 20px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 28px rgba(15, 23, 42, 0.05);
  overflow: hidden;
}

/* flag stripe: hard stop, never a blended blue-red gradient */
.pf-feedhead::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--pf-blue) 0 50%, var(--pf-red) 50% 100%);
}

body.night-mode .pf-feedhead::before {
  background: linear-gradient(90deg, var(--pf-yellow) 0 50%, var(--pf-red) 50% 100%);
}

.pf-feedhead-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.pf-feedhead-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.pf-feedhead-flag {
  flex: 0 0 auto;
  width: 8px;
  height: 40px;
  border-radius: 6px;
  background: linear-gradient(180deg, var(--pf-blue) 0 50%, var(--pf-red) 50% 100%);
}

body.night-mode .pf-feedhead-flag {
  background: linear-gradient(180deg, var(--pf-yellow) 0 50%, var(--pf-red) 50% 100%);
}

.pf-feedhead h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--pf-ink);
}

body.night-mode .pf-feedhead h2 {
  color: var(--pf-yellow);
}

.pf-feedhead-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.pf-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
  border-radius: 999px;
  white-space: nowrap;
}

.pf-chip i {
  font-size: 10px;
}

.pf-chip.pinned {
  color: var(--pf-blue);
  border: 1px solid var(--pf-blue);
}

.pf-chip.promoted {
  color: var(--pf-red);
  background: #fdecef;
  border: 1px solid #f7c6d0;
}

body.night-mode .pf-chip.pinned,
body.night-mode .pf-chip.promoted {
  color: var(--pf-yellow);
  background: transparent;
  border: 1px solid rgba(245, 197, 24, 0.6);
}

.pf-feedhead-cta {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #fff !important;
  background: var(--pf-red);
  border-radius: 999px;
  text-decoration: none !important;
  box-shadow: 0 6px 16px rgba(210, 16, 52, 0.22);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.pf-feedhead-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(210, 16, 52, 0.3);
}

/* tabs */
.pf-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  background: var(--pf-hover);
  border-radius: 14px;
  overflow-x: auto;
  scrollbar-width: none;
}

.pf-tabs::-webkit-scrollbar {
  display: none;
}

.pf-tab {
  flex: 1 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--pf-muted) !important;
  border-radius: 11px;
  text-decoration: none !important;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.pf-tab:hover {
  color: var(--pf-ink) !important;
  background: var(--pf-card);
}

.pf-tab.active {
  color: #fff !important;
  background: var(--pf-blue);
  box-shadow: 0 4px 12px rgba(0, 32, 159, 0.22);
}

body.night-mode .pf-tab {
  color: #fff !important;
}

body.night-mode .pf-tab i {
  color: var(--pf-yellow);
}

body.night-mode .pf-tab.active {
  color: #111 !important;
  background: var(--pf-yellow);
  box-shadow: none;
}

body.night-mode .pf-tab.active i {
  color: #111;
}

/* ---------- post ribbons ---------- */
.pf-ribbon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px 6px;
  padding: 3px 11px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
  color: #fff;
  border-radius: 999px;
}

.pf-ribbon i {
  font-size: 10px;
}

.pf-ribbon.pinned {
  background: var(--pf-blue, #00209F);
}

.pf-ribbon.promoted {
  background: var(--pf-red, #D21034);
}

body.night-mode .pf-ribbon.pinned {
  color: #111;
  background: var(--pf-yellow, #F5C518);
}

/* ---------- post cards ---------- */
.pf-feed .post {
  border: 1px solid var(--pf-line);
  border-radius: 20px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 28px rgba(15, 23, 42, 0.04);
  overflow: visible;
  transition: box-shadow 0.2s ease;
}

.pf-feed .post:hover {
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 14px 34px rgba(15, 23, 42, 0.08);
}

body.night-mode .pf-feed .post {
  box-shadow: none;
}

.pf-feed li.feed-pinned > .post {
  border-color: var(--pf-blue);
  box-shadow: 0 0 0 1px var(--pf-blue), 0 10px 28px rgba(0, 32, 159, 0.08);
}

body.night-mode .pf-feed li.feed-pinned > .post {
  border-color: var(--pf-yellow);
  box-shadow: 0 0 0 1px var(--pf-yellow);
}

.pf-feed .post.boosted,
body.night-mode .pf-feed .post.boosted {
  border: 1px solid var(--pf-red);
}

.pf-feed .post-header {
  padding: 18px 18px 0;
}

.pf-feed .post-avatar-picture {
  min-width: 48px;
  min-height: 48px;
  border-radius: 50%;
}

.pf-feed .pg_wrapper {
  overflow: hidden;
}

.pf-feed .pg_1x img {
  display: block;
  background: var(--pf-hover);
}

.pf-feed .see-more.alert-post {
  border: 1px solid var(--pf-line);
  border-radius: 14px;
  font-weight: 600;
}

/* ---------- empty All feed ---------- */
.pf-empty {
  padding: 40px 20px;
  text-align: center;
  background: var(--pf-card);
  border: 1px dashed var(--pf-line);
  border-radius: 20px;
}

.pf-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin-bottom: 12px;
  font-size: 22px;
  color: var(--pf-red);
  background: #fdecef;
  border-radius: 50%;
}

body.night-mode .pf-empty-icon {
  color: var(--pf-yellow);
  background: rgba(245, 197, 24, 0.12);
}

.pf-empty-title {
  margin-bottom: 14px;
  font-weight: 600;
  color: var(--pf-ink);
}

.pf-empty-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  color: #fff !important;
  background: var(--pf-blue);
  border-radius: 999px;
  text-decoration: none !important;
}

body.night-mode .pf-empty-btn {
  color: #111 !important;
  background: var(--pf-yellow);
}

/* ---------- small screens ---------- */
@media (max-width: 575.98px) {
  .pf-feedhead {
    padding: 16px 12px 12px;
    border-radius: 16px;
  }

  .pf-feedhead h2 {
    font-size: 19px;
  }

  .pf-feedhead-cta span {
    display: none;
  }

  .pf-feedhead-cta {
    padding: 10px 12px;
  }

  .pf-tab {
    padding: 8px 12px;
  }

  .pf-feed .post {
    border-radius: 16px;
  }
}
