/* ── СЕКЦИЯ ── */
.gallery-section {
  /*margin-top: 44px;
  padding-top: 56px;
  border-top: 1px solid var(--gray-200);*/
}

/* ── СЕТКА ── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 900px) { .gallery-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .gallery-grid { grid-template-columns: 1fr; } }

/* ── КАРТОЧКА ── */
.gallery-item {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  background: var(--gray-100);
  aspect-ratio: 4 / 3;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
  transition: transform 0.25s, box-shadow 0.25s;
}
.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s;
}
.gallery-item:hover img { transform: scale(1.05); }

/* Заглушка если картинка не загрузилась */
.gallery-placeholder {
  background: linear-gradient(135deg, var(--primary) 0%, #2d3142 100%);
}
.gallery-placeholder::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.12)' stroke-width='1.5'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Ccircle cx='8.5' cy='8.5' r='1.5'/%3E%3Cpolyline points='21 15 16 10 5 21'/%3E%3C/svg%3E")
    center / 48px no-repeat;
}

/* ── ПОДПИСЬ НА КАРТОЧКЕ ── */
.gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 40px 16px 14px;
  background: linear-gradient(to top, rgba(10, 10, 30, 0.85) 0%, transparent 100%);
  color: #fff;
  transform: translateY(4px);
  transition: transform 0.25s;
}
.gallery-item:hover .gallery-caption { transform: translateY(0); }
.gallery-caption span {
  display: block;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.3;
  letter-spacing: 0.3px;
}
.gallery-caption small {
  display: block;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 3px;
}

/* ── ОВЕРЛЕЙ «УВЕЛИЧИТЬ» ── */
.gallery-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(230, 57, 70, 0.55);
  opacity: 0;
  transition: opacity 0.25s;
}
.gallery-item:hover .gallery-overlay { opacity: 1; }

/* ── ЛАЙТБОКС ── */
@keyframes galleryLightboxIn {
  from { opacity: 0; transform: scale(0.95) translateY(16px); }
  to   { opacity: 1; transform: none; }
}

.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 15, 0.93);
  z-index: 1100;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.lightbox-overlay.open { display: flex; }

.lightbox-inner {
  position: relative;
  max-width: 900px;
  width: 100%;
  animation: galleryLightboxIn 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-img-wrap {
  width: 100%;
  border-radius: 10px 10px 0 0;
  overflow: hidden;
  background: var(--primary, #1a1a2e);
  max-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-img-wrap img {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  display: block;
}

/* Подпись под фото в лайтбоксе */
.lightbox-info {
  width: 100%;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 0 0 10px 10px;
  color: #fff;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.lightbox-info strong {
  display: block;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}
.lightbox-info span {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
}
.lightbox-counter {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
  margin-top: 8px;
}

/* Кнопка закрыть */
.lightbox-close {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #fff;
  transition: background 0.2s;
  z-index: 1101;
  line-height: 1;
}
.lightbox-close:hover { background: var(--accent, #e63946); }

/* Стрелки навигации */
.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: background 0.2s;
  z-index: 1101;
}
.lightbox-nav:hover { background: var(--accent, #e63946); }
.lightbox-nav.prev { left: 16px; }
.lightbox-nav.next { right: 16px; }

@media (max-width: 600px) {
  .lightbox-nav.prev { left: 6px; }
  .lightbox-nav.next { right: 6px; }
}

/**/
/* ── GALLERY PAGE ── */
.gallery-section { padding: 72px 0 96px; }

/* Category filter tabs */
.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 56px;
}
.gallery-filter-btn {
  padding: 10px 22px;
  font-family: 'Raleway', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  border: 2px solid var(--gray-200);
  background: var(--white);
  color: var(--primary);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}
.gallery-filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.gallery-filter-btn.active { background: var(--accent); border-color: var(--accent); color: var(--white); }

/* Category block */
.gallery-category { margin-bottom: 72px; }
.gallery-category:last-child { margin-bottom: 0; }

.gallery-cat-header {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 2px solid var(--gray-200);
  position: relative;
}
.gallery-cat-header::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 80px;
  height: 2px;
  background: var(--accent);
}
.gallery-cat-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 56px;
  color: rgba(26,26,46,0.07);
  line-height: 1;
  flex-shrink: 0;
  margin-top: -8px;
  user-select: none;
}
.gallery-cat-info { flex: 1; }
.gallery-cat-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.gallery-cat-tag::before { content: ''; width: 20px; height: 2px; background: var(--accent); }
.gallery-cat-title a {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(28px, 3vw, 40px);
  color: var(--primary);
  letter-spacing: 1.5px;
  line-height: 1;
  margin-bottom: 12px;
  text-decoration: none;
}
.gallery-cat-title a:hover{
    text-decoration: underline;
}
.gallery-cat-desc {
  font-size: 15px;
  color: var(--gray-600);
  line-height: 1.7;
  max-width: 620px;
}
.gallery-cat-count {
  flex-shrink: 0;
  align-self: flex-end;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-400);
  letter-spacing: 0.5px;
}

/* Photo grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.gallery-grid--3 { grid-template-columns: repeat(3, 1fr); }
.gallery-grid--masonry { grid-template-columns: repeat(4, 1fr); }

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  background: var(--gray-100);
  cursor: pointer;
  aspect-ratio: 4/3;
}
.gallery-item--tall { aspect-ratio: 3/4; grid-row: span 2; }
.gallery-item--wide { aspect-ratio: 16/9; grid-column: span 2; }

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

.gallery-item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(26,26,46,0.85) 0%, transparent 55%);
  opacity: 0;
  transition: opacity 0.3s;
  display: flex;
  align-items: flex-end;
  padding: 20px;
}
.gallery-item:hover .gallery-item-overlay { opacity: 1; }

.gallery-item-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--white);
  line-height: 1.4;
}
.gallery-item-zoom {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s, background 0.2s;
  backdrop-filter: blur(4px);
}
.gallery-item:hover .gallery-item-zoom { opacity: 1; }
.gallery-item-zoom:hover { background: var(--accent); }
.gallery-item-zoom svg { stroke: var(--white); }

/* Placeholder color fills for demo */
.gallery-ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }