/* لایت‌باکس تصویر — گالری قبل/بعد V2 */

.royal-gab-ilb {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.royal-gab-ilb.is-open {
  opacity: 1;
  visibility: visible;
}

.royal-gab-ilb__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 15, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
}

.royal-gab-ilb__figure {
  position: relative;
  z-index: 1;
  margin: 0;
  padding-top: 2.5rem;
  max-width: min(96vw, 1200px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
}

.royal-gab-ilb__stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  max-width: 100%;
}

.royal-gab-ilb__column {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  max-width: 100%;
}

.royal-gab-ilb__img-wrap {
  width: 100%;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  -webkit-overflow-scrolling: touch;
}

.royal-gab-ilb__img-wrap.is-zoomed {
  overflow: auto;
  max-height: min(62vh, 560px);
  align-items: flex-start;
  justify-content: flex-start;
  touch-action: pan-x pan-y;
}

.royal-gab-ilb__zoom-tools {
  display: none;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  padding: 0.35rem 0.5rem;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(109, 221, 255, 0.35);
  box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.45);
}

.royal-gab-ilb__zoom-btn {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  border: 1px solid rgba(100, 116, 139, 0.55);
  background: rgba(30, 41, 59, 0.9);
  color: #e2e8f0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    opacity 0.15s ease;
}

.royal-gab-ilb__zoom-btn .material-symbols-outlined {
  font-size: 1.35rem;
  font-variation-settings: 'FILL' 0, 'wght' 500;
}

.royal-gab-ilb__zoom-btn:hover:not(:disabled),
.royal-gab-ilb__zoom-btn:focus-visible:not(:disabled) {
  background: rgba(109, 221, 255, 0.2);
  border-color: rgba(109, 221, 255, 0.55);
  outline: none;
}

.royal-gab-ilb__zoom-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.royal-gab-ilb__zoom-btn--reset .material-symbols-outlined {
  font-size: 1.2rem;
}

.royal-gab-ilb__zoom-value {
  font-family: Vazirmatn, sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #94a3b8;
  min-width: 3.25rem;
  text-align: center;
  user-select: none;
}

.royal-gab-ilb__nav {
  flex-shrink: 0;
  width: 2.85rem;
  height: 2.85rem;
  border-radius: 9999px;
  border: 1px solid rgba(109, 221, 255, 0.4);
  background: rgba(15, 23, 42, 0.92);
  color: #e2e8f0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    opacity 0.15s ease;
}

.royal-gab-ilb__nav .material-symbols-outlined {
  font-size: 1.75rem;
  font-variation-settings: 'FILL' 0, 'wght' 500;
}

.royal-gab-ilb__nav:hover:not(:disabled),
.royal-gab-ilb__nav:focus-visible:not(:disabled) {
  background: rgba(109, 221, 255, 0.18);
  border-color: rgba(109, 221, 255, 0.65);
  outline: none;
}

.royal-gab-ilb__nav:disabled {
  opacity: 0.28;
  cursor: not-allowed;
}

.royal-gab-ilb__img {
  flex: 0 0 auto;
  min-width: 0;
  max-width: 100%;
  max-height: min(78vh, 900px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow:
    0 0 0 1px rgba(109, 221, 255, 0.18),
    0 24px 48px -12px rgba(0, 0, 0, 0.65);
  transition: transform 0.18s ease;
  will-change: transform;
}

.royal-gab-ilb__caption {
  font-family: Vazirmatn, sans-serif;
  font-size: 0.9rem;
  color: #cbd5e1;
  text-align: center;
  max-width: 42rem;
  line-height: 1.5;
}

.royal-gab-ilb__counter {
  font-family: Vazirmatn, sans-serif;
  font-size: 0.8125rem;
  color: #94a3b8;
  letter-spacing: 0.02em;
}

@media (max-width: 640px) {
  .royal-gab-ilb__nav {
    width: 2.4rem;
    height: 2.4rem;
  }

  .royal-gab-ilb__nav .material-symbols-outlined {
    font-size: 1.5rem;
  }

  .royal-gab-ilb__img {
    max-height: min(58vh, 680px);
  }

  .royal-gab-ilb__img-wrap.is-zoomed {
    max-height: min(58vh, 520px);
  }
}

.royal-gab-ilb__close {
  position: absolute;
  top: -0.25rem;
  inset-inline-end: -0.25rem;
  inset-inline-start: auto;
  z-index: 2;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid rgba(109, 221, 255, 0.35);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.95);
  color: #e2e8f0;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.royal-gab-ilb__close:hover,
.royal-gab-ilb__close:focus-visible {
  background: rgba(109, 221, 255, 0.2);
  border-color: rgba(109, 221, 255, 0.55);
  color: #fff;
  outline: none;
}

@media (max-width: 640px) {
  .royal-gab-ilb__close {
    top: 0.25rem;
    inset-inline-end: 0.25rem;
  }
}
