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

.gallery-item {
  background: var(--light-bg);
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  cursor: pointer;
  padding: 0;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.gallery-item:hover,
.gallery-item:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 6px 14px rgba(26, 54, 93, 0.15);
}

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

.gallery-thumb-wrap {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background-color: #e2e8f0;
}

.gallery-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-caption {
  padding: 0.9rem 1rem;
}

.gallery-caption h3 {
  font-size: 1rem;
  color: var(--secondary-color);
  margin-bottom: 0.25rem;
}

.gallery-caption p {
  font-size: 0.9rem;
  color: var(--dark-text);
  opacity: 0.85;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(26, 54, 93, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 2000;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-content {
  position: relative;
  max-width: min(1100px, 92vw);
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 74vh;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.lightbox-caption {
  color: white;
  text-align: center;
  margin-top: 1rem;
  max-width: 700px;
}

.lightbox-caption h3 {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.lightbox-caption p {
  opacity: 0.85;
  font-size: 0.95rem;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: white;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: var(--accent-color);
  border-color: var(--accent-color);
}

.lightbox-close {
  top: -3.5rem;
  right: 0;
}

.lightbox-prev,
.lightbox-next {
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-prev {
  left: -1rem;
}

.lightbox-next {
  right: -1rem;
}

@media (max-width: 640px) {
  .lightbox-prev { left: 0.25rem; }
  .lightbox-next { right: 0.25rem; }
  .lightbox-close { top: -3rem; right: 0.25rem; }
}
