/* Gallery Styles - Codenera Website */
/* Dark theme matching the existing website aesthetic */

/* Gallery Section Styles */
.gallery-section {
  padding: 80px 0;
  background-color: var(--black);
  position: relative;
  overflow: hidden;
}

.gallery-container {
  max-width: 1348px;
  margin: 0 auto;
  padding: 0 24px;
}

.gallery-header {
  text-align: center;
  margin-bottom: 60px;
}

.gallery-title {
  font-size: 44px;
  font-weight: 600;
  color: var(--white);
  margin: 0 0 16px 0;
  line-height: 1.2;
}

.gallery-subtitle {
  font-size: 18px;
  color: rgba(238, 238, 238, 0.8);
  margin: 0;
  line-height: 1.5;
}

/* Gallery Grid Layout */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 300px);
  gap: 24px;
  position: relative;
}

/* Gallery Item Styles */
.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  background-color: #121212;
}

.gallery-item:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  z-index: 10;
}

/* Gallery Image Styles */
.gallery-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  display: block;
}

.gallery-item:hover .gallery-image {
  transform: scale(1.1);
}

/* Overlay Effect */
.gallery-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0));
  padding: 30px 24px 24px;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

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

.gallery-caption {
  color: var(--white);
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 8px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.gallery-category {
  color: rgba(238, 238, 238, 0.7);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 400;
}

/* Responsive Design */
@media (max-width: 768px) {
  .gallery-section {
    padding: 60px 0;
  }
  
  .gallery-title {
    font-size: 32px;
  }
  
  .gallery-grid {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, 250px);
    gap: 16px;
  }
  
  .gallery-item {
    height: 250px;
  }
  
  .gallery-overlay {
    padding: 20px 16px 16px;
  }
  
  .gallery-caption {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .gallery-section {
    padding: 40px 0;
  }
  
  .gallery-title {
    font-size: 28px;
  }
  
  .gallery-grid {
    gap: 12px;
  }
  
  .gallery-item {
    height: 200px;
  }
  
  .gallery-overlay {
    padding: 16px 12px 12px;
  }
  
  .gallery-caption {
    font-size: 14px;
  }
  
  .gallery-category {
    font-size: 12px;
  }
}

/* Animation for gallery items on scroll */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.gallery-item {
  animation: fadeInUp 0.6s ease-out;
}

/* Staggered animation for grid items */
.gallery-grid .gallery-item:nth-child(1) { animation-delay: 0.1s; }
.gallery-grid .gallery-item:nth-child(2) { animation-delay: 0.2s; }
.gallery-grid .gallery-item:nth-child(3) { animation-delay: 0.3s; }
.gallery-grid .gallery-item:nth-child(4) { animation-delay: 0.4s; }

/* Additional hover effects for better interactivity */
.gallery-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.05) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.gallery-item:hover::before {
  opacity: 1;
}

/* Focus styles for accessibility */
.gallery-item:focus {
  outline: 2px solid #3898ec;
  outline-offset: 2px;
}

/* Loading animation for images */
.gallery-image {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-image.loaded {
  opacity: 1;
}

/* Smooth transitions for the entire gallery section */
.gallery-section {
  transition: all 0.3s ease;
}

/* Ensure gallery integrates well with existing blur backgrounds */
.gallery-section::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 50% 50%, rgba(104, 104, 104, 0.1) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}