/* Art Gallery Specific Styles */

/* Gallery Header */
.gallery-header {
  padding: 100px 0 60px;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  text-align: center;
}

.gallery-header-content h1 {
  font-size: 3rem;
  font-weight: 700;
  color: #071b72;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.gallery-header-content p {
  font-size: 1.2rem;
  color: #6b7280;
  line-height: 1.6;
  max-width: 800px;
  margin: 0 auto;
}

/* Gallery Section */
.gallery-section {
  padding: 80px 0;
  background: white;
}

/* Gallery Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px 50px;
  margin-top: 2rem;
  max-width: 1400px;
}

/* Gallery Item */
.gallery-item {
  position: relative;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
  transition: box-shadow 0.3s ease;
  cursor: pointer;
  aspect-ratio: 1;
  min-height: 400px;
}

.gallery-item:hover {
  transform: none;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.18); /* elevate on hover */
}

.gallery-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

/* No zoom effect on grid hover */
.gallery-item:hover .gallery-image {
  transform: none;
}

/* Gallery Overlay */
.gallery-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 20px;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
  transform: translateY(0);
}

.gallery-overlay h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.gallery-overlay p {
  font-size: 0.9rem;
  opacity: 0.9;
  margin: 0;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  animation: fadeIn 0.3s ease;
}

.modal-content {
  position: relative;
  background-color: white;
  margin: 2% auto;
  width: 95%;
  max-width: 1200px;
  max-height: 90vh;
  border-radius: 8px;
  overflow: scroll;
  animation: slideIn 0.3s ease;
}

.close-btn {
  position: absolute;
  top: 15px;
  right: 25px;
  color: #666;
  font-size: 35px;
  font-weight: bold;
  cursor: pointer;
  z-index: 1001;
  background: rgba(255, 255, 255, 0.9);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 1);
  color: #071b72;
}

.modal-body {
  display: grid;
  grid-template-columns: 2fr 1fr;
  height: 80vh;
  min-height: 500px;
}

/* Artwork Display */
.artwork-display {
  position: relative;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  object-fit: inherit;
  height: 100%;
  height: inherit;
  overflow: hidden; /* keep zoom bounded by container */
}

#modalImage {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  height: auto;
  transition: transform 0.3s ease;
  user-select: none;
  cursor: zoom-in;
}

/* Modal zoom functionality handled via JS */

/* Navigation Buttons - Hidden */
.artwork-navigation {
  display: none;
}

.nav-btn {
  display: none;
}

/* Artwork Info */
.artwork-info {
  padding: 40px;
  background: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow-y: auto;
}

#artworkTitle {
  font-size: 2rem;
  font-weight: 700;
  color: #071b72;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

#artworkArtist {
  font-size: 1.5rem;
  font-weight: 500;
  color: #6b7280;
  margin-bottom: 2rem;
  font-style: italic;
}

.artwork-details {
  background: #f8fafc;
  padding: 1.5rem;
  border-radius: 8px;
  border-left: 4px solid #071b72;
}

.artwork-details p {
  margin-bottom: 0.8rem;
  font-size: 1rem;
  line-height: 1.4;
}

.artwork-details strong {
  color: #374151;
  font-weight: 600;
}

.artwork-details span {
  color: #6b7280;
}

/* Gallery Footer */
.gallery-footer {
  padding: 60px 0;
  background: #f8fafc;
  text-align: center;
  border-top: 1px solid #e5e7eb;
}

.gallery-footer-content p {
  font-size: 1.2rem;
  color: #6b7280;
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.gallery-footer-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive Design */
@media screen and (max-width: 968px) {
  .gallery-header {
    padding: 80px 0 40px;
  }

  .gallery-header-content h1 {
    font-size: 2.5rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
  }

  .modal-body {
    grid-template-columns: 1fr;
    height: auto;
  }

  .artwork-display {
    height: 60vh;
    min-height: 300px;
  }

  .artwork-info {
    padding: 30px 20px;
  }

  #artworkTitle {
    font-size: 1.5rem;
  }

  #artworkArtist {
    font-size: 1.2rem;
  }
}

@media screen and (max-width: 1100px) {
  .gallery-header-content h1 {
    font-size: 2rem;
  }

  .gallery-header-content p {
    font-size: 1rem;
    padding: 0 20px;
  }

  .gallery-section {
    padding: 60px 0;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 25px;
  }

  .gallery-item {
    min-height: 350px;
  }

  .modal-content {
    margin: 1% auto;
    width: 98%;
    max-height: 95vh;
  }

  .close-btn {
    top: 10px;
    right: 15px;
    width: 40px;
    height: 40px;
    font-size: 28px;
  }

  .gallery-footer-buttons {
    flex-direction: column;
    align-items: center;
  }

  .gallery-footer-buttons .cta-btn {
    width: 100%;
    max-width: 300px;
  }
}

@media screen and (max-width: 480px) {
  .gallery-header {
    padding: 60px 0 30px;
  }

  .gallery-header-content h1 {
    font-size: 1.8rem;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .gallery-item {
    min-height: 300px;
  }

  .gallery-overlay {
    padding: 15px;
  }

  .gallery-overlay h3 {
    font-size: 1rem;
  }

  .gallery-overlay p {
    font-size: 0.8rem;
  }

  .artwork-info {
    padding: 20px 15px;
  }

  #artworkTitle {
    font-size: 1.3rem;
  }

  #artworkArtist {
    font-size: 1rem;
  }

  .artwork-details {
    padding: 1rem;
  }
}

/* Focus states for accessibility */
.gallery-item:focus {
  outline: 2px solid #071b72;
  outline-offset: 4px;
}

.close-btn:focus {
  outline: 2px solid #071b72;
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .gallery-overlay {
    background: rgba(0, 0, 0, 0.95);
  }

  .modal {
    background-color: rgba(0, 0, 0, 0.95);
  }
}
