/* ============================
   GALLERY PAGE STYLES
============================ */

.gallery-container {
  padding-top: 130px;
  padding-bottom: 100px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Intro Text Block at Top */
.gallery-intro-wrap {
  max-width: 520px;
  margin: 0 auto 50px auto;
  padding: 0 20px;
  font-size: 0.82rem;
  line-height: 1.5;
  color: #000;
}

.gallery-intro-wrap .copy-block {
  margin-bottom: 16px;
}

.gallery-intro-wrap .copy-block:last-child {
  margin-bottom: 0;
}

/* Horizontal Track Wrapper */
.gallery-scroll-wrap {
  position: relative;
  width: 100%;
}

/* Track & Image Strip */
.gallery-track {
  display: flex;
  gap: clamp(12px, 2vw, 24px); /* Gap shrinks smoothly with window size */
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 10px 0;
  
  /* Hide scrollbars cleanly */
  -ms-overflow-style: none;  
  scrollbar-width: none;  
}

.gallery-track::-webkit-scrollbar {
  display: none;
}

/* Individual Slide Items */
.gallery-item {
  position: relative;
  flex-shrink: 0;
  scroll-snap-align: center;
  
  /* Lock the height on the container */
  height: clamp(360px, 50vh, 520px); 
  
  /* CRITICAL: Let width fit the image tightly with zero phantom padding */
  width: max-content; 

  overflow: hidden;
  cursor: pointer;
}

/* Image fills the container height and calculates its own width */
.gallery-item img {
  display: block;
  height: 100%;
  width: auto;
  object-fit: cover;
}

/* Base Caption Style (Hidden by default) */
.gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 40px 20px 20px 20px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0) 100%);
  color: #fff;
  pointer-events: none;
  
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

/* Desktop Hover: Mouse devices only */
@media (hover: hover) {
  .gallery-item:hover .gallery-caption {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile Tap: Controlled purely by JS class */
.gallery-item.is-active .gallery-caption {
  opacity: 1;
  transform: translateY(0);
}

/* Title Styling */
.gallery-caption-title {
  font-family: "Gothic", sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  line-height: 1.2;
  margin: 0 0 6px 0;
  color: #ffffff;
  letter-spacing: 0.02em;
}

/* Body Text Styling */
.gallery-caption-text {
  font-size: 0.75rem;
  line-height: 1.4;
  margin: 0;
  color: #fff;
}

/* Floating Hand Arrow Navigation */
.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 10px;
  
  /* Smooth 0.3s cubic-bezier transition restores the soft desktop hover */
  transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}

.arrow-icon {
  width: 90px;
  height: auto;
  display: block;
  pointer-events: none;
}

.gallery-arrow-left {
  left: 15px;
}

.gallery-arrow-right {
  right: 15px;
}

/* Smooth Desktop Hover: Gently scales up without snapping */
@media (hover: hover) {
  .gallery-arrow:hover {
    transform: translateY(-50%) scale(1.12);
  }
}

/* ============================
   MOBILE RESPONSIVENESS
============================ */
@media (max-width: 700px) {
  .gallery-container {
    padding-top: 100px;
  }

  .gallery-intro-wrap {
    font-size: 0.8rem;
    margin-bottom: 30px;
  }

  .gallery-item {
    height: 360px;
    width: auto;
    /* Cap landscape photos so they don't stretch beyond screen bounds */
    max-width: 82vw; 
  }

  .gallery-item img {
    height: 100%;
    width: 100%;
    /* Covers container cleanly without distorting image proportions */
    object-fit: cover; 
    /* Remove any min-width from img here! */
  }

  /* Keep captions readable & scrollable on mobile */
  .gallery-caption {
    padding: 24px 14px 14px 14px;
    max-height: 75%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .gallery-caption-title {
    font-size: 0.8rem;
    margin-bottom: 4px;
  }

  .gallery-caption-text {
    font-size: 0.7rem;
    line-height: 1.35;
  }

  .arrow-icon {
    width: 75px;
  }

  .gallery-arrow-left {
    left: 5px;
  }

  .gallery-arrow-right {
    right: 5px;
  }

  .gallery-arrow:hover {
    transform: translateY(-50%);
  }

  .gallery-arrow:active {
    transform: translateY(-50%) scale(0.96);
    transition: transform 0.08s ease-out; /* Instant soft press */
  }
  
  .gallery-arrow {
    -webkit-tap-highlight-color: transparent;
  }
}