/*!
 * rbgallery.css — styling for rbgallery.js
 */

/* ---------- grid thumbnails ---------- */

.pg-thumb-wrap {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 10px;
  cursor: pointer;
  margin-bottom: 1.5rem;
  background: #eee;
  outline-offset: 3px;
}

/* Default landscape thumbnail */
.pg-thumb-wrap img.pg-thumb {
  display: block;
  width: 100%;
  height: 230px;
  object-fit: cover;
}

/* Portrait thumbnail (same height, centered, matching aspect ratio) */
.pg-thumb-wrap.pg-thumb-portrait {
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.pg-thumb-wrap.pg-thumb-portrait img.pg-thumb {
  width: auto;
  height: 230px;
  max-width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.pg-thumb-wrap:focus-visible {
  outline: 2px solid #2f80ed;
}

/* ---------- overlay / backdrop ---------- */

.pg-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  background: rgba(0, 0, 0, 0.88);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.pg-overlay.pg-open {
  display: flex;
  opacity: 1;
}

body.pg-noscroll {
  overflow: hidden;
}

/* ---------- round icon buttons (close / prev / next) ---------- */

.pg-btn {
  position: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.pg-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}

.pg-btn:focus-visible {
  outline: 2px solid #2f80ed;
  outline-offset: 2px;
}

.pg-close {
  top: 1.5rem;
  right: 1.5rem;
}

.pg-nav.pg-prev {
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
}

.pg-nav.pg-next {
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
}

.pg-nav:hover {
  transform: translateY(-50%) scale(1.05);
}

/* ---------- the card ---------- */

.pg-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  width: 100%;
  max-width: 1180px;
  max-height: 85vh;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Fixed-dimension loading screen centered */
.pg-card.pg-is-loading {
  width: 520px;
  height: 380px;
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}

.pg-card.pg-is-loading .pg-image-pane,
.pg-card.pg-is-loading .pg-content-pane {
  display: none !important;
}

.pg-loading {
  display: none;
  width: 100%;
  height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  color: #555;
  background: #fff;
}

.pg-card.pg-is-loading .pg-loading {
  display: flex;
}

.pg-loading-text {
  font-size: 0.95rem;
  color: #666;
  font-weight: 500;
}

.pg-spinner {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3px solid #e2e2e2;
  border-top-color: #2f80ed;
  animation: pg-spin 0.8s linear infinite;
}

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

/* ---------- full image (view="fi") mode ---------- */

.pg-card.pg-view-fi {
  max-width: 90vw;
  max-height: 85vh;
  background: transparent;
  box-shadow: none;
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.pg-card.pg-view-fi .pg-content-pane {
  display: none !important;
}

.pg-card.pg-view-fi .pg-image-pane {
  flex: 0 1 auto;
  background: transparent;
  aspect-ratio: auto;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.pg-card.pg-view-fi .pg-full-img {
  max-height: 85vh;
  max-width: 90vw;
  border-radius: 12px;
  display: block;
}

/* Info overlay & (i) button for fi mode */
.pg-info-wrap {
  display: none;
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  z-index: 10;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  max-width: min(340px, 80vw);
}

.pg-card.pg-view-fi .pg-info-wrap {
  display: flex;
}

.pg-info-box {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  padding: 0.9rem 1.1rem;
  border-radius: 10px;
  font-size: 0.85rem;
  line-height: 1.45;
  text-align: right;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.pg-info-wrap.pg-info-open .pg-info-box {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.pg-info-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.pg-info-desc {
  color: #ccc;
  margin-bottom: 0.35rem;
}

.pg-info-date {
  font-size: 0.78rem;
  color: #aaa;
}

.pg-info-loc-link {
  color: #64b5f6;
  text-decoration: none;
  font-size: 0.78rem;
}

.pg-info-loc-link:hover {
  text-decoration: underline;
}

.pg-info-btn {
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.6));
  transition: color 0.2s ease, transform 0.15s ease;
}

.pg-info-btn:hover {
  color: rgba(255, 255, 255, 0.95);
  transform: scale(1.1);
}

/* ---------- with pane (view="wp") mode ---------- */

.pg-image-pane {
  position: relative;
  flex: 1 1 62%;
  min-height: 320px;
  max-height: 85vh;
  aspect-ratio: 4 / 3;
  transition: aspect-ratio 0.25s ease;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pg-full-img {
  display: block;
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
}

.pg-content-pane {
  flex: 1 1 38%;
  padding: 2.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.pg-title {
  margin: 0 0 0.9rem;
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.2;
}

.pg-description {
  margin: 0 0 1.5rem;
  color: #555;
  line-height: 1.6;
}

.pg-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
  color: #444;
}

.pg-meta .pg-icon {
  flex: none;
  color: #888;
}

.pg-location-link {
  color: #2f80ed;
  text-decoration: none;
}

.pg-location-link:hover {
  text-decoration: underline;
}

/* image-only lightbox fallback */
.pg-card.pg-no-content {
  max-width: 90vw;
  background: transparent;
  box-shadow: none;
}

.pg-card.pg-no-content .pg-image-pane {
  background: transparent;
}

.pg-card.pg-no-content .pg-content-pane {
  display: none;
}

/* ---------- responsive: mobile screens ---------- */

@media (max-width: 767.98px) {
  .pg-overlay {
    padding: 1rem;
  }

  .pg-card {
    flex-direction: column;
    align-items: stretch;
    max-height: 92vh;
    overflow-y: auto;
  }

  .pg-card.pg-is-loading {
    width: 90vw;
    height: 300px;
    max-height: 70vh;
  }

  .pg-image-pane {
    width: 100%;
    min-height: 220px;
    max-height: 45vh;
    flex: none;
  }

  .pg-full-img {
    max-height: 45vh;
  }

  .pg-content-pane {
    padding: 1.5rem;
  }

  .pg-title {
    font-size: 1.4rem;
  }

  .pg-nav.pg-prev {
    left: 0.5rem;
  }

  .pg-nav.pg-next {
    right: 0.5rem;
  }

  .pg-btn {
    width: 38px;
    height: 38px;
  }
}