/* ============================================
   GALLERY — CURVED CONTINUOUS CAROUSEL
   ============================================ */

.gallery {
  padding: 5rem 0 4rem;
  overflow: hidden;
}

.gallery-header {
  text-align: center;
  margin-bottom: 2rem;
}

/* --------------------------------------------
   CAROUSEL
   -------------------------------------------- */

.gallery-carousel-wrapper {
  width: 100%;
  overflow: hidden;
  position: relative;
}

.gallery-carousel-wrapper::before,
.gallery-carousel-wrapper::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 220px;
  z-index: 8;
  pointer-events: none;
}

.gallery-carousel-wrapper::before {
  left: 0;
  background: linear-gradient(to right, #fff 0%, rgba(255,255,255,0) 100%);
}

.gallery-carousel-wrapper::after {
  right: 0;
  background: linear-gradient(to left, #fff 0%, rgba(255,255,255,0) 100%);
}

/* --------------------------------------------
   TRACK
   -------------------------------------------- */

.gallery-track {
  display: flex;
  align-items: center;
  gap: 2.5rem;

  width: max-content;

  /* χώρος για το "κατέβασμα" των ακριανών καρτών */
  padding: 3rem 0 7rem;

  animation: galleryMove 38s linear infinite;
  will-change: transform;
}

.gallery-carousel-wrapper:hover .gallery-track {
  animation-play-state: paused;
}

/* όταν τρέχει το gallery.js, η κίνηση γίνεται από εκεί */
.gallery-track.js-scroll { animation: none; }

/* --------------------------------------------
   ΒΕΛΑΚΙΑ
   -------------------------------------------- */

.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--gold-light);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font-size: 1.6rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  transition: background 0.2s, color 0.2s, transform 0.15s;
}
.gallery-arrow:hover { background: var(--gold); color: #fff; }
.gallery-arrow:active { transform: translateY(-50%) scale(0.92); }
.gallery-arrow-prev { left: 2rem; }
.gallery-arrow-next { right: 2rem; }

@media (max-width: 600px) {
  .gallery-arrow { width: 42px; height: 42px; font-size: 1.3rem; }
  .gallery-arrow-prev { left: 0.75rem; }
  .gallery-arrow-next { right: 0.75rem; }
}

/* --------------------------------------------
   CARDS
   -------------------------------------------- */

.gallery-card {
  flex: 0 0 320px;
  height: 250px;

  border-radius: 18px;
  overflow: hidden;
  background: #f4f4f2;

  box-shadow: 0 18px 45px rgba(0,0,0,0.14);

  /* ΠΡΟΣΟΧΗ: καμία transition στο transform —
     το transform ανανεώνεται κάθε frame από το JS */
  transition: box-shadow 0.4s ease;

  transform-origin: 50% 50%;
  backface-visibility: hidden;
  position: relative;
}

.gallery-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.gallery-card:hover {
  box-shadow: 0 30px 65px rgba(0,0,0,0.2);
}

.gallery-card:hover img {
  transform: scale(1.06);
}

/* --------------------------------------------
   FALLBACK (αν δεν φορτώσει το gallery.js)
   -------------------------------------------- */

.gallery-track:not(.curve-on) .card-1 { transform: rotate(-2deg); }
.gallery-track:not(.curve-on) .card-2 { transform: rotate(1.5deg); }
.gallery-track:not(.curve-on) .card-3 { transform: rotate(-1deg); }
.gallery-track:not(.curve-on) .card-4 { transform: rotate(2deg); }
.gallery-track:not(.curve-on) .card-5 { transform: rotate(-1.5deg); }
.gallery-track:not(.curve-on) .card-6 { transform: rotate(1deg); }
.gallery-track:not(.curve-on) .card-7 { transform: rotate(-2deg); }

/* --------------------------------------------
   INFINITE MOVEMENT
   -------------------------------------------- */

@keyframes galleryMove {
  from { transform: translateX(0); }
  to   { transform: translateX(calc(-50% - 1.25rem)); }
}

/* --------------------------------------------
   RESPONSIVE
   -------------------------------------------- */

@media (max-width: 900px) {
  .gallery { padding: 4rem 0 3rem; }

  .gallery-card {
    flex-basis: 280px;
    height: 220px;
  }

  .gallery-track {
    gap: 2rem;
    padding: 2.5rem 0 5rem;
  }

  .gallery-carousel-wrapper::before,
  .gallery-carousel-wrapper::after { width: 100px; }
}

@media (max-width: 600px) {
  .gallery { padding: 3.5rem 0 2.5rem; }
  .gallery-header { margin-bottom: 1.5rem; }

  .gallery-card {
    flex-basis: 250px;
    height: 195px;
    border-radius: 14px;
  }

  .gallery-track {
    gap: 1.25rem;
    padding: 2rem 0 3.5rem;
  }

  .gallery-carousel-wrapper::before,
  .gallery-carousel-wrapper::after { width: 50px; }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-track { animation: none; }
}
/* ============================================
   GALLERY ZOOM MODAL
   ============================================ */

.gallery-zoom-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.gallery-zoom-modal.active {
  opacity: 1;
  visibility: visible;
}

.gallery-zoom-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-zoom-img {
  width: 100%;
  height: 100%;
  max-width: 1200px;
  max-height: 800px;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.5);
  animation: zoomInImage 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes zoomInImage {
  from {
    opacity: 0;
    transform: scale(0.7);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.gallery-zoom-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.5);
  color: white;
  font-size: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 1000;
  line-height: 1;
  padding: 0;
}

.gallery-zoom-close:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.8);
  transform: scale(1.1);
}

@media (max-width: 600px) {
  .gallery-zoom-close {
    width: 45px;
    height: 45px;
    font-size: 28px;
    top: 15px;
    right: 15px;
  }

  .gallery-zoom-img {
    max-height: 85vh;
  }
}
