/* Photo gallery */

.gallery-featured {
  display: grid;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

@media (min-width: 768px) {
  .gallery-featured {
    grid-template-columns: 1.4fr 1fr 1fr;
    grid-template-rows: 220px 220px;
  }

  .gallery-featured .gallery-featured-main {
    grid-row: span 2;
  }
}

.gallery-featured a {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 200px;
  box-shadow: var(--shadow-md);
}

.gallery-featured img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

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

.gallery-featured-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1rem 1.1rem;
  background: linear-gradient(transparent, rgba(15, 39, 68, 0.88));
  color: var(--white);
  font-size: 0.875rem;
  font-weight: 700;
}

.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.gallery-filter {
  font-family: var(--font);
  font-size: 0.8125rem;
  font-weight: 700;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.gallery-filter:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.gallery-filter.active {
  background: var(--gradient-accent);
  border-color: transparent;
  color: var(--white);
  box-shadow: 0 4px 12px rgba(14, 116, 144, 0.3);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.gallery-item {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}

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

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

.gallery-item button {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.gallery-item figcaption {
  padding: 0.9rem 1rem 1rem;
}

.gallery-item .gallery-tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 0.25rem;
}

.gallery-item h3 {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--navy-dark);
  line-height: 1.35;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(15, 39, 68, 0.92);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
}

.lightbox-inner {
  position: relative;
  max-width: min(1100px, 100%);
  max-height: 90vh;
  width: 100%;
}

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

.lightbox-caption {
  margin-top: 1rem;
  text-align: center;
  color: var(--white);
  font-size: 0.9375rem;
  font-weight: 600;
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.15);
  color: var(--white);
  cursor: pointer;
  transition: background 0.15s;
}

.lightbox-close:hover,
.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.28);
}

.lightbox-close {
  top: -3.25rem;
  right: 0;
  font-size: 1.5rem;
  line-height: 1;
}

.lightbox-prev {
  left: -3.5rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.25rem;
}

.lightbox-next {
  right: -3.5rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.25rem;
}

@media (max-width: 900px) {
  .lightbox-prev { left: 0.5rem; top: auto; bottom: 0.5rem; transform: none; }
  .lightbox-next { right: 0.5rem; top: auto; bottom: 0.5rem; transform: none; }
  .lightbox-close { top: 0.5rem; right: 0.5rem; }
}
