/* === Fichier Project Detail - Vue détaillée === */

/* === STRUCTURE GLOBALE === */
.project-detail-wrapper {
  display: grid;
  grid-template-columns: 30% 1fr 20%;
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "images title sidebar"
    "images content sidebar";
  gap: clamp(1.25rem, calc(0.698rem + 0.9025vw), 1.875rem);
  width: 100%;
  max-width: clamp(1100px, calc(18.05vw + 853.85px), 1200px);
  margin: auto;
  box-sizing: border-box;
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.project-detail-wrapper.visible {
  opacity: 1;
  transform: translateY(0);
}
.project-detail-wrapper.hiding {
  opacity: 0;
  transform: translateX(-25px);
}

/* === COLONNE IMAGES === */
.detail-images-column {
  grid-area: images;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.detail-main-image {
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f0f0;
  border: 3px solid #000;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease, filter 0.3s ease;
}
.detail-main-image:hover {
  transform: scale(1.02);
  filter: brightness(0.6);
}
.detail-main-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-main-image.has-video .video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
}
.detail-main-image.has-video:hover .video-overlay {
  background: rgba(0, 0, 0, 0.6);
}

.video-overlay .play-button {
  width: 60px;
  height: 60px;
  padding-left: 4px;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  border: 3px solid #fff;
  color: #000;
  transition: transform 0.3s ease;
}

.detail-thumbnails {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.detail-thumbnail {
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f0f0;
  border: 2px solid #000;
  overflow: hidden;
  cursor: pointer;
  filter: brightness(0.6);
  transition: transform 0.3s ease, border-color 0.3s ease, filter 0.3s ease;
}
.detail-thumbnail:hover {
  transform: scale(1.05);
  border-color: #667eea;
  filter: brightness(1);
}
.detail-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-thumbnail.has-video .video-overlay-small {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
}
.detail-thumbnail.has-video:hover .video-overlay-small {
  background: rgba(0, 0, 0, 0.6);
}

.video-overlay-small .play-button-small {
  width: 30px;
  height: 30px;
  padding-left: 2px;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  border: 2px solid #fff;
  color: #000;
  transition: transform 0.3s ease;
}

/* === COLONNE CONTENU === */
.detail-content-column {
  grid-area: content;
  display: flex;
  flex-direction: column;
  gap: clamp(0.75rem, calc(0.429rem + 0.361vw), 1rem);
  min-width: 0;
}

.detail-title {
  grid-area: title;
  font-size: clamp(1.5rem, calc(0.797rem + 1.444vw), 2rem);
  color: #333;
  margin: 0;
  font-weight: bold;
  align-self: start;
}
.detail-description {
  font-size: clamp(0.875rem, calc(0.694rem + 0.361vw), 1rem);
  color: #666;
  line-height: 1.6;
  margin: 0;
}
.detail-features {
  list-style: none;
  padding: 0;
  margin: 16px 0;
}
.detail-features li {
  padding: 8px 0;
  border-bottom: 1px solid #eee;
  color: #555;
  font-size: clamp(0.75rem, calc(0.569rem + 0.361vw), 0.875rem);
}
.detail-features li:before {
  content: "✓ ";
  color: #4caf50;
  font-weight: bold;
  margin-right: 8px;
}

/* === COLONNE SIDEBAR === */
.detail-sidebar-column {
  grid-area: sidebar;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.detail-info-card {
  width: 100%;
  height: fit-content;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  gap: clamp(0.875rem, calc(0.423rem + 0.903vw), 1.25rem);
  background: #f5f5f5;
  border: 3px solid #000;
  padding: clamp(1.125rem, calc(0.673rem + 0.903vw), 1.5rem);
}

.detail-info-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.detail-info-label {
  font-size: 12px;
  color: #888;
  text-transform: uppercase;
  font-weight: bold;
  letter-spacing: 0.5px;
}
.detail-info-value {
  font-size: clamp(0.875rem, calc(0.694rem + 0.361vw), 1rem);
  color: #333;
  font-weight: 500;
}
.detail-tags {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.detail-tag {
  width: fit-content;
  padding: 6px 12px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 15px;
  font-size: 12px;
  color: #555;
}
.detail-quote-button {
  display: none;
}

.detail-back-button {
  width: 100%;
  padding: 10px 20px;
  font-family: Arial, sans-serif;
  color: #000;
  font-size: 1rem;
  background: #fff;
  border: 2px solid #000;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}
.detail-back-button:hover {
  background: #000;
  color: #fff;
}

/* === LIGHTBOX === */
.image-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.image-lightbox.active {
  opacity: 1;
  visibility: visible;
}
.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-image {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border: 4px solid #fff;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}
.lightbox-video {
  width: 80vw;
  height: 60vh;
  max-width: 1200px;
  border: 4px solid #fff;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 3px solid #000;
  border-radius: 50%;
  font-size: 28px;
  font-weight: bold;
  color: #000;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10001;
}
.lightbox-close:hover {
  background: #000;
  color: #fff;
  transform: rotate(90deg);
}
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10000;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 3px solid #000;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
  font-size: 32px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}
.lightbox-nav:hover {
  background: #000;
  color: #fff;
  transform: translateY(-50%) scale(1.1);
}
.lightbox-nav.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}
.lightbox-prev {
  left: 40px;
}
.lightbox-next {
  right: 40px;
}
.lightbox-counter {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 20px;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid #000;
  border-radius: 20px;
  font-size: 14px;
  font-weight: bold;
  color: #333;
}

/* === RESPONSIVE (Mobile) === */
@media (max-width: 1024px) {
  .project-detail-wrapper {
    display: flex;
    flex-direction: column;
    grid-template-areas: none;
    grid-template-columns: 1fr;
    grid-template-rows: none;
    gap: 20px;
    transform: translateY(0);
    max-width: unset;
    padding-top: 30px;
    padding-bottom: 30px;
  }
  .project-detail-wrapper.visible {
    transform: translateY(0);
  }

  .detail-title {
    order: 1;
  }
  .detail-images-column {
    order: 2;
  }
  .detail-content-column {
    order: 3;
  }
  .detail-sidebar-column {
    order: 4;
  }

  .detail-images-column,
  .detail-content-column,
  .detail-sidebar-column,
  .detail-title {
    flex: 1 1 100%;
    width: 100%;
    padding: 0;
    align-self: auto;
  }

  .detail-images-column,
  .detail-content-column,
  .detail-info-card {
    padding: 12px;
  }

  .detail-title {
    padding: 0 15px;
    font-size: 1.8rem;
  }

  .detail-description,
  .detail-features li,
  .detail-info-value {
    font-size: unset;
  }

  .detail-info-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto;
    gap: 20px;
    padding: 20px;
  }

  .detail-info-block[data-item="client"],
  .detail-info-block[data-item="duration"],
  .detail-info-block[data-item="year"] {
    grid-column: 1;
  }
  .detail-info-block[data-item="tags"] {
    grid-column: 2;
    grid-row: 1 / span 3;
  }

  .detail-tags {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 5px;
    align-content: flex-start;
  }
  .detail-tag {
    padding: 4px 8px;
    font-size: 11px;
  }

  .detail-thumbnails {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }
  .detail-back-button {
    width: 100%;
    text-align: center;
    margin-top: 10px;
  }
  .detail-sidebar-column {
    margin-left: 15px;
    margin-right: 15px;
    width: calc(100% - 30px);
  }

  .lightbox-nav {
    width: 50px;
    height: 50px;
    font-size: 24px;
  }
  .lightbox-prev {
    left: 10px;
  }
  .lightbox-next {
    right: 10px;
  }
  .lightbox-close {
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    font-size: 24px;
  }
}

@media (max-width: 500px) {
  .detail-thumbnails {
    gap: 8px;
    grid-template-columns: repeat(3, 1fr);
  }
  .lightbox-video {
    width: 95vw;
    height: auto;
    aspect-ratio: 16/9;
  }
  .lightbox-nav {
    display: none;
  }
  .lightbox-counter {
    bottom: 10px;
  }
}
