/* ============================================================
   Nattoint House Renting — Property Feed
   Instagram-style cards. Inherits the plugin's design tokens
   from frontend.css (--bhr-*), with feed-only additions here.
   ============================================================ */

.bhr-feed-wrap {
  font-family: 'Segoe UI', system-ui, Arial, sans-serif;
  color: var(--bhr-text, #1a202c);
  background: var(--bhr-bg, #f4f7fb);
  line-height: 1.7;
  font-size: 14px;
  padding: 24px 16px 80px;
}

.bhr-feed-shell { max-width: 620px; margin: 0 auto; }

/* ── Header ─────────────────────────────────────────────── */
.bhr-feed-header {
  background: var(--bhr-card, #fff);
  border: 1px solid var(--bhr-border, #e2e8f0);
  border-radius: var(--bhr-radius, 10px);
  padding: 22px 24px;
  margin-bottom: 20px;
  box-shadow: var(--bhr-shadow, 0 1px 3px rgba(0,0,0,.05));
}
.bhr-feed-header-top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.bhr-feed-title {
  font-size: 22px; font-weight: 700; margin: 0;
  color: var(--bhr-primary, #1e3a5f); letter-spacing: -.3px;
}
.bhr-feed-sub {
  margin: 6px 0 0; font-size: 13px; color: var(--bhr-text-muted, #64748b);
}
.bhr-feed-filters { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.bhr-feed-search, .bhr-feed-select {
  padding: 9px 12px; font-size: 13px; font-family: inherit;
  border: 1px solid var(--bhr-border, #e2e8f0);
  border-radius: var(--bhr-radius-sm, 6px);
  background: #fff; color: inherit;
}
.bhr-feed-search { flex: 1 1 200px; }
.bhr-feed-select { flex: 0 1 190px; }
.bhr-feed-search:focus, .bhr-feed-select:focus {
  outline: none; border-color: var(--bhr-accent, #2563eb);
}

.bhr-feed-single-banner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--bhr-primary-light, #f0f6ff);
  border: 1px solid var(--bhr-primary-mid, #c0d4ee);
  color: var(--bhr-primary, #1e3a5f);
  border-radius: var(--bhr-radius-sm, 6px);
  padding: 10px 14px; font-size: 13px; margin-bottom: 16px;
}
.bhr-feed-linkbtn {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--bhr-accent, #2563eb); font: inherit; font-weight: 600;
  text-decoration: underline;
}

/* ── Post card ──────────────────────────────────────────── */
.bhr-feed-list { display: flex; flex-direction: column; gap: 20px; }

.bhr-feed-post {
  background: var(--bhr-card, #fff);
  border: 1px solid var(--bhr-border, #e2e8f0);
  border-radius: var(--bhr-radius, 10px);
  overflow: hidden;
  box-shadow: var(--bhr-shadow, 0 1px 3px rgba(0,0,0,.05));
  transition: opacity .2s ease, box-shadow .2s ease;
  animation: bhrFeedIn .32s cubic-bezier(.4,0,.2,1);
}
.bhr-feed-post:hover { box-shadow: var(--bhr-shadow-md, 0 4px 20px rgba(0,0,0,.09)); }

@keyframes bhrFeedIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .bhr-feed-post { animation: none; }
  .bhr-feed-track { transition: none !important; }
}

.bhr-feed-post-head {
  display: flex; align-items: center; gap: 11px; padding: 13px 16px;
}
.bhr-feed-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
  border: 2px solid var(--bhr-primary-mid, #c0d4ee);
}
.bhr-feed-avatar-blank {
  display: flex; align-items: center; justify-content: center;
  background: var(--bhr-primary, #1e3a5f); color: #fff;
  font-weight: 700; font-size: 16px;
}
.bhr-feed-post-meta { flex: 1; min-width: 0; }
.bhr-feed-author {
  font-weight: 700; font-size: 14px; line-height: 1.3;
  display: flex; align-items: center; gap: 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bhr-feed-verified {
  color: #fff; background: var(--bhr-accent, #2563eb);
  width: 14px; height: 14px; border-radius: 50%; font-size: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.bhr-feed-loc { font-size: 12px; color: var(--bhr-text-muted, #64748b); }
.bhr-feed-time {
  font-size: 12px; color: var(--bhr-text-light, #94a3b8);
  flex-shrink: 0; align-self: flex-start; padding-top: 2px;
}

/* ── Gallery ────────────────────────────────────────────── */
.bhr-feed-gallery {
  position: relative; overflow: hidden;
  background: #0f172a; aspect-ratio: 4 / 5; max-height: 620px;
}
.bhr-feed-track {
  display: flex; height: 100%;
  transition: transform .32s cubic-bezier(.4,0,.2,1);
}
.bhr-feed-slide { flex: 0 0 100%; height: 100%; }
.bhr-feed-img {
  width: 100%; height: 100%; object-fit: cover;
  display: block; cursor: zoom-in;
}
.bhr-feed-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border-radius: 50%; border: none;
  background: rgba(255,255,255,.9); color: #1a202c;
  font-size: 20px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.2); transition: background .15s;
}
.bhr-feed-arrow:hover { background: #fff; }
.bhr-feed-arrow.prev { left: 10px; visibility: hidden; }
.bhr-feed-arrow.next { right: 10px; }
.bhr-feed-counter {
  position: absolute; top: 12px; right: 12px;
  background: rgba(15,23,42,.72); color: #fff;
  font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
}
.bhr-feed-dots {
  position: absolute; bottom: 12px; left: 0; right: 0;
  display: flex; justify-content: center; gap: 6px;
}
.bhr-feed-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,.5); cursor: pointer; transition: all .2s;
}
.bhr-feed-dot.active { background: #fff; width: 18px; border-radius: 999px; }

/* ── Actions ────────────────────────────────────────────── */
.bhr-feed-actions {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 12px 6px; flex-wrap: wrap;
}
.bhr-feed-action {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600;
  color: var(--bhr-text, #1a202c);
  padding: 7px 11px; border-radius: var(--bhr-radius-sm, 6px);
  transition: background .15s ease, color .15s ease;
}
.bhr-feed-action:hover { background: var(--bhr-bg, #f4f7fb); }
.bhr-feed-heart { font-size: 19px; line-height: 1; transition: transform .2s ease; }
.bhr-feed-like.liked { color: #e0245e; }
.bhr-feed-like.pop .bhr-feed-heart { animation: bhrHeartPop .35s cubic-bezier(.4,0,.2,1); }
@keyframes bhrHeartPop {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.4); }
  100% { transform: scale(1); }
}
.bhr-feed-danger { color: var(--bhr-danger, #b91c1c); margin-left: auto; }
.bhr-feed-danger:hover { background: var(--bhr-danger-light, #fef2f2); }

/* ── Caption ────────────────────────────────────────────── */
.bhr-feed-body { padding: 2px 16px 16px; }
.bhr-feed-caption { font-size: 14px; }
.bhr-feed-caption.is-clamped .bhr-feed-caption-text {
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical;
  overflow: hidden;
}
.bhr-feed-morebtn { font-size: 13px; margin-top: 2px; text-decoration: none; }

/* ── Comments ───────────────────────────────────────────── */
.bhr-feed-comments {
  border-top: 1px solid var(--bhr-border, #e2e8f0);
  background: #fbfcfe; padding: 12px 16px 14px;
}
.bhr-feed-comment-list {
  display: flex; flex-direction: column; gap: 12px;
  max-height: 340px; overflow-y: auto; margin-bottom: 12px;
}
.bhr-feed-comment { display: flex; gap: 10px; align-items: flex-start; }
.bhr-feed-comment .bhr-feed-avatar { width: 30px; height: 30px; border-width: 1px; font-size: 13px; }
.bhr-feed-comment-body { flex: 1; min-width: 0; }
.bhr-feed-comment-head {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  font-size: 12px; margin-bottom: 1px;
}
.bhr-feed-comment-head strong { font-size: 13px; }
.bhr-feed-comment-role {
  background: var(--bhr-primary-light, #f0f6ff);
  color: var(--bhr-primary, #1e3a5f);
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  padding: 1px 6px; border-radius: 999px; letter-spacing: .3px;
}
.bhr-feed-comment-time { color: var(--bhr-text-light, #94a3b8); }
.bhr-feed-comment-text { font-size: 13.5px; word-break: break-word; }
.bhr-feed-comment-del {
  background: none; border: none; cursor: pointer; font-size: 18px;
  color: var(--bhr-text-light, #94a3b8); line-height: 1; padding: 0 4px;
}
.bhr-feed-comment-del:hover { color: var(--bhr-danger, #b91c1c); }

.bhr-feed-comment-form { display: flex; gap: 8px; align-items: flex-end; }
.bhr-feed-comment-input {
  flex: 1; resize: none; font: inherit; font-size: 13.5px;
  padding: 9px 12px; border: 1px solid var(--bhr-border, #e2e8f0);
  border-radius: var(--bhr-radius-sm, 6px); background: #fff;
  line-height: 1.5; max-height: 120px;
}
.bhr-feed-comment-input:focus { outline: none; border-color: var(--bhr-accent, #2563eb); }

/* ── Status / pagination ────────────────────────────────── */
.bhr-feed-status, .bhr-feed-status-sm {
  text-align: center; color: var(--bhr-text-muted, #64748b);
  font-size: 13px; padding: 26px 16px;
}
.bhr-feed-status-sm { padding: 12px; font-size: 12.5px; }
.bhr-feed-sentinel { height: 1px; }
.bhr-feed-more { display: block; margin: 4px auto 0; }

/* ── Modals ─────────────────────────────────────────────── */
.bhr-feed-modal {
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(15,23,42,.55);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: bhrFadeIn .18s ease;
}
@keyframes bhrFadeIn { from { opacity: 0; } to { opacity: 1; } }
.bhr-feed-modal-card {
  background: #fff; border-radius: var(--bhr-radius, 10px);
  padding: 28px 26px; max-width: 420px; width: 100%;
  position: relative; box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.bhr-feed-modal-card h3 { margin: 0 0 8px; font-size: 18px; }
.bhr-feed-modal-close {
  position: absolute; top: 10px; right: 14px;
  background: none; border: none; font-size: 26px; line-height: 1;
  color: var(--bhr-text-muted, #64748b); cursor: pointer;
}
.bhr-feed-modal-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.bhr-feed-modal-actions .bhr-btn { flex: 1 1 150px; text-align: center; }

.bhr-feed-share-row { display: flex; gap: 8px; margin-top: 14px; }
.bhr-feed-share-input {
  flex: 1; padding: 9px 11px; font-size: 12.5px; font-family: inherit;
  border: 1px solid var(--bhr-border, #e2e8f0);
  border-radius: var(--bhr-radius-sm, 6px); background: var(--bhr-bg, #f4f7fb);
  color: var(--bhr-text-muted, #64748b);
}
.bhr-feed-share-links {
  display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap;
}
.bhr-feed-share-link {
  flex: 1 1 90px; text-align: center; text-decoration: none;
  font-size: 12.5px; font-weight: 600; padding: 9px 10px;
  border: 1px solid var(--bhr-border, #e2e8f0);
  border-radius: var(--bhr-radius-sm, 6px);
  color: var(--bhr-primary, #1e3a5f); background: var(--bhr-bg, #f4f7fb);
  transition: all .15s ease;
}
.bhr-feed-share-link:hover {
  border-color: var(--bhr-accent, #2563eb); color: var(--bhr-accent, #2563eb);
}

/* ── Lightbox ───────────────────────────────────────────── */
.bhr-feed-lightbox {
  position: fixed; inset: 0; z-index: 100000;
  background: rgba(0,0,0,.92);
  display: flex; align-items: center; justify-content: center; padding: 30px;
}
.bhr-feed-lightbox img {
  max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px;
}
.bhr-feed-lightbox .bhr-feed-modal-close { color: #fff; font-size: 38px; top: 14px; right: 22px; }

/* ── Toast ──────────────────────────────────────────────── */
.bhr-feed-toast {
  position: fixed; bottom: 26px; left: 50%; transform: translate(-50%, 20px);
  background: #1a202c; color: #fff; padding: 11px 20px;
  border-radius: 999px; font-size: 13px; font-weight: 500;
  z-index: 100001; opacity: 0; pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
  max-width: calc(100vw - 40px); text-align: center;
}
.bhr-feed-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── Mobile ─────────────────────────────────────────────── */
@media (max-width: 640px) {
  .bhr-feed-wrap { padding: 12px 0 70px; }
  .bhr-feed-header { border-radius: 0; border-left: none; border-right: none; padding: 18px; }
  .bhr-feed-post { border-radius: 0; border-left: none; border-right: none; }
  .bhr-feed-list { gap: 14px; }
  .bhr-feed-single-banner { margin: 0 12px 14px; }
  .bhr-feed-gallery { aspect-ratio: 1 / 1; }
  .bhr-feed-arrow { display: none; }   /* swipe instead */
  .bhr-feed-title { font-size: 19px; }
}
