@keyframes modalIn { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: scale(1); } }

/* ── NAV ── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 99999;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.4rem 2.5rem;
  background: rgba(8,9,15,0.75);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border-bottom: 1px solid rgba(160,50,230,0.12);
}
.nav-logo {
  font-family: 'Playfair Display', serif; font-style: italic;
  font-size: 1.1rem; color: var(--cream); text-decoration: none; opacity: 0.9;
}
.nav-back {
  font-size: 0.78rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--blue1); text-decoration: none; opacity: 0.8;
  transition: opacity 0.3s;
}
.nav-back:hover { opacity: 1; }

/* ── PAGE WRAPPER ── */
.page-wrap {
  position: relative; z-index: 1;
  padding: 8rem 2rem 5rem;
  max-width: 1200px; margin: 0 auto;
}

/* ── PAGE TITLE ── */
.page-header {
  text-align: center; margin-bottom: 4rem;
  animation: fadeUp 0.8s ease both;
}
.page-label {
  font-size: 0.78rem; letter-spacing: 0.42em; text-transform: uppercase;
  background: var(--grad); background-size: 300% 300%;
  animation: gradShift 6s ease infinite;
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; margin-bottom: 0.8rem; display: block;
}
.page-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 5vw, 3rem); font-weight: 700;
}

/* ── VIDEO GRID ── */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.8rem;
}

.video-card {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(160,50,230,0.22);
  box-shadow: 0 4px 32px rgba(0,0,0,0.4);
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
  animation: fadeUp 0.7s ease both;
  background: rgba(12,14,30,0.6);
}
.video-card:hover {
  transform: translateY(-6px) scale(1.015);
  box-shadow: 0 12px 48px rgba(155,48,224,0.35);
  border-color: rgba(155,48,224,0.55);
}
.video-card:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(155,48,224,0.8), 0 12px 48px rgba(155,48,224,0.35);
  border-color: rgba(155,48,224,0.8);
}

.video-thumb-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  overflow: hidden;
  background: #0a0b15;
}
/* Shorts : cadre 9:16 → object-fit: cover recadre la vignette YouTube 4:3 exactement sur la vidéo verticale */
.video-thumb-wrap.shorts { padding-bottom: 177.78%; }
.video-thumb-wrap img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s, filter 0.4s;
  filter: brightness(0.85);
}
.video-card:hover .video-thumb-wrap img {
  transform: scale(1.05);
  filter: brightness(1);
}

/* Overlay play button */
.play-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.2);
  transition: background 0.3s;
}
.video-card:hover .play-overlay { background: rgba(0,0,0,0.05); }

.play-btn {
  width: 58px; height: 58px;
  background: rgba(155,48,224,0.85);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 24px rgba(155,48,224,0.6);
  transition: transform 0.2s, background 0.2s;
}
.video-card:hover .play-btn {
  transform: scale(1.12);
  background: rgba(155,48,224,1);
}
.play-btn svg { margin-left: 4px; }

.shorts-badge {
  position: absolute; top: 10px; left: 10px;
  background: rgba(155,48,224,0.85);
  font-size: 0.75rem; letter-spacing: 0.15em; text-transform: uppercase;
  padding: 0.25rem 0.6rem; border-radius: 50px;
  color: #fff; font-family: 'Playfair Display', serif;
  backdrop-filter: blur(4px);
}

.video-info {
  padding: 1rem 1.2rem 1.2rem;
}
.video-title {
  font-size: 0.95rem; font-weight: 700; margin-bottom: 0.3rem;
  line-height: 1.35;
}
.video-meta {
  font-size: 0.75rem; letter-spacing: 0.12em; opacity: 0.7;
  text-transform: uppercase;
}

/* ── MODAL ── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 999998;
  background: rgba(4,4,12,0.92);
  backdrop-filter: blur(10px);
  align-items: center; justify-content: center;
  padding: 1rem;
}
.modal-overlay.open { display: flex; }

/* Largeur bornée par la hauteur de l'écran : la vidéo (16:9 ou 9:16) + le bouton Fermer tiennent toujours dans le viewport */
.modal-box {
  position: relative;
  width: 100%; max-width: min(900px, calc((100vh - 110px) * 16 / 9));
  animation: modalIn 0.3s ease both;
}

/* Shorts = ratio 9:16, autres = 16:9 */
.modal-box .ratio-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  background: #000;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 60px rgba(0,0,0,0.7);
  border: 1px solid rgba(155,48,224,0.3);
}
.modal-box.shorts-modal { max-width: min(420px, calc((100vh - 110px) * 9 / 16)); }
@supports (height: 100dvh) {
  .modal-box { max-width: min(900px, calc((100dvh - 110px) * 16 / 9)); }
  .modal-box.shorts-modal { max-width: min(420px, calc((100dvh - 110px) * 9 / 16)); }
}
.modal-box.shorts-modal .ratio-wrap { padding-bottom: 177.78%; }

.modal-box iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: none;
}

.modal-close {
  position: absolute; top: -46px; right: 0;
  background: none; border: none; cursor: pointer;
  color: var(--cream); opacity: 0.6;
  font-family: 'Playfair Display', serif;
  font-size: 0.7rem; letter-spacing: 0.2em; text-transform: uppercase;
  display: flex; align-items: center; gap: 0.4rem;
  transition: opacity 0.2s;
}
.modal-close:hover { opacity: 1; }

footer { margin-top: 4rem; }


/* ── RESPONSIVE ── */
.nav-back-short { display: none; }
@media (max-width: 768px) {
  nav { padding: 1.2rem 1.2rem; gap: 0.8rem; }
  .nav-logo { white-space: nowrap; font-size: 1rem; }
  .nav-back { white-space: nowrap; }
  .nav-back-full { display: none; }
  .nav-back-short { display: inline; }
  .page-wrap { padding: 7rem 1.2rem 4rem; }
  .video-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .video-info { padding: 0.8rem 0.9rem 1rem; }
  .video-title { font-size: 0.85rem; }
}

/* Décalage d'apparition des cartes (remplace les style="animation-delay" inline) */
.video-card:nth-child(2) { animation-delay: 0.1s; }
.video-card:nth-child(3) { animation-delay: 0.2s; }
.video-card:nth-child(4) { animation-delay: 0.3s; }
.video-card:nth-child(5) { animation-delay: 0.4s; }

/* ── MOBILE & TACTILE : pas de flou ── */
@media (max-width: 1024px) {
  nav, .play-btn, .shorts-badge { backdrop-filter: none; -webkit-backdrop-filter: none; }
  nav { background: rgba(8,9,15,0.92); }
}
