/* ============================================================
   Benrishi Electrical — Gallery page styles
   Loaded only by /gallery/. Relies on site.css for the shared
   design system (tokens, header, footer, buttons, page-hero).
   ============================================================ */

/* === Gallery grid === */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 8px;
}

.gallery-item {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 2px;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 4 / 3;
  position: relative;
  transition: border-color 0.2s, transform 0.2s;
}

.gallery-item:hover,
.gallery-item:focus-visible {
  border-color: var(--accent);
  transform: translateY(-2px);
  outline: none;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.gallery-item:hover img,
.gallery-item:focus-visible img {
  transform: scale(1.04);
}

.gallery-note {
  margin-top: 28px;
  color: var(--muted);
  font-size: 15px;
}

/* === Lightbox === */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(8, 8, 8, 0.94);
  backdrop-filter: blur(6px);
  padding: 24px;
}

.lightbox.open { display: flex; }

.lightbox-figure {
  margin: 0;
  max-width: 1100px;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-img {
  max-width: 100%;
  max-height: 82vh;
  width: auto;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 2px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.lightbox-caption {
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  letter-spacing: 0.02em;
}

.lightbox-counter {
  display: block;
  color: var(--gold);
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.lb-btn {
  position: absolute;
  background: rgba(20, 20, 20, 0.7);
  border: 1px solid var(--border);
  color: var(--text);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
}

.lb-btn:hover { background: var(--accent); border-color: var(--accent); }

.lb-close { top: 20px; right: 20px; }
.lb-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 20px; top: 50%; transform: translateY(-50%); }

/* === Responsive === */
@media (max-width: 900px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .lb-prev { left: 12px; }
  .lb-next { right: 12px; }
}

@media (max-width: 600px) {
  .gallery-grid { grid-template-columns: 1fr; gap: 14px; }
  .lb-btn { width: 42px; height: 42px; font-size: 20px; }
  .lightbox { padding: 12px; }
  .lightbox-img { max-height: 78vh; }
}
