/* ============================================================
   ZAG Gallery Suite — Frontend Styles
   ============================================================ */

/* ---------- SHARED ---------- */
.zagg-empty {
  color: #888;
  font-style: italic;
  padding: 2rem 0;
}

/* ---------- ALBUM BROWSER ---------- */
.zagg-album-browser {
  width: 100%;
}

/* Filter bar */
.zagg-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 2rem;
}

.zagg-filter-btn {
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.45rem 1.1rem;
  border-radius: 99px;
  border: 1.5px solid #d0cdc8;
  background: transparent;
  color: #555;
  cursor: pointer;
  transition: all 0.18s ease;
}

.zagg-filter-btn:hover,
.zagg-filter-btn.active {
  background: #7B1C2E;
  border-color: #7B1C2E;
  color: #fff;
}

/* Album grid */
.zagg-album-grid {
  display: grid;
  gap: 1.25rem;
}

.zagg-cols-2 { grid-template-columns: repeat(2, 1fr); }
.zagg-cols-3 { grid-template-columns: repeat(3, 1fr); }
.zagg-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Album card */
.zagg-album-card {
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #ede9e2;
  box-shadow: 0 2px 12px rgba(28,28,30,.08);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.zagg-album-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 28px rgba(28,28,30,.15);
}

.zagg-album-card.zagg-hidden { display: none; }

.zagg-album-card-inner {
  display: block;
  text-decoration: none;
  color: inherit;
}

.zagg-album-thumb {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: #f0ece4;
}

.zagg-album-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.zagg-album-card:hover .zagg-album-thumb img {
  transform: scale(1.05);
}

.zagg-album-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: #bbb;
}

.zagg-photo-count {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 99px;
  letter-spacing: 0.04em;
}

.zagg-album-meta {
  padding: 1rem 1.1rem 1.1rem;
}

.zagg-album-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 4px;
  color: #1c1c1e;
  line-height: 1.3;
}

.zagg-album-date {
  display: block;
  font-size: 0.8rem;
  color: #888;
  margin-bottom: 4px;
}

.zagg-album-cat {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #7B1C2E;
  background: rgba(123,28,46,.08);
  padding: 2px 8px;
  border-radius: 99px;
}

/* Load more */
.zagg-load-more-wrap {
  text-align: center;
  margin-top: 2.5rem;
}

.zagg-load-more-btn {
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.7rem 2rem;
  border-radius: 6px;
  border: 2px solid #7B1C2E;
  background: transparent;
  color: #7B1C2E;
  cursor: pointer;
  transition: all 0.18s ease;
}

.zagg-load-more-btn:hover {
  background: #7B1C2E;
  color: #fff;
}

.zagg-load-more-btn:disabled {
  opacity: .45;
  cursor: default;
}

/* ---------- MASONRY GRID ---------- */
.zagg-masonry-wrap {
  width: 100%;
}

.zagg-masonry {
  column-count: 3;
  column-gap: 12px;
}

.zagg-masonry-item {
  break-inside: avoid;
  page-break-inside: avoid;
  margin-bottom: 12px;
  position: relative;
  cursor: zoom-in;
  border-radius: 8px;
  overflow: hidden;
  background: #f0ece4;
}

.zagg-masonry-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.35s ease;
  border-radius: 8px;
}

.zagg-masonry-item:hover img {
  transform: scale(1.03);
}

.zagg-masonry-overlay {
  position: absolute;
  inset: 0;
  background: rgba(123, 28, 46, 0.35);
  opacity: 0;
  transition: opacity 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.zagg-masonry-item:hover .zagg-masonry-overlay {
  opacity: 1;
}

.zagg-zoom-icon {
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  display: block;
}

/* ---------- LIGHTBOX ---------- */
.zagg-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.zagg-lightbox[hidden] { display: none; }

.zagg-lb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  cursor: zoom-out;
}

.zagg-lb-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 70px 120px;
  box-sizing: border-box;
  user-select: none;
}

/* Close button */
.zagg-lb-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: rgba(255,255,255,.75);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s;
  padding: 4px 8px;
  z-index: 10;
}

.zagg-lb-close:hover { color: #fff; }

/* Prev / Next */
.zagg-lb-prev,
.zagg-lb-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.12);
  border: 1.5px solid rgba(255,255,255,.2);
  color: #fff;
  font-size: 1.75rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.15s;
  z-index: 10;
  line-height: 1;
}

.zagg-lb-prev { left: 16px; }
.zagg-lb-next { right: 16px; }

.zagg-lb-prev:hover { background: rgba(255,255,255,.25); transform: translateY(-50%) scale(1.08); }
.zagg-lb-next:hover { background: rgba(255,255,255,.25); transform: translateY(-50%) scale(1.08); }

.zagg-lb-prev:disabled,
.zagg-lb-next:disabled { opacity: .3; cursor: default; }

/* Image stage */
.zagg-lb-stage {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.zagg-lb-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  opacity: 0;
  transition: opacity 0.25s ease;
  display: block;
}

.zagg-lb-img.zagg-loaded { opacity: 1; }

/* Spinner */
.zagg-lb-spinner {
  position: absolute;
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255,255,255,.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: zagg-spin .7s linear infinite;
}

.zagg-lb-spinner.zagg-hidden { display: none; }

@keyframes zagg-spin {
  to { transform: rotate(360deg); }
}

/* Footer */
.zagg-lb-footer {
  position: absolute;
  bottom: 72px;
  left: 0;
  right: 0;
  text-align: center;
  padding: 0 80px;
}

.zagg-lb-caption {
  color: rgba(255,255,255,.8);
  font-size: 0.875rem;
  margin: 0 0 4px;
  line-height: 1.5;
}

.zagg-lb-counter {
  color: rgba(255,255,255,.45);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

/* Thumbnail strip */
.zagg-lb-thumbstrip {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 80px;
  overflow-x: auto;
  scrollbar-width: none;
}

.zagg-lb-thumbstrip::-webkit-scrollbar { display: none; }

.zagg-lb-thumb {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 5px;
  object-fit: cover;
  opacity: 0.5;
  cursor: pointer;
  border: 2px solid transparent;
  transition: opacity 0.15s, border-color 0.15s;
}

.zagg-lb-thumb:hover { opacity: 0.8; }
.zagg-lb-thumb.zagg-active {
  opacity: 1;
  border-color: #C8922A;
}

/* Slide animation */
.zagg-lb-img.zagg-slide-left  { animation: zagg-slide-l .22s ease forwards; }
.zagg-lb-img.zagg-slide-right { animation: zagg-slide-r .22s ease forwards; }

@keyframes zagg-slide-l {
  from { transform: translateX(30px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
@keyframes zagg-slide-r {
  from { transform: translateX(-30px); opacity: 0; }
  to   { transform: translateX(0);     opacity: 1; }
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1024px) {
  .zagg-masonry { column-count: 2; }
  .zagg-cols-4  { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .zagg-masonry { column-count: 2; }
  .zagg-cols-3,
  .zagg-cols-4  { grid-template-columns: repeat(2, 1fr); }

  .zagg-lb-shell { padding: 50px 50px 100px; }
  .zagg-lb-prev  { left: 8px; }
  .zagg-lb-next  { right: 8px; }
  .zagg-lb-prev,
  .zagg-lb-next  { width: 38px; height: 38px; font-size: 1.4rem; }
  .zagg-lb-thumbstrip { height: 56px; }
  .zagg-lb-thumb { width: 40px; height: 40px; }
}

@media (max-width: 480px) {
  .zagg-masonry { column-count: 1; }
  .zagg-cols-2,
  .zagg-cols-3,
  .zagg-cols-4  { grid-template-columns: 1fr; }

  .zagg-lb-shell { padding: 44px 10px 90px; }
}
