/* === GALLERY LAYOUT === */
.gallery-container {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--space-lg) var(--space-md);
}

.gallery-header {
  margin-bottom: var(--space-lg);
}

.gallery-back {
  display: inline-block;
  margin-bottom: var(--space-md);
  font-family: var(--font-sans);
  font-size: var(--font-size-sm);
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.gallery-back:hover {
  text-decoration: underline;
}

/* === GRID === */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.gallery-item {
  aspect-ratio: 1;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-tertiary);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
  filter: brightness(0.85);
}

/* Video items */
.gallery-item-video {
  position: relative;
}

.gallery-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(0, 0, 0, 0.2);
  pointer-events: none;
  transition: background 0.3s ease;
}

.gallery-item-video:hover .gallery-play-overlay {
  background: rgba(0, 0, 0, 0.4);
}

.gallery-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--space-xl) var(--space-md);
  font-family: var(--font-sans);
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* === LIGHTBOX === */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.9);
  align-items: center;
  justify-content: center;
}

.lightbox.active {
  display: flex;
}

.lightbox-close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  background: none;
  border: none;
  color: #FFFFFF;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  padding: var(--space-sm);
  opacity: 0.7;
  transition: opacity 0.2s ease;
  z-index: 1001;
}

.lightbox-close:hover {
  opacity: 1;
}

.lightbox-content {
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

/* Lightbox video */
.lightbox-video {
  display: none;
  width: 90vw;
  max-width: 800px;
  aspect-ratio: 16 / 9;
}

.lightbox-video iframe {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: var(--radius-sm);
}

.lightbox-caption {
  margin-top: var(--space-sm);
  font-family: var(--font-sans);
  max-width: 600px;
  width: 100%;
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-sm);
  padding: var(--space-md);
  line-height: 1.5;
}

.lightbox-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-lg);
}

.meta-date {
  font-size: var(--font-size-xs);
  color: rgba(255, 255, 255, 0.5);
}

.meta-label {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.6rem;
  margin-right: 4px;
}

.lightbox-text {
  font-size: var(--font-size-sm);
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.6;
}

.lightbox-meta + .lightbox-text:not(:empty) {
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* === RESPONSIVE === */
@media (max-width: 680px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery-container {
    padding: var(--space-md) var(--space-sm);
  }
}

@media (max-width: 400px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}
