/* ============================================
   CAROUSEL RÉALISATIONS
   ============================================ */

/* BLOC DES RÉALISATIONS */
.home #realisations h2 {
  margin-bottom: 0;
}

/* Header with title and navigation */
.realisations-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  width: 100%;
}

.realisations-header h2 {
  margin-bottom: 0;
  flex: 1;
}

.carousel-nav-group {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  border-radius: 50px;
  transition: all 0.3s ease;
}

.carousel-nav-group:hover {
  background: rgba(255, 255, 255, 0.8);
}

/* Carousel Container */
.realisations-carousel-wrapper {
  position: relative;
  width: 100%;
  padding: 0;
}

.realisations-carousel-container {
  position: relative;
  width: 100%;
  overflow-x: scroll;
  overflow-y: hidden;
  margin: 0 auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
  cursor: grab;
}

.realisations-carousel-container::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.realisations-carousel-container:active {
  cursor: grabbing;
}

.realisations-carousel-track {
  display: flex;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
  touch-action: pan-x;
  user-select: none;
  -webkit-user-select: none;
}

.realisation-carousel-item {
  flex: 0 0 auto;
  width: calc(100% / 1);
  padding: 0 10px;
  box-sizing: border-box;
}

/* Navigation Buttons */
.carousel-nav {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: transparent;
  color: var(--couleur-texte, var(--couleur-primaire));
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
  z-index: 10;
  outline: none;
}

.carousel-nav:hover:not(:disabled) {
  color: var(--couleur-primaire);
  transform: scale(1.1);
}

.carousel-nav:active:not(:disabled) {
  transform: scale(0.95);
}

.carousel-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.carousel-nav svg {
  width: 24px;
  height: 24px;
  transition: color 0.3s ease;
}

.carousel-nav:hover:not(:disabled) svg {
  color: var(--couleur-primaire);
}

@media (min-width: 768px) {
  .carousel-nav {
    width: 60px;
    height: 60px;
  }
  
  .carousel-nav svg {
    width: 28px;
    height: 28px;
  }
}

.carousel-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

@media (min-width: 576px) {
  .realisation-carousel-item {
    width: calc(100% / 2);
  }
}

@media (min-width: 768px) {
  .realisation-carousel-item {
    width: calc(100% / 2);
  }
  
  .carousel-nav {
    width: 60px;
    height: 60px;
  }
  
  .carousel-arrow {
    width: 28px;
    height: 28px;
  }
  
  .carousel-nav-group {
    gap: 15px;
    padding: 10px 20px;
  }
}

/* Column structure for desktop */
.realisation-carousel-column {
  flex: 0 0 auto;
  width: calc(100% / 1);
  padding: 0 10px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.realisation-carousel-item {
  width: 100%;
  flex: 0 0 auto;
}

/* Mobile: Show items individually (1 item per view) */
@media (max-width: 575px) {
  .realisations-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
  }
  
  .realisations-header h2 {
    flex: 1;
    margin-bottom: 0;
  }
  
  .carousel-nav-group {
    flex-shrink: 0;
    gap: 10px;
    padding: 6px 12px;
  }
  
  .realisation-carousel-column {
    display: contents; /* Flatten column structure on mobile */
  }
  
  .realisation-carousel-item {
    flex: 0 0 auto;
    width: 100%;
    padding: 0 10px;
    margin-bottom: 0;
  }
  
  /* Each item becomes its own slide on mobile */
  .realisation-carousel-item:not(:first-child) {
    margin-left: 0;
  }
}

@media (min-width: 576px) {
  .realisation-carousel-column {
    width: calc(100% / 2);
  }
  
  /* Show all items in columns on tablet+ */
  .realisation-carousel-column .realisation-carousel-item {
    display: block;
  }
}

@media (min-width: 768px) {
  .realisation-carousel-column {
    width: calc(100% / 2);
  }
}

@media (min-width: 1024px) {
  /* Desktop: 2 rows x 3 columns grid */
  .realisation-carousel-column {
    width: calc(100% / 3);
    padding: 0 10px;
  }
  
  .realisation-carousel-item {
    width: 100%;
  }
  
  .carousel-nav-group {
    gap: 18px;
    padding: 12px 24px;
  }
}

/* Loading indicator */
.carousel-load-more-indicator {
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
}

.loading-spinner {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(63, 63, 64, 0.1);
  border-top-color: var(--couleur-primaire);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.realisation-item {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

.realisation-link {
  position: absolute;
  inset: 0;
  display: block;
}

.realisation-thumb {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  transition: transform 0.4s ease, opacity 0.4s ease;
}

.realisation-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  z-index: 2;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.realisation-link:hover .realisation-video {
  opacity: 1;
}

.realisation-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 70px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 40px;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
  background-color: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  transform: translateY(100%);
}

/* --- Contenu horizontal --- */
.overlay-inline {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.overlay-inline h3,
.overlay-inline p {
  font-family: var(--global-font-family);
  font-weight: var(--global-font-weight);
  color: var(--couleur-blanc);
  margin: 0;
}

.overlay-inline h3 {
  font-size: 1.6rem;
}

.overlay-inline p {
  font-size: 1.4rem;
  opacity: 0.85;
}

/* --- Ligne animée (horizontale) --- */
.overlay-sep {
  display: inline-block;
  height: 2px;
  width: 0;
  background-color: var(--couleur-blanc);
  transition: width 0.6s ease-in-out;
  vertical-align: middle;
}

.realisation-link:hover .overlay-sep {
  width: 40px;
}

.fleche-lien {
  width: 28px;
  height: 22px;
  filter: brightness(100);
  opacity: 0.9;
  transform: rotateZ(-45deg);
  filter: brightness(0) invert(1);
}

.realisation-link:hover .fleche-gauche {
  animation: fleche-bounce 1s ease-in-out infinite;
}

@keyframes fleche-bounce {
  0%,
  100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(6px);
  }
}

.realisation-link:hover .realisation-thumb {
  transform: scale(1.05);
  opacity: 0.5;
}

.realisation-link:hover .realisation-video {
  opacity: 1;
}

.realisation-link:hover .realisation-overlay {
  opacity: 1;
  transform: translateY(0);
}

@media (min-width: 768px) {
  .realisation-item {
    aspect-ratio: 4 / 3;
  }
}

@media (min-width: 1024px) {
  .realisation-item {
    aspect-ratio: 1 / 1;
  }
}