/* ---------- Post card (feed) ---------- */
.post-card {
  max-width: 470px;
  width: 100%;
  margin: 0 auto;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-light);
}

.post-card__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0 8px;
}
.post-card__user { flex: 1; min-width: 0; }
.post-menu { position: relative; }
.post-menu__btn {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  padding: 4px;
  color: var(--text);
}
.post-menu__btn::-webkit-details-marker { display: none; }
.post-menu__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 20;
  width: 180px;
  background: var(--bg);
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}
.post-menu__item {
  display: block;
  width: 100%;
  padding: 12px 16px;
  font-size: 14px;
  text-align: center;
  border-bottom: 1px solid var(--border-light);
}
.post-menu__item:hover { background: var(--bg-secondary); }
.post-menu__item--danger { color: var(--red); font-weight: 700; }

.post-card__media {
  position: relative;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  overflow: hidden;
  background: #000;
}

/* ---------- Carousel ---------- */
.carousel {
  position: relative;
  width: 100%;
  overflow: hidden;
}
.carousel__track {
  display: flex;
  height: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.carousel__track::-webkit-scrollbar { display: none; }
.carousel__item {
  flex: 0 0 100%;
  scroll-snap-align: center;
  scroll-snap-stop: always;
}
.carousel__item img,
.carousel__item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}
.carousel__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  color: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}
.carousel__nav:hover { background: #fff; }
.carousel__nav[hidden] { display: none; }
.carousel__nav--prev { left: 8px; }
.carousel__nav--next { right: 8px; }
.carousel__dots {
  position: absolute;
  bottom: 14px;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  justify-content: center;
  gap: 4px;
  pointer-events: none;
}
.carousel__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  transition: background-color 0.15s;
}
.carousel__dot.is-active { background: #fff; }

/* ---------- Heart burst (double-tap like) ---------- */
.heart-burst {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.heart-burst svg {
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
  animation: heart-burst 1s ease forwards;
}
@keyframes heart-burst {
  0% { transform: scale(0); opacity: 0; }
  15% { transform: scale(1.2); opacity: 0.9; }
  30% { transform: scale(1); opacity: 0.9; }
  70% { transform: scale(1); opacity: 0.9; }
  100% { transform: scale(1.1); opacity: 0; }
}

/* ---------- Post actions ---------- */
.post-actions { padding-top: 6px; }
.post-actions__row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 6px 0;
}
.post-actions__spacer { flex: 1; }
.action-btn {
  display: inline-flex;
  padding: 0;
  color: var(--text);
  transition: color 0.1s;
}
.action-btn:hover { color: var(--text-secondary); }
.action-btn.is-liked { color: var(--red); }
.action-btn.is-liked:hover { color: var(--red); }
.action-btn.pop svg { animation: like-pop 0.35s ease; }
@keyframes like-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.25); }
  100% { transform: scale(1); }
}
.post-actions__likes { font-size: 14px; padding: 2px 0; }

/* ---------- Post card body ---------- */
.post-card__body { display: flex; flex-direction: column; gap: 4px; }
.post-card__caption { word-wrap: break-word; }
.post-card__caption a { margin-right: 4px; }
.post-card__viewall { color: var(--text-secondary); }
.post-card__viewall:hover { color: var(--text); }

.comment-form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 2px;
}
.comment-form__input {
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 14px;
  padding: 4px 0;
}
.comment-form__submit { flex-shrink: 0; }
.comment-form:has(.comment-form__input:placeholder-shown) .comment-form__submit { display: none; }
.comment-form__emoji { color: var(--text); display: inline-flex; }

/* ---------- Comments ---------- */
.comment {
  display: flex;
  gap: 12px;
  padding: 8px 0;
}
.comment--reply { padding-left: 0; }
.comment__main { flex: 1; min-width: 0; }
.comment__text { word-wrap: break-word; }
.comment__text a { margin-right: 4px; }
.comment__meta {
  display: flex;
  gap: 12px;
  margin-top: 6px;
  align-items: center;
}
.comment__reply-btn, .comment__delete {
  color: var(--text-secondary);
  font-size: 12px;
}
.comment__like {
  display: inline-flex;
  padding: 4px;
  margin-top: 6px;
  color: var(--text);
}
.comment__like.is-liked { color: var(--red); }
.comment__replies { margin-top: 4px; }

/* ---------- Post detail (page + modal) ---------- */
.post-detail {
  display: flex;
  background: var(--bg);
  width: 100%;
}
.post-detail__media {
  position: relative;
  flex: 1;
  min-width: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.post-detail__media .carousel { max-height: inherit; }
.post-detail__side {
  width: 405px;
  min-width: 405px;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border-light);
}
.post-detail__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
}
.post-detail__header a.text-bold { flex: 1; }
.post-detail__comments {
  flex: 1;
  overflow-y: auto;
  padding: 8px 16px;
  min-height: 0;
}
.post-detail__foot {
  border-top: 1px solid var(--border-light);
  padding: 4px 16px 8px;
}
.post-detail__time { padding: 4px 0 8px; text-transform: none; }
.comment-form--detail { border-top: 1px solid var(--border-light); padding-top: 8px; }

.post-modal .post-detail {
  max-height: calc(100vh - 80px);
  height: min(calc(100vh - 80px), 800px);
}
.post-modal .post-detail__media { max-width: min(60vw, 800px); }
.post-detail-page {
  max-width: 935px;
  margin: 0 auto;
  padding: 24px 0;
}
.post-detail-page .post-detail {
  border: 1px solid var(--border);
  border-radius: 4px;
  max-height: 800px;
}

@media (max-width: 767px) {
  .post-detail { flex-direction: column; }
  .post-detail__side { width: 100%; min-width: 0; border-left: 0; }
  .post-detail__comments { max-height: none; overflow: visible; }
  .post-detail-page { padding: 0; }
  .post-detail-page .post-detail { border: 0; }
  .post-card { padding-bottom: 12px; }
  .post-card__header { padding-left: 12px; padding-right: 12px; }
  .post-card__media { border: 0; border-radius: 0; }
  .post-actions, .post-card__body { padding-left: 12px; padding-right: 12px; }
}

/* ---------- Follow ---------- */
.follow-slot { display: inline-flex; flex-shrink: 0; }
.follow-following { color: var(--text); }

/* ---------- User rows (search results, follower lists, suggestions) ---------- */
.user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 24px;
}
.user-row:hover { background: var(--bg-secondary); }
.user-row__names {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 18px;
}
.user-row__names .text-secondary {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
