/* ============================================================
   GALLERY.CSS — Gallery page specific styles
   ============================================================ */

/* ── Controls ─────────────────────────────────────────────── */
.gallery-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
  flex-wrap: wrap;
}

.gallery-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-shrink: 0;
}

.gallery-count {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--grey-mid);
}

/* ── Gallery grid ─────────────────────────────────────────── */
.gallery-grid {
  columns: 4 240px;
  column-gap: var(--space-md);
}

.gallery-item {
  break-inside: avoid;
  position: relative;
  margin-bottom: var(--space-md);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
}

.gallery-img {
  width: 100%;
  display: block;
  transition: transform 0.4s ease;
}

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

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(0,0,0,0.85) 100%);
  display: flex;
  align-items: flex-end;
  padding: var(--space-md);
  opacity: 0;
  transition: var(--transition-base);
}

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

.gallery-overlay-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gallery-zoom-icon {
  font-size: 1.5rem;
}

.gallery-caption-preview {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.85);
  line-height: 1.4;
}

/* ── Lightbox ─────────────────────────────────────────────── */
.lightbox {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
}

.lightbox-img-wrap {
  width: 100%;
  max-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: var(--radius-lg);
  transition: opacity 0.25s ease;
}

.lightbox-close {
  position: fixed;
  top: 20px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--white);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
  z-index: 10;
}

.lightbox-close:hover {
  background: var(--red-glass-strong);
  border-color: var(--red-primary);
}

.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--white);
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
  z-index: 10;
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-nav:hover {
  background: var(--red-glass-strong);
  border-color: var(--red-primary);
}

.lightbox-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  margin-top: var(--space-md);
}

.lightbox-caption {
  font-size: 0.9rem;
  color: var(--grey-light);
  flex: 1;
  text-align: center;
}

.lightbox-counter {
  font-size: 0.82rem;
  color: var(--grey-dark);
  flex-shrink: 0;
  min-width: 60px;
  text-align: right;
}

/* ── Field Error ──────────────────────────────────────────── */
.field-error {
  display: none;
  font-size: 0.78rem;
  color: var(--red-bright);
  margin-top: 4px;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .gallery-controls {
    flex-direction: column;
    align-items: flex-start;
  }

  .gallery-grid { columns: 2 150px; }

  .lightbox-nav { display: none; }
}

@media (max-width: 480px) {
  .gallery-grid { columns: 2 120px; }
}
