.gallery-page {
  background:
    radial-gradient(
      circle at top left,
      rgba(37, 99, 235, 0.04),
      transparent 34%
    ),
    #efeee9;
}

.gallery-main {
  padding-top: 70px;
}

.gallery-section {
  min-height: 100dvh;
  padding: 58px 24px 80px;
  text-align: left;
}

.gallery-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 34px 36px 42px;
  background: #ffffff;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.1);
}

.gallery-heading {
  margin-bottom: 28px;
}

.gallery-kicker {
  display: block;
  margin-bottom: 24px;
  color: #111827;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-align: center;
}

.gallery-title-row {
  display: flex;
  justify-content: flex-start;
}

.gallery-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.gallery-title-wrap h1 {
  margin: 0;
  color: #111827;
  font-size: clamp(22px, 3vw, 31px);
  font-weight: 500;
  letter-spacing: 0.03em;
}

.gallery-heading p {
  max-width: 640px;
  margin: 13px 0 0;
  color: #737373;
  font-size: 13px;
  line-height: 1.7;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}

.gallery-item {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: #e5e7eb;
  cursor: pointer;
  text-align: left;
}

.gallery-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.gallery-item:hover img,
.gallery-item:focus-visible img {
  transform: scale(1.06);
}

.gallery-item:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.65);
  outline-offset: 2px;
}

.gallery-overlay {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 13px;
  color: #fff;
  font-size: 12px;
  background: linear-gradient(
    to top,
    rgba(15, 23, 42, 0.82),
    rgba(15, 23, 42, 0)
  );
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.25s ease;
}

.gallery-item:hover .gallery-overlay,
.gallery-item:focus-visible .gallery-overlay {
  opacity: 1;
  transform: translateY(0);
}

.gallery-overlay i {
  font-size: 12px;
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.86);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.25s ease,
    visibility 0.25s ease;
}

.gallery-lightbox.show {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  width: min(1000px, 94vw);
  max-height: 90vh;
  text-align: center;
}

.lightbox-content img {
  display: block;
  width: 100%;
  max-height: 80vh;
  object-fit: contain;
  background: #111827;
  border-radius: 4px;
}

.lightbox-content p {
  margin-top: 10px;
  color: #fff;
  font-size: 14px;
}

.lightbox-close {
  position: absolute;
  top: 22px;
  right: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  font-size: 18px;
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.04);
}

body.lightbox-open {
  overflow: hidden;
}

@media (max-width: 900px) {
  .gallery-shell {
    padding: 30px 24px 36px;
  }

  .gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
}

@media (max-width: 640px) {
  .gallery-section {
    padding: 35px 14px 55px;
  }

  .gallery-shell {
    padding: 25px 16px 28px;
  }

  .gallery-kicker {
    margin-bottom: 18px;
    font-size: 11px;
  }

  .gallery-heading p {
    font-size: 12px;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .gallery-overlay {
    opacity: 1;
    transform: none;
    padding: 9px 10px;
    font-size: 10px;
  }

  .lightbox-close {
    top: 12px;
    right: 12px;
  }
}
