/* Gallery Page Styles */

body {
  background-color: #0f1013;
}

/* Gallery Container */
.photo-gallery {
  padding: 2rem 5vw 5rem;
  max-width: 1900px;
  margin: 0 auto;
  margin-top: clamp(0.5rem, 2vh, 1.5rem);
}

/* Gallery Title */
.gallery-title {
  text-align: left;
  font-size: clamp(2rem, 5vw, 3.5rem); /* Responsive font size */
  margin-top: clamp(1rem, 3vh, 2rem); /* Reduced top margin */
  margin-bottom: clamp(0.5rem, 1.5vh, 1rem); /* Reduced bottom margin */
  padding-left: 2vw; /* Align with gallery padding */
  max-width: 1900px; /* Match gallery max-width */
  margin-left: auto;
  margin-right: auto;
}

/* Gallery Filters */
.gallery-filters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  gap: 1rem;
}

.filter-btn {
  display: none !important;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  padding: 0.5rem 1.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: all 0.3s ease;
}

.filter-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.filter-btn.active {
  background: #fff;
}

/* Gallery Grid - Modern Masonry Layout */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  grid-auto-rows: 260px; /* Increased by 30% from 200px */
  gap: 20px;
  padding: 20px 0;
  max-width: 1400px;
  margin: 0 auto;
  margin-top: rem;
  justify-content: center;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  cursor: pointer;
  background: #000;
}

.gallery-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}

/* Aspect Ratio Classes */
.gallery-item.horizontal {
  grid-column: span 2;
  grid-row: span 1;
}

.gallery-item.vertical {
  grid-column: span 1;
  grid-row: span 2;
}

.gallery-item.square {
  grid-column: span 1;
  grid-row: span 1;
}

.gallery-item.large {
  grid-column: span 2;
  grid-row: span 2;
}

.gallery-item-img {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

footer {
  display: block !important;
  opacity: 1 !important;
}

.gallery-item.show {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

.gallery-item:active {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}



.gallery-item-img-inner {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}

.gallery-item:hover .gallery-item-img-inner {
  transform: scale(1.08);
}

.gallery-item-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 1rem;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
  color: #fff;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-item-caption {
  transform: translateY(0);
}

.gallery-item-caption h3 {
  margin: 0 0 0rem 0;
  font-size: 0.6rem;
}

.gallery-item-caption span {
  font-size: 0.45rem;
  font-family: 'Courier New', Courier, monospace;
  opacity: 0.8;
}

.lightbox-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  z-index: 1000;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox-modal.active {
  display: block;
  opacity: 1;
}

.lightbox-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) translateY(20px);
  max-width: 90%;
  max-height: 90%;
  text-align: center;
  transition: transform 0.4s ease;
}

.lightbox-modal.active .lightbox-content {
  transform: translate(-50%, -50%) translateY(0);
}

.lightbox-img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
  transition: opacity 0.3s ease;
}

.lightbox-caption {
  color: white;
  margin-top: 20px;
  text-align: center;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  transition-delay: 0.2s;
}

.lightbox-modal.active .lightbox-caption {
  opacity: 1;
  transform: translateY(0);
}

.lightbox-caption h3 {
  font-size: 1.5rem;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.lightbox-caption span {
  font-size: 1rem;
  opacity: 0.8;
  display: block;
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.8);
}

.lightbox-close, .lightbox-prev, .lightbox-next {
  position: absolute;
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  opacity: 0.7;
  z-index: 1010;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  text-decoration: none;
}

.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover {
  background-color: rgba(0, 0, 0, 0.8);
  opacity: 1;
  transform: scale(1.1);
}

.lightbox-close:active, .lightbox-prev:active, .lightbox-next:active {
  transform: scale(0.95);
}

.lightbox-close {
  top: 20px;
  right: 20px;
}

.lightbox-prev {
  top: 50%;
  left: 20px;
  transform: translateY(-50%);
}

.lightbox-prev:hover {
  transform: translateY(-50%) scale(1.1);
}

.lightbox-prev:active {
  transform: translateY(-50%) scale(0.95);
}

.lightbox-next {
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
}

.lightbox-next:hover {
  transform: translateY(-50%) scale(1.1);
}

.lightbox-next:active {
  transform: translateY(-50%) scale(0.95);
}

/* Add arrow icons to navigation buttons */
.lightbox-prev::before,
.lightbox-next::before {
  content: '';
  display: block;
  width: 15px;
  height: 15px;
  border-top: 3px solid white;
  border-left: 3px solid white;
}

.lightbox-prev::before {
  transform: rotate(-45deg);
  margin-left: 5px;
}

.lightbox-next::before {
  transform: rotate(135deg);
  margin-right: 5px;
}

/* Responsive Adjustments */
@media (max-width: 1440px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 15px;
  }
  
  .gallery-item.horizontal,
  .gallery-item.large {
    grid-column: span 1;
  }
  
}

@media (max-width: 488px) {
  .photo-gallery {
    padding: 1rem 1vw 3rem;
    margin-top: clamp(0.3rem, 1vh, 1rem);
  }
  
  .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    grid-auto-rows: 180px;
    gap: 12px;
  }
  
  .gallery-item.horizontal,
  .gallery-item.vertical,
  .gallery-item.large {
    grid-column: span 1;
    grid-row: span 1;
  }
  
  .lightbox-content {
    width: 95%;
    margin: 5% auto;
  }
  
  .lightbox-prev,
  .lightbox-next {
    font-size: 1.5rem;
    padding: 0.5rem;
  }
  
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: 180px;
    gap: 10px;
  }
  
  .filter-btn {
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
  }
  
  .gallery-item {
    border-radius: 8px;
  }
}

/* Mobile font size fixes to prevent text from becoming too small */
@media (max-width: 767px) {
  .gallery-item-caption {
    font-size: max(12px, 0.8rem) !important;
  }
  
  .gallery-item-caption span {
    font-size: max(11px, 0.7rem) !important;
  }
  
  /* Ensure all small fonts have minimum readable sizes, but exclude headings and title elements */
  p, span, a, li, button, input, textarea, label, div:not(.hidcontent__title):not(.feature-header):not(.feature-head):not(.hyper):not(.font-12) {
    font-size: max(11px, 1em) !important;
  }
  
  .filter-btn {
    font-size: max(12px, 0.8rem) !important;
  }
}