/* ==========================================================================
   Страница: Галерея (page-gallery.css)
   ========================================================================== */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page-gallery .breadcrumbs {
  margin-bottom: 20px;
}

.page-gallery .breadcrumbs__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5.6px 8px;
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}

.page-gallery .breadcrumbs__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.page-gallery .breadcrumbs__item:not(:last-child)::after {
  content: "›";
  opacity: 0.7;
}

.page-gallery .breadcrumbs__link:hover {
  color: var(--color-accent);
}

.page-gallery .breadcrumbs__current {
  color: var(--color-text);
  font-weight: 600;
}

/* Hero */
.gal-hero {
  padding-top: clamp(12px, 8px + 0.6vw, 18.4px);
  padding-bottom: clamp(13.6px, 9.6px + 0.8vw, 20px);
  background:
    radial-gradient(ellipse 55% 50% at 0% 0%, rgba(227, 6, 19, 0.07), transparent 55%),
    linear-gradient(180deg, #fff 0%, var(--color-bg-soft) 100%);
}

.gal-hero__eyebrow {
  display: inline-block;
  margin-bottom: 8.8px;
  font-size: var(--fs-xs);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent);
}

.gal-hero__title {
  font-size: var(--fs-hero);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.gal-hero__accent {
  color: var(--color-accent);
}

.gal-hero__text {
  color: var(--color-text-muted);
  font-size: var(--fs-md);
  max-width: 640px;
  line-height: 1.55;
}

/* Grid — фото не обрезаются и не растягиваются */
.gal-section {
  padding-top: 0;
  padding-bottom: clamp(20px, 16px + 1.5vw, 32px);
  background: var(--color-bg-soft);
}

.gal-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.gal-item {
  margin: 0;
  border: 0;
  padding: 0;
  cursor: pointer;
  border-radius: var(--radius-md);
  background: var(--color-navy);
  box-shadow: 0 6px 20px rgba(26, 39, 68, 0.06);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  display: block;
  transition: transform var(--transition), box-shadow var(--transition);
}

.gal-item:hover,
.gal-item:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(26, 39, 68, 0.12);
  outline: none;
}

.gal-item:focus-visible {
  box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.35), 0 12px 28px rgba(26, 39, 68, 0.12);
}

.gal-item__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Lightbox */
.gal-lb {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.gal-lb[hidden] {
  display: none;
}

.gal-lb__overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 16, 32, 0.88);
  backdrop-filter: blur(4px);
}

.gal-lb__dialog {
  position: relative;
  z-index: 1;
  width: min(1100px, 100%);
  max-height: min(92vh, 900px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 13.6px;
}

.gal-lb__stage {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.gal-lb__img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(78vh, 780px);
  object-fit: contain;
  object-position: center;
  border-radius: var(--radius-sm);
}

.gal-lb__close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-navy);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.95),
    0 6px 18px rgba(10, 16, 32, 0.45);
  transition: background var(--transition), transform var(--transition);
}

.gal-lb__close:hover {
  background: var(--color-accent);
  transform: scale(1.05);
}

.gal-lb__close::before,
.gal-lb__close::after {
  content: "";
  position: absolute;
  width: 17.6px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}

.gal-lb__close::before {
  transform: rotate(45deg);
}

.gal-lb__close::after {
  transform: rotate(-45deg);
}

.gal-lb__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-navy);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.95),
    0 6px 18px rgba(10, 16, 32, 0.45);
  transition: background var(--transition), transform var(--transition);
}

.gal-lb__nav:hover {
  background: var(--color-accent);
}

.gal-lb__nav--prev {
  left: 8px;
}

.gal-lb__nav--next {
  right: 8px;
}

.gal-lb__nav-icon {
  display: block;
  width: 8.8px;
  height: 8.8px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
}

.gal-lb__nav--prev .gal-lb__nav-icon {
  transform: rotate(-135deg);
  margin-left: 2.4px;
}

.gal-lb__nav--next .gal-lb__nav-icon {
  transform: rotate(45deg);
  margin-right: 2.4px;
}

.gal-lb__meta {
  color: rgba(255, 255, 255, 0.85);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-align: center;
}

.gal-lb__counter {
  opacity: 0.7;
  font-weight: 500;
}

@media (min-width: 640px) {
  .gal-grid {
    gap: 16px;
  }
}

@media (min-width: 768px) {
  .gal-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .gal-lb__nav--prev {
    left: 16px;
  }

  .gal-lb__nav--next {
    right: 16px;
  }
}

@media (min-width: 1024px) {
  .gal-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 18.4px;
  }

  .gal-item {
    aspect-ratio: 1 / 1;
  }
}
