/**
 * Блок «Travaux des participants»: карусель и лайтбокс (js/works-gallery.js).
 */

@media (max-width: 480px) {
  .modal-next {
    background: #134fa9 !important;
  }
  .modal-prev {
    background: #134fa9 !important;
  }
}

.carousel-container {
  background: white;
  padding: 0 40px;
  width: 100%;
  margin-bottom: 4%;
}

.carousel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4%;
  width: 100%;
}

.carousel-title {
  text-align: left;
  padding: 4px 12px 6px;
  background: #134fa9;
  border-radius: 4px;
  color: #fff;
  display: inline-block;
  font-weight: 600 !important;
  font-size: 24px !important;
  line-height: 1.1;
  margin: 0;
  margin-bottom: 0px;
  font-family: "Gilroy", sans-serif;
}

.carousel-controls {
  display: flex;
  gap: 8px;
}

.carousel-btn {
  width: 44px;
  height: 44px;
  border: none;
  background: #f0f0f0;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-size: 18px;
  color: #666;
}

.carousel-btn:hover {
  background: #e0e0e0;
  color: #333;
}

.carousel-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.carousel-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
}

.carousel-track {
  display: flex;
  transition: transform 0.3s ease;
  gap: 16px;
}

.carousel-slide {
  flex: 0 0 auto;
  width: 300px;
  height: 350px;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  position: relative;
}

.carousel-slide:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

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

.carousel-slide::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0);
  transition: background 0.3s ease;
  pointer-events: none;
}

.carousel-slide:hover::after {
  background: rgba(0, 0, 0, 0.1);
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  max-width: 50vw;
  max-height: 90vh;
  position: relative;
}

.modal-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.modal-close {
  position: absolute;
  top: -40px;
  right: 0;
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  color: #333;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
}

.modal-close:hover {
  background: white;
}

@media (max-width: 768px) {
  .carousel-container {
    width: 100%;
    padding: 0% 5% 4% 5%;
  }
  .carousel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10%;
    width: 100%;
  }
  .carousel-title {
    font-size: 20px !important;
  }
  .carousel-slide {
    width: 250px;
    height: 250px;
  }
  .carousel-controls {
    display: none;
  }
}

@media (max-width: 480px) {
  .carousel-slide {
    width: 200px;
    height: 200px;
  }
}

@media (max-width: 768px) {
  .modal-content {
    max-width: 95%;
    max-height: 90%;
    position: relative;
  }
  .modal-close {
    position: absolute;
    top: -0px;
    width: 42px;
    height: 42px;
    background: #134fa9;
    color: #ffffff;
    border-radius: 50%;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}
