/* ============================================================
   NOUVEAU DIAPORAMA — CSS propre, simple et testé
   Préfixe "nd-" (new diapo) pour éviter tout conflit avec l'ancien
   ============================================================ */

.ndiapo {
  position: relative;
  width: 100%;
  background: #020A16;
  overflow: hidden;
  font-family: inherit;
}

/* --- SCÈNE PRINCIPALE --- */
.ndiapo .nd-scene {
  position: relative;
  width: 100%;
  height: 65vh;
  min-height: 480px;
  max-height: 620px;
  overflow: hidden;
  background: #020A16;
}

.ndiapo .nd-slide {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  opacity: 0;
  transition: opacity .7s ease;
  pointer-events: none;
  z-index: 1;
}
.ndiapo .nd-slide.nd-active {
  opacity: 1;
  pointer-events: auto;
  z-index: 2;
}

.ndiapo .nd-img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

.ndiapo .nd-grad {
  position: absolute; inset: 0;
  background:
    linear-gradient(to right, rgba(2,10,22,.75) 0%, rgba(2,10,22,.2) 50%, transparent 70%),
    linear-gradient(to top, rgba(2,10,22,.85) 0%, transparent 45%);
  pointer-events: none;
  z-index: 2;
}

/* --- LÉGENDE --- */
.ndiapo .nd-cap {
  position: absolute;
  left: 0; right: 0;
  bottom: 4.2rem; /* au-dessus des points */
  padding: 0 3rem;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  pointer-events: none;
}

.ndiapo .nd-cap-body {
  max-width: 640px;
  pointer-events: auto;
}

.ndiapo .nd-cat {
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: .6rem;
}

.ndiapo .nd-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  font-weight: 500;
  line-height: 1.15;
  color: #F0EBE0;
  margin: 0 0 .8rem 0;
}

.ndiapo .nd-sub {
  font-size: .82rem;
  color: rgba(240,235,224,.78);
  line-height: 1.4;
  max-width: 560px;
}

.ndiapo .nd-cap-tag {
  text-align: right;
  pointer-events: auto;
}

.ndiapo .nd-tag {
  font-size: .55rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(201,168,76,.8);
}

/* --- LANGUE (affichée selon .lang-fr/.lang-en sur <html>) --- */
.ndiapo .fr, .ndiapo .en { display: none; }
html.lang-fr .ndiapo .fr { display: block; }
html.lang-en .ndiapo .en { display: block; }
html:not(.lang-fr):not(.lang-en) .ndiapo .fr { display: block; }

/* --- FLÈCHES --- */
.ndiapo .nd-arrow {
  position: absolute;
  top: calc(32.5vh - 24px);
  width: 50px; height: 50px;
  border-radius: 50%;
  background: rgba(201,168,76,.12);
  border: 1px solid rgba(201,168,76,.3);
  color: #c9a84c;
  font-size: 28px;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .3s;
  font-family: Arial, sans-serif;
  line-height: 1;
  padding: 0;
}
.ndiapo .nd-arrow:hover {
  background: rgba(232,102,26,.85);
  border-color: rgba(232,102,26,.9);
  color: #fff;
}
.ndiapo .nd-prev { left: 1.5rem; }
.ndiapo .nd-next { right: 1.5rem; }

/* --- PAUSE/PLAY --- */
.ndiapo .nd-pause {
  position: absolute;
  top: 1.5rem; right: 1.5rem;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(232,102,26,.85);
  border: none;
  color: white;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .3s;
}
.ndiapo .nd-pause:hover {
  background: rgba(232,102,26,1);
  transform: scale(1.08);
}

/* --- BOTTOM : COMPTEUR + PUCES --- */
.ndiapo .nd-bottom {
  position: absolute;
  left: 0; right: 0;
  bottom: 1.4rem;
  padding: 0 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 4;
  pointer-events: none;
}

.ndiapo .nd-counter {
  color: rgba(240,235,224,.92);
  font-size: .78rem;
  letter-spacing: .3em;
  font-family: 'Courier New', monospace;
  font-weight: 500;
  text-shadow: 0 1px 4px rgba(0,0,0,.5);
}
.ndiapo .nd-counter #ndCur {
  color: #c9a84c;
  font-size: .95rem;
  margin-right: .25em;
}

.ndiapo .nd-dots {
  display: flex;
  gap: 6px;
  pointer-events: auto;
  padding: .5rem .9rem;
  background: rgba(2,10,22,.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 100px;
  border: 1px solid rgba(201,168,76,.12);
}

.ndiapo .nd-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(240,235,224,.3);
  cursor: pointer;
  transition: all .35s cubic-bezier(.4,0,.2,1);
  flex-shrink: 0;
}
.ndiapo .nd-dot:hover {
  background: rgba(240,235,224,.7);
  transform: scale(1.3);
}
.ndiapo .nd-dot.on {
  width: 26px;
  border-radius: 3px;
  background: linear-gradient(90deg, #e8661a, #c9a84c);
  box-shadow: 0 0 10px rgba(232,102,26,.5);
}

/* --- PROGRESS BAR --- */
.ndiapo .nd-progress {
  position: absolute;
  left: 0; right: 0;
  bottom: 0; /* tout en bas de la scène */
  height: 2px;
  background: rgba(201,168,76,.12);
  z-index: 5;
  pointer-events: none;
}
.ndiapo .nd-progress > div {
  height: 100%;
  background: linear-gradient(90deg, #e8661a, #c9a84c);
  width: 0;
  transition: width linear;
  box-shadow: 0 0 8px rgba(232,102,26,.5);
}

/* --- MINIATURES --- */
.ndiapo .nd-strip {
  position: relative;
  width: 100%;
  background: #020A16;
  border-top: 1px solid rgba(201,168,76,.1);
  overflow-x: auto;
  overflow-y: hidden;
  padding: .9rem 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
}
.ndiapo .nd-strip::-webkit-scrollbar { display: none; }

.ndiapo .nd-thumbs {
  display: flex;
  gap: 6px;
  padding: 0 1.5rem;
  width: max-content; /* Important: le conteneur s'adapte au contenu */
}

.ndiapo .nd-thumb {
  flex-shrink: 0;
  width: 100px; height: 64px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  border: 1px solid rgba(201,168,76,.15);
  transition: all .3s;
  box-sizing: border-box;
}
.ndiapo .nd-thumb:hover {
  border-color: rgba(201,168,76,.5);
  transform: translateY(-2px);
}
.ndiapo .nd-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: brightness(.7) saturate(.85);
  transition: filter .3s;
  display: block;
}
.ndiapo .nd-thumb:hover img { filter: brightness(.95) saturate(1); }

/* État actif — use outline (pas box-shadow) pour éviter tout bug graphique */
.ndiapo .nd-thumb.nd-thumb-on {
  border-color: #e8661a;
  outline: 2px solid #e8661a;
  outline-offset: 0;
  transform: translateY(-2px);
}
.ndiapo .nd-thumb.nd-thumb-on img {
  filter: brightness(1.05) saturate(1.1);
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
  .ndiapo .nd-scene { height: 50vh; min-height: 360px; }
  .ndiapo .nd-cap {
    padding: 0 1rem;
    bottom: 4rem;
    flex-direction: column;
    align-items: flex-start;
  }
  .ndiapo .nd-bottom { padding: 0 1rem; bottom: 1rem; }
  .ndiapo .nd-counter { font-size: .7rem; }
  .ndiapo .nd-dots { padding: .4rem .7rem; gap: 5px; }
  .ndiapo .nd-dot { width: 5px; height: 5px; }
  .ndiapo .nd-dot.on { width: 22px; }
  .ndiapo .nd-arrow { width: 40px; height: 40px; font-size: 24px; top: calc(25vh - 20px); }
  .ndiapo .nd-prev { left: .5rem; }
  .ndiapo .nd-next { right: .5rem; }
  .ndiapo .nd-thumb { width: 80px; height: 52px; }
}
