/* ═══════════════════════════════════════════════════════════
   GALLERY PAGE — Futuristic styles
   ═══════════════════════════════════════════════════════════ */

/* ── Hero ─────────────────────────────────────────────────── */
.gallery-hero {
  text-align: center;
  padding: 140px 20px 80px;
  position: relative;
}
.gallery-hero h1 {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 800;
  background: linear-gradient(135deg, #00c9a7, #35e8ff, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
}
.gallery-hero p {
  color: rgba(180,226,218,0.75);
  max-width: 600px;
  margin: 0 auto;
  font-size: 1.05rem;
  line-height: 1.7;
}

/* ── Category Tabs ────────────────────────────────────────── */
.gallery-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 48px;
}
.gtab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  border-radius: 50px;
  border: 1px solid rgba(0,203,190,0.25);
  background: rgba(10,12,20,0.6);
  color: rgba(180,226,218,0.7);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.25s ease;
  backdrop-filter: blur(8px);
}
.gtab:hover {
  border-color: #00c9a7;
  color: #fff;
  background: rgba(0,203,190,0.1);
}
.gtab.active {
  background: linear-gradient(135deg, var(--tab-clr, #00c9a7), color-mix(in srgb, var(--tab-clr, #00c9a7) 60%, #35e8ff));
  border-color: transparent;
  color: #000;
  font-weight: 700;
  box-shadow: 0 0 20px color-mix(in srgb, var(--tab-clr, #00c9a7) 60%, transparent);
}

/* ── Masonry Grid ─────────────────────────────────────────── */
.gallery-masonry {
  columns: 3;
  column-gap: 20px;
  margin-bottom: 60px;
}
@media (max-width: 900px)  { .gallery-masonry { columns: 2; } }
@media (max-width: 540px)  { .gallery-masonry { columns: 1; } }

/* ── Gallery Item ─────────────────────────────────────────── */
.gitem {
  break-inside: avoid;
  margin-bottom: 20px;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.16,1,0.3,1);
}
.gitem.hidden { display: none; }
.gitem:hover  { transform: scale(1.02); }

.gitem-inner {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
}

.gitem img {
  width: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.5s ease;
  min-height: 180px;
  background: rgba(10,12,20,0.8);
}
.gitem:hover img { transform: scale(1.06); }

/* Overlay */
.gitem-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(5,8,20,0.92) 0%, rgba(5,8,20,0.3) 55%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 18px;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.gitem:hover .gitem-overlay { opacity: 1; }

.gitem-info { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; }

.gitem-cat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c, #00c9a7);
  background: rgba(0,0,0,0.5);
  border: 1px solid var(--c, #00c9a7);
  border-radius: 50px;
  padding: 3px 10px;
  width: fit-content;
  margin-bottom: 6px;
}

.gitem-overlay h4 {
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.3;
}
.gitem-overlay p {
  color: rgba(180,226,218,0.7);
  font-size: 0.78rem;
  margin: 0;
}

.gitem-zoom {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0,203,190,0.2);
  border: 1px solid rgba(0,203,190,0.4);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  opacity: 0;
}
.gitem:hover .gitem-zoom { opacity: 1; }
.gitem-zoom:hover {
  background: #00c9a7;
  transform: scale(1.1);
}

/* Scanline on item */
.gitem-scan {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: 16px;
}
.gitem-scan::after {
  content: '';
  position: absolute;
  left: 0; width: 100%; height: 2px;
  background: linear-gradient(90deg, transparent, #00c9a7 40%, rgba(255,255,255,0.6) 50%, #00c9a7 60%, transparent);
  top: -2px;
  opacity: 0;
  animation: gscan 2.5s linear infinite;
  animation-play-state: paused;
}
.gitem:hover .gitem-scan::after {
  opacity: 0.5;
  animation-play-state: running;
}
@keyframes gscan {
  0%   { top: -2px; }
  100% { top: 100%; }
}

/* ── Upload CTA ───────────────────────────────────────────── */
.gallery-upload-cta {
  text-align: center;
  padding: 48px 24px;
  border: 1px dashed rgba(0,203,190,0.25);
  border-radius: 20px;
  background: rgba(0,203,190,0.03);
  margin-top: 20px;
}
.gallery-upload-cta i {
  font-size: 2.5rem;
  color: #00c9a7;
  margin-bottom: 16px;
  display: block;
}
.gallery-upload-cta p {
  color: rgba(180,226,218,0.65);
  margin-bottom: 24px;
  font-size: 0.95rem;
}

/* ── Homepage Gallery Preview ─────────────────────────────── */
.gallery-preview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 40px;
}
.gallery-preview-grid.gp-six {
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
@media (max-width: 1024px) {
  .gallery-preview-grid.gp-six { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px)  { .gallery-preview-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 540px)  {
  .gallery-preview-grid,
  .gallery-preview-grid.gp-six { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}
@media (max-width: 380px) {
  .gallery-preview-grid,
  .gallery-preview-grid.gp-six { grid-template-columns: 1fr; }
}
.gp-flag { margin-left: 4px; font-size: 0.9rem; }

/* Card */
.gp-card {
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  display: block;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.06);
  background: #050810;
  transition:
    transform 0.4s cubic-bezier(0.16,1,0.3,1),
    box-shadow 0.4s ease,
    border-color 0.4s ease;
  cursor: pointer;
}
.gp-card:hover {
  transform: translateY(-10px) scale(1.02);
  border-color: var(--gp-clr, #00c9a7);
  box-shadow:
    0 0 0 1px var(--gp-clr, #00c9a7),
    0 20px 50px rgba(0,0,0,0.6),
    0 0 40px color-mix(in srgb, var(--gp-clr, #00c9a7) 30%, transparent);
}

/* Image wrapper — tighter aspect ratio */
.gp-img-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3/2;
}
.gp-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.16,1,0.3,1), filter 0.4s ease;
  filter: brightness(0.75) saturate(0.8);
}
.gp-card:hover .gp-img-wrap img {
  transform: scale(1.1);
  filter: brightness(0.55) saturate(0.6);
}

/* Colour tint overlay — matches Mectrion accent per city */
.gp-tint {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    160deg,
    color-mix(in srgb, var(--gp-clr, #00c9a7) 35%, transparent) 0%,
    transparent 55%
  );
  mix-blend-mode: color;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.gp-card:hover .gp-tint { opacity: 1; }

/* Dark gradient at bottom for label */
.gp-img-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(3,5,15,0.92) 0%,
    rgba(3,5,15,0.4) 40%,
    transparent 70%
  );
  pointer-events: none;
}

/* Corner bracket decorations */
.gp-corner {
  position: absolute;
  width: 16px;
  height: 16px;
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.gp-card:hover .gp-corner { opacity: 1; }
.gp-corner.tl { top: 8px;  left: 8px;  border-top: 2px solid var(--gp-clr,#00c9a7); border-left: 2px solid var(--gp-clr,#00c9a7); }
.gp-corner.tr { top: 8px;  right: 8px; border-top: 2px solid var(--gp-clr,#00c9a7); border-right: 2px solid var(--gp-clr,#00c9a7); }
.gp-corner.bl { bottom: 8px; left: 8px;  border-bottom: 2px solid var(--gp-clr,#00c9a7); border-left: 2px solid var(--gp-clr,#00c9a7); }
.gp-corner.br { bottom: 8px; right: 8px; border-bottom: 2px solid var(--gp-clr,#00c9a7); border-right: 2px solid var(--gp-clr,#00c9a7); }

/* Scanline sweep */
.gp-scan {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}
.gp-scan::after {
  content: '';
  position: absolute;
  left: 0; width: 100%; height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--gp-clr,#00c9a7) 30%,
    rgba(255,255,255,0.9) 50%,
    var(--gp-clr,#00c9a7) 70%,
    transparent 100%);
  top: -2px;
  opacity: 0;
  animation: gscan 2.2s linear infinite;
  animation-play-state: paused;
}
.gp-card:hover .gp-scan::after {
  opacity: 0.7;
  animation-play-state: running;
}

/* Label */
.gp-label {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 20px 14px 12px;
  z-index: 3;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px;
}
.gp-label-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.gp-city-name {
  font-size: 0.92rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.02em;
  line-height: 1;
  display: flex;
  align-items: center;
  gap: 5px;
}
.gp-city-name i { color: var(--gp-clr, #00c9a7); font-size: 0.8rem; }
.gp-city-sub {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(180,226,218,0.5);
}
/* Photo count badge */
.gp-count {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--gp-clr, #00c9a7);
  background: rgba(0,0,0,0.55);
  border: 1px solid var(--gp-clr, #00c9a7);
  border-radius: 50px;
  padding: 3px 8px;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  flex-shrink: 0;
}
.gp-card:hover .gp-count {
  opacity: 1;
  transform: translateY(0);
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  .gp-scan::after { animation: none; }
  .gp-card:hover { transform: none; }
  .gp-card:hover .gp-img-wrap img { transform: none; }
}

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

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3,5,15,0.92);
  backdrop-filter: blur(16px);
  cursor: pointer;
}

.lightbox-content {
  position: relative;
  z-index: 1;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.lb-img-wrap {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(0,203,190,0.3);
  box-shadow: 0 0 60px rgba(0,203,190,0.2);
}
#lbImg {
  max-width: 80vw;
  max-height: 72vh;
  display: block;
  object-fit: contain;
  border-radius: 16px;
}

/* Scanline inside lightbox */
.lb-scan {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: 16px;
}
.lb-scan::after {
  content: '';
  position: absolute;
  left: 0; width: 100%; height: 3px;
  background: linear-gradient(90deg, transparent, #00c9a7 40%, rgba(255,255,255,0.8) 50%, #00c9a7 60%, transparent);
  top: -3px;
  opacity: 0.5;
  animation: gscan 3s linear infinite;
}

.lb-caption {
  display: flex;
  align-items: center;
  gap: 20px;
  color: rgba(180,226,218,0.85);
  font-size: 0.9rem;
}
#lbTitle { font-weight: 700; color: #fff; font-size: 1rem; }
#lbLoc   { color: #00c9a7; }

.lb-counter {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.75rem;
  color: rgba(180,226,218,0.5);
  letter-spacing: 0.1em;
}

/* Nav buttons */
.lb-close, .lb-prev, .lb-next {
  position: absolute;
  background: rgba(10,12,20,0.8);
  border: 1px solid rgba(0,203,190,0.3);
  color: #fff;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  z-index: 2;
}
.lb-close { top: -52px; right: 0; }
.lb-prev  { left: -60px; top: 50%; transform: translateY(-50%); }
.lb-next  { right: -60px; top: 50%; transform: translateY(-50%); }
.lb-close:hover, .lb-prev:hover, .lb-next:hover {
  background: #00c9a7;
  transform: scale(1.1);
}
.lb-prev:hover { transform: translateY(-50%) scale(1.1); }
.lb-next:hover { transform: translateY(-50%) scale(1.1); }

@media (max-width: 600px) {
  .lb-prev { left: 8px; }
  .lb-next { right: 8px; }
  .lb-close { top: 8px; right: 8px; }
}

/* ── Reduce motion ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .gitem-scan::after,
  .gp-scan::after,
  .lb-scan::after { animation: none; }
  .gitem:hover, .gp-card:hover { transform: none; }
}
