/* ======= GALLERY MAIN LAYOUT ======= */
.gallery-main {
  display: flex;
  gap: 1.5rem;
  padding-left: 3rem;
  padding-right: 3rem;
  box-sizing: border-box;
  height: calc(100vh - 128px);
}

.gallery-left, .gallery-right {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* ======= FEATURE TILE ======= */
.gallery-feature-tile {
  position: relative;
  width: 100%;
  height: 100%;
  background-image: url('../images/DLHID1.jpg');
  background-size: cover;
  background-position: center;
  border-radius: 25px;
  overflow: hidden;
  display: block;
  text-decoration: none;
}

.gradient-overlay {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 20%;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
  z-index: 1;
}

.tile-title {
  font-weight: 400;
  position: absolute;
  bottom: 1rem;
  left: 1.5rem;
  color: white;
  font-size: 2.5rem;
  z-index: 2;
}

.tile-button {
  font-family: Calibri;
  position: absolute;
  display: flex;
  bottom: 1rem;
  right: 1rem;
  width: 60px;
  height: 60px;
  justify-content: center;
  align-items: center;
  background: rgba(255, 255, 255, 0.95);
  color: black;
  border-radius: 50%;
  font-size: 2rem;
  cursor: pointer;
  z-index: 2;
  transition: 0.3s;
}

.tile-button:hover {
  background-color: rgba(0, 0, 0, 0.95);
  color: white;
}

@keyframes pulseColors {
  0%, 100% {
    background-color: rgba(0, 0, 0, 0.85);
    color: white;
  }
  50% {
    background-color: rgb(255, 255, 255);
    color: black;
  }
}

.overlay-text {
  position: absolute;
  top: 15px;        /* distance from top */
  right: 15px;      /* distance from right */
  background-color: rgba(0, 0, 0, 0.85); /* semi-transparent background */
  color: white;
  padding: 5px 10px;
  border-radius: 15px;
  font-size: 14px;
  font-weight: bold;
  pointer-events: none; /* optional: so text doesn't interfere with clicks */
  animation: pulseColors 3s ease-in-out infinite; /* 2 seconds loop, infinite */
}


/* ======= SCROLLABLE STRIP ======= */
.gallery-strip {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  height: 100%;
  align-items: stretch;
  scrollbar-width: thin;
  scrollbar-color: #000000 transparent;
  position: relative;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory; /* enable horizontal snap */
  -webkit-overflow-scrolling: touch; /* smooth scrolling on iOS */
}

.gallery-strip::-webkit-scrollbar {
  height: 8px;
  background: transparent;
  transition: opacity 0.3s;
  opacity: 0;
  position: absolute;
}

.gallery-strip:hover::-webkit-scrollbar {
  opacity: 1;
}

.gallery-strip::-webkit-scrollbar-thumb {
  background: #aaa;
  border-radius: 4px;
}

.project-thumb {
  flex: 0 0 auto;
  width: calc(50% - 0.75rem);
  height: 100%;
  position: relative;
  border-radius: 15px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: start;     /* snap to the start of each image */
  object-fit: cover;            /* scale images nicely */
  border-radius: 25px;           /* optional styling */
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 25px;
}

.hover-tile {
  position: relative;
}

.hover-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('../images/Overlay.jpg');
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.hover-tile:hover .hover-overlay {
  opacity: 0.8;
}

project-thumb:hover {
  background-image: url('../images/Overlay.jpg');
  background-size: cover;
  background-position: center;
}

.gallery-right {
  position: relative;
}

.carousel-button {
  font-family: Calibri;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.9);
  color: black;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: all 0.3s;
}

.carousel-button:hover {
  color: white;
  background: rgba(0, 0, 0, 0.9);
  opacity: 1;
}

#carouselPrev {
    left: 10px;
}

#carouselNext {
    right: 10px;
}


@media (max-width: 810px) {
  .gallery-main {
    flex-direction: column;
    gap: 2rem;
    padding-left: 2rem;
    padding-right: 2rem;
    height: auto;
    min-height: 0;
    overflow: visible;

  }
  .carousel-button {
    display: none !important;
  }

  .gallery-left, .gallery-right {
    width: 100%;
    height: auto;
    flex: none;
  }

  .gallery-feature-tile {
    height: 55vh;
    border-radius: 15px;
  }

  .tile-button {
    display: none;
  }

  .tile-title {
    font-size: 1.8rem;
  }

  .gallery-strip {
    flex-direction: column;
    gap: 2rem;
    overflow-x: hidden;
    overflow-y: visible;
    height: auto;
  }

  .project-thumb {
    width: 100%;
    height: 35vh;
    border-radius: 15px;
  }

  .project-thumb img {
    border-radius: 15px;
  }
}