/* bnyxnet-public.css
   Public styles for BnyxNetImageGallery
   Author: Binoy Abraham — Professional Edition © Binoy Abraham
*/

/* Sticky toolbar */
.bxng-controls {
  position: sticky;
  top: 0;
  background: #fff;
  padding: 8px 12px;
  border-bottom: 1px solid #ddd;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  z-index: 100;
}

/* Buttons & selects */
.bxng-btn,
.bxng-year,
.bxng-folder {
  font-size: 14px;
  padding: 6px 8px;
}
.bxng-btn {
  background: #1a73e8;
  color: #fff;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}
.bxng-btn[disabled] { opacity: 0.5; cursor: default; }

/* Grid */
#bxng-grid {
  column-count: 4;
  column-gap: 12px;
  padding: 12px;
}
@media (max-width:1200px){ #bxng-grid { column-count:3; } }
@media (max-width:800px){ #bxng-grid { column-count:2; } }
@media (max-width:500px){ #bxng-grid { column-count:1; } }

/* Cards */
.bxng-card {
  display: block;
  break-inside: avoid;
  margin-bottom: 12px;
  border-radius: 6px;
  overflow: hidden;
  background: #f8f8f8;
  transition: transform .15s ease, box-shadow .15s ease;
}
.bxng-card img {
  width: 100%;
  height: auto;
  display: block;
  background: #eee;
}
.bxng-card:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

/* ensure card is positioned for watermark overlay */
.bxng-card { position: relative; overflow: hidden; display:block; }

/* watermark overlay (grid cards and modal slides) */
.bxng-card .bxng-watermark,
.bxng-modal .swiper-slide .bxng-watermark {
  position: absolute;
  right: 8px;
  bottom: 8px;
  font-size: 11px;
  line-height: 1;
  color: rgba(255,255,255,0.95);
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
  background: rgba(0,0,0,0.28);
  padding: 2px 6px;
  border-radius: 3px;
  pointer-events: none;
  z-index: 9999;
  white-space: nowrap;
}

/* thumbnail grid cards: ensure anchor contains watermark */
.bxng-card > .bxng-watermark { pointer-events:none; }

/* Status + error */
.bxng-status { font-size: 13px; color: #555; margin-left: 8px; }
.bxng-error {
  color: #b00020;
  font-size: 13px;
  margin: 10px;
  padding: 6px 8px;
  background: rgba(176,0,32,0.08);
  border-left: 3px solid #b00020;
}

/* Spinner */
.bxng-loading {
  display: none;
  position: fixed;
  left: 50%;
  top: 50%;
  width: 48px;
  height: 48px;
  margin-left: -24px;
  margin-top: -24px;
  z-index: 9999;
}
.bxng-loading .spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(0,0,0,0.15);
  border-top: 4px solid rgba(0,0,0,0.6);
  border-radius: 50%;
  animation: bxng-spin .7s linear infinite;
}
@keyframes bxng-spin { to { transform: rotate(360deg); } }

/* Hover preview */
#bxng-hover-preview {
  display: none;
  position: fixed; /* use fixed so we can clamp inside viewport */
  pointer-events: none;
  z-index: 9999;
  border: 2px solid #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  background: #000;
  border-radius: 4px;
  overflow: hidden;
  max-width: 90vw;
  max-height: 90vh;
}
/* Larger, responsive hover preview: up to 800px or 80% of viewport */
#bxng-hover-preview img {
  max-width: min(80vw, 800px);
  max-height: min(80vh, 800px);
  display: block;
}
@media (max-width:600px){
  /* smaller devices: allow up to 90% of viewport or 480px */
  #bxng-hover-preview img { max-width: min(90vw, 480px); max-height: min(70vh, 480px); }
}

/* Modal slideshow (Swiper) */
.bxng-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 10000;
}
.bxng-modal.show { display: block; }
.bxng-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.85);
}
.bxng-modal-dialog {
  position: absolute;
  inset: 40px;
  display: grid;
  place-items: center;
}
.bxng-close {
  position: absolute;
  top: 14px; right: 18px;
  width: 36px; height: 36px;
  border-radius: 18px;
  border: 0;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
}

/* Swiper sizing - ensure slides and images fill modal area (cover to fit gallery width) */
.bxng-modal .bxng-swiper { width: 100%; height: 100%; }
.bxng-modal .bxng-swiper .swiper-wrapper,
.bxng-modal .bxng-swiper .swiper-slide { height: 100%; }
.bxng-modal .bxng-swiper .swiper-slide { display: flex; align-items: center; justify-content: center; }
.bxng-modal .bxng-swiper .swiper-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  margin: 0 auto;
}

/* ensure preloader doesn't visually cover loaded image (keeps contrast) */
.bxng-modal .swiper-lazy-preloader { opacity: 0.9; }

/* Ensure any fullscreen or inline image caption/name is hidden on public site */
.bxng-fs-caption,
.bxng-card .caption,
.bxng-public-image-name {
  display: none !important;
}
