.photo-gallery {
  padding: 76px 0;
  background: #fff;
  color: #102748;
}

.photo-gallery:nth-of-type(even) {
  background: #f4f7f8;
}

.photo-gallery__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.photo-gallery__head {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(280px, .65fr);
  gap: 40px;
  align-items: end;
  margin-bottom: 30px;
}

.photo-gallery h2 {
  margin: 0;
  color: #243b5c;
  font-size: clamp(29px, 4vw, 40px);
  line-height: 1.15;
}

.photo-gallery__intro {
  margin: 0;
  color: #36506d;
  font-size: 16px;
  line-height: 1.6;
}

.photo-gallery__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 190px;
  gap: 12px;
}

.photo-gallery__item {
  position: relative;
  display: block;
  overflow: hidden;
  margin: 0;
  padding: 0;
  border: 0;
  background: #dce5ec;
  cursor: zoom-in;
}

.photo-gallery__grid .photo-gallery__item {
  border-radius: 10px;
}

.photo-gallery__grid .photo-gallery__item:first-child {
  grid-column: span 2;
  grid-row: span 2;
}

.photo-gallery__item img {
  display: block;
  width: 100%;
  height: 100% !important;
  object-fit: cover;
  transition: transform .35s ease;
}

.photo-gallery__item:hover img,
.photo-gallery__item:focus-visible img {
  transform: scale(1.035);
}

.photo-gallery__item:focus-visible {
  outline: 3px solid #3384bf;
  outline-offset: 3px;
}

.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  background: rgba(3, 13, 22, .94);
  color: #fff;
}

.photo-lightbox.is-open {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.photo-lightbox__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 20px;
}

.photo-lightbox__count {
  font-size: 14px;
  font-weight: 700;
}

.photo-lightbox__close,
.photo-lightbox__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  cursor: pointer;
}

.photo-lightbox__close {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 28px;
}

.photo-lightbox__stage {
  position: relative;
  display: flex;
  min-height: 0;
  align-items: center;
  justify-content: center;
  padding: 0 78px;
}

.photo-lightbox__image {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.photo-lightbox__nav {
  position: absolute;
  top: 50%;
  width: 48px;
  height: 64px;
  border-radius: 8px;
  transform: translateY(-50%);
  font-size: 34px;
}

.photo-lightbox__nav--prev { left: 18px; }
.photo-lightbox__nav--next { right: 18px; }

.photo-lightbox__caption {
  min-height: 58px;
  margin: 0;
  padding: 14px 24px 18px;
  text-align: center;
  font-size: 15px;
  line-height: 1.45;
}

.photo-lightbox button:focus-visible {
  outline: 3px solid #65afe4;
  outline-offset: 2px;
}

body.photo-lightbox-open {
  overflow: hidden;
}

@media (max-width: 800px) {
  .photo-gallery { padding: 56px 0; }
  .photo-gallery__head { grid-template-columns: 1fr; gap: 14px; }
  .photo-gallery__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 150px; }
  .photo-gallery__grid .photo-gallery__item:first-child { grid-column: span 2; grid-row: span 2; }
  .photo-lightbox__stage { padding: 0 12px; }
  .photo-lightbox__nav { top: auto; bottom: 8px; width: 52px; height: 48px; }
  .photo-lightbox__nav--prev { left: 16px; }
  .photo-lightbox__nav--next { right: 16px; }
  .photo-lightbox__caption { padding-right: 76px; padding-left: 76px; }
}

@media (max-width: 480px) {
  .photo-gallery__inner { padding: 0 14px; }
  .photo-gallery__grid { grid-auto-rows: 120px; gap: 7px; }
  .photo-gallery__grid .photo-gallery__item { border-radius: 7px; }
  .photo-lightbox__top { padding: 8px 12px; }
  .photo-lightbox__caption { font-size: 13px; }
}
