/* ============================================================
   ALBUM VIEWER — 2 tầng (lưới + phóng to)
   Tầng 1: av-grid (lưới mosaic)
   Tầng 2: tái dùng rs-lb đã có (results.css). Chỉ thêm nút "Quay lại album".
   ============================================================ */

body.av-lock { overflow: hidden; }

/* ── Tầng 1: lưới ảnh ─────────────────────────────────────── */
.av-grid {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, .92);
  z-index: 1000;
  display: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.av-grid.open { display: block; }

.av-grid-head {
  position: sticky; top: 0; z-index: 2;
  background: rgba(0, 0, 0, .85);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  padding: 18px 24px;
  display: flex; align-items: center; gap: 14px;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.av-grid-head h2 {
  font-family: var(--ff);
  flex: 1;
  font-size: 20px; font-weight: 700;
  margin: 0; line-height: 1.3;
  color: #fff;
}
.av-grid-head .count {
  color: rgba(255, 255, 255, .7);
  font-size: 13px; font-weight: 600;
  background: rgba(255, 255, 255, .08);
  padding: 5px 13px; border-radius: 99px;
  white-space: nowrap;
}
.av-grid-head .close {
  background: rgba(255, 255, 255, .1);
  border: 0; color: #fff;
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid; place-items: center;
  cursor: pointer;
  font-size: 22px;
  transition: .15s;
}
.av-grid-head .close:hover { background: var(--red); }

.av-grid-body {
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  max-width: 1320px;
  margin: 0 auto;
}
.av-thumb {
  cursor: pointer;
  border-radius: var(--r-m);
  overflow: hidden;
  position: relative;
  aspect-ratio: 4/3;
  background: #1a1a1b;
  transition: transform .15s ease, box-shadow .15s ease;
  border: 0;
  padding: 0;
}
.av-thumb:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
}
.av-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.av-thumb .av-thumb-num {
  position: absolute;
  top: 8px; left: 8px;
  font-size: 11px; font-weight: 700;
  color: #fff;
  background: rgba(0, 0, 0, .55);
  padding: 3px 8px;
  border-radius: 6px;
}

/* ── Tầng 2: nút "Quay lại album" thêm vào rs-lb ─────────── */
.rs-lb-back {
  position: absolute;
  top: 24px;
  left: 78px;
  color: #fff;
  font-family: var(--ff);
  font-size: 13px; font-weight: 700;
  background: rgba(255, 255, 255, .12);
  padding: 6px 14px 6px 10px;
  border-radius: 99px;
  display: none;
  align-items: center;
  gap: 4px;
  border: 0;
  cursor: pointer;
  transition: .15s;
}
.rs-lb-back:hover { background: rgba(255, 255, 255, .22); }
.rs-lb-back.show { display: inline-flex; }
.rs-lb-back i { font-size: 16px; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 1080px) {
  .av-grid-body { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
  .av-grid-head { padding: 14px 16px; gap: 10px; }
  .av-grid-head h2 { font-size: 17px; }
  .av-grid-body { grid-template-columns: repeat(2, 1fr); padding: 14px; gap: 8px; }
  .rs-lb-back { left: 12px; top: 70px; }
}
