/* ============================================================
   VAIDEO — Fil public (racine du site)
   Reprend les cartes de la chaîne (channel.css) ; la grille est plus large, chaque carte
   dit quelle chaîne la présente, et un panneau latéral filtre le fil (format,
   plateforme) et liste les abonnements.
   ============================================================ */

/* La barre et le panneau restent visibles au défilement ; sous le bandeau bêta quand il
   est affiché (même logique que .lp-nav dans app.css). */
.fd { --fd-top-h: 64px; --fd-offset: 0px; }
.has-beta-banner .fd { --fd-offset: var(--beta-banner-h); }

.fd-top { position: sticky; top: var(--fd-offset); z-index: 30; height: var(--fd-top-h); width: 100%; padding: 0 24px;
  display: flex; align-items: center; gap: 10px; background: color-mix(in oklch, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--border-subtle); }
.fd-menu-btn { display: none; place-items: center; width: 40px; height: 40px; margin-left: -8px; border: 0; border-radius: 50%;
  background: transparent; color: var(--text); cursor: pointer; }
.fd-menu-btn:hover, .fd-menu-btn:focus-visible { background: var(--surface-2); outline: none; }

.fd-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); width: 100%; }

/* ── Panneau latéral ─────────────────────────────────────────────────── */
.fd-side { position: sticky; top: calc(var(--fd-offset) + var(--fd-top-h)); align-self: start;
  height: calc(100vh - var(--fd-offset) - var(--fd-top-h)); overflow-y: auto; padding: 12px 12px 24px;
  scrollbar-width: thin; }
.fd-nav { display: flex; align-items: center; gap: 16px; min-height: 40px; padding: 0 12px; border-radius: var(--r-md);
  color: var(--text); text-decoration: none; font-size: var(--t-sm); min-width: 0;
  transition: background var(--dur) var(--ease); }
.fd-nav:hover, .fd-nav:focus-visible { background: var(--surface-2); outline: none; }
.fd-nav.is-active { background: var(--surface-2); font-weight: var(--fw-semibold); }
.fd-nav.is-active .fd-nav__ic:not(.pf-icon) { color: var(--primary); }
.fd-nav__ic { flex: none; }
.fd-nav__avatar { flex: none; width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.fd-nav__avatar--initials { display: grid; place-items: center; background: oklch(0.55 0.14 280); color: #fff;
  font-size: 0.62rem; font-weight: var(--fw-bold); }
.fd-side__sep { height: 1px; margin: 12px 4px; background: var(--border); }
.fd-side__title { padding: 4px 12px 6px; font-size: var(--t-sm); font-weight: var(--fw-semibold); color: var(--text); }
.fd-side__hint { padding: 0 12px; font-size: var(--t-xs); line-height: 1.5; color: var(--text-muted); }
.fd-side__cta { margin: 10px 12px 0; }
.fd-scrim { display: none; }

/* ── Fil ─────────────────────────────────────────────────────────────── */
.fd-main { min-width: 0; padding: 20px 24px 64px; }
.fd-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; font-size: 1.35rem;
  font-weight: var(--fw-black); letter-spacing: -0.02em; }

.fd-grid { gap: 28px 18px; }
/* Portrait : vignettes verticales, plus étroites, comme les Shorts. */
.fd-grid--portrait { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.fd-grid--portrait .ch-card__thumb { aspect-ratio: 9 / 16; }

/* Plateformes en haut à gauche de la vignette : des raccourcis vers la vidéo chez elles. */
.fd-card__platforms { position: absolute; z-index: 1; top: 8px; left: 8px; display: flex; gap: 6px; }
.fd-card__platform { display: block; border-radius: 6px; box-shadow: 0 1px 3px rgb(0 0 0 / 0.45); line-height: 0;
  transition: transform var(--dur) var(--ease); }
a.fd-card__platform:hover, a.fd-card__platform:focus-visible { transform: scale(1.12); outline: none;
  box-shadow: 0 0 0 2px var(--primary), 0 1px 3px rgb(0 0 0 / 0.45); }
.fd-card__media:has(.ch-card__link:hover) .fd-card__platforms { translate: 0 -3px; }

/* Chaîne mise en avant par le créateur, en haut à droite de la vignette : même taille
   que les pastilles des plateformes en haut à gauche, mais ronde (c'est un avatar). */
.fd-card__media { position: relative; }
.fd-card__account { position: absolute; z-index: 1; top: 7px; right: 7px; width: 26px; height: 26px; border-radius: 50%;
  overflow: hidden; display: grid; place-items: center; background: oklch(0.55 0.14 280); color: #fff;
  font-size: 0.6rem; font-weight: var(--fw-bold); text-decoration: none;
  box-shadow: 0 0 0 1.5px rgb(255 255 255 / 0.85), 0 1px 3px rgb(0 0 0 / 0.45);
  transition: transform var(--dur) var(--ease); }
.fd-card__account img { width: 100%; height: 100%; object-fit: cover; display: block; }
a.fd-card__account:hover, a.fd-card__account:focus-visible { transform: scale(1.12); outline: none;
  box-shadow: 0 0 0 2px var(--primary), 0 1px 3px rgb(0 0 0 / 0.45); }
/* La vignette se soulève au survol : la pastille suit. */
.fd-card__media:has(.ch-card__link:hover) .fd-card__account { translate: 0 -3px; }

/* Avatar de la chaîne à gauche, titre / chaîne / audience à droite. */
.fd-card__row { display: flex; gap: 12px; margin-top: 12px; min-width: 0; }
.fd-card__avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  background: oklch(0.55 0.14 280); color: #fff; font-size: 0.8rem; font-weight: var(--fw-bold); text-decoration: none; }
.fd-card__avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fd-grid--portrait .fd-card__avatar { display: none; }
.fd-card__body { min-width: 0; flex: 1; }
.fd-card .ch-card__title a { color: inherit; text-decoration: none; }
.fd-card .ch-card__title a:hover, .fd-card .ch-card__title a:focus-visible { color: var(--primary); outline: none; }
.fd-card__channel { display: block; max-width: 100%; margin-top: 4px; color: var(--text-muted); font-size: var(--t-sm); text-decoration: none; }
.fd-card__channel:hover, .fd-card__channel:focus-visible { color: var(--text); outline: none; }
.fd-card .ch-card__meta { margin-top: 2px; }

/* Bas du fil. Sans défilement infini : le lien « Voir plus ». Avec : une roue pendant le
   chargement, et le lien seulement pour réessayer après un échec. */
.fd-more { display: flex; justify-content: center; align-items: center; min-height: 40px; margin-top: 40px; }
.fd-more.is-loading [data-feed-next] { opacity: 0.6; pointer-events: none; }
.fd-more__spinner { display: none; width: 26px; height: 26px; border-radius: 50%;
  border: 2.5px solid var(--border-strong); border-top-color: var(--primary); animation: fd-spin 0.7s linear infinite; }
.fd--infinite .fd-more:not(.is-failed) [data-feed-next] { display: none; }
.fd--infinite .fd-more.is-loading .fd-more__spinner { display: block; }
@keyframes fd-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .fd-more__spinner { animation-duration: 2s; } }

/* ── Écrans étroits : le panneau devient un tiroir ───────────────────── */
@media (max-width: 960px) {
  .fd-menu-btn { display: grid; }
  .fd-layout { grid-template-columns: minmax(0, 1fr); }
  .fd-side { position: fixed; z-index: 40; left: 0; top: calc(var(--fd-offset) + var(--fd-top-h)); width: 260px;
    background: var(--bg); border-right: 1px solid var(--border); transform: translateX(-100%); visibility: hidden;
    transition: transform var(--dur) var(--ease), visibility 0s linear var(--dur); }
  .fd--side-open .fd-side { transform: none; visibility: visible; transition: transform var(--dur) var(--ease); }
  .fd--side-open .fd-scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgb(0 0 0 / 0.5); }
}
@media (max-width: 640px) {
  .fd-top { padding: 0 16px; }
  .fd-main { padding: 16px 16px 48px; }
  .fd-grid--portrait { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }
}
@media (prefers-reduced-motion: reduce) { .fd-side { transition: none !important; } }
