/* =============================================
   gallery.css — Stiluri galerie și lightbox
   ============================================= */

/* ---- Filtre categorii ---- */
.gallery__filters {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-3xl);
}

.gallery__filter {
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: var(--fs-sm);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: all var(--transition-base);
  background: transparent;
}
.gallery__filter:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}
.gallery__filter.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #000;
}

/* ---- Grid galerie ---- */
.gallery__grid {
  display: grid;
  /* ✏️ EDITEAZĂ: numărul de coloane; auto-fill = se adaptează la lățime */
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-lg);
}

/* Cardul unui item din galerie */
.gallery__item {
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-bg-card);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  /* Animație de intrare — controlată din gallery.js */
  opacity: 0;
  transform: translateY(20px);
}
.gallery__item.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s ease, transform 0.5s ease, box-shadow var(--transition-base);
}
.gallery__item.is-hidden {
  display: none;
}
.gallery__item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* Wrapper imagine */
.gallery__img-wrap {
  position: relative;
  aspect-ratio: 4/3;       /* ✏️ EDITEAZĂ: raportul de aspect (ex: 1/1 pentru pătrat) */
  overflow: hidden;
}
.gallery__img-wrap img,
.gallery__img-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}
.gallery__item:hover .gallery__img-wrap img,
.gallery__item:hover .gallery__img-wrap video {
  transform: scale(1.05);
}

/* Overlay cu buton zoom la hover */
.gallery__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-base);
}
.gallery__item:hover .gallery__overlay {
  opacity: 1;
}

/* Buton zoom */
.gallery__zoom {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #000;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-base);
}
.gallery__zoom:hover {
  transform: scale(1.1);
}

/* Buton play pentru video */
.gallery__play-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #000;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 4px; /* offset vizual pentru icon play */
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.gallery__play-btn:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-accent);
}

/* Info sub imagine */
.gallery__info {
  padding: var(--space-md) var(--space-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.gallery__item-title {
  font-size: var(--fs-base);
  font-family: var(--font-heading);
  font-weight: 400;
}
.gallery__item-cat {
  font-size: var(--fs-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent);
}

/* ---- LIGHTBOX ---- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox[hidden] { display: none; }

.lightbox__backdrop {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(0,0,0,0.9);
}
.lightbox__backdrop[hidden] { display: none; }

/* Same box for both: a video opens where a photo would have, at the 90vw/85vh
   the spec fixes for the lightbox. */
.lightbox__img,
.lightbox__video {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  z-index: 1;
  box-shadow: var(--shadow-lg);
}

.lightbox__close,
.lightbox__prev,
.lightbox__next {
  position: absolute;
  z-index: 2;
  color: #fff;
  font-size: 2rem;
  background: rgba(0,0,0,0.5);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}
.lightbox__close { top: 1rem; right: 1rem; font-size: 1.5rem; }
.lightbox__prev  { left: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox__next  { right: 1rem; top: 50%; transform: translateY(-50%); }

.lightbox__close:hover,
.lightbox__prev:hover,
.lightbox__next:hover {
  background: var(--color-accent);
  color: #000;
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .gallery__grid {
    grid-template-columns: 1fr;
  }
}
