/* =========================================================
   PAGE « TÉMOIGNAGES VIDÉO »

   Construite sur les variables du thème : elle suit le mode
   clair et le mode sombre sans règles dupliquées.
   Écrite en mobile d'abord (socle valable dès 320px).
========================================================= */

.tv-page {
  background: var(--body-bg);
  color: var(--text);
}

.tv-container {
  width: min(100% - 28px, var(--container-width));
  margin-inline: auto;
}

/* ---------------------------------------------------------
   En-tête
--------------------------------------------------------- */
.tv-hero {
  position: relative;
  overflow: hidden;
  padding: 32px 0 38px;
  background:
    radial-gradient(circle at 88% -12%, rgba(112, 197, 0, .17), transparent 55%),
    var(--section-bg);
  border-bottom: 1px solid var(--border);
}

.tv-hero-glow {
  position: absolute;
  z-index: 0;
  top: -130px;
  right: -100px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(112, 197, 0, .22), transparent 68%);
  filter: blur(14px);
  pointer-events: none;
}

.tv-hero .tv-container {
  position: relative;
  z-index: 1;
}

.tv-breadcrumb {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
  font-size: 12.5px;
  color: var(--text-light);
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}

.tv-breadcrumb::-webkit-scrollbar {
  height: 0;
}

.tv-breadcrumb a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  color: var(--text-light);
  transition: color .25s ease;
}

.tv-breadcrumb a:hover {
  color: var(--primary-dark);
}

.tv-breadcrumb i {
  font-size: 9px;
  opacity: .7;
}

.tv-breadcrumb span[aria-current] {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  color: var(--heading-color);
  font-weight: 700;
}

.tv-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px;
  border: 1px solid rgba(112, 197, 0, .3);
  border-radius: 999px;
  background: rgba(112, 197, 0, .1);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--primary-dark);
}

body.dark-mode .tv-kicker {
  color: var(--primary);
}

.tv-hero h1 {
  margin: 16px 0 0;
  font-size: clamp(1.9rem, 7.6vw, 3.3rem);
  line-height: 1.1;
  letter-spacing: -.03em;
  color: var(--heading-color);
}

.tv-hero h1 span {
  color: var(--primary);
}

.tv-lead {
  max-width: 64ch;
  margin: 14px 0 0;
  font-size: clamp(.94rem, 3.1vw, 1.05rem);
  line-height: 1.65;
  color: var(--text-light);
}

/* ---------------------------------------------------------
   Filtres par formation
--------------------------------------------------------- */
.tv-filters {
  position: sticky;
  top: var(--hopes-header-height, 72px);
  z-index: 20;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--body-bg) 92%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Repli si color-mix n'est pas géré par le navigateur. */
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .tv-filters {
    background: var(--body-bg);
  }
}

.tv-filter-row {
  display: flex;
  gap: 8px;
  /* Les puces glissent horizontalement sur mobile, sans barre visible. */
  overflow-x: auto;
  padding-bottom: 2px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.tv-filter-row::-webkit-scrollbar {
  height: 0;
}

.tv-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  /* 40px : reste confortable au doigt même à 320px. */
  min-height: 40px;
  padding: 9px 15px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card-bg);
  font-size: .86rem;
  font-weight: 700;
  white-space: nowrap;
  color: var(--text);
  scroll-snap-align: start;
  transition: border-color .25s ease, background-color .25s ease, color .25s ease;
}

.tv-chip:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
}

body.dark-mode .tv-chip:hover {
  color: var(--primary);
}

.tv-chip.is-active {
  border-color: var(--primary);
  background: var(--primary);
  color: #10220f;
}

.tv-chip-count {
  display: inline-grid;
  min-width: 22px;
  height: 20px;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(18, 23, 19, .12);
  font-size: 11px;
  font-weight: 800;
}

.tv-chip.is-active .tv-chip-count {
  background: rgba(16, 34, 15, .18);
}

body.dark-mode .tv-chip:not(.is-active) .tv-chip-count {
  background: rgba(255, 255, 255, .1);
}

/* ---------------------------------------------------------
   Grille des vidéos
--------------------------------------------------------- */
.tv-grid-section {
  padding: 26px 0 46px;
}

.tv-result-count {
  margin: 0 0 18px;
  font-size: .92rem;
  color: var(--text-light);
}

.tv-result-count strong {
  color: var(--heading-color);
}

.tv-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.tv-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--card-bg);
  box-shadow: var(--shadow-small);
  transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
}

.tv-card:hover {
  border-color: rgba(112, 197, 0, .42);
  box-shadow: var(--shadow-medium);
  transform: translateY(-4px);
}

.tv-card-media {
  position: relative;
  /* Ratio fixe : la grille reste alignée quelle que soit la vidéo. */
  aspect-ratio: 16 / 9;
  background: #0b0f0b;
}

/* Position absolue indispensable : en flux, une <video> avec un `poster`
   impose l'aspect intrinsèque de son image au conteneur et annule
   l'`aspect-ratio` (vignettes carrées au lieu de 16/9). */
.tv-card-media video,
.tv-card-media iframe,
.tv-card-placeholder {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  /* Vidéo entière : « cover » rognait les vidéos portrait
     et faisait disparaître le texte qu'elles contiennent. */
  object-fit: contain;
}

.tv-card-placeholder {
  display: grid;
  place-items: center;
  font-size: 30px;
  color: rgba(255, 255, 255, .3);
}

.tv-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}

.tv-card-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 11px;
}

.tv-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #b4e96b);
  font-size: 1.05rem;
  font-weight: 800;
  color: #10220f;
}

.tv-card-identity {
  min-width: 0;
}

.tv-card-identity strong {
  display: block;
  font-size: .98rem;
  line-height: 1.25;
  color: var(--heading-color);
}

.tv-card-identity span {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--primary-dark);
}

body.dark-mode .tv-card-identity span {
  color: var(--primary);
}

.tv-card-desc {
  flex: 1;
  margin: 0;
  font-size: .9rem;
  line-height: 1.55;
  color: var(--text-light);
}

.tv-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.tv-views {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-light);
}

.tv-views i {
  font-size: 12px;
  color: var(--primary);
}

.tv-rating {
  display: inline-flex;
  gap: 2px;
  font-size: 11.5px;
  color: var(--yellow);
}

/* ---------------------------------------------------------
   État vide
--------------------------------------------------------- */
.tv-empty {
  padding: 46px 20px;
  border: 1px dashed var(--border);
  border-radius: 22px;
  background: var(--card-bg);
  text-align: center;
}

.tv-empty-icon {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: rgba(112, 197, 0, .12);
  font-size: 24px;
  color: var(--primary);
}

.tv-empty h2 {
  margin: 0 0 10px;
  font-size: clamp(1.15rem, 5vw, 1.55rem);
  color: var(--heading-color);
}

.tv-empty p {
  max-width: 52ch;
  margin: 0 auto 20px;
  font-size: .93rem;
  line-height: 1.6;
  color: var(--text-light);
}

/* ---------------------------------------------------------
   Appel à l'action
--------------------------------------------------------- */
.tv-cta {
  padding: 0 0 56px;
}

.tv-cta-card {
  padding: 30px 20px;
  border: 1px solid rgba(112, 197, 0, .26);
  border-radius: 26px;
  background:
    radial-gradient(circle at 6% 0%, rgba(112, 197, 0, .15), transparent 58%),
    var(--card-bg);
  box-shadow: var(--shadow-medium);
  text-align: center;
}

.tv-cta-card h2 {
  margin: 0 0 12px;
  font-size: clamp(1.35rem, 5.6vw, 2.1rem);
  line-height: 1.18;
  color: var(--heading-color);
}

.tv-cta-card p {
  max-width: 58ch;
  margin: 0 auto 22px;
  font-size: clamp(.92rem, 3vw, 1rem);
  line-height: 1.6;
  color: var(--text-light);
}

.tv-cta-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.tv-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 16px;
  font-size: .95rem;
  font-weight: 700;
  transition: transform .25s ease, background-color .25s ease, border-color .25s ease;
}

.tv-btn--primary {
  background: var(--primary);
  color: #10220f;
  box-shadow: 0 14px 30px rgba(112, 197, 0, .22);
}

.tv-btn--primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

.tv-btn--ghost {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--heading-color);
}

.tv-btn--ghost:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
  transform: translateY(-2px);
}

body.dark-mode .tv-btn--ghost:hover {
  color: var(--primary);
}

/* ---------------------------------------------------------
   Très petits écrans
--------------------------------------------------------- */
@media (max-width: 360px) {
  .tv-container {
    width: calc(100% - 20px);
  }

  .tv-card-body {
    padding: 14px;
  }

  .tv-chip {
    padding: 9px 12px;
    font-size: .82rem;
  }

  .tv-cta-card {
    padding: 24px 16px;
  }
}

/* ---------------------------------------------------------
   Tablette
--------------------------------------------------------- */
@media (min-width: 620px) {
  .tv-hero {
    padding: 42px 0 50px;
  }

  .tv-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tv-cta-actions {
    grid-template-columns: auto auto;
    justify-content: center;
  }
}

/* ---------------------------------------------------------
   Ordinateur
--------------------------------------------------------- */
@media (min-width: 1024px) {
  .tv-hero {
    padding: 54px 0 62px;
  }

  .tv-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
  }

  .tv-grid-section {
    padding: 32px 0 60px;
  }

  .tv-cta-card {
    padding: 44px 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tv-card,
  .tv-btn,
  .tv-chip {
    transition: none !important;
  }

  .tv-card:hover,
  .tv-btn:hover {
    transform: none !important;
  }
}
