/* Bentley Green Gallery – WordPress Plugin Styles */

.bgg-gallery {
  font-family: Georgia, 'Times New Roman', serif;
}

/* Grid */
.bgg-grid {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
}

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

@media (max-width: 768px) {
  .bgg-cols-3 .bgg-grid,
  .bgg-cols-4 .bgg-grid,
  .bgg-cols-5 .bgg-grid,
  .bgg-cols-6 .bgg-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .bgg-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Thumbnail */
.bgg-item {
  display: flex;
  flex-direction: column;
}

.bgg-thumb {
  display: block;
  overflow: hidden;
  border-radius: 6px;
  aspect-ratio: 1 / 1;
  background: #f5f5f0;
}

.bgg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.bgg-thumb:hover .bgg-img {
  transform: scale(1.03);
  opacity: 0.92;
}

.bgg-caption {
  margin-top: 6px;
  font-size: 0.8rem;
  color: #5a5a50;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bgg-caption-text {
  font-style: italic;
}

.bgg-caption-credit::before {
  content: '— ';
}

/* Pagination */
.bgg-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 24px;
}

.bgg-page-btn {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid #c8c8b8;
  border-radius: 4px;
  color: #2a4a2a;
  text-decoration: none;
  font-size: 0.875rem;
  background: #fff;
  transition: background 0.15s ease, color 0.15s ease;
}

.bgg-page-btn:hover {
  background: #e8f0e8;
  color: #1a3a1a;
  text-decoration: none;
}

.bgg-page-btn--active {
  background: #1a5c3a;
  color: #fff;
  border-color: #1a5c3a;
  font-weight: 600;
  pointer-events: none;
}

/* Errors / empty */
.bgg-error {
  color: #a00;
  font-size: 0.9rem;
}

.bgg-empty {
  color: #777;
  font-style: italic;
  text-align: center;
  padding: 2rem 0;
}

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

.bgg-lightbox[hidden] {
  display: none !important;
}

.bgg-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  cursor: pointer;
}

.bgg-lightbox-inner {
  position: relative;
  z-index: 1;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.bgg-lightbox-figure {
  margin: 0;
  text-align: center;
}

.bgg-lightbox-img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 4px;
  display: block;
}

.bgg-lightbox-caption {
  margin-top: 12px;
  color: rgba(255,255,255,0.8);
  font-size: 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.bgg-lightbox-caption-text {
  font-style: italic;
}

.bgg-lightbox-credit::before {
  content: '— ';
}

.bgg-lightbox-close,
.bgg-lightbox-prev,
.bgg-lightbox-next {
  position: absolute;
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
  font-size: 1.5rem;
  line-height: 1;
}

.bgg-lightbox-close:hover,
.bgg-lightbox-prev:hover,
.bgg-lightbox-next:hover {
  background: rgba(255,255,255,0.3);
}

.bgg-lightbox-close {
  top: -3rem;
  right: 0;
  width: 36px;
  height: 36px;
}

.bgg-lightbox-prev {
  left: -3.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
}

.bgg-lightbox-next {
  right: -3.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
}

@media (max-width: 600px) {
  .bgg-lightbox-prev { left: 4px; }
  .bgg-lightbox-next { right: 4px; }
  .bgg-lightbox-close { top: 4px; right: 4px; position: fixed; }
}
