/* ============================================================
   Riaz Developers — Portfolio Gallery Widget
   Pure visual gallery. No header, no footer — place native
   Elementor widgets around this for those. Colors/spacing here
   are DEFAULTS — overridden by Elementor's Style tab controls.

   Shape system: every tile is exactly ONE photo at one of three
   proportions — large (2x2), wide (2x1), square (1x1). No narrow
   "tall" shape — that caused cramped/doubled-looking images at
   tablet widths in an earlier version. Responsive breakpoints
   below explicitly reset BOTH grid-column and grid-row on every
   shape class so nothing inherits a mismatched span.
   ============================================================ */

.riaz-portfolio-gallery * ,
.riaz-portfolio-gallery *::before,
.riaz-portfolio-gallery *::after {
  box-sizing: border-box;
}

.riaz-portfolio-gallery {
  font-family: 'Urbanist', sans-serif;
}

/* ── FILTER TABS ── */
.riaz-filter-tabs {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.riaz-portfolio-gallery button.riaz-filter-tab {
  position: relative;
  display: inline-block;
  margin: 0 !important;
  padding: 11px 24px !important;
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  border: 1px solid #E8E6E0 !important;
  border-radius: 999px !important;
  outline: none !important;
  box-shadow: none !important;
  cursor: pointer;
  font-family: 'Urbanist', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: none !important;
  color: #5B6172;
  -webkit-appearance: none;
  appearance: none;
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.riaz-portfolio-gallery button.riaz-filter-tab:hover {
  border-color: #A07D30 !important;
  color: #1C2230;
  background: transparent !important;
}

.riaz-portfolio-gallery button.riaz-filter-tab.active {
  background: #0e1c34 !important;
  border-color: #0e1c34 !important;
  color: #F0EDE6;
}

/* ── GRID ── */
.riaz-portfolio-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 280px;
  gap: 16px;
}

.riaz-portfolio-item {
  position: relative;
  overflow: hidden;
  cursor: zoom-in;
  background-color: #0e1c34;
  display: block;
}
.riaz-portfolio-item.riaz-is-hidden {
  display: none;
}

.riaz-item-large  { grid-column: span 2; grid-row: span 2; }
.riaz-item-wide   { grid-column: span 2; grid-row: span 1; }
.riaz-item-square { grid-column: span 1; grid-row: span 1; }

.riaz-portfolio-item img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.92) brightness(0.97);
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1), filter 0.4s ease;
}
.riaz-portfolio-item:hover img {
  transform: scale(1.06);
  filter: saturate(1) brightness(0.85);
}

.riaz-item-zoom-cue {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(8,14,28,0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}
.riaz-portfolio-item:hover .riaz-item-zoom-cue {
  opacity: 1;
  transform: scale(1);
}
.riaz-item-zoom-cue svg {
  width: 16px;
  height: 16px;
  stroke: #F0EDE6;
}

/* ════════════════════════════════════════════
   LIGHTBOX
════════════════════════════════════════════ */
.riaz-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(8, 14, 28, 0.96);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.riaz-lightbox.riaz-is-open {
  display: flex;
  opacity: 1;
}

.riaz-lightbox-figure {
  position: relative;
  max-width: 92vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: scale(0.96);
  transition: transform 0.3s ease;
}
.riaz-lightbox.riaz-is-open .riaz-lightbox-figure {
  transform: scale(1);
}

.riaz-lightbox-img {
  max-width: 92vw;
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}

.riaz-lightbox-counter {
  margin-top: 18px;
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 13px;
  color: rgba(240,237,230,0.6);
  letter-spacing: 0.04em;
}

.riaz-lightbox-close,
.riaz-lightbox-prev,
.riaz-lightbox-next {
  position: fixed;
  background: rgba(240,237,230,0.08);
  border: 1px solid rgba(240,237,230,0.18);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  padding: 0;
}
.riaz-lightbox-close:hover,
.riaz-lightbox-prev:hover,
.riaz-lightbox-next:hover {
  background: rgba(192,154,69,0.18);
  border-color: #C09A45;
}
.riaz-lightbox-close svg,
.riaz-lightbox-prev svg,
.riaz-lightbox-next svg {
  width: 20px;
  height: 20px;
  stroke: #F0EDE6;
}

.riaz-lightbox-close { top: 28px; right: 28px; }
.riaz-lightbox-prev  { left: 28px; top: 50%; transform: translateY(-50%); }
.riaz-lightbox-next  { right: 28px; top: 50%; transform: translateY(-50%); }

/* ============================================================
   RESPONSIVE — every shape class explicitly resets BOTH
   grid-column AND grid-row at each breakpoint.
   ============================================================ */
@media (max-width: 1024px) {
  .riaz-portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 260px;
    gap: 14px;
  }
  .riaz-item-large  { grid-column: span 2; grid-row: span 2; }
  .riaz-item-wide   { grid-column: span 2; grid-row: span 1; }
  .riaz-item-square { grid-column: span 1; grid-row: span 1; }
}

@media (max-width: 640px) {
  .riaz-filter-tabs { gap: 8px; margin-bottom: 28px; }
  .riaz-portfolio-gallery button.riaz-filter-tab {
    padding: 9px 18px !important;
    font-size: 11.5px;
  }
  .riaz-portfolio-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 240px;
    gap: 12px;
  }
  .riaz-item-large,
  .riaz-item-wide,
  .riaz-item-square {
    grid-column: span 1;
    grid-row: span 1;
  }
  .riaz-item-zoom-cue {
    opacity: 1;
    transform: scale(1);
    top: 12px;
    right: 12px;
  }

  .riaz-lightbox { padding: 16px; }
  .riaz-lightbox-prev, .riaz-lightbox-next { width: 40px; height: 40px; }
  .riaz-lightbox-prev  { left: 10px; }
  .riaz-lightbox-next  { right: 10px; }
  .riaz-lightbox-close { top: 14px; right: 14px; width: 40px; height: 40px; }
}
