/* =====================================================
   OUR WORK IN PHOTOS (section #gallery)
   Uses the site's tokens from style.css (colors, radius,
   shadows), so it follows light and dark mode too.
===================================================== */

.gallery-group + .gallery-group { margin-top: 48px; }

.gallery-place {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.gallery-place::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand-gradient);
  flex-shrink: 0;
}

/* Mosaic: the first photo of each place is large (2×2),
   the other four fill the space around it — no empty cells. */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 200px;
  gap: 12px;
}

.gallery-item:first-child { grid-column: span 2; grid-row: span 2; }

@media (min-width: 760px) {
  .gallery-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 230px; gap: 18px; }
  .gallery-item:first-child { grid-column: span 2; grid-row: span 2; }
}

@media (max-width: 479.98px) {
  .gallery-grid { grid-auto-rows: 170px; gap: 10px; }
}

.gallery-item {
  position: relative;
  margin: 0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  background: var(--surface-2);
  transition: transform .25s ease, box-shadow .25s ease;
}

.gallery-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-card-hover); }

.gallery-open {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.gallery-open:focus-visible { outline: 3px solid var(--teal-400); outline-offset: -3px; border-radius: var(--radius-lg); }

.gallery-open img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s ease;
}

.gallery-item:hover .gallery-open img { transform: scale(1.04); }

/* Caption over the bottom of the photo */
.gallery-item figcaption {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  padding: 36px 14px 12px;
  font-size: .86rem;
  font-weight: 600;
  line-height: 1.45;
  color: #fff;
  background: linear-gradient(180deg, transparent 0%, rgba(5, 12, 28, 0.82) 100%);
  pointer-events: none;
}

.gallery-item:first-child figcaption { font-size: 1rem; padding: 48px 18px 16px; }

@media (max-width: 479.98px) {
  .gallery-item figcaption { font-size: .74rem; padding: 28px 10px 9px; }
  .gallery-item:first-child figcaption { font-size: .88rem; }
}

/* ---------- Enlarged photo ---------- */

.gallery-lightbox {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: min(94vw, 1100px);
  max-height: 94vh;
  overflow: visible;
}

.gallery-lightbox::backdrop { background: rgba(5, 10, 20, .88); }

.gallery-lightbox img {
  display: block;
  max-width: min(94vw, 1100px);
  max-height: 80vh;
  width: auto;
  height: auto;
  margin: 0 auto;
  border-radius: var(--radius-md);
}

.gallery-lightbox p {
  color: #e6edf7;
  text-align: center;
  font-size: .95rem;
  margin: 12px 8px 0;
}

.gallery-close {
  position: absolute;
  top: -14px;
  inset-inline-end: -10px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 0;
  background: var(--white);
  color: var(--slate-900);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  z-index: 1;
}

@media (max-width: 599.98px) {
  .gallery-close { top: -50px; inset-inline-end: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-item, .gallery-item:hover,
  .gallery-open img, .gallery-item:hover .gallery-open img { transition: none; transform: none; }
}
