/* ============================================================
   CAR THERAPY NAPLES — Gallery Page
   ============================================================ */

.gallery-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.gallery-header h2 { color: var(--white); }
.gallery-header h2 em { font-style: italic; color: var(--gold); }

/* ── Filters ── */
.gallery-filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.gallery-filter {
  padding: 0.5rem 1.1rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border);
  background: transparent;
  transition: all 0.3s var(--ease-out);
  cursor: pointer;
}

.gallery-filter:hover { color: var(--white); border-color: var(--muted-2); }

.gallery-filter.active {
  background: var(--gold);
  color: var(--black);
  border-color: var(--gold);
}

/* ── Masonry Grid ── */
.gallery-grid {
  columns: 3;
  column-gap: 1px;
  background: var(--border);
}

.gallery-item {
  break-inside: avoid;
  position: relative;
  overflow: hidden;
  background: var(--surface);
  cursor: pointer;
  margin-bottom: 1px;
  display: block;
}

.gallery-item.hidden {
  display: none;
}

.gallery-item__img {
  width: 100%;
  aspect-ratio: 4/3;
}

.gallery-item--tall .gallery-item__img { aspect-ratio: 3/4; }
.gallery-item--wide .gallery-item__img { aspect-ratio: 16/9; }

.gallery-item__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s var(--ease-out);
}

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

/* Info overlay */
.gallery-item__info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem;
  transform: translateY(8px);
  opacity: 0;
  transition: all 0.35s var(--ease-out);
  z-index: 2;
  pointer-events: none;
}

.gallery-item:hover .gallery-item__info {
  opacity: 1;
  transform: translateY(0);
}

.gallery-item__tag {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(8,8,8,0.7);
  padding: 0.25rem 0.6rem;
  margin-bottom: 0.4rem;
}

.gallery-item__title {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--white);
  letter-spacing: 0.02em;
}

/* Expand button */
.gallery-item__expand {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  background: rgba(8,8,8,0.7);
  border: 1px solid rgba(201,168,76,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  opacity: 0;
  transform: translateY(-4px);
  transition: all 0.3s var(--ease-out);
  z-index: 3;
  cursor: pointer;
}

.gallery-item__expand svg { width: 16px; height: 16px; }

.gallery-item:hover .gallery-item__expand {
  opacity: 1;
  transform: translateY(0);
}

.gallery-item__expand:hover {
  background: var(--gold);
  color: var(--black);
}

/* ── Lightbox ── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(8,8,8,0.97);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.lightbox.open {
  opacity: 1;
  pointer-events: all;
}

.lightbox__close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: all 0.3s;
  cursor: pointer;
}

.lightbox__close:hover { border-color: var(--gold); color: var(--gold); }
.lightbox__close svg { width: 20px; height: 20px; }

.lightbox__img-wrap {
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__img-wrap img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  width: auto;
  height: auto;
}

.lightbox__info {
  margin-top: 1.5rem;
  text-align: center;
}

.lightbox__info span {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  display: block;
  margin-bottom: 0.4rem;
}

.lightbox__info p {
  font-size: 0.9rem;
  color: var(--white);
  margin: 0;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .gallery-grid { columns: 2; }
}

@media (max-width: 768px) {
  .gallery-header { flex-direction: column; align-items: flex-start; }
  .gallery-grid { columns: 1; }
  .gallery-item__info { opacity: 1; transform: translateY(0); }
  .gallery-item__expand { opacity: 1; transform: translateY(0); }
}
