/* ==========================================================
   VistaNova — Médiathèque dynamique
   Barre de filtres + tuiles vidéo + lecteur plein écran
   ========================================================== */

/* ---------- Barre de filtres / recherche ---------- */
.vn-toolbar {
  position: sticky;
  top: 72px;
  z-index: 30;
  margin: clamp(1.2rem, 3vw, 2rem) 0 clamp(1.5rem, 3vw, 2.4rem);
  padding: 0.85rem 0;
  background: rgba(12, 34, 28, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-top: 1px solid rgba(224, 180, 128, 0.14);
  border-bottom: 1px solid rgba(224, 180, 128, 0.14);
}
.vn-toolbar-inner {
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 3vw, 2rem);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}
.vn-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-right: auto;
}
.vn-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.05rem;
  border-radius: 999px;
  border: 1px solid rgba(224, 180, 128, 0.32);
  background: rgba(12, 34, 28, 0.55);
  color: #ecc89e;
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}
.vn-chip:hover {
  border-color: rgba(224, 180, 128, 0.6);
  color: #fdebd6;
  transform: translateY(-1px);
}
.vn-chip.is-active {
  background: linear-gradient(135deg, #e0b480, #c89a64);
  color: #0c221c;
  border-color: transparent;
  box-shadow: 0 8px 24px -10px rgba(224, 180, 128, 0.55);
}
.vn-chip span {
  font-family: 'Cinzel', serif;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  padding: 2px 6px;
  border-radius: 99px;
  background: rgba(12, 34, 28, 0.35);
  opacity: 0.85;
}
.vn-chip.is-active span {
  background: rgba(12, 34, 28, 0.18);
  color: #0c221c;
  opacity: 1;
}
.vn-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  border: 1px solid rgba(224, 180, 128, 0.3);
  background: rgba(12, 34, 28, 0.55);
  color: #ecc89e;
}
.vn-search input {
  border: 0;
  outline: 0;
  background: transparent;
  color: #fdebd6;
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  min-width: 190px;
}
.vn-search input::placeholder { color: rgba(236, 200, 158, 0.6); }
.vn-empty {
  max-width: 600px;
  margin: 1.4rem auto 0;
  text-align: center;
  color: #ecc89e;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
}

/* ---------- Tuiles vidéo dynamiques ---------- */
.vn-tile { position: relative; }
.vn-tile .vn-tile-poster {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  transition: transform 1.2s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.vn-tile:hover .vn-tile-poster { transform: scale(1.04); }
.vn-tile-duration {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(12, 34, 28, 0.78);
  color: #fdebd6;
  font-family: 'Inter', sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  backdrop-filter: blur(6px);
  pointer-events: none;
}

/* ---------- Lecteur plein écran ---------- */
.vn-player {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 3rem);
  background: rgba(8, 22, 18, 0.97);
  backdrop-filter: blur(20px) saturate(120%);
  -webkit-backdrop-filter: blur(20px) saturate(120%);
  animation: vnFade 0.28s ease;
}
@keyframes vnFade { from { opacity: 0; } to { opacity: 1; } }

.vn-player-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  max-width: min(1200px, 95vw);
}
.vn-player-video {
  max-width: 100%;
  max-height: 82vh;
  border-radius: 14px;
  background: #000;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8),
              0 0 80px -12px rgba(224, 180, 128, 0.18);
}
.vn-player-caption {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  text-align: center;
}
.vn-player-cat {
  color: #e0b480;
  font-family: 'Cinzel', serif;
  font-size: 0.66rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}
.vn-player-title {
  color: #fdebd6;
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.1rem, 2vw, 1.5rem);
}
.vn-player-close {
  position: absolute;
  top: clamp(0.8rem, 2vw, 1.4rem);
  right: clamp(0.8rem, 2vw, 1.4rem);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(224, 180, 128, 0.45);
  background: rgba(12, 34, 28, 0.65);
  color: #fdebd6;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  transition: transform 0.3s ease, background 0.3s ease;
}
.vn-player-close:hover {
  background: linear-gradient(135deg, #e0b480, #c89a64);
  color: #0c221c;
  transform: scale(1.06) rotate(90deg);
}

/* ---------- Mobile ---------- */
@media (max-width: 820px) {
  .vn-toolbar { top: 60px; padding: 0.65rem 0; }
  .vn-toolbar-inner { gap: 0.5rem; }
  .vn-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    width: 100%;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .vn-chips::-webkit-scrollbar { display: none; }
  .vn-chip { flex-shrink: 0; font-size: 0.72rem; padding: 0.45rem 0.85rem; }
  .vn-search { width: 100%; }
  .vn-search input { min-width: 0; width: 100%; }
  .vn-player-video { max-height: 70vh; }
}

/* ==========================================================
   Visionneuse portfolio — navigation photo par photo
   ========================================================== */
.pflb {
  position: fixed;
  inset: 0;
  z-index: 99998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 3rem);
  background: rgba(8, 22, 18, 0.97);
  backdrop-filter: blur(20px) saturate(120%);
  -webkit-backdrop-filter: blur(20px) saturate(120%);
  animation: vnFade 0.25s ease;
}
.pflb-figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  max-width: 100%;
  max-height: 100%;
}
.pflb-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
}
.pflb-media {
  max-width: min(1400px, 92vw);
  max-height: 80vh;
  object-fit: contain;
  border-radius: 14px;
  background: #000;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.85),
              0 0 80px -14px rgba(224, 180, 128, 0.16);
}
.pflb-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  text-align: center;
}
.pflb-caption {
  color: #fdebd6;
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(0.95rem, 1.6vw, 1.15rem);
}
.pflb-counter {
  color: #e0b480;
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  letter-spacing: 0.22em;
}

/* Boutons */
.pflb-btn {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(224, 180, 128, 0.42);
  background: rgba(12, 34, 28, 0.62);
  color: #fdebd6;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease;
  z-index: 2;
}
.pflb-btn svg { width: 20px; height: 20px; }
.pflb-btn:hover {
  background: linear-gradient(135deg, #e0b480, #c89a64);
  color: #0c221c;
  border-color: transparent;
}
.pflb-btn[hidden] { display: none; }

.pflb-prev { left: clamp(0.5rem, 2.5vw, 2rem); top: 50%; transform: translateY(-50%); }
.pflb-next { right: clamp(0.5rem, 2.5vw, 2rem); top: 50%; transform: translateY(-50%); }
.pflb-prev:hover, .pflb-next:hover { transform: translateY(-50%) scale(1.07); }

.pflb-close {
  top: clamp(0.8rem, 2vw, 1.4rem);
  right: clamp(0.8rem, 2vw, 1.4rem);
  width: 46px;
  height: 46px;
  font-size: 26px;
  line-height: 1;
}
.pflb-close:hover { transform: scale(1.07) rotate(90deg); }

@media (max-width: 820px) {
  .pflb-btn { width: 44px; height: 44px; }
  .pflb-prev { left: 0.4rem; }
  .pflb-next { right: 0.4rem; }
  .pflb-media { max-height: 72vh; }
}

/* ---------- Accessibilité ---------- */
@media (prefers-reduced-motion: reduce) {
  .pflb { animation: none !important; }
  .pflb-btn { transition: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  .vn-tile .vn-tile-poster,
  .vn-chip,
  .vn-player-close { transition: none !important; }
  .vn-player { animation: none !important; }
}
