/* Reset & Base */
* {
  box-sizing: border-box;
  border-radius: 0 !important;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background-color: white;
  font-family: 'Space Grotesk', sans-serif;
  overflow-x: hidden;
}

/* Background Canvas */
#gridCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
}

/* Main Layout */
body {
  display: flex;
  flex-direction: row;
  min-height: 100vh;
}

/* Columns */
.left-column,
.center-column,
.right-column {
  position: relative;
  z-index: 1;
}

.left-column {
  flex: 0 0 28%;
  padding: 4rem;
  font-size: 1rem;
  line-height: 1.2;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 100vh;
}

.center-column {
  flex: 0 0 52%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  max-height: 100vh;
  overflow-y: auto;
  padding: 2rem 0;
}

.right-column {
  flex: 0 0 20%;
  padding: 4rem 1rem 4rem 4rem;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Scrollbars */
.center-column::-webkit-scrollbar {
  width: 8px;
}

.center-column::-webkit-scrollbar-thumb {
  background: #ccc;
}

.center-column::-webkit-scrollbar-track {
  background: #f1f1f1;
}

/* Typography */
h1 {
  font-weight: 700;
  font-size: 2rem;
  margin: 0 0 0.5rem 0;
  text-align: left;
}

h2 {
  font-weight: 700;
  font-size: 0.85rem;
  margin: 0 0 0.5rem 0;
  text-align: left;
  font-style: italic;
}

.name-title {
  font-weight: 700;
  font-size: 2rem;
  margin: 0 0 1rem 0;
}

/* Image Wrapper */
.image-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
  max-width: 600px;
  cursor: pointer;
  margin-bottom: 2rem;
  text-decoration: none;
}

.image-wrapper img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  transition: filter 0.3s ease;
}

.image-wrapper:hover img {
  filter: brightness(70%);
}

.image-title {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 3rem;
  font-weight: 700;
  text-align: center;
  pointer-events: none;
  user-select: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}

.image-wrapper:hover .image-title {
  opacity: 1;
}

/* PDF Links */
.pdf-link {
  display: inline-block;
  width: 24px;
  height: 24px;
  margin-left: 0.5rem;
  cursor: pointer;
  vertical-align: middle;
}

.pdf-link img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Footer */
.adagp-credit {
  margin-top: auto;
  font-size: 0.9rem;
  color: #666;
  text-align: center;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(255, 255, 255, 0.95);
  z-index: 1000;
  overflow: auto;
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.modal-content {
  position: relative;
  background: white;
  width: 100%;
  max-width: 1400px;
  max-height: 90vh;
  display: flex;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}

/* Bouton de fermeture unifié */
.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #ddd;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: bold;
  color: #333;
  z-index: 1001;
  transition: all 0.2s ease;
  user-select: none;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 1);
  color: #000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.modal-close::before {
  content: '×';
  line-height: 1;
}

/* MODAL CV - UNE SEULE COLONNE */
.modal#modalcv .modal-content {
  max-width: 900px;
  width: 95%;
  height: 85vh;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.modal#modalcv h2 {
  font-size: 1.5rem;
  margin: 0;
  padding: 1.5rem 2rem 1rem 2rem;
  background: white;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
}

/* MODAL TEXTES */
.modal#modaltextes .modal-content {
  max-width: 900px;
  width: 95%;
  height: 85vh;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.modal#modaltextes h2 {
  font-size: 1.5rem;
  margin: 0;
  padding: 1.5rem 2rem 1rem 2rem;
  background: white;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
}

.cv-columns {
  display: flex;
  flex: 1;
  min-height: 0;
  background: white;
  justify-content: center;
  overflow: hidden;
}

.cv-column {
  width: 100%;
  max-width: 100%;
  background: white;
  overflow-y: auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.cv-column::-webkit-scrollbar {
  width: 8px;
}

.cv-column::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

.cv-column::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.modal-left {
  flex: 0 0 400px;
  padding: 2rem;
  overflow-y: auto;
  background: white;
}

.modal-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: white;
  overflow: hidden;
  padding: 1rem;
  min-height: 0;
  max-height: 100%;
}

/* Carousel wrapper & images */
.carousel-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  margin: 0 auto;
  background: white;
  position: relative;
  overflow: hidden;
  min-height: 0;
  max-height: 100%;
}

.carousel-images {
  display: flex;
  transition: transform 0.4s ease;
  width: max-content;
  height: 100%;
  align-items: center;
  user-select: none;
  will-change: transform;
  min-height: 0;
  max-height: 100%;
}

.carousel-images img {
  flex-shrink: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  max-width: 100%;
  max-height: 100%;
}

/* Chaque élément du carousel doit prendre toute la largeur disponible */
.carousel-images > * {
  width: 100%;
  flex-shrink: 0;
}

/* Video container */
.video-container {
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
  overflow: hidden;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  height: 450px;
  max-height: 70vh;
}

.video-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  max-width: 100%;
  max-height: 100%;
}

.video-container iframe {
  border: none;
  pointer-events: auto !important;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.play-button:hover {
  background: rgba(255, 255, 255, 1);
}

.play-button::before {
  content: '';
  width: 0;
  height: 0;
  border-left: 20px solid #000;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  margin-left: 4px;
}

.video-container.ratio-4-3 {
  height: 600px;
}

.video-container.ratio-1-1 {
  height: 800px;
  max-height: 60vh;
}

.video-container.ratio-21-9 {
  height: 343px;
}

/* Video thumbnail */
.video-thumbnail {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 1; /* pour rester sous le bouton play */
}




/* Carousel navigation buttons */
.prev-btn,
.next-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.9);
  border: none;
  font-size: 24px;
  font-weight: bold;
  color: #000;
  cursor: pointer;
  padding: 10px;
  user-select: none;
  transition: opacity 0.3s ease;
  z-index: 10;
  min-width: 40px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.prev-btn:hover,
.next-btn:hover {
  opacity: 0.7;
  background: rgba(255, 255, 255, 1);
}

.prev-btn { left: 10px; }
.next-btn { right: 10px; }

/* Accordéon CV */
.modal#modalcv .accordion-header {
  padding: 1rem 0;
  cursor: pointer;
  user-select: none;
  transition: color 0.2s ease;
  font-size: 1rem !important;
  font-weight: 700;
  margin: 0 !important;
  position: relative;
}

.modal#modalcv .accordion-header:hover {
  color: #666;
}

.modal#modalcv .accordion-header::after {
  content: '+';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  transition: transform 0.2s ease;
}

.modal#modalcv .accordion-header.active::after {
  content: '−';
  transform: translateY(-50%) rotate(0deg);
}

.modal#modalcv .accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.modal#modalcv .accordion-content.active {
  max-height: 1000px;
  padding-bottom: 1rem;
}

.modal#modalcv .accordion-content p {
  margin: 0;
  line-height: 1.5;
  font-size: 0.9rem;
}

/* Styling modaltextes */
.modal#modaltextes .cv-column {
  padding: 2rem;
}

.modal#modaltextes .cv-column p {
  margin: 0;
  line-height: 1.5;
  font-size: 0.9rem;
  padding-bottom: 1rem;
}

.modal#modaltextes .cv-column h3,
.modal#modaltextes .cv-column h4,
.modal#modaltextes .cv-column h5,
.modal#modaltextes .cv-column h6 {
  padding: 1rem 0;
  font-size: 1rem !important;
  font-weight: 700;
  margin: 0 !important;
  font-family: 'Space Grotesk', sans-serif;
  transition: color 0.2s ease;
  cursor: default;
}

.modal#modaltextes .cv-column h3:hover,
.modal#modaltextes .cv-column h4:hover,
.modal#modaltextes .cv-column h5:hover,
.modal#modaltextes .cv-column h6:hover {
  color: #666;
}

.modal#modaltextes .cv-column h3 a,
.modal#modaltextes .cv-column h4 a,
.modal#modaltextes .cv-column h5 a,
.modal#modaltextes .cv-column h6 a {
  color: inherit;
  text-decoration: none;
}

.modal#modaltextes .cv-column h3 a:hover,
.modal#modaltextes .cv-column h4 a:hover,
.modal#modaltextes .cv-column h5 a:hover,
.modal#modaltextes .cv-column h6 a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 900px) {
  body {
    flex-direction: column;
  }

  .left-column,
  .center-column,
  .right-column {
    flex: none;
    width: 100%;
    padding: 1rem;
    min-height: auto;
  }

  .image-wrapper {
    width: 100%;
    max-width: 100%;
  }

  .image-title {
    font-size: 2rem;
  }

  .modal {
    padding: 1rem;
  }

  .modal.active {
    padding: 1rem;
  }

  .modal-content {
    flex-direction: column;
    max-height: 95vh;
    width: 100%;
    height: auto;
  }

  .modal-left {
    flex: none;
    width: 100%;
    max-height: 30vh;
    overflow-y: auto;
    padding: 1rem;
  }

  .modal-right {
    flex: none;
    width: 100%;
    height: 60vh;
    padding: 1rem;
  }

  .modal-close {
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    font-size: 18px;
  }
}
