/* =========================================================================
   GALERIA.CSS — Galería de obras (referencias reales de Domus Alfha)
   + lightbox (visor ampliado) y filtros
   ========================================================================= */

/* Filtros */
.gallery-filters { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; margin-bottom: 2.2rem; }
.filter-btn {
  border: 1.5px solid var(--border); background: #fff; color: var(--navy);
  font-weight: 600; font-size: .9rem; padding: .5rem 1.1rem; border-radius: 999px; cursor: pointer;
  transition: all .2s ease;
}
.filter-btn:hover { border-color: var(--blue-mid); color: var(--blue-mid); }
.filter-btn.active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* Rejilla */
.gallery-grid {
  display: grid; gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
/* Variante de 4 categorías: 4 columnas en escritorio, 2 en tablet, 1 en móvil */
.gallery-grid--4 { grid-template-columns: repeat(4, 1fr); }
.gallery-grid--4 .gallery-item { aspect-ratio: 3 / 4; }
@media (max-width: 1000px) { .gallery-grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .gallery-grid--4 { grid-template-columns: 1fr; } .gallery-grid--4 .gallery-item { aspect-ratio: 4 / 3; } }
.gallery-item {
  position: relative; border-radius: var(--radius); overflow: hidden; cursor: pointer;
  aspect-ratio: 4 / 3; box-shadow: var(--shadow); border: 1px solid var(--border);
  background: var(--navy);
}
.gallery-item.hide { display: none; }

/* Lámina visual generada (funciona sin fotos reales; sustituible por <img>) */
.gallery-item__art { position: absolute; inset: 0; }
.gallery-item__art svg { width: 100%; height: 100%; }
/* Foto real de la obra: ocupa toda la tarjeta y hace un ligero zoom al pasar el ratón */
.gallery-item__art img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.gallery-item:hover .gallery-item__art img { transform: scale(1.07); }

/* Capa de información */
.gallery-item__overlay {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 1.4rem;
  background: linear-gradient(to top, rgba(20,44,70,.92) 0%, rgba(20,44,70,.35) 45%, rgba(20,44,70,0) 75%);
  transition: background .3s ease;
}
.gallery-item:hover .gallery-item__overlay { background: linear-gradient(to top, rgba(20,44,70,.95) 20%, rgba(46,109,164,.55) 100%); }
.gallery-item__tag {
  align-self: flex-start; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  background: var(--blue-mid); color: #fff; padding: .28rem .7rem; border-radius: 999px; margin-bottom: .7rem;
}
.gallery-item__overlay h3 { color: #fff; font-size: 1.25rem; margin-bottom: .25rem; }
.gallery-item__overlay p { color: rgba(255,255,255,.82); font-size: .9rem; }
.gallery-item__zoom {
  position: absolute; top: 1rem; right: 1rem; width: 38px; height: 38px; z-index: 3;
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.4); border-radius: 50%;
  display: grid; place-items: center; color: #fff; opacity: 0; transform: scale(.8);
  transition: opacity .25s ease, transform .25s ease;
}
.gallery-item:hover .gallery-item__zoom { opacity: 1; transform: scale(1); }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 200; display: none;
  background: rgba(15, 30, 48, .92); padding: 5vw;
  align-items: center; justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox__card {
  background: #fff; border-radius: var(--radius); max-width: 640px; width: 100%;
  overflow: hidden; box-shadow: var(--shadow-lg);
}
.lightbox__art { aspect-ratio: 16/10; background: var(--navy); }
.lightbox__art svg { width: 100%; height: 100%; }
.lightbox__art img { width: 100%; height: 100%; object-fit: cover; }
.lightbox__body { padding: 1.8rem; }
.lightbox__body .gallery-item__tag { position: static; }
.lightbox__body h3 { font-size: 1.5rem; margin: .2rem 0 .6rem; }
.lightbox__body p { color: var(--text-muted); margin-bottom: 1.2rem; }
.lightbox__close {
  position: absolute; top: 1.4rem; right: 1.4rem; width: 46px; height: 46px; border-radius: 50%;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.4); color: #fff;
  font-size: 1.5rem; cursor: pointer; line-height: 1;
}
.lightbox__close:hover { background: var(--blue-mid); }
