/* ============================================================
   GALERIA.CSS — Gallery page styles
   Hero banner, filter tabs, masonry grid, lightbox
   ============================================================ */

/* ============================================================
   GALLERY PAGE HERO BANNER
   ============================================================ */

.gallery-hero {
  min-height: 40vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    135deg,
    var(--color-primary) 0%,
    var(--color-primary-light) 50%,
    var(--color-surface) 100%
  );
  padding: var(--space-20) var(--space-6) var(--space-12);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.gallery-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at 60% 40%,
    rgba(245, 196, 41, 0.08) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.gallery-hero-content {
  position: relative;
  z-index: var(--z-base);
  max-width: 600px;
}

.gallery-hero-content .section-eyebrow {
  color: var(--color-accent);
}

.gallery-hero-title {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: 300;
  line-height: var(--leading-tight);
  color: var(--color-text-light);
  margin-bottom: var(--space-4);
  letter-spacing: var(--tracking-tight);
}

.gallery-hero-content > p {
  font-family: var(--font-script);
  font-size: var(--text-xl);
  color: var(--color-accent);
  margin-bottom: var(--space-8);
  line-height: var(--leading-snug);
}

/* ============================================================
   FILTER TABS
   ============================================================ */

.gallery-filters-wrap {
  background-color: var(--color-bg);
  padding: var(--space-8) 0 var(--space-6);
  position: sticky;
  top: 72px;
  z-index: var(--z-dropdown);
  border-bottom: 1px solid var(--color-border);
}

.gallery-filters {
  display: flex;
  gap: var(--space-3);
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  padding: 0 var(--space-6);
  -webkit-overflow-scrolling: touch;
}

.gallery-filters::-webkit-scrollbar {
  display: none;
}

.filter-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: var(--space-2) var(--space-5);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
  background-color: transparent;
  border: 1.5px solid var(--color-border-dark);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition:
    background-color var(--duration-base) var(--ease-smooth),
    color var(--duration-base) var(--ease-smooth),
    border-color var(--duration-base) var(--ease-smooth),
    transform var(--duration-fast) var(--ease-spring);
  white-space: nowrap;
}

.filter-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-1px);
}

.filter-btn.active {
  background-color: var(--color-primary);
  color: var(--color-text-light);
  border-color: var(--color-primary);
}

.filter-btn:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

/* ============================================================
   GALLERY MASONRY GRID
   ============================================================ */

.gallery-section {
  padding: var(--space-10) var(--space-6) var(--space-20);
  background-color: var(--color-bg);
}

.gallery-grid {
  position: relative;
  max-width: 1280px;
  margin-inline: auto;
  min-height: 200px;
}

.gallery-item {
  position: absolute;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition:
    box-shadow var(--duration-base) var(--ease-smooth),
    transform var(--duration-base) var(--ease-smooth);
}

.gallery-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.gallery-item:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
}

.gallery-item img {
  width: 100%;
  display: block;
  transition: transform var(--duration-base) var(--ease-smooth);
}

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

.gallery-item figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-4) var(--space-4) var(--space-3);
  background: linear-gradient(
    to top,
    rgba(44, 62, 45, 0.80) 0%,
    transparent 100%
  );
  color: var(--color-text-light);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  line-height: var(--leading-snug);
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity var(--duration-base) var(--ease-smooth),
    transform var(--duration-base) var(--ease-smooth);
}

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

/* ============================================================
   LIGHTBOX
   ============================================================ */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
}

.lightbox-backdrop {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-modal) - 1);
  background-color: rgba(44, 62, 45, 0.90);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.lightbox-figure {
  position: relative;
  z-index: var(--z-modal);
  max-width: min(90vw, 900px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  margin: 0;
}

.lightbox-img {
  max-width: 100%;
  max-height: 80vh;
  width: auto;
  height: auto;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  object-fit: contain;
  display: block;
}

.lightbox-caption {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: rgba(250, 251, 246, 0.80);
  text-align: center;
  line-height: var(--leading-normal);
}

.lightbox-close {
  position: fixed;
  top: var(--space-6);
  right: var(--space-6);
  z-index: calc(var(--z-modal) + 1);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(250, 251, 246, 0.15);
  border: 1.5px solid rgba(250, 251, 246, 0.30);
  border-radius: 50%;
  color: var(--color-text-light);
  cursor: pointer;
  transition:
    background-color var(--duration-fast) var(--ease-smooth),
    transform var(--duration-fast) var(--ease-spring);
}

.lightbox-close:hover {
  background-color: rgba(250, 251, 246, 0.25);
  transform: scale(1.1);
}

.lightbox-close:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
}

.lightbox-prev,
.lightbox-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: calc(var(--z-modal) + 1);
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(250, 251, 246, 0.15);
  border: 1.5px solid rgba(250, 251, 246, 0.30);
  border-radius: 50%;
  color: var(--color-text-light);
  cursor: pointer;
  transition:
    background-color var(--duration-fast) var(--ease-smooth),
    transform var(--duration-fast) var(--ease-spring);
}

.lightbox-prev {
  left: var(--space-4);
}

.lightbox-next {
  right: var(--space-4);
}

.lightbox-prev:hover {
  background-color: rgba(250, 251, 246, 0.25);
  transform: translateY(-50%) scale(1.1);
}

.lightbox-next:hover {
  background-color: rgba(250, 251, 246, 0.25);
  transform: translateY(-50%) scale(1.1);
}

.lightbox-prev:focus-visible,
.lightbox-next:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
}

@media (min-width: 768px) {
  .lightbox-prev {
    left: var(--space-8);
  }
  .lightbox-next {
    right: var(--space-8);
  }
}

/* Gallery CTA section */
.gallery-cta {
  background-color: var(--color-surface-alt);
  border-top: 1px solid var(--color-border);
  padding: var(--space-16) var(--space-6);
  text-align: center;
}

.gallery-cta h2 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 300;
  color: var(--color-text);
  margin-bottom: var(--space-4);
}

.gallery-cta p {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-muted);
  max-width: 50ch;
  margin-inline: auto;
  margin-bottom: var(--space-8);
  line-height: var(--leading-relaxed);
}

.gallery-cta-btns {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  justify-content: center;
}
