/* ===================================
   КРОКУС — СТИЛИ ГАЛЕРЕИ
=================================== */

/* ===== СЕТКА ===== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 220px;
  gap: 0.8rem;
  margin-top: 1rem;
}

.gallery-item {
  position: relative; overflow: hidden;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid var(--card-border);
  background: linear-gradient(135deg, #16335c, #2e5c9a);
}

/* Реальное фото — целиком, без обрезки */
.gi-photo {
  width: 100%; height: 100%;
  object-fit: contain;
  background: #0a1424;
  transition: transform 0.5s ease;
}
.gallery-item:hover .gi-photo { transform: scale(1.06); }

/* Если фото не загрузилось — остаётся спокойная синяя плитка */
.gallery-item.no-photo .gi-photo { display: none; }

/* Оверлей при наведении */
.gi-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(5,10,20,0.9) 0%, transparent 50%);
  display: flex; flex-direction: column;
  justify-content: flex-end; padding: 1rem;
  opacity: 0; transition: opacity 0.3s;
}
.gallery-item:hover .gi-overlay,
.gallery-item:focus-visible .gi-overlay { opacity: 1; }
.gi-title { font-family: 'Unbounded', sans-serif; font-size: 0.82rem; color: var(--white); }
.gi-sub   { font-size: 0.72rem; color: var(--green-bright); margin-top: 0.2rem; }

/* ===== ЛАЙТБОКС ===== */
.lightbox {
  display: none;
  position: fixed; inset: 0; z-index: 2000;
  align-items: center; justify-content: center;
}
.lightbox.open { display: flex; }

.lb-overlay {
  position: absolute; inset: 0;
  background: rgba(5,10,20,0.95);
  backdrop-filter: blur(10px);
}
.lb-content {
  position: relative; z-index: 1;
  max-width: 900px; width: 90%;
  display: flex; flex-direction: column; gap: 1rem;
}
.lb-img {
  width: 100%; height: 70vh; max-height: 600px;
  border-radius: var(--radius);
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #0a1424;
  border: 1px solid var(--card-border);
}
.lb-info { text-align: center; }
.lb-info h3 { font-family: 'Unbounded', sans-serif; font-size: 1rem; margin-bottom: 0.3rem; }
.lb-info p  { font-size: 0.85rem; color: var(--text-muted); }

.lb-close, .lb-prev, .lb-next {
  position: absolute;
  background: rgba(255,255,255,0.1);
  border: 1px solid var(--card-border);
  color: var(--white); cursor: pointer;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover { background: var(--green); }

.lb-close { top: -1rem; right: -1rem; width: 40px; height: 40px; font-size: 1rem; }
.lb-prev  { left: -1.5rem; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; font-size: 1.5rem; }
.lb-next  { right: -1.5rem; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; font-size: 1.5rem; }

/* ===== АДАПТИВ ===== */
@media (max-width: 900px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 200px; }
}
@media (max-width: 600px) {
  .gallery-grid { grid-template-columns: 1fr; grid-auto-rows: 200px; }
  .lb-img { height: 60vh; }
  .lb-prev { left: 0.5rem; }
  .lb-next { right: 0.5rem; }
}
