/* ============================================================================
   Projets en cours - Styles
   ============================================================================ */

body {
  overflow-x: hidden;
}

.header-section {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.header-section p {
  text-align: center;
}
/* Section principale */
.projects-section {
  width: 100%;
  max-width: 1400px;
  margin: 60px auto;
  padding: 0 20px;
  box-sizing: border-box;
}

.projects-section-title {
  font-family: "East-liberty-signature", serif;
  font-weight: 400;
  color: #042825;
  font-size: 2.5rem;
  text-align: left;
  margin-bottom: 5px !important;
}

/* Container pour garder la ligne proche du titre */
.title-wrapper {
  margin-bottom: 50px;
  display: inline-block; /* Permet à la ligne de ne pas s'étirer sur tout l'écran */
}

/* L'image de la ligne */
.boreal-line-decoration {
  display: block;
  width: 100%;
  max-width: 750px; /* À ajuster selon la taille réelle de ton PNG */
  height: auto;

  /* Le masque : noir à gauche (visible), transparent à droite (caché) */
  -webkit-mask-image: linear-gradient(to right, black 45%, transparent 55%);
  mask-image: linear-gradient(to right, black 45%, transparent 55%);

  -webkit-mask-size: 220% 100%;
  mask-size: 220% 100%;

  /* Position initiale : la partie transparente (droite du masque) recouvre l'image */
  -webkit-mask-position: 100% 0;
  mask-position: 100% 0;
}

/* Classe active déclenchée par JS */
.boreal-line-decoration.is-drawn {
  /* Position finale : la partie noire (gauche du masque) recouvre l'image */
  -webkit-mask-position: 0% 0;
  mask-position: 0% 0;

  /* Transition fluide */
  transition:
    -webkit-mask-position 2s ease-out,
    mask-position 2s ease-out;
}
/* --- OPTIONNEL ---
   Si tu te rends compte que tu préfères de GAUCHE à DROITE, 
   remplace le mask-image par : linear-gradient(to left, transparent 45%, black 55%);
   et garde les mêmes mask-position (0% puis 100%).
*/

/* Carrousel de projets */
.projects-carousel {
  position: relative;
  width: 100%;
  overflow: visible;
}

.project-item {
  display: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.project-item.active {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  opacity: 1;
  animation: fadeIn 0.5s ease;
  overflow: visible;
}

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

/* Panneau d'images (gauche) */
.project-item-image-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-self: center;
}

/* Before/After */
.project-item-before-after {
  width: 100%;
  overflow: hidden;
}

/* Modules interactifs (3 images en dessous) */
.project-item-int-module {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}

.module-preview {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.module-preview:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

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

.module-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background 0.3s ease;
}

.module-preview:hover::after {
  background: rgba(0, 0, 0, 0.1);
}

/* Label pour les modules */
.module-label {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  padding: 5px 12px;
  border-radius: 4px;
  font-family: "Montserrat", sans-serif;
  font-size: 0.85rem;
  color: #042825;
  font-weight: 500;
  z-index: 2;
}

/* Panneau de description (droite) - wrapper for positioning */
.project-item-description-panel {
  position: relative;
}

/* The actual content box with border */
.project-item-description-panel > *:not(img) {
  position: relative;
  z-index: 2;
}

.project-item-description-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px;
  background-color: white;
  border: 2px solid #b4c9d5;
  border-top: none;
}

/* Create the two top border segments with gap in middle */
.project-item-description-panel::before,
.project-item-description-panel::after {
  content: "";
  position: absolute;
  top: 0;
  height: 2px;
  background-color: #b4c9d5;
  width: calc(50% - 25%);
  z-index: 2;
}

.project-item-description-panel::before {
  left: 0;
}

.project-item-description-panel::after {
  right: 0;
}

/* Shadow images for description panel */
.project-item-description-panel img.shadow-left,
.project-item-description-panel img.shadow-right,
.project-item-description-panel img.shadow-bottom {
  position: absolute;
  pointer-events: none;
  opacity: 0.2;
  z-index: 0;
}

.project-item-description-panel .shadow-left {
  top: -2px;
  bottom: -2px;
  left: 0;
  transform: translateX(-69%);
  height: calc(100% + 4px);
  width: auto;
}

.project-item-description-panel .shadow-right {
  top: -2px;
  bottom: -2px;
  right: 0;
  transform: translateX(69%);
  height: calc(100% + 4px);
  width: auto;
}

.project-item-description-panel .shadow-bottom {
  left: -2px;
  right: -2px;
  bottom: 0;
  transform: translateY(69%);
  width: calc(100% + 4px);
  height: auto;
}

.project-item-description-panel-title {
  font-family: "Poiret", serif;
  font-weight: 400;
  color: #042825;
  font-size: 2rem;
  line-height: 1.3;
  text-align: center;
}

.project-item-description-panel-type,
.project-item-description-panel-mission-type {
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
  color: #d9a33e;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.project-item-description-panel-budget {
  font-family: "Montserrat", sans-serif;
  font-weight: 500;
  color: #042825;
  font-size: 1.1rem;
}

.project-item-description-panel-architectural-intent {
  font-family: "Montserrat", sans-serif;
  font-weight: 400;
  color: #042825;
  font-size: 1rem;
  line-height: 1.6;
  text-align: left;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 10px;
}

/* Scrollbar personnalisée pour l'intention architecturale */
.project-item-description-panel-architectural-intent::-webkit-scrollbar {
  width: 6px;
}

.project-item-description-panel-architectural-intent::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.project-item-description-panel-architectural-intent::-webkit-scrollbar-thumb {
  background: #d9a33e;
  border-radius: 3px;
}

.project-item-description-panel-architectural-intent::-webkit-scrollbar-thumb:hover {
  background: #c08f2e;
}

.project-item-description-panel-date {
  font-family: "Montserrat", sans-serif;
  font-weight: 400;
  color: #666;
  font-size: 0.95rem;
  font-style: italic;
}

/* Navigation du carrousel */
.projects-navigation {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 40px;
}

.project-arrow {
  background: none;
  border: none;
  color: #042825;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 10px 15px;
  font-family: "Montserrat", sans-serif;
}

.project-arrow .arrow-icon {
  font-size: 2rem;
  font-weight: bold;
  transition: transform 0.3s ease;
}

.project-arrow .arrow-label {
  font-size: 0.95rem;
  font-weight: 500;
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-arrow:hover .arrow-icon {
  transform: translateX(0);
}

.project-prev:hover .arrow-icon {
  transform: translateX(-5px);
}

.project-next:hover .arrow-icon {
  transform: translateX(5px);
}

.project-arrow:hover {
  color: #d9a33e;
}

.project-arrow:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.project-arrow:disabled:hover {
  color: #042825;
}

.project-arrow:disabled .arrow-icon {
  transform: translateX(0) !important;
}

/* Indicateur de projet actuel */
.project-indicator {
  font-family: "Montserrat", sans-serif;
  font-size: 1rem;
  color: #042825;
  font-weight: 500;
}

/* Message si aucun projet */
.no-projects-message {
  text-align: center;
  font-family: "Montserrat", sans-serif;
  font-size: 1.2rem;
  color: #666;
  padding: 60px 20px;
  font-style: italic;
}

.projet-button-wrapper {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  margin-block: 20px;
}

/* ============================================================================
   Responsive Design
   ============================================================================ */

/* Tablettes */
@media (max-width: 1024px) {
  .project-item.active {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .projects-section-title {
    font-size: 2rem;
  }

  .project-item-description-panel-title {
    font-size: 1.7rem;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .projects-section {
    margin: 40px auto;
    padding: 0 15px;
  }

  .projects-section-title {
    font-size: 1.8rem;
    margin-bottom: 30px;
  }

  /* Reorder layout on mobile: description first, then images */
  .project-item.active {
    display: flex;
    flex-direction: column;
  }

  .project-item-description-panel {
    order: 1;
    padding: 10px;
    gap: 15px;
  }

  .project-item-description-panel .shadow-left,
  .project-item-description-panel .shadow-right {
    display: none;
  }

  .project-item-description-panel .shadow-bottom {
    left: 0;
    right: 0;
    bottom: -102px;
    width: 100%;
  }

  .project-item-image-panel {
    order: 2;
  }

  .project-item-before-after {
    order: 1;
  }

  .project-item-int-module {
    order: 2;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .project-item-description-panel-title {
    font-size: 1.5rem;
  }

  .project-item-description-panel-architectural-intent {
    max-height: 200px;
    font-size: 0.95rem;
  }

  .project-arrow {
    padding: 8px 10px;
    gap: 10px;
  }

  .project-arrow .arrow-icon {
    font-size: 1.5rem;
  }

  .project-arrow .arrow-label {
    font-size: 0.85rem;
    max-width: 120px;
  }

  .projects-navigation {
    gap: 10px;
    margin-top: 30px;
    flex-wrap: wrap;
  }

  .project-indicator {
    font-size: 0.9rem;
    order: -1;
    width: 100%;
    text-align: center;
    margin-bottom: 10px;
  }
}

/* Très petits écrans */
@media (max-width: 480px) {
  .projects-section-title {
    font-size: 1.5rem;
  }

  .project-item-description-panel-title {
    font-size: 1.3rem;
  }

  .project-arrow {
    padding: 5px 8px;
    gap: 8px;
  }

  .project-arrow .arrow-icon {
    font-size: 1.3rem;
  }

  .project-arrow .arrow-label {
    font-size: 0.75rem;
    max-width: 80px;
  }
}
