/* ============================================================
   Alpha Voleibol Club — Galería
   ============================================================ */

.page--gallery { background: var(--alpha-cream); }

/* ============================================================
   GALLERY HERO
   ============================================================ */
.gallery-hero {
  position: relative;
  margin-top: var(--header-h);
  padding: var(--sp-3xl) 0 var(--sp-2xl);
  background:
    radial-gradient(ellipse at top right, rgba(245,197,24,0.18) 0%, transparent 60%),
    linear-gradient(135deg, var(--alpha-navy-deep) 0%, var(--alpha-navy) 100%);
  color: var(--alpha-white);
  overflow: hidden;
}
.gallery-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 80%, rgba(245,197,24,0.08) 0%, transparent 40%),
    radial-gradient(circle at 80% 20%, rgba(255,255,255,0.05) 0%, transparent 40%);
  pointer-events: none;
}
.gallery-hero > * { position: relative; z-index: 1; }

.gallery-hero__kicker {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--alpha-navy);
  background: var(--alpha-gold);
  padding: 6px var(--sp-md);
  border-radius: var(--r-full);
  margin-bottom: var(--sp-md);
  box-shadow: 0 4px 12px rgba(245, 197, 24, 0.4);
  animation: hero-title-in 0.8s var(--ease-out) 0.1s both;
}
.gallery-hero__title {
  font-family: var(--font-display);
  font-size: var(--text-5xl);
  line-height: 0.95;
  letter-spacing: 0.02em;
  margin-bottom: var(--sp-md);
  animation: hero-title-in 0.8s var(--ease-out) 0.3s both;
}
.gallery-hero__title span { color: var(--alpha-gold); }
.gallery-hero__sub {
  font-size: var(--text-lg);
  max-width: 640px;
  opacity: 0.92;
  margin-bottom: var(--sp-xl);
  animation: hero-title-in 0.8s var(--ease-out) 0.5s both;
}

.gallery-hero__stats {
  display: flex;
  gap: var(--sp-xl);
  flex-wrap: wrap;
  animation: hero-title-in 0.8s var(--ease-out) 0.7s both;
}
.gallery-hero__stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-right: var(--sp-xl);
  border-right: 1px solid rgba(255,255,255,0.15);
}
.gallery-hero__stat:last-child { border-right: none; }
.gallery-hero__stat .num {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  color: var(--alpha-gold);
  line-height: 1;
}
.gallery-hero__stat .lbl {
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.7;
}

/* ============================================================
   FILTROS
   ============================================================ */
.gallery-section { padding: var(--sp-2xl) 0 var(--sp-3xl); }

.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-sm);
  justify-content: center;
  margin-bottom: var(--sp-2xl);
  position: sticky;
  top: calc(var(--header-h) + 12px);
  z-index: 50;
  padding: var(--sp-sm);
  background: rgba(250, 247, 238, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--r-full);
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
  max-width: 100%;
  overflow-x: auto;
  box-shadow: var(--sh-md);
}
.gfilter {
  padding: var(--sp-sm) var(--sp-md);
  border-radius: var(--r-full);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--alpha-graphite);
  background: transparent;
  border: 1.5px solid transparent;
  white-space: nowrap;
  transition: all var(--dur-base) var(--ease-bounce);
}
.gfilter:hover {
  color: var(--alpha-navy);
  background: rgba(11, 31, 58, 0.06);
  transform: translateY(-2px);
}
.gfilter--active {
  background: var(--alpha-navy);
  color: var(--alpha-white);
  box-shadow: 0 4px 14px rgba(11, 31, 58, 0.3);
}
.gfilter--active:hover {
  background: var(--alpha-navy-deep);
  transform: translateY(-2px);
}

/* ============================================================
   GALLERY GRID (album / masonry)
   ============================================================ */
.gallery-grid {
  column-count: 1;
  column-gap: var(--sp-lg);
}
@media (min-width: 640px)  { .gallery-grid { column-count: 2; } }
@media (min-width: 1024px) { .gallery-grid { column-count: 3; } }
@media (min-width: 1440px) { .gallery-grid { column-count: 4; } }

.gitem {
  break-inside: avoid;
  margin-bottom: var(--sp-lg);
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--alpha-white);
  box-shadow: var(--sh-sm);
  cursor: pointer;
  transition: transform var(--dur-base) var(--ease-default),
              box-shadow var(--dur-base) var(--ease-default),
              opacity var(--dur-slow) var(--ease-default);
  opacity: 0;
  transform: translateY(20px);
  display: block;
}
.gitem.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.gitem:hover {
  transform: translateY(-8px);
  box-shadow: var(--sh-lg);
}
.gitem.is-hidden {
  display: none;
}

.gitem__media {
  position: relative;
  overflow: hidden;
  background: var(--alpha-cream);
}
.gitem__img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform var(--dur-slow) var(--ease-default),
              filter var(--dur-base) var(--ease-default);
}
.gitem:hover .gitem__img {
  transform: scale(1.06);
  filter: brightness(0.7);
}

/* Tag de categoría */
.gitem__cat {
  position: absolute;
  top: var(--sp-sm);
  left: var(--sp-sm);
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: rgba(11, 31, 58, 0.85);
  color: var(--alpha-gold);
  border-radius: var(--r-full);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 2;
  transition: transform var(--dur-base) var(--ease-default);
}
.gitem:hover .gitem__cat {
  transform: translateY(-3px);
  background: var(--alpha-gold);
  color: var(--alpha-navy);
}

/* Caption overlay (aparece en hover) */
.gitem__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--sp-md);
  background: linear-gradient(180deg, transparent 40%, rgba(11,31,58,0.92) 100%);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--dur-base) var(--ease-default),
              transform var(--dur-base) var(--ease-default);
  pointer-events: none;
}
.gitem:hover .gitem__overlay {
  opacity: 1;
  transform: translateY(0);
}

.gitem__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  letter-spacing: 0.02em;
  color: var(--alpha-white);
  line-height: 1.05;
  margin-bottom: 4px;
}
.gitem__desc {
  font-size: var(--text-sm);
  color: var(--alpha-mist);
  line-height: 1.4;
}

/* Caption visible siempre (debajo de la foto) */
.gitem__caption {
  padding: var(--sp-md);
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-top: 1px solid var(--alpha-mist);
}
.gitem__caption-title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--alpha-navy);
  line-height: 1.3;
}
.gitem__caption-desc {
  font-size: var(--text-xs);
  color: var(--alpha-graphite);
  line-height: 1.5;
}

/* Icono de "expand" en hover */
.gitem__expand {
  position: absolute;
  top: var(--sp-sm);
  right: var(--sp-sm);
  width: 36px;
  height: 36px;
  border-radius: var(--r-full);
  background: rgba(245, 197, 24, 0.95);
  color: var(--alpha-navy);
  display: grid;
  place-items: center;
  z-index: 2;
  opacity: 0;
  transform: scale(0.7);
  transition: all var(--dur-base) var(--ease-bounce);
}
.gitem:hover .gitem__expand {
  opacity: 1;
  transform: scale(1);
}

/* ============================================================
   LIGHTBOX
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(6, 19, 40, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--sp-lg);
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-default);
}
.lightbox.is-open {
  display: flex;
  opacity: 1;
}

.lightbox__figure {
  position: relative;
  max-width: min(1200px, 95vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: lb-in 0.4s var(--ease-out);
}
@keyframes lb-in {
  from { transform: scale(0.92); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

.lightbox__img {
  max-width: 100%;
  max-height: 78vh;
  width: auto;
  height: auto;
  border-radius: var(--r-lg);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6);
}

.lightbox__caption {
  margin-top: var(--sp-md);
  text-align: center;
  color: var(--alpha-white);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.lightbox__title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  letter-spacing: 0.02em;
  color: var(--alpha-gold);
}
.lightbox__desc {
  font-size: var(--text-base);
  color: var(--alpha-mist);
  max-width: 600px;
}
.lightbox__counter {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  opacity: 0.6;
  margin-top: var(--sp-sm);
}

.lightbox__close {
  position: absolute;
  top: var(--sp-md);
  right: var(--sp-md);
  width: 48px;
  height: 48px;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.1);
  color: var(--alpha-white);
  display: grid;
  place-items: center;
  z-index: 2;
  transition: all var(--dur-base) var(--ease-bounce);
}
.lightbox__close:hover {
  background: var(--alpha-gold);
  color: var(--alpha-navy);
  transform: rotate(90deg) scale(1.1);
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.1);
  color: var(--alpha-white);
  display: grid;
  place-items: center;
  z-index: 2;
  transition: all var(--dur-base) var(--ease-bounce);
}
.lightbox__nav:hover {
  background: var(--alpha-gold);
  color: var(--alpha-navy);
  transform: translateY(-50%) scale(1.15);
  box-shadow: 0 12px 28px rgba(245, 197, 24, 0.4);
}
.lightbox__nav--prev { left: var(--sp-md); }
.lightbox__nav--next { right: var(--sp-md); }

@media (max-width: 767px) {
  .lightbox__nav { width: 44px; height: 44px; }
  .lightbox__nav--prev { left: 8px; }
  .lightbox__nav--next { right: 8px; }
}

/* Active link en nav */
.header__link--active { color: var(--alpha-gold) !important; }
.header__link--active::after { width: 70% !important; box-shadow: 0 0 12px rgba(245, 197, 24, 0.8); }

/* Footer mini */
.footer__inner--mini { grid-template-columns: 1fr !important; }
@media (min-width: 768px) { .footer__inner--mini { grid-template-columns: 1fr 1fr !important; } }
