/* Phone-mockup lightbox (Negar's bot-lightbox, adapted to the Design System tokens).
   Markup: <a href="big.webp" data-lightbox="group" data-title="…" data-caption="…"><img …></a> */

.lb {
  --lb-backdrop: rgba(4, 7, 26, 0.86);
  --lb-btn-bg: rgba(40, 140, 255, 0.18);
  --lb-btn-bg-hover: rgba(40, 140, 255, 0.34);
  --lb-text: #f2f4f8;
  --lb-muted: #aab3c2;
  /* <dialog> lives outside .bf-root, so set the font here */
  font-family: var(--font-sans, Vazirmatn, Tahoma, sans-serif);
  border: 0;
  padding: 0;
  margin: 0;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  background: transparent;
  color: var(--lb-text);
  overflow: hidden;
}

.lb::backdrop {
  background: radial-gradient(60% 60% at 50% 40%, rgba(22, 140, 255, 0.16), transparent 70%), rgba(4, 7, 26, 0.86);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.lb[open] { display: flex; animation: lb-fade 0.18s ease; }

.lb__stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 56px 72px 24px;
  min-width: 0;
}

.lb__img {
  display: block;
  max-width: min(460px, 100%);
  max-height: calc(100dvh - 150px);
  width: auto;
  height: auto;
  object-fit: contain;
  cursor: zoom-out;
  user-select: none;
  -webkit-user-drag: none;
  animation: lb-in 0.22s ease;
}

.lb__caption { margin: 0; max-width: 460px; text-align: center; line-height: 1.8; }
.lb__caption strong { display: block; font-size: 1.05rem; }
.lb__caption span { color: var(--lb-muted); font-size: 0.9rem; }

.lb__counter {
  position: absolute;
  top: 20px;
  inset-inline-start: 20px;
  font-size: 0.85rem;
  color: var(--lb-muted);
  font-variant-numeric: tabular-nums;
}

.lb__btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(120, 175, 255, 0.24);
  border-radius: 50%;
  background: var(--lb-btn-bg);
  color: var(--lb-text);
  cursor: pointer;
  transition: background 0.15s ease;
}
.lb__btn:hover,
.lb__btn:focus-visible { background: var(--lb-btn-bg-hover); }
.lb__btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.lb__btn svg { width: 22px; height: 22px; }

.lb__close { top: 12px; inset-inline-end: 12px; }

/* RTL: «قبلی» on the right, «بعدی» on the left */
.lb__prev, .lb__next { top: 50%; transform: translateY(-50%); }
.lb__prev { inset-inline-start: 16px; }
.lb__next { inset-inline-end: 16px; }
[dir="rtl"] .lb__prev svg,
[dir="rtl"] .lb__next svg { transform: scaleX(-1); }

.lb.is-single .lb__prev,
.lb.is-single .lb__next,
.lb.is-single .lb__counter { display: none; }

html.lb-lock { overflow: hidden; }

@media (max-width: 640px) {
  .lb__stage { padding: 60px 16px 88px; }
  .lb__img { max-height: calc(100dvh - 210px); }
  .lb__prev, .lb__next { top: auto; bottom: 20px; transform: none; }
  .lb__prev { inset-inline-start: calc(50% - 60px); }
  .lb__next { inset-inline-end: calc(50% - 60px); }
}

@keyframes lb-fade { from { opacity: 0; } }
@keyframes lb-in { from { opacity: 0; transform: scale(0.96); } }

@media (prefers-reduced-motion: reduce) {
  .lb[open], .lb__img { animation: none; }
}
