/* === GALLERY === */
.gallery {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap; /* allows stacking on smaller screens */
  gap: 2rem;
  padding: 0 1rem 4rem;
}

.gallery h1 {
  font-size: 1.8rem;
  margin: 0 auto 1rem;
  color: #15143E;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: table;
  background: white;
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  border-bottom: 3px solid #15143E;
}

.gallery-container {
  position: relative;
  flex: 1 1 45%;
  max-width: 600px;
  height: 500px;
  padding: 2rem 4rem;
  text-align: center;
  overflow: hidden;
}

.gallery-container img {
  width: 100%;
  height: 90%;
  max-width: 800px;
  display: none;
  margin: 0 auto;
  border-radius: 8px;
  object-fit: cover;  /* crop image instead of squishing */
}

.gallery-container img.active {
  display: block;
}

.gallery-container .arrow {
  position: absolute;
  top: 50%;
  transform: translateY(+20%);
  color: #15143E;
  font-size: 4rem;
  cursor: pointer;
  user-select: none;
  z-index: 5;
  transition: color 0.3s ease;
}

.gallery-container .arrow:hover {
  color: #29C86C;
}

.gallery-container .arrow.left {
  left: 10px;
}

.gallery-container .arrow.right {
  right: 10px;
}


/* === Gallery Videos === */
.gallery-container video {
  width: 100%;
  max-width: 800px;
  max-height: 90%;
  height: auto;
  display: none;
  margin: 0 auto;
  border-radius: 8px;
  background: black; /* avoids white edges when aspect ratio differs */
  object-fit: contain; /* keeps video centered and fully visible */
}

.gallery-container video.active {
  display: block;
}


/* === BEFORE & AFTER SECTION === */
.before-after-slider {
  position: relative;
  width: 85%;
  margin: 2rem auto;
}

.before-after-inner {
  overflow: hidden;
}

.before-after-row {
  display: flex;
  transition: transform 0.6s ease;
}

.before-after-card {
  flex: 0 0 33.333%;
  padding: 1rem;
  box-sizing: border-box;
  cursor: pointer;
}

.image-wrapper {
  position: relative;
  width: 100%;
  height: 300px;
  overflow: hidden;
  border-radius: 10px;
}

.image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  transition: opacity 1s ease-in-out;
}

.image-wrapper img.before {
  opacity: 1;
  z-index: 2;
}

.image-wrapper img.after {
  opacity: 0;
  z-index: 1;
}

.click-text {
  position: absolute;
  top: 50px;
  left: 10px;
  background: rgba(21, 20, 62, 0.7);
  color: #fff;
  font-size: 1rem;
  padding: 4px 10px;
  border-radius: 5px;
  z-index: 10;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.label {
  position: absolute;
  top: 10px;
  background: rgba(21, 20, 62, 0.8);
  color: white;
  font-weight: bold;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 1.5rem;
  z-index: 5;
}

.before-label, .after-label {
  transition: opacity 1s ease;
  left: 10px;
}

/* Remove hover effects completely */
.image-wrapper:hover img.before,
.image-wrapper:hover img.after,
.image-wrapper:hover .before-label,
.image-wrapper:hover .after-label {
  opacity: 1;
  display: block;
}


/* Arrows */
#beforeAfterSection .arrow {
  position: absolute;
  font-size: 4rem;
  top: 50%;
  transform: translateY(-50%);
  color: #15143E;
  cursor: pointer;
  z-index: 10;
}

#beforeAfterSection .arrow.left {
  left: -50px;
}

#beforeAfterSection .arrow.right {
  right: -50px;
}

#beforeAfterSection .arrow:hover {
  color: #29C86C;
}



@media (max-width: 700px) {

  /* === BEFORE & AFTER SECTION === */
  .before-after-card {
    flex: 0 0 100%;
    padding: 0.5rem 1.5rem;
  }

  .image-wrapper {
    width: 100%;
    height: 250px;
    border-radius: 10px;
  }

  #beforeAfterSection .arrow {
    font-size: 2.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: #15143E;
    border-radius: 50%;
    padding: 0.3rem 0.6rem;
    z-index: 20;
  }

  #beforeAfterSection .arrow.left {
    left: -20px;
  }

  #beforeAfterSection .arrow.right {
    right: -20px;
  }


  /* === GALLERY SECTION === */
  .gallery {
    flex-direction: column;
    align-items: center;
  }

  .gallery h1 {
    font-size: 1.4rem;
    padding: 0.7rem 1.5rem;
  }

  .gallery-container {
    flex: 0 0 auto;
    width: 95%;
    max-width: 400px;
    height: auto;
    padding: 0 1rem;
  }

  .gallery-container img,
  .gallery-container video {
    width: 90%;
    height: 250px;
    object-fit: cover;
    border-radius: 10px;
  }

  .gallery-container .arrow {
    font-size: 2.5rem;
    top: 50%;
    transform: translateY(-290%);
    color: #15143E;
    border-radius: 50%;
    padding: 0.1rem 0.9rem;
    z-index: 20;
  }

  .gallery-container .arrow.left {
    left: 10px;
  }

  .gallery-container .arrow.right {
    right: 10px;
  }

  .gallery-container .arrow:hover {
    color: #15143E;
  }
}


/* === MODAL BASE === */
.img-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  justify-content: center;
  align-items: center;
  cursor: zoom-out;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease;
  overflow: hidden;
}

.img-modal.show {
  display: flex;
  opacity: 1;
}

#imgModalContent {
  max-width: 90%;
  max-height: 90%;
  border-radius: 6px;
  transition: transform 0.3s ease;
  transform: scale(1);
  touch-action: none;
}

.img-modal.show #imgModalContent.zoomed {
  transform: scale(1.5);
}

/* Arrows */
.zoom-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
  color: white;
  cursor: pointer;
  user-select: none;
  padding: 0.5rem 1rem;
  opacity: 0.8;
  z-index: 10000;
  transition: opacity 0.2s ease;
}

.zoom-arrow:hover {
  opacity: 1;
}

.zoom-arrow.left {
  left: 2%;
}

.zoom-arrow.right {
  right: 2%;
}

/* Exit Button */
.zoom-exit {
  position: absolute;
  top: 20px;
  right: 25px;
  font-size: 2.4rem;
  color: white;
  cursor: pointer;
  user-select: none;
  z-index: 10001;
  transition: opacity 0.2s ease;
}

.zoom-exit:hover {
  opacity: 1;
}
