/* ============================================================
   ORHASHI — GALLERY PAGE STYLES
   assets/css/pages/gallery.css
   ============================================================ */

/* ── Gallery section ────────────────────────────────────── */
#gallery-grid {
  position: static;
}

/* ── Masonry: 3 fixed columns using float ───────────────────
   Float-based columns are the most universally reliable
   approach — no BFC conflicts, no grid overflow, no z-index
   fighting. Each column is a fixed-width container that
   stacks photos vertically. The clearfix ensures the section
   expands to contain all three columns properly.
═══════════════════════════════════════════════════════════ */
.masonry-columns-wrap {
  display: flex;
  gap: 1rem;
  align-items: flex-start; /* columns align at top, not stretched */
  width: 100%;
}

.masonry-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0; /* prevent flex blowout */
}

/* ── Gallery item card ──────────────────────────────────── */
.gal-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  cursor: pointer;
  background: var(--color-dark-2);
  display: block;
  width: 100%;
  /* Remove margin — gap on parent handles spacing */
}

.gal-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform .6s var(--ease-out), opacity .4s ease;
}

.gal-item:hover img {
  transform: scale(1.06);
  opacity: .8;
}

/* ── Hover overlay ──────────────────────────────────────── */
.gal-item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(42,34,64,.85) 100%);
  opacity: 0;
  transition: opacity .35s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.25rem;
  pointer-events: none;
}
.gal-item:hover .gal-item-overlay { opacity: 1; }

/* ── Zoom icon ──────────────────────────────────────────── */
.gal-item-zoom {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(.7);
  width: 48px;
  height: 48px;
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(6px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.1rem;
  transition: transform .35s var(--ease-spring), opacity .3s ease;
  opacity: 0;
  pointer-events: none;
}
.gal-item:hover .gal-item-zoom {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

/* ── Category badge ─────────────────────────────────────── */
.gal-item-category {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: rgba(67,58,107,.85);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: .3rem .7rem;
  border-radius: var(--radius-full);
  margin-bottom: .4rem;
  width: fit-content;
}

.gal-item-caption {
  color: rgba(255,255,255,.85);
  font-size: .8rem;
  line-height: 1.4;
}

/* ── Responsive columns ─────────────────────────────────── */
@media (max-width: 991px) {
  .masonry-columns-wrap .masonry-col:nth-child(3) {
    display: none; /* hide 3rd col on tablet → 2 cols */
  }
}
@media (max-width: 575px) {
  .masonry-columns-wrap {
    flex-direction: column;
  }
  .masonry-columns-wrap .masonry-col:nth-child(3) {
    display: flex; /* restore 3rd col — it becomes a row in single column */
  }
}