/* /assets/css/gallery.css */

.gallery-header-section {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 2rem 1.5rem;
  margin-bottom: 2rem;
}

.gallery-header-section > * {
  max-width: 1200px;
  margin: 0 auto;
}

.gallery-footer-section {
  background: #f8fafc;
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  margin-top: 3rem;
}

.gallery-footer-section > * {
  max-width: 1200px;
  margin: 0 auto;
}

.gallery-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.gallery-title {
  text-align: center;
  margin-bottom: 3rem;
}

.gallery-grid {
  column-width: 320px;
  column-gap: 1.5rem;
  column-fill: balance;
  -webkit-column-fill: balance;
  margin-top: 2rem;
}

@media (max-width: 1023px) {
  .gallery-grid {
    column-width: 280px;
  }
}

@media (max-width: 767px) {
  .gallery-grid {
    column-width: 100%;
  }
}

.gallery-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: inline-block;
  width: 100%;
  margin-bottom: 1.5rem;
  break-inside: avoid-column;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
}

.gallery-card:last-child {
  margin-bottom: 0;
}

.gallery-card:hover {
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
  transform: translateY(-8px);
}

.gallery-image-wrapper {
  position: relative;
  width: 100%;
  background: linear-gradient(135deg, #f0f0f0 0%, #e5e5e5 100%);
  overflow: hidden;
}

.gallery-image {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.4s ease;
}

.gallery-card:hover .gallery-image {
  transform: scale(1.08);
}

.gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(2px);
}

.gallery-card:hover .gallery-overlay {
  opacity: 1;
}

.gallery-overlay-icon {
  font-size: 3rem;
  animation: bounce 0.6s ease forwards;
}

@keyframes bounce {
  0% {
    transform: translateY(0);
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

.empty-gallery {
  text-align: center;
  padding: 4rem 1.5rem;
  color: var(--muted);
}

.empty-gallery p {
  font-size: 1.1rem;
  margin: 0;
}

.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.lightbox.active {
  display: flex;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-image {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 8px;
}

.lightbox-info {
  color: white;
  text-align: center;
  margin-top: 1.5rem;
  max-width: 600px;
}

.lightbox-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
}

.lightbox-desc {
  font-size: 0.95rem;
  color: #ccc;
  margin: 0;
}

.catalogue-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.catalogue-modal.active {
  display: flex;
}

.catalogue-body {
  width: min(100%, 1100px);
  max-height: 90vh;
  overflow-y: auto;
  background: rgba(12, 12, 12, 0.95);
  border-radius: 16px;
  padding: 1.5rem;
  display: grid;
  gap: 1.5rem;
}

.catalogue-main {
  display: grid;
  gap: 1.25rem;
  justify-items: center;
}

.catalogue-main-image {
  width: 100%;
  max-height: 60vh;
  object-fit: contain;
  border-radius: 12px;
  background: #111;
}

.catalogue-meta {
  width: 100%;
  color: white;
  text-align: left;
}

.catalogue-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.catalogue-tag {
  background: rgba(255, 255, 255, 0.1);
  color: #f0f0f0;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  font-size: 0.8rem;
}

.catalogue-related {
  width: 100%;
}

.catalogue-related h3 {
  color: white;
  margin-bottom: 1rem;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
}

.related-card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  overflow: hidden;
  background: #111;
  color: white;
  text-align: left;
  padding: 0;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.related-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.24);
}

.related-card img {
  width: 100%;
  display: block;
  height: 100px;
  object-fit: cover;
}

.related-card span {
  display: block;
  padding: 0.75rem;
  font-size: 0.9rem;
  color: #f5f5f5;
}

.related-empty,
.related-loading {
  color: #ccc;
  font-size: 0.95rem;
}

.lightbox-close,
.catalogue-close {
  position: absolute;
  top: 1.25rem;
  right: 1.875rem;
  color: white;
  font-size: 2.25rem;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0.5rem;
  transition: color 0.3s;
  line-height: 1;
}

.lightbox-close:hover,
.catalogue-close:hover {
  color: #ccc;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: white;
  font-size: 2.5rem;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.5);
  padding: 0.6rem 0.9rem;
  border: none;
  transition: background 0.3s;
  border-radius: 4px;
  line-height: 1;
}

.lightbox-nav:hover {
  background: rgba(0, 0, 0, 0.8);
}

.lightbox-prev {
  left: 1.25rem;
}

.lightbox-next {
  right: 1.25rem;
}

@media (max-width: 768px) {
  .gallery-grid {
    column-count: 2;
    column-gap: 1rem;
  }

  .gallery-card {
    margin-bottom: 1rem;
  }

  .gallery-title h1 {
    font-size: 1.75rem;
  }

  .lightbox-nav {
    font-size: 1.75rem;
    padding: 0.5rem 0.75rem;
  }

  .lightbox-close {
    font-size: 1.75rem;
    top: 0.625rem;
    right: 0.9rem;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    column-count: 1;
    column-gap: 0;
  }

  .gallery-card {
    margin-bottom: 1rem;
  }

  .gallery-page {
    padding: 1rem;
  }

  .gallery-title {
    margin-bottom: 1.5rem;
  }

  .gallery-title h1 {
    font-size: 1.5rem;
  }

  .gallery-image-wrapper {
    min-height: 200px;
  }

  .lightbox-nav {
    display: none;
  }

  .gallery-overlay-icon {
    font-size: 2.25rem;
  }
}
