/* ============================================
   videos.css — Page Vidéos (videos.html)
   Réutilise les tokens définis dans styles.css :
   --ink, --accent, --accent-2, --gold, --gradient-accent,
   --font-display, --font-body, --ease, --duration, --max-w
   ============================================ */

/* ======== HERO VIDÉOS ======== */
.videos-hero {
  position: relative;
  min-height: 60vh;
  padding: calc(var(--space-2xl) + 60px) 0 var(--space-2xl);
  overflow: hidden;
  background: var(--ink);
}
.videos-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.videos-hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* center 30% : visible window décalée vers le haut de la source,
     ce qui fait apparaître le visage de Coralie plus bas dans le hero */
  object-position: center 30%;
  opacity: 0.32;
  filter: saturate(1.1) brightness(0.7);
  animation: contactKenBurns 28s ease-in-out infinite alternate;
}
.videos-hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 70% 30%, rgba(232,67,147,0.22), transparent 55%),
    linear-gradient(180deg, rgba(13,10,26,0.5) 0%, rgba(13,10,26,0.95) 100%);
}
.videos-hero-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
}
.videos-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid rgba(232, 196, 108, 0.4);
  border-radius: 99px;
  background: rgba(232, 196, 108, 0.08);
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--space-md);
}
.videos-hero-eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
}
.videos-hero h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: #fff;
  margin-bottom: var(--space-md);
}
.videos-hero h1 em {
  font-style: italic;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.videos-hero-sub {
  font-family: var(--font-body);
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.78);
  max-width: 580px;
  margin: 0 auto var(--space-lg);
}
.videos-hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all var(--duration) var(--ease);
}
.videos-hero-cta:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--gold);
  color: var(--gold);
  transform: translateY(-1px);
}
.videos-hero-cta svg {
  width: 14px;
  height: 14px;
}

/* ======== VIDEOS SECTION ======== */
.videos-section {
  padding: var(--space-2xl) 0;
  background: var(--surface);
  position: relative;
  contain: layout style paint;
}
.videos-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 180px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232, 196, 108, 0.3), transparent);
}

/* État de chargement */
.videos-loading {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-lg);
  min-height: 400px;
  position: relative;
}
.videos-loading::after {
  content: 'Chargement des vidéos…';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.05em;
}
.videos-loading.is-ready::after {
  display: none;
}

/* Grille des cartes */
.videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-lg);
}
@media (min-width: 1024px) {
  .videos-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Carte vidéo */
.video-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all var(--duration) var(--ease);
}
.video-card:hover {
  border-color: rgba(232, 196, 108, 0.3);
  transform: translateY(-4px);
  box-shadow:
    0 20px 40px -20px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(232, 196, 108, 0.2),
    0 0 60px -20px rgba(232, 67, 147, 0.25);
}

/* Thumbnail (clic = ouvre lightbox) */
.video-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #1a1029;
  border: none;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  display: block;
}
.video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease), filter var(--duration) var(--ease);
  filter: saturate(0.95) brightness(0.92);
}
.video-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(13, 10, 26, 0.65) 100%);
  pointer-events: none;
  transition: opacity var(--duration) var(--ease);
}
.video-thumb:hover img,
.video-card:hover .video-thumb img {
  transform: scale(1.06);
  filter: saturate(1.1) brightness(1);
}

/* Bouton play */
.video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  border-radius: 50%;
  background: var(--gradient-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 0 8px rgba(255, 255, 255, 0.08),
    0 12px 32px -8px rgba(232, 67, 147, 0.6);
  transition: transform var(--duration) var(--ease);
  z-index: 1;
}
.video-thumb:hover .video-play,
.video-card:hover .video-play {
  transform: scale(1.1);
}
.video-play svg {
  width: 26px;
  height: 26px;
  color: #fff;
  margin-left: 3px;
}

/* Body de la carte */
.video-info {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  flex: 1;
}
.video-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.4rem;
  line-height: 1.25;
  color: #fff;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.video-date {
  font-family: var(--font-body);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.85;
}
.video-actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: auto;
  padding-top: var(--space-sm);
}
.video-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 99px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}
.video-btn svg {
  width: 14px;
  height: 14px;
}
.video-btn.primary {
  background: var(--gradient-accent);
  color: #fff;
  box-shadow: 0 8px 20px -8px rgba(232, 67, 147, 0.5);
}
.video-btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px -8px rgba(232, 67, 147, 0.7);
}
.video-btn.ghost {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.85);
}
.video-btn.ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--gold);
  color: var(--gold);
}

/* Bouton "Charger plus" — caché par défaut, visible si > MAX_VISIBLE */
.videos-loadmore {
  display: none;
  margin: var(--space-xl) auto 0;
  padding: 14px 32px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(232, 196, 108, 0.3);
  color: var(--gold);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}
.videos-loadmore.is-visible {
  display: block;
}
.videos-loadmore:hover {
  background: rgba(232, 196, 108, 0.1);
  transform: translateY(-1px);
}

/* Message vide */
.videos-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--space-2xl) 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.5);
}

/* Fallback propre : panneau message + CTA YouTube si l'API est indisponible
   ou si la clé YouTube Data API n'est pas configurée.
   Aucun iframe : zéro risque de placeholder cassé Google.
   Voir app.js setupVideosPage pour la logique d'affichage. */
.videos-fallback {
  margin-top: var(--space-lg);
  padding: var(--space-xl) var(--space-lg);
  text-align: center;
  border: 1px solid rgba(232, 196, 108, 0.18);
  border-radius: 16px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(232, 67, 147, 0.08), transparent 60%),
    rgba(255, 255, 255, 0.02);
}
.videos-fallback-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.25rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.85);
  margin: 0 auto var(--space-md);
  max-width: 520px;
}
.videos-fallback-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: 99px;
  background: var(--gradient-accent);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  box-shadow: 0 12px 28px -10px rgba(232, 67, 147, 0.55);
  transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.videos-fallback-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 36px -10px rgba(232, 67, 147, 0.7);
}
.videos-fallback-cta svg {
  width: 14px;
  height: 14px;
}

/* Mini-bandeau discret "vidéos potentiellement obsolètes" :
   affiché uniquement si l'API échoue mais qu'on a un cache local à montrer
   (stale-while-revalidate). Pas de CTA, juste une info. */
.videos-stale-notice {
  margin: 0 auto var(--space-md);
  padding: 8px 16px;
  border: 1px solid rgba(232, 196, 108, 0.22);
  border-radius: 99px;
  background: rgba(232, 196, 108, 0.06);
  text-align: center;
  font-family: var(--font-body);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  color: rgba(232, 196, 108, 0.85);
  max-width: max-content;
}

/* ======== LIGHTBOX (lecture sur le site) ======== */
.video-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(8, 5, 16, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  animation: lightboxFadeIn 0.25s ease-out;
}
.video-lightbox[hidden] { display: none; }
@keyframes lightboxFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.video-lightbox-inner {
  position: relative;
  width: 100%;
  max-width: 1100px;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  box-shadow:
    0 40px 80px -20px rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(232, 196, 108, 0.2),
    0 0 100px -20px rgba(232, 67, 147, 0.4);
  background: #000;
  animation: lightboxScaleIn 0.3s var(--ease);
}
@keyframes lightboxScaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
.video-lightbox-inner iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.video-lightbox-close {
  position: absolute;
  top: -52px;
  right: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration) var(--ease);
}
.video-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--gold);
  color: var(--gold);
  transform: rotate(90deg);
}
.video-lightbox-close svg {
  width: 18px;
  height: 18px;
}

/* Body lock when lightbox open */
body.lightbox-open {
  overflow: hidden;
}

/* ======== HOME VIDEOS TEASER (section "Mes dernières vidéos" sur la home) ======== */
.home-videos {
  padding: var(--space-2xl) 0;
  background: var(--surface);
  position: relative;
  contain: layout style paint;
}
.home-videos::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 180px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232, 196, 108, 0.3), transparent);
}
.home-videos-header {
  margin-bottom: var(--space-xl);
}
.home-videos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}
@media (max-width: 900px) {
  .home-videos-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .home-videos-grid { grid-template-columns: 1fr; }
}

/* Carte teaser : un seul bouton qui englobe thumbnail + titre */
.home-video-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  overflow: hidden;
  transition: all var(--duration) var(--ease);
}
.home-video-card:hover {
  border-color: rgba(232, 196, 108, 0.3);
  transform: translateY(-4px);
  box-shadow:
    0 20px 40px -20px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(232, 196, 108, 0.2),
    0 0 50px -20px rgba(232, 67, 147, 0.25);
}
.home-video-trigger {
  display: block;
  width: 100%;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  text-align: left;
}
.home-video-trigger .video-thumb {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #1a1029;
  overflow: hidden;
}
.home-video-trigger .video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease), filter var(--duration) var(--ease);
  filter: saturate(0.95) brightness(0.92);
}
.home-video-trigger .video-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(13, 10, 26, 0.65) 100%);
  pointer-events: none;
}
.home-video-card:hover .video-thumb img {
  transform: scale(1.06);
  filter: saturate(1.1) brightness(1);
}
.home-video-card:hover .video-play {
  transform: scale(1.1);
}
.home-video-title {
  display: block;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.25rem;
  line-height: 1.3;
  color: #fff;
  padding: var(--space-md);
  margin: 0;
  /* clamp à 2 lignes pour rythmer la grille */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* CTA "Voir toutes mes vidéos" */
.home-videos-cta {
  text-align: center;
  margin-top: var(--space-xl);
}

/* Fallback (iframe playlist) si RSS échoue */
.home-videos-fallback {
  margin-top: var(--space-md);
}

/* ======== RESPONSIVE ======== */
@media (max-width: 768px) {
  .videos-hero {
    min-height: 50vh;
    padding-top: calc(var(--space-xl) + 60px);
  }
  .video-actions {
    flex-direction: column;
  }
  .video-lightbox-close {
    top: -48px;
  }
}

/* ======== VIDEOS INTRO (contenu statique anti thin-content) ======== */
.videos-intro {
  padding: var(--space-xl) 0;
  background: var(--surface);
}
.videos-intro .section-heading {
  margin-bottom: var(--space-md);
  text-align: center;
}
.videos-intro .section-sub {
  max-width: 720px;
  margin: 0 auto var(--space-md);
  text-align: center;
}
.videos-intro .section-sub a {
  color: var(--accent-2);
  text-decoration: underline;
  text-decoration-color: rgba(232, 67, 147, 0.4);
  text-underline-offset: 3px;
  transition: color var(--duration) var(--ease);
}
.videos-intro .section-sub a:hover,
.videos-intro .section-sub a:focus-visible {
  color: var(--gold);
  text-decoration-color: var(--gold);
}

@media (max-width: 768px) {
  .videos-intro {
    padding: var(--space-lg) 0;
  }
  .videos-intro .section-sub {
    text-align: left;
  }
}
