/* Shared property gallery lightbox (tenant websites) */
.ef-lb-open {
  overflow: hidden !important;
}

.ef-lb {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.9);
}

.ef-lb.is-open {
  display: flex;
}

.ef-lb__close,
.ef-lb__nav,
.ef-lb__zoom button {
  border: 0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.ef-lb__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.ef-lb__close:hover {
  background: rgba(255, 255, 255, 0.28);
}

.ef-lb__zoom {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 8;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.3rem;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.ef-lb__zoom button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 9999px;
  background: transparent;
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
}

.ef-lb__zoom button:hover {
  background: rgba(255, 255, 255, 0.14);
}

.ef-lb__pct {
  min-width: 3.4rem;
  padding: 0 0.15rem;
  text-align: center;
  color: #f8fafc;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.ef-lb__nav {
  position: absolute;
  top: 50%;
  z-index: 8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 9999px;
  background: #fff;
  color: #0f172a;
  font-size: 1.75rem;
  line-height: 1;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  transform: translateY(-50%);
  transition: background 0.15s ease, transform 0.15s ease;
}

.ef-lb__nav:hover {
  background: #eff6ff;
  color: #0b3d91;
  transform: translateY(-50%) scale(1.04);
}

.ef-lb__nav--prev {
  left: max(0.85rem, env(safe-area-inset-left, 0px));
}

.ef-lb__nav--next {
  right: max(0.85rem, env(safe-area-inset-right, 0px));
}

.ef-lb__stage {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(100%, 52rem);
  max-height: 100%;
  flex-direction: column;
  align-items: center;
  padding: 0 4.75rem;
  pointer-events: none;
}

.ef-lb__stage > * {
  pointer-events: auto;
}

.ef-lb__viewport {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(calc(100vw - 7.5rem), 52rem);
  height: min(78vh, 42rem);
  overflow: hidden;
  border-radius: 0.75rem;
  background: #0f172a;
  touch-action: none;
  cursor: zoom-in;
  user-select: none;
}

.ef-lb__loader {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.35);
}

.ef-lb__loader.is-visible {
  display: flex;
}

.ef-lb__spinner {
  width: 2.25rem;
  height: 2.25rem;
  border: 3px solid rgba(255, 255, 255, 0.22);
  border-top-color: #fff;
  border-radius: 50%;
  animation: efLbSpin 0.65s linear infinite;
}

.ef-lb__loader-text {
  color: rgba(255, 255, 255, 0.78);
  font: 600 0.75rem/1 system-ui, sans-serif;
  letter-spacing: 0.02em;
}

.ef-lb__loader.is-error .ef-lb__spinner {
  display: none;
}

@keyframes efLbSpin {
  to {
    transform: rotate(360deg);
  }
}

.ef-lb__viewport.is-zoomed {
  cursor: grab;
}

.ef-lb__viewport.is-dragging {
  cursor: grabbing;
}

.ef-lb__transform {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  transform-origin: center center;
  will-change: transform;
}

.ef-lb__img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.ef-lb__img.is-ready {
  opacity: 1;
}

.ef-lb__count {
  margin: 0.75rem 0 0;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
}

.ef-lb__hint {
  margin: 0.45rem 0 0;
  color: rgba(226, 232, 240, 0.75);
  font-size: 0.75rem;
  font-weight: 500;
}

#mainPhoto,
.detail-gallery #mainPhoto,
#mainMediaHost {
  cursor: zoom-in;
}

#mainMediaHost {
  position: relative;
  width: 100%;
  overflow: hidden;
}

#mainMediaHost .ef-gallery-main-media,
#mainMediaHost .ef-lazy-image,
#mainMediaHost > img,
#mainMediaHost > video,
#mainMediaHost > iframe {
  display: block;
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  background: #0b1c33;
}

#mainMediaHost .ef-lazy-image {
  min-height: 220px;
  background: #e2e8f0;
}

#mainMediaHost > iframe {
  min-height: 320px;
  border: 0;
  object-fit: unset;
  cursor: default;
}

#mainMediaHost > video {
  object-fit: contain;
  background: #0b1c33;
}

.ef-media-thumb {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: inherit;
}

.ef-media-thumb img,
.ef-media-thumb video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  background: #0b1c33;
}

.ef-media-badge {
  position: absolute;
  left: 0.4rem;
  bottom: 0.4rem;
  z-index: 2;
  padding: 0.15rem 0.4rem;
  border-radius: 0.3rem;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  pointer-events: none;
}

.shot .ef-media-thumb,
.shot .ef-media-thumb img,
.shot .ef-media-thumb video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.ef-project-hero.ef-gallery-main-media,
.ef-project-gallery #mainMediaHost > img,
.ef-project-gallery #mainMediaHost > video,
.ef-project-gallery #mainMediaHost > iframe {
  max-height: 420px;
}

@media (max-width: 640px) {
  .ef-lb__zoom {
    top: 0.75rem;
    left: 0.75rem;
  }
  .ef-lb__close {
    top: 0.75rem;
    right: 0.75rem;
  }
  .ef-lb__nav--prev {
    left: 0.4rem;
  }
  .ef-lb__nav--next {
    right: 0.4rem;
  }
  .ef-lb__nav {
    width: 2.85rem;
    height: 2.85rem;
  }
  .ef-lb__stage {
    padding: 0 2.75rem;
    width: 100%;
  }
  .ef-lb__viewport {
    width: min(calc(100vw - 4.5rem), 100%);
    height: min(70vh, 28rem);
  }
  .ef-lb__hint {
    display: none;
  }
  .ef-lb__thumbs {
    max-width: min(100vw - 1.5rem, 36rem);
  }
}

/* Thumbnail strip (shared PropertyLightbox) */
.ef-lb__thumbs {
  display: flex;
  gap: 0.5rem;
  max-width: min(92vw, 48rem);
  margin-top: 0.85rem;
  padding: 0.15rem 0.25rem 0.35rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.ef-lb__thumb {
  flex: 0 0 auto;
  width: 4.25rem;
  height: 3.15rem;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 0.5rem;
  overflow: hidden;
  background: #1e293b;
  cursor: pointer;
  opacity: 0.72;
  transition: opacity 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.ef-lb__thumb img,
.ef-lb__thumb video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.ef-lb__thumb:hover {
  opacity: 1;
}

.ef-lb__thumb.is-active {
  opacity: 1;
  border-color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
}

/* JS-theme dialog lightbox (daylight / atelier / arcade) */
dialog.lightbox {
  position: fixed;
  inset: 0;
  width: min(1120px, 96vw);
  max-width: none;
  max-height: min(92vh, 900px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: #0b1220;
  color: #fff;
  overflow: hidden;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55);
}

dialog.lightbox::backdrop {
  background: rgba(8, 12, 20, 0.78);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

dialog.lightbox .lb-stage {
  position: relative;
  height: min(68vh, 620px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3.25rem 4.5rem 0.75rem;
  background: #070b14;
  color: #94a3b8;
}

dialog.lightbox .lb-stage img,
dialog.lightbox .lb-stage video,
dialog.lightbox .lb-stage .ef-lazy-image,
dialog.lightbox .lb-stage iframe {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
}

dialog.lightbox .lb-close,
dialog.lightbox .lb-nav {
  position: absolute;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  color: #0f172a;
  background: #fff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease, background 0.15s ease;
}

dialog.lightbox .lb-close:hover,
dialog.lightbox .lb-nav:hover {
  background: #eff6ff;
  color: #0b3d91;
  transform: scale(1.05);
}

dialog.lightbox .lb-close {
  top: 0.85rem;
  right: 0.85rem;
  width: 2.75rem;
  height: 2.75rem;
}

dialog.lightbox .lb-nav {
  top: calc(50% - 2.5rem);
  width: 3.15rem;
  height: 3.15rem;
  transform: translateY(-50%);
}

dialog.lightbox .lb-nav:hover {
  transform: translateY(-50%) scale(1.05);
}

dialog.lightbox .lb-prev {
  left: 0.85rem;
}

dialog.lightbox .lb-next {
  right: 0.85rem;
}

dialog.lightbox .lb-footer {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.85rem 1rem 1.1rem;
  background: #0b1220;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

dialog.lightbox .lb-count,
dialog.lightbox #lb-count {
  align-self: center;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

dialog.lightbox .lb-thumbs {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-start;
  overflow-x: auto;
  padding: 0.15rem 0.1rem 0.25rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

dialog.lightbox .lb-thumb {
  flex: 0 0 auto;
  width: 4.5rem;
  height: 3.35rem;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 0.55rem;
  overflow: hidden;
  background: #1e293b;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

dialog.lightbox .lb-thumb img,
dialog.lightbox .lb-thumb video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

dialog.lightbox .lb-thumb:hover {
  opacity: 1;
}

dialog.lightbox .lb-thumb.is-active {
  opacity: 1;
  border-color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
}

@media (max-width: 640px) {
  dialog.lightbox {
    width: 100vw;
    max-height: 100vh;
    border-radius: 0;
  }
  dialog.lightbox .lb-stage {
    height: min(62vh, 520px);
    padding: 3rem 3.25rem 0.5rem;
  }
  dialog.lightbox .lb-nav {
    width: 2.65rem;
    height: 2.65rem;
  }
  dialog.lightbox .lb-prev {
    left: 0.45rem;
  }
  dialog.lightbox .lb-next {
    right: 0.45rem;
  }
  dialog.lightbox .lb-close {
    top: 0.55rem;
    right: 0.55rem;
  }
}
