/* ══════════════════════════════════════════
   Gallery — Album Grid + Panel + Lightbox
   ══════════════════════════════════════════ */

/* ── Album cards ── */
.g-albums {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}

.g-album {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.05);
  transition: transform .2s, box-shadow .2s;
  user-select: none;
}
.g-album:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0,0,0,.14);
}

.g-album__thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #e8edf3;
  display: flex;
  align-items: center;
  justify-content: center;
}
.g-album__thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s ease;
}
.g-album:hover .g-album__thumb img { transform: scale(1.06); }

.g-album__placeholder { font-size: 52px; color: #94a3b8; }

.g-album__badge {
  position: absolute;
  bottom: 8px; right: 8px;
  background: rgba(0,0,0,.52);
  color: #fff;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 99px;
  backdrop-filter: blur(4px);
}

.g-album__info { padding: 14px 16px 16px; }
.g-album__title { font-weight: 700; font-size: 15px; color: #1e293b; margin-bottom: 3px; }
.g-album__desc  { font-size: 13px; color: #64748b; line-height: 1.45; }

/* ── Image panel (opens below grid on click) ── */
.g-panel {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid #e2e8f0;
}
.g-panel[hidden] { display: none; }

.g-panel__header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.g-panel__back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: none;
  border: 1px solid #cbd5e1;
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  color: #1e293b;
  transition: background .15s;
  white-space: nowrap;
}
.g-panel__back:hover { background: #f1f5f9; }
.g-panel__back svg   { stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.g-panel__header h3  { font-size: 20px; font-weight: 700; color: #1a3a6e; }

.g-panel__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.g-img {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 9px;
  cursor: zoom-in;
  background: #e2e8f0;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  transition: transform .2s;
}
.g-img:hover { transform: scale(1.03); box-shadow: 0 4px 16px rgba(0,0,0,.14); }
.g-img img   { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ── Lightbox ── */
.g-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.92);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: lbFadeIn .18s ease;
}
.g-lightbox[hidden] { display: none; }

@keyframes lbFadeIn { from { opacity: 0 } to { opacity: 1 } }

.g-lb__close {
  position: absolute;
  top: 16px; right: 20px;
  background: rgba(255,255,255,.12);
  border: none;
  color: #fff;
  font-size: 22px;
  width: 40px; height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.g-lb__close:hover { background: rgba(255,255,255,.25); }

.g-lb__nav {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.12);
  border: none;
  color: #fff;
  font-size: 36px;
  line-height: 1;
  padding: 10px 18px;
  cursor: pointer;
  border-radius: 8px;
  transition: background .15s;
}
.g-lb__nav:hover  { background: rgba(255,255,255,.25); }
.g-lb__nav--prev  { left: 16px; }
.g-lb__nav--next  { right: 16px; }

.g-lb__stage {
  max-width: min(90vw, 1200px);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
}
.g-lb__img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 5px;
  object-fit: contain;
  display: block;
  box-shadow: 0 8px 40px rgba(0,0,0,.5);
}
.g-lb__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 12px;
  color: rgba(255,255,255,.65);
  font-size: 13px;
  gap: 12px;
}
.g-lb__counter { flex-shrink: 0; }
.g-lb__caption { flex: 1; text-align: center; font-style: italic; }

/* ── Utility states ── */
.gallery-loading,
.gallery-empty {
  text-align: center;
  padding: 40px 20px;
  color: #94a3b8;
  font-size: 15px;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .g-albums           { grid-template-columns: 1fr 1fr; gap: 14px; }
  .g-panel__grid      { grid-template-columns: 1fr 1fr; gap: 10px; }
  .g-lb__nav          { font-size: 28px; padding: 8px 12px; }
  .g-lb__nav--prev    { left: 6px; }
  .g-lb__nav--next    { right: 6px; }
}
