/* ============================================================
   VAIDEO — Chaîne publique d'un utilisateur (/@adresse)
   Pas de menu de l'application : la page est tout entière à la chaîne.
   ============================================================ */

.ch { display: flex; flex-direction: column; }

.ch-top { max-width: 1080px; width: 100%; margin: 0 auto; padding: 16px 24px; display: flex; align-items: center; gap: 10px; }
.ch-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; opacity: 0.85; transition: opacity var(--dur) var(--ease); }
.ch-brand:hover { opacity: 1; }

.ch-main { max-width: 1080px; width: 100%; margin: 0 auto; padding: 0 24px 64px; }

.ch-banner { height: clamp(120px, 22vw, 220px); border-radius: var(--r-lg); border: 1px solid var(--border);
  background:
    radial-gradient(90% 140% at 15% 0%, color-mix(in oklch, var(--primary) 55%, transparent) 0%, transparent 60%),
    radial-gradient(80% 120% at 90% 100%, color-mix(in oklch, var(--primary) 30%, var(--bg)) 0%, transparent 65%),
    var(--surface); }

/* La bannière choisie garde son format 4:1 ; sur mobile elle reste lisible en se
   rognant sur les côtés plutôt qu'en devenant un mince ruban. Pas de min-height avec
   aspect-ratio : le navigateur en déduirait une largeur minimale qui déborderait. */
.ch-banner--image { height: auto; aspect-ratio: 4 / 1; overflow: hidden; background: var(--surface); }
.ch-banner--image img { width: 100%; height: 100%; object-fit: cover; display: block; }

.ch-identity { display: flex; align-items: flex-end; gap: 22px; padding: 0 24px; margin-top: -56px; }
.ch-avatar { width: 136px; height: 136px; border-radius: 50%; flex: none; object-fit: cover;
  border: 4px solid var(--bg); box-shadow: var(--shadow-lg); background: var(--surface); }
.ch-avatar--initials { display: grid; place-items: center; background: oklch(0.55 0.14 280); color: #fff;
  font-size: 48px; font-weight: var(--fw-bold); }
.ch-names { padding-bottom: 10px; min-width: 0; flex: 1; }
.ch-name { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: var(--fw-black); letter-spacing: -0.025em; line-height: 1.1; overflow-wrap: anywhere; }
.ch-meta { margin-top: 6px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; color: var(--text-muted); font-size: var(--t-sm); }
.ch-handle { font-family: var(--font-mono); }
.ch-dot { color: var(--text-faint); }
.ch-followers { font-weight: var(--fw-semibold); color: var(--text); }
.ch-actions { flex: none; padding-bottom: 12px; }
.ch-actions form { margin: 0; }

/* Abonné : au survol, le bouton annonce ce qu'un clic fera. */
.ch-follow { min-width: 120px; }
.ch-follow__on { display: inline-flex; align-items: center; gap: 6px; }
.ch-follow__off { display: none; }
.ch-follow--on:hover .ch-follow__on, .ch-follow--on:focus-visible .ch-follow__on { display: none; }
.ch-follow--on:hover .ch-follow__off, .ch-follow--on:focus-visible .ch-follow__off { display: inline; }
.ch-follow--on:hover { color: var(--st-failed-fg); border-color: var(--st-failed-bd); }

/* ── Projet mis en avant : la porte d'entrée de la communauté ── */
.ch-featured { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 24px; padding: 16px 18px;
  border: 1px solid var(--border); border-radius: var(--r-lg);
  background: linear-gradient(120deg, color-mix(in oklch, var(--primary) 12%, var(--surface)) 0%, var(--surface) 60%); }
.ch-featured__logo { width: 56px; height: 56px; border-radius: var(--r-md); object-fit: cover; flex: none; border: 1px solid var(--border); }
.ch-featured__logo--initial { display: grid; place-items: center; background: oklch(0.55 0.14 280); color: #fff; font-weight: var(--fw-bold); font-size: 20px; }
.ch-featured__body { min-width: 0; flex: 1 1 160px; }
.ch-featured__eyebrow { font-size: var(--t-xs); font-weight: var(--fw-semibold); color: var(--primary); text-transform: uppercase; letter-spacing: 0.06em; }
.ch-featured__name { font-size: 1.15rem; font-weight: var(--fw-bold); margin-top: 2px; overflow-wrap: anywhere; }
.ch-featured__links { display: flex; flex-wrap: wrap; gap: 8px; }
.ch-featured__link { display: inline-flex; align-items: center; gap: 8px; max-width: 220px; padding: 6px 12px 6px 6px; border-radius: var(--r-pill);
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: var(--t-sm); font-weight: var(--fw-semibold);
  text-decoration: none; transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease); }
.ch-featured__link:hover, .ch-featured__link:focus-visible { border-color: var(--primary); transform: translateY(-1px); outline: none; }

/* ── Onglets : le libellé seul, souligné quand il est actif ── */
.ch-tabs { display: flex; gap: 28px; margin-top: 28px; border-bottom: 1px solid var(--border);
  overflow-x: auto; scrollbar-width: none; }
.ch-tabs::-webkit-scrollbar { display: none; }
.ch-tab { position: relative; flex: none; padding: 12px 2px 14px; color: var(--text-muted); font-weight: var(--fw-semibold);
  font-size: 0.95rem; text-decoration: none; transition: color var(--dur) var(--ease); }
.ch-tab:hover { color: var(--text); }
.ch-tab::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0;
  background: var(--primary); transform: scaleX(0); transition: transform var(--dur) var(--ease); }
.ch-tab:hover::after { transform: scaleX(0.4); background: var(--border-strong); }
.ch-tab.is-active { color: var(--text); }
.ch-tab.is-active::after { transform: scaleX(1); background: var(--primary); }
.ch-tab:focus-visible { outline: none; color: var(--text); box-shadow: 0 0 0 3px var(--primary-ring); border-radius: var(--r-sm); }

.ch-panel { padding-top: 24px; }
.ch-group-title { font-size: 1.05rem; font-weight: var(--fw-bold); margin: 8px 0 14px; }
.ch-group-title:not(:first-child) { margin-top: 32px; }

/* ── Cartes (médias et playlists) ── */
.ch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 22px 18px; }
.ch-card__link { display: flex; flex-direction: column; gap: 10px; color: inherit; text-decoration: none; }
.ch-card__thumb { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-md); overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--border); transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
/* La couverture remplit la vignette ; les tuiles de plateforme gardent leur taille. */
.ch-card__thumb img:not(.pf-icon) { width: 100%; height: 100%; object-fit: cover; display: block; }
.ch-card__link:hover .ch-card__thumb, .ch-card__link:focus-visible .ch-card__thumb { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--primary); }
.ch-card__link:focus-visible { outline: none; }
/* Plateformes où la vidéo est en ligne : les tuiles communes, en haut à gauche. */
.ch-card__thumb .ch-card__platform { position: absolute; top: 8px; left: 8px; border-radius: 6px; box-shadow: 0 1px 3px rgb(0 0 0 / 0.45); }
.ch-card__thumb .ch-card__platform + .ch-card__platform { left: 38px; }
.ch-card__thumb .ch-card__platform + .ch-card__platform + .ch-card__platform { left: 68px; }
.ch-card__thumb--playlist { background:
    radial-gradient(90% 140% at 15% 0%, color-mix(in oklch, var(--primary) 45%, transparent) 0%, transparent 60%), var(--surface-2); }
.ch-card__count { position: absolute; right: 0; top: 0; bottom: 0; width: 38%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px; background: rgb(0 0 0 / 0.7); color: #fff;
  font-size: var(--t-sm); font-weight: var(--fw-semibold); text-align: center; padding: 0 6px; }
.ch-card__title { font-size: 0.95rem; font-weight: var(--fw-semibold); line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ch-card__meta { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 4px; color: var(--text-muted); font-size: var(--t-xs); min-width: 0; }
.ch-card__meta .trunc { max-width: 100%; }

/* Pastilles de plateforme sous une carte de playlist : une par plateforme. */
.ch-platforms { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ch-platform { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 10px 3px 4px; border-radius: var(--r-pill);
  border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); font-size: var(--t-xs);
  font-weight: var(--fw-semibold); text-decoration: none; transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.ch-platform:hover, .ch-platform:focus-visible { color: var(--text); border-color: var(--primary); outline: none; }
.ch-platform__count { font-family: var(--font-mono); color: var(--text-subtle); }

.ch-empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 64px 16px; color: var(--text-subtle); text-align: center; }
.ch-empty p { font-size: 0.95rem; }

.ch-missing { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding-top: 12vh; }
.ch-missing h1 { font-size: 1.8rem; font-weight: var(--fw-black); }

@media (max-width: 640px) {
  .ch-top, .ch-main { padding-left: 16px; padding-right: 16px; }
  .ch-identity { flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 0; margin-top: -60px; }
  .ch-avatar { width: 112px; height: 112px; }
  .ch-banner--image { aspect-ratio: auto; height: 120px; }
  .ch-names { padding-bottom: 0; }
  .ch-meta { justify-content: center; }
  .ch-actions { padding-bottom: 0; }
  .ch-tabs { gap: 22px; margin-top: 20px; }
  .ch-featured { margin-top: 18px; }
  .ch-featured__links { width: 100%; }
  .ch-grid { grid-template-columns: 1fr; }
}
