/* Oasis Gallery — modern grid + lightbox (mobile & desktop) */
:root {
  --og-gap: 16px;
  --og-radius: 14px;
  --og-shadow: 0 6px 24px rgba(0,0,0,.08);
  --og-thumb-bg: #f6f7f9;
  --og-accent: #0ea5e9; /* sky-500 */
}

/* grid */
.gallery, .oas-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--og-gap);
}

@media (max-width: 980px){
  .gallery, .oas-gallery { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 640px){
  .gallery, .oas-gallery { grid-template-columns: 1fr; }
}

.gallery a, .oas-gallery a, .oas-gallery figure {
  position: relative;
  border-radius: var(--og-radius);
  overflow: hidden;
  box-shadow: var(--og-shadow);
  background: var(--og-thumb-bg);
  display: block;
  margin: 0;
}

.gallery img, .oas-gallery img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  aspect-ratio: 16 / 10;
  transition: transform .3s ease;
  will-change: transform;
}

.gallery a:hover img, .oas-gallery a:hover img { transform: scale(1.02); }

/* watermark or corner badge space */
.oas-badge {
  position: absolute;
  right: 10px; bottom: 10px;
  font-size: 11px;
  letter-spacing: .02em;
  padding: 4px 8px;
  background: rgba(255,255,255,.9);
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

/* compact mode (shows only N items) */
.oas-compact [data-idx] { display: none; }
.oas-compact [data-idx].__og-visible { display: block; }

/* 'View all photos' button */
.oas-gallery-toggle {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin: 20px auto 0;
  padding: 14px 22px;
  background: #ffffff;
  color: #0f2747;
  border: 1px solid rgba(17,24,39,.12);
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 8px 30px rgba(2,6,23,.06);
  transition: transform .15s ease, box-shadow .2s ease, background-color .2s ease;
}
.oas-gallery-toggle:hover { transform: translateY(-1px); box-shadow: 0 10px 34px rgba(2,6,23,.10); }
.oas-gallery-toggle:focus-visible { outline: 2px solid var(--og-accent); outline-offset: 3px; }
.oas-gallery-toggle:focus-visible { outline: 2px solid var(--og-accent); outline-offset: 2px; }

/* Lightbox */
.lb { position: fixed; inset: 0; z-index: 9999; display: none; }
.lb[open] { display: grid; place-items: center; background: rgba(0,0,0,.72); }

.lb__stage {
  width: min(1200px, 92vw);
  height: min(78vh, 720px);
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #0b0b0b;
  border-radius: 16px;
}

.lb__img {
  max-width: 100%;
  max-height: 100%;
  width: auto; height: auto;
  display: block;
}

.lb__cap {
  position: absolute;
  left: 16px; right: 16px; bottom: 12px;
  color: #e5e7eb;
  text-shadow: 0 1px 2px rgba(0,0,0,.6);
  font-size: 14px;
}

.lb-btn {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  border: 0;
  background: rgba(255,255,255,.14);
  color: #fff;
  width: 44px; height: 44px;
  border-radius: 999px;
  display: grid; place-items: center;
  cursor: pointer;
}
.lb-prev { left: 14px; }
.lb-next { right: 14px; }

.lb-close {
  position: absolute;
  top: -54px; right: -6px;
  width: 40px; height: 40px;
  border-radius: 999px;
  border: 0;
  background: #111827;
  color: #fff;
  cursor: pointer;
}
@media (max-width:700px){ .lb-close { top: -52px; right: -4px; } }

/* Avoid layout leaking below the footer when modals open */
.scroll-lock { overflow: hidden; }

/* Legacy support: if a page already has .gallery.compact from older builds,
   reuse that class for the compact toggle */
.gallery.compact [data-idx] { display: none; }
.gallery.compact [data-idx].__og-visible { display: block; }


/* only show the last toggle in a Photos section, to avoid duplicates */
.section .oas-gallery-toggle { display: none; }
.section :is(.gallery, .oas-gallery):last-of-type + .oas-gallery-toggle { display: inline-flex; }