/* Photography page — minimal editorial gallery */

body.photography-page {
  overflow-x: hidden;
}

.photography-page .section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 120px 0 100px;
}

.photography-page .section__content {
  border-top: none;
  padding-top: 8px;
}

.photography-page .section-divider {
  margin-bottom: 36px;
}

.photography-page .footer {
  position: relative;
  bottom: auto;
  padding: 8px 0 36px;
}

.photography-page .section__intro {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

.photography-page .section__count {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #53c2ee;
  white-space: nowrap;
}

/* Masonry gallery */
.gallery {
  column-count: 3;
  column-gap: clamp(14px, 2vw, 22px);
}

.gallery__item {
  display: block;
  width: 100%;
  margin: 0 0 clamp(14px, 2vw, 22px);
  padding: 0;
  border: none;
  background: rgba(83, 194, 238, 0.06);
  cursor: zoom-in;
  border-radius: 4px;
  overflow: hidden;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  position: relative;
  aspect-ratio: 3 / 4;
  opacity: 1;
  transform: none;
  animation: none;
}

.gallery__loader {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    110deg,
    rgba(83, 194, 238, 0.08) 8%,
    rgba(83, 194, 238, 0.18) 18%,
    rgba(83, 194, 238, 0.08) 33%
  );
  background-size: 200% 100%;
  animation: gallery-shimmer 1.4s ease-in-out infinite;
  pointer-events: none;
}

[data-theme="dark"] .gallery__loader {
  background: linear-gradient(
    110deg,
    rgba(83, 194, 238, 0.05) 8%,
    rgba(83, 194, 238, 0.12) 18%,
    rgba(83, 194, 238, 0.05) 33%
  );
  background-size: 200% 100%;
}

@keyframes gallery-shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

.gallery__item--loaded .gallery__loader {
  opacity: 0;
  transition: opacity 0.35s ease;
}

.gallery__item img {
  display: block;
  width: 100%;
  height: auto;
  opacity: 0;
  transition:
    opacity 0.45s ease,
    transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.gallery__item--loaded img {
  opacity: 1;
}

.gallery__item--error {
  background: var(--border);
}

.gallery__item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background 0.35s ease;
  pointer-events: none;
}

.gallery__item:hover::after,
.gallery__item:focus-visible::after {
  background: rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .gallery__item:hover::after,
[data-theme="dark"] .gallery__item:focus-visible::after {
  background: rgba(255, 255, 255, 0.04);
}

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

.gallery__item:focus-visible {
  outline: 2px solid #53c2ee;
  outline-offset: 3px;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 48px);
  background: rgba(8, 8, 10, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.lightbox__stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  max-height: calc(100vh - 96px);
  min-height: min(60vh, 520px);
}

.lightbox__img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 96px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: scale(0.98);
  transition:
    opacity 0.35s ease,
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.lightbox--loading .lightbox__stage::after {
  content: "";
  position: absolute;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: #53c2ee;
  animation: lightbox-spin 0.75s linear infinite;
}

@keyframes lightbox-spin {
  to {
    transform: rotate(360deg);
  }
}

.lightbox--open .lightbox__img--visible {
  opacity: 1;
  transform: scale(1);
}

.lightbox__btn {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: color 0.2s ease, opacity 0.2s ease;
  z-index: 2;
}

.lightbox__btn:hover,
.lightbox__btn:focus-visible {
  color: #fff;
  outline: none;
}

.lightbox__close {
  top: clamp(16px, 3vw, 32px);
  right: clamp(16px, 3vw, 32px);
  width: 44px;
  height: 44px;
  font-size: 28px;
  line-height: 1;
}

.lightbox__prev,
.lightbox__next {
  top: 50%;
  width: 48px;
  height: 48px;
  margin-top: -24px;
  font-size: 22px;
}

.lightbox__prev {
  left: clamp(8px, 2vw, 24px);
}

.lightbox__next {
  right: clamp(8px, 2vw, 24px);
}

.lightbox__count {
  position: absolute;
  bottom: clamp(16px, 3vw, 32px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

@media (max-width: 900px) {
  .photography-page .section {
    padding: calc(110px + var(--safe-top)) 0 calc(80px + var(--safe-bottom));
  }

  .gallery {
    column-count: 2;
  }
}

@media (max-width: 600px) {
  .photography-page .section {
    padding: calc(96px + var(--safe-top)) 0 calc(64px + var(--safe-bottom));
  }

  .photography-page .section__intro {
    margin-bottom: 28px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .gallery {
    column-count: 1;
    column-gap: 14px;
  }

  .gallery__item {
    margin-bottom: 14px;
  }

  .lightbox {
    padding: calc(12px + var(--safe-top)) calc(12px + var(--safe-right)) calc(12px + var(--safe-bottom)) calc(12px + var(--safe-left));
  }

  .lightbox__prev,
  .lightbox__next {
    width: 40px;
    height: 40px;
    margin-top: -20px;
  }

  .lightbox__close {
    width: 40px;
    height: 40px;
    font-size: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery__item {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .gallery__loader {
    animation: none;
  }

  .gallery__item img,
  .lightbox__img {
    transition: none;
  }

  .lightbox--loading .lightbox__stage::after {
    animation: none;
  }
}
