/* =====================================================================
   Om Enterprise — "Our Work" gallery
   Creative bento mosaic · hover captions · click-to-zoom lightbox
   Matches the brand system (blue #3783F0 → indigo #6963EC, warm accents).
   ===================================================================== */

/* ---- Bento mosaic -------------------------------------------------- */
.gallery-mosaic {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 200px;
  grid-auto-flow: dense;
  gap: 1rem;
  margin-top: 2.5rem;
}
.gallery-item {
  position: relative;
  margin: 0;
  border-radius: var(--radius, 16px);
  overflow: hidden;
  cursor: pointer;
  background: var(--secondary, #eff6ff);
  box-shadow: 0 10px 30px -16px rgba(22, 34, 53, .35);
  border: 1px solid var(--border, #e0e5ed);
  isolation: isolate;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .7s cubic-bezier(.16, 1, .3, 1), filter .5s ease;
}
.gallery-item:hover img { transform: scale(1.08); filter: saturate(1.08); }

/* gradient + caption overlay */
.g-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: .15rem;
  padding: 1.15rem 1.25rem;
  color: #fff;
  background: linear-gradient(to top,
    rgba(16, 22, 40, .82) 0%, rgba(16, 22, 40, .35) 38%, rgba(16, 22, 40, 0) 68%);
  opacity: .55;
  transition: opacity .45s ease;
  z-index: 2;
}
.gallery-item:hover .g-overlay { opacity: 1; }
.g-cat {
  font-size: .66rem; letter-spacing: .2em; text-transform: uppercase;
  font-weight: 700; color: #bcd2ff;
  transform: translateY(10px); opacity: 0;
  transition: transform .45s var(--ease-premium, ease) .04s, opacity .45s ease .04s;
}
.g-title {
  font-family: "Manrope", system-ui, sans-serif;
  font-weight: 800; font-size: 1.18rem; line-height: 1.2;
  transform: translateY(10px); opacity: .92;
  transition: transform .45s var(--ease-premium, ease) .08s, opacity .45s ease .08s;
}
.gallery-item:hover .g-cat,
.gallery-item:hover .g-title { transform: translateY(0); opacity: 1; }

/* zoom affordance, top-right */
.g-zoom {
  position: absolute; top: .9rem; right: .9rem;
  width: 2.5rem; height: 2.5rem; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .92); color: var(--primary, #3783f0);
  transform: scale(.6) rotate(-12deg); opacity: 0;
  transition: transform .45s var(--ease-premium, ease), opacity .35s ease;
  z-index: 3; pointer-events: none;
  box-shadow: 0 8px 20px -8px rgba(22, 34, 53, .5);
}
.g-zoom svg { width: 1.2rem; height: 1.2rem; }
.gallery-item:hover .g-zoom { transform: scale(1) rotate(0); opacity: 1; }

/* gradient hairline ring on hover */
.gallery-item::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  box-shadow: inset 0 0 0 2px rgba(55, 131, 240, 0);
  transition: box-shadow .4s ease; z-index: 4; pointer-events: none;
}
.gallery-item:hover::after { box-shadow: inset 0 0 0 2px rgba(55, 131, 240, .55); }

/* bento spans (4-col → fills a clean 4×3 block) */
.gallery-item.g1 { grid-column: span 2; grid-row: span 2; }
.gallery-item.g4 { grid-column: span 2; }
.gallery-item.g6 { grid-column: span 2; }

/* ---- Responsive --------------------------------------------------- */
@media (max-width: 1024px) {
  .gallery-mosaic { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 190px; }
  .gallery-item.g1 { grid-column: span 2; grid-row: span 2; }
  .gallery-item.g4,
  .gallery-item.g6 { grid-column: span 2; grid-row: span 1; }
}
@media (max-width: 560px) {
  .gallery-mosaic { grid-template-columns: 1fr; grid-auto-rows: auto; }
  .gallery-item { grid-column: span 1 !important; grid-row: auto !important; aspect-ratio: 4 / 3; }
  .g-overlay { opacity: 1; }          /* always show caption on touch */
  .g-cat, .g-title { transform: none; opacity: 1; }
}

/* ---- Lightbox ----------------------------------------------------- */
#lightbox {
  position: fixed; inset: 0; z-index: 900;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1rem; padding: 4vh 4vw;
  background: rgba(10, 12, 24, .92);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  opacity: 0; visibility: hidden;
  transition: opacity .4s ease, visibility .4s ease;
}
#lightbox.open { opacity: 1; visibility: visible; }
.lb-figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: .85rem; max-width: 100%; }
.lb-img {
  max-width: min(1100px, 90vw); max-height: 78vh;
  border-radius: 14px; object-fit: contain;
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .8);
  transform: scale(.96); transition: transform .45s var(--ease-premium, cubic-bezier(.16,1,.3,1));
}
#lightbox.open .lb-img { transform: scale(1); }
.lb-cap { color: #eef3fc; text-align: center; }
.lb-cap b { display: block; font-family: "Manrope", sans-serif; font-weight: 800; font-size: 1.15rem; }
.lb-cap span { font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: #9fb6e6; }
.lb-counter { color: #9fb6e6; font-size: .8rem; letter-spacing: .05em; }

.lb-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 3.1rem; height: 3.1rem; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .12); color: #fff;
  border: 1px solid rgba(255, 255, 255, .25);
  transition: background .25s ease, transform .25s ease;
}
.lb-btn:hover { background: rgba(255, 255, 255, .24); }
.lb-prev { left: 3vw; } .lb-next { right: 3vw; }
.lb-prev:hover { transform: translateY(-50%) translateX(-3px); }
.lb-next:hover { transform: translateY(-50%) translateX(3px); }
.lb-close {
  position: absolute; top: 1.4rem; right: 1.6rem;
  width: 2.8rem; height: 2.8rem; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .12); color: #fff;
  border: 1px solid rgba(255, 255, 255, .25);
  transition: background .25s ease, transform .25s ease;
}
.lb-close:hover { background: rgba(255, 255, 255, .24); transform: rotate(90deg); }
.lb-btn svg, .lb-close svg { width: 1.4rem; height: 1.4rem; }

@media (max-width: 560px) {
  .lb-btn { width: 2.6rem; height: 2.6rem; }
  .lb-prev { left: 1rem; } .lb-next { right: 1rem; }
}

/* ---- Section wash (keeps the gallery on-brand with siblings) ------- */
#gallery {
  background: radial-gradient(130% 60% at 50% 0%, rgba(239, 246, 255, .7) 0%, rgba(255, 255, 255, 0) 70%);
}

@media (prefers-reduced-motion: reduce) {
  .gallery-item img,
  .g-overlay, .g-cat, .g-title, .g-zoom, .lb-img { transition: none; }
}
