.nine-feed {
  position: absolute;
  inset: 0;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.nine-feed::-webkit-scrollbar {
  display: none;
}

/* ── Post = bloc (carte vidéo centrée + rail). Une seule vidéo visible :
   chaque carte remplit la hauteur du viewport et snap. ── */
/* Le post occupe toute la hauteur (unité de snap, clippée aux bords écran),
   mais la carte à l'intérieur garde 16px de marge haut/bas. Ainsi la vidéo
   peut défiler jusqu'au bord de l'écran sans être coupée à la ligne des 16px. */
.feed-post {
  /* carte 9:16 calée sur la hauteur du viewport (100vh - 2×16px de padding) */
  --card-w: calc((100vh - 32px) * 9 / 16);

  position: relative;
  width: 100%;
  height: 100%;
  scroll-snap-align: start;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* La carte arrondie qui clippe le média. Le glow ambiant (--ambient) prend la
   couleur moyenne de la vidéo en cours pour la faire ressortir. */
.feed-post__card {
  position: relative;
  width: var(--card-w);
  height: calc(100% - 32px);
  border-radius: 58px;
  overflow: hidden;
  background: #0a0a0a;
  box-shadow: 0 0 80px 4px var(--ambient, transparent), 0 2px 16px rgba(0, 0, 0, 0.12);
  transition: box-shadow 0.6s ease;
}

/* Video */
.feed-post__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Photo */
.feed-post__photo {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Overlay bottom-left */
.feed-post__overlay {
  position: absolute;
  inset: 0;
  padding: 24px 16px;
  display: flex;
  align-items: flex-end;
  background: linear-gradient(to top,
    rgba(0, 0, 0, 0.55) 0%,
    rgba(0, 0, 0, 0.18) 40%,
    transparent 65%);
  pointer-events: none;
}

.feed-post__left {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: calc(100% - 56px);
}

.feed-post__username {
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feed-post__description {
  color: rgba(255, 255, 255, 0.88);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Empty / loading states */
.feed-empty,
.feed-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 13px;
  background: #0a0a0a;
}

.feed-loading::after {
  content: '';
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-top-color: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  animation: feed-spin 0.8s linear infinite;
}

@keyframes feed-spin {
  to { transform: rotate(360deg); }
}
