/* ========================================
   REALISATIONS 6 — PORTFOLIO DOSSIERS
   ======================================== */

/* ─── Section ─────────────────────────────────────────── */
.real-6 {
  padding: 100px 0;
  background: var(--primary);
  overflow: hidden;
}

/* ─── En-tête ─────────────────────────────────────────── */
.real-6__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 5%;
  max-width: 1300px;
  margin: 0 auto 50px;
  flex-wrap: wrap;
  gap: 20px;
}

.real-6__header .eyebrow {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 12px;
}

.real-6__header h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.8rem);
  color: var(--white);
}

/* ─── Flèches ──────────────────────────────────────────── */
.real-6__nav {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.real-6__nav-btn {
  width: 50px;
  height: 50px;
  background: var(--white);
  border: none;
  color: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    background 0.3s,
    color 0.3s;
}

.real-6__nav-btn:hover {
  background: var(--secondary);
  color: var(--white);
}

.real-6__nav-btn svg {
  width: 26px;
  height: 26px;
  pointer-events: none;
}

/* ─── Piste ───────────────────────────────────────────── */
.real-6__track {
  display: flex;
  gap: 50px;
  will-change: transform;
  padding: 30px 0 40px;
  /* Transition douce pour les flèches */
  transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Mode "animating" : on laisse le JS gérer, pas de transition */
.real-6__track.is-auto {
  transition: none;
}

/* ─── Carte ───────────────────────────────────────────── */
.real-6__card {
  flex: 0 0 360px;
  cursor: pointer;
  position: relative;
}

/* ─── Stack (wrapper effet empilement) ─────────────────── */
.real-6__stack {
  position: relative;
  width: 100%;
}

/* Couches "derrière" */
.real-6__stack-layer {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  transition: transform 0.4s ease;
}

.real-6__stack-layer img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.real-6__stack-layer--2 {
  transform: translate(8px, -8px) rotate(2.5deg);
  z-index: 0;
  filter: brightness(0.75);
}

.real-6__stack-layer--3 {
  transform: translate(16px, -16px) rotate(5deg);
  z-index: -1;
  filter: brightness(0.5);
}

.real-6__card:hover .real-6__stack-layer--2 {
  transform: translate(12px, -12px) rotate(3.5deg);
}

.real-6__card:hover .real-6__stack-layer--3 {
  transform: translate(22px, -22px) rotate(7deg);
}

/* ─── Couverture principale ────────────────────────────── */
.real-6__cover {
  position: relative;
  height: 280px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  z-index: 1;
  transition: transform 0.4s ease;
}

.real-6__card:hover .real-6__cover {
  transform: translateY(-6px);
}

.real-6__cover > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
  display: block;
}

.real-6__card:hover .real-6__cover > img {
  transform: scale(1.07);
}

/* ─── Badge photos ─────────────────────────────────────── */
.real-6__count {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  color: var(--white);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.real-6__count svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

/* ─── Overlay hover ───────────────────────────��────────── */
.real-6__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.82) 0%,
    rgba(0, 0, 0, 0.1) 60%,
    transparent 100%
  );
  display: flex;
  align-items: flex-end;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.35s ease;
  border-radius: 16px;
}

.real-6__card:hover .real-6__overlay {
  opacity: 1;
}

.real-6__cta {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--secondary);
  color: var(--black);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 9px 18px;
  border-radius: 8px;
  transform: translateY(8px);
  transition: transform 0.35s ease;
}

.real-6__card:hover .real-6__cta {
  transform: translateY(0);
}

.real-6__cta svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ========================================
   MODALE PROJET — CENTRÉE
   ======================================== */
.real-6-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.real-6-modal[hidden] {
  display: none;
}

/* Overlay flou */
.real-6-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  cursor: pointer;
}

/* Boîte modale */
.real-6-modal__box {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1100px;
  max-height: 88vh;
  background: #1a1a1a;
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 40px 80px rgba(0, 0, 0, 0.8);
  animation: real6PopIn 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes real6PopIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ─── En-tête modale (simplifié — sans dots) ──────────── */
.real-6-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  background: #111;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
  gap: 16px;
}

/* Titre */
.real-6-modal__title-wrap {
  flex: 1;
}

.real-6-modal__title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--white);
  margin-bottom: 2px;
}

.real-6-modal__subtitle {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.4);
}

/* Bouton fermer */
.real-6-modal__close {
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}

.real-6-modal__close:hover {
  background: rgba(255, 255, 255, 0.14);
}

.real-6-modal__close svg {
  width: 16px;
  height: 16px;
  color: var(--white);
}

/* ─── Grille vignettes — PLUS GRANDES ─────────────────── */
.real-6-modal__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  padding: 24px 28px;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.real-6-modal__grid::-webkit-scrollbar {
  width: 6px;
}
.real-6-modal__grid::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.real-6-modal__thumb {
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: 10px;
  cursor: pointer;
  position: relative;
  background: #2a2a2a;
}

.real-6-modal__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
  display: block;
}

.real-6-modal__thumb:hover img {
  transform: scale(1.06);
}

.real-6-modal__thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 10px;
  border: 2px solid transparent;
  transition: border-color 0.2s;
}

.real-6-modal__thumb:hover::after {
  border-color: var(--secondary);
}

/* ─── Visionneuse plein écran ──────────────────────────── */
.real-6-modal__viewer {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  border-radius: 20px;
}

.real-6-modal__viewer[hidden] {
  display: none;
}

.real-6-modal__viewer-img {
  max-width: 80%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
  transition: opacity 0.15s ease;
}

/* Compteur */
.real-6-modal__viewer-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  color: var(--white);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

/* Bouton fermer visionneuse */
.real-6-modal__viewer-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.real-6-modal__viewer-close:hover {
  background: var(--secondary);
}

.real-6-modal__viewer-close svg {
  width: 18px;
  height: 18px;
  color: var(--white);
}

/* Flèches visionneuse */
.real-6-modal__viewer-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.2s,
    border-color 0.2s,
    transform 0.2s;
}

.real-6-modal__viewer-arrow:hover {
  background: var(--secondary);
  border-color: var(--secondary);
  transform: translateY(-50%) scale(1.08);
}

.real-6-modal__viewer-arrow--prev {
  left: 20px;
}
.real-6-modal__viewer-arrow--next {
  right: 20px;
}

.real-6-modal__viewer-arrow svg {
  width: 22px;
  height: 22px;
  color: var(--white);
  pointer-events: none;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 1024px) {
  .real-6__card {
    flex: 0 0 300px;
  }
  .real-6__cover {
    height: 230px;
  }

  .real-6-modal__grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

@media (max-width: 640px) {
  .real-6__card {
    flex: 0 0 240px;
  }
  .real-6__cover {
    height: 190px;
  }

  .real-6__stack-layer--2 {
    transform: translate(5px, -5px) rotate(2deg);
  }
  .real-6__stack-layer--3 {
    transform: translate(10px, -10px) rotate(4deg);
  }

  /* Modale plein écran sur mobile */
  .real-6-modal {
    padding: 0;
    align-items: flex-end;
  }

  .real-6-modal__box {
    max-width: 100%;
    max-height: 92vh;
    border-radius: 20px 20px 0 0;
  }

  .real-6-modal__grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    padding: 16px 16px;
    gap: 8px;
  }

  .real-6-modal__viewer-arrow {
    width: 38px;
    height: 38px;
  }
  .real-6-modal__viewer-arrow--prev {
    left: 10px;
  }
  .real-6-modal__viewer-arrow--next {
    right: 10px;
  }
  .real-6-modal__viewer-img {
    max-width: 92%;
  }
}
