/* Gallery / Poptrox improved styles (trimmed from Multiverse theme) */
.poptrox-popup .caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(20,20,20,0.56);
  color: #fff;
  padding: 1rem 1.25rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.6);
  width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-align: left;
  line-height: 1.4;
}

.poptrox-popup img,
.poptrox-popup .caption img { max-width: 100%; height: auto; display: block; }

.poptrox-popup { padding-bottom: 0 !important; box-sizing: border-box; max-width: 100% !important; width: auto !important; }
.poptrox-popup.has-caption { padding-bottom: 60px !important; }
.poptrox-popup .caption:empty { display: none !important; height: 0 !important; padding: 0 !important; margin: 0 !important; }

/* Overlay and body state while modal active */
.poptrox-overlay { z-index: 12000 !important; background-color: rgba(8,8,8,0.36) !important; backdrop-filter: blur(8px) saturate(0.95); -webkit-backdrop-filter: blur(8px) saturate(0.95); }

body.modal-active { overflow: hidden !important; }
body.modal-active #wrapper { filter: blur(10px) saturate(0.9); -webkit-filter: blur(10px) saturate(0.9); }

/* Minimal scrollbar inside popup */
.poptrox-popup { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.14) rgba(255,255,255,0.02); }
.poptrox-popup::-webkit-scrollbar { width: 12px; height: 12px; }
.poptrox-popup::-webkit-scrollbar-track { background: rgba(255,255,255,0.02); border-radius: 8px; }
.poptrox-popup::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 8px; }

/* Gallery thumbnail grid */
#gallery .thumbs { display:flex; flex-wrap:wrap; gap:8px; }
#gallery .thumb { flex: 1 1 calc(33% - 8px); box-sizing:border-box; position:relative; overflow:hidden; }
#gallery .thumb img { width:100%; height:auto; display:block; border-radius:6px; }
@media (max-width:880px){ #gallery .thumb { flex:1 1 calc(50% - 8px); } }
@media (max-width:560px){ #gallery .thumb { flex:1 1 100%; } }

/* Past gallery two-column layout */
.past-gallery .split { display:flex; gap:1.5rem; align-items:flex-start; }
.past-gallery .left { flex: 0 0 58%; }
.past-gallery .right { flex: 1 1 42%; max-width:42%; }
.past-gallery .left-grid { display:grid; gap:10px; grid-auto-rows: auto; }
.past-gallery .left-grid .thumb { box-sizing:border-box; position:relative; overflow:hidden; border-radius:8px; }
.past-gallery .left-grid .thumb img { width:100%; height:100%; object-fit:cover; display:block; aspect-ratio:1 / 1; transition: transform .18s cubic-bezier(.2,.9,.3,1), box-shadow .18s ease; }

/* Tight packing: small gap already set above */

/* Hover effect: small scale, lift shadow, and slight translate */
.past-gallery .left-grid .thumb:hover img,
.past-gallery .left-grid .thumb:focus-within img { transform: scale(1.06) translateY(-3px); box-shadow: 0 10px 30px rgba(0,0,0,0.35); }
@media (max-width:980px){ .past-gallery .split { flex-direction:column; } .past-gallery .left, .past-gallery .right { max-width:100%; flex:1 1 100%; } }

/* Poptrox popup controls override: closer top-right, nav buttons visible */
.poptrox-popup .closer { position: absolute; top: 8px; right: 8px; z-index: 20001; background: rgba(0,0,0,0.6); color: #fff; width: 44px; height: 44px; border-radius: 6px; text-align: center; line-height: 44px; font-size: 20px; cursor: pointer; }
.poptrox-popup .nav-previous, .poptrox-popup .nav-next { position: absolute; top: 50%; transform: translateY(-50%); z-index: 20000; width: 72px; height: 140px; display:flex; align-items:center; justify-content:center; color: rgba(255,255,255,0.95); font-size: 34px; }
.poptrox-popup .nav-previous { left: 0; }
.poptrox-popup .nav-next { right: 0; }

/* Ensure overlay covers header/footer and disable background scroll when modal active */
.poptrox-overlay { position: fixed; inset: 0; }
.modal-active body, .modal-active #wrapper { overflow: hidden !important; }
