/* Карточки фото на /gallery */
.gallery .gph-thumb {
  cursor: zoom-in;
}
.gallery .gph-thumb-img {
  cursor: zoom-in;
  display: block;
}

.gallery .gph-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: transparent;
  transition: background 0.25s ease;
}
.gallery .card:hover .gph-overlay {
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 40%,
    rgba(0, 0, 0, 0.22) 72%,
    rgba(0, 0, 0, 0.48) 100%
  );
}

.gallery .gph-dl {
  pointer-events: auto;
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(0, 0, 0, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 8px;
  text-decoration: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.38);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.gallery .gph-dl:hover {
  background: rgba(0, 0, 0, 0.68);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
}
.gallery .gph-dl svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  flex-shrink: 0;
}
.gallery .gph-dl-text {
  line-height: 1;
}

@media (max-width: 560px) {
  .gallery .gph-dl-text {
    display: none;
  }
  .gallery .gph-dl {
    padding: 8px;
    border-radius: 50%;
  }
}

/* Лайтбокс */
.gph-lb {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.gph-lb[hidden] {
  display: none !important;
}
.gph-lb-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  margin: 0;
  padding: 0;
  background: rgba(4, 5, 8, 0.92);
  cursor: pointer;
}

.gph-lb-inner {
  position: relative;
  z-index: 1;
  max-width: min(96vw, 920px);
  max-height: min(92vh, 1200px);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  min-height: 0;
}

.gph-lb-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 0;
  max-height: min(92vh, 1200px);
  overflow: hidden;
}

.gph-lb-img {
  max-width: 100%;
  max-height: min(68vh, 900px);
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 10px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  cursor: default;
  flex-shrink: 0;
}

.gph-lb-foot {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-height: min(30vh, 280px);
  overflow-y: auto;
  margin-top: 14px;
  padding: 0 6px 4px;
  text-align: center;
  -webkit-overflow-scrolling: touch;
}

.gph-lb-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  line-height: 1.35;
  margin: 0 0 8px;
}

.gph-lb-title:empty,
.gph-lb-title[hidden] {
  display: none;
}

.gph-lb-desc {
  font-size: 0.88rem;
  line-height: 1.5;
  color: rgba(220, 224, 235, 0.82);
}

.gph-lb-desc[hidden] {
  display: none !important;
}

.gph-lb-desc-main {
  margin: 0 0 10px;
}

.gph-lb-desc-main:last-child {
  margin-bottom: 0;
}

.gph-lb-desc-meta {
  margin: 0;
  font-size: 0.8rem;
  color: rgba(180, 186, 200, 0.72);
  letter-spacing: 0.01em;
}

.gph-lb-close {
  position: absolute;
  top: -44px;
  right: 0;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0 4px;
  transition: background 0.15s, color 0.15s;
}
.gph-lb-close:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

@media (max-width: 560px) {
  .gph-lb-close {
    top: 8px;
    right: 0;
    background: rgba(0, 0, 0, 0.55);
  }
}
