/* 10-lightbox.css — The photo viewer and the photo grid under a listing's gallery.
   Part of the CRM stylesheet: the files load in number order (components/app_styles.html) and later
   rules win, exactly as when this was one file. */

/* ---------- Lightbox ---------- */
html.lb-open, html.lb-open body { overflow: hidden; }
.lightbox {
  position: fixed; inset: 0; z-index: 95; display: flex; flex-direction: column;
  background: #05070c; color: #fff; user-select: none; -webkit-user-select: none;
  animation: lb-in .18s ease-out;
}
@keyframes lb-in { from { opacity: 0; } }
.lb-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px 6px; min-height: 52px; }
.lb-count { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; opacity: .9; padding-left: 4px; }
.lightbox button { color: inherit; font: inherit; }
.lb-close, .lb-nav {
  display: grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .12); cursor: pointer; transition: background .15s, opacity .15s;
}
.lb-close:hover, .lb-nav:hover { background: rgba(255, 255, 255, .22); }
.lightbox svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.lb-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; touch-action: none; }
.lb-track { display: flex; height: 100%; transition: transform .3s cubic-bezier(.2, .8, .2, 1); will-change: transform; }
/* The slide's one cell is exactly the stage (minmax(0, 1fr)), and the photo fills it with object-fit: contain, so the
   whole photo always shows. With an auto-sized cell and max-height: 100%, the cell grew to the photo's own height
   (1600 px) and the stage cut an upright photo off. */
.lb-slide { flex: 0 0 100%; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); padding: 8px 16px; min-width: 0; cursor: zoom-out; }
.lb-slide img { width: 100%; height: 100%; object-fit: contain; cursor: default; pointer-events: none; }
.lb-nav { position: absolute; top: 50%; translate: 0 -50%; width: 48px; height: 48px; }
.lb-prev { left: 16px; }
.lb-next { right: 16px; }
.lb-nav[disabled] { opacity: 0; pointer-events: none; }
.lb-strip { display: flex; gap: 6px; padding: 10px 14px 14px; overflow-x: auto; scrollbar-width: none; justify-content: safe center; }
.lb-strip::-webkit-scrollbar { display: none; }
.lb-strip button { flex: none; width: 58px; height: 44px; padding: 0; border: 2px solid transparent; border-radius: 7px; overflow: hidden; background: rgba(255, 255, 255, .08); opacity: .55; cursor: pointer; transition: opacity .15s, border-color .15s; }
.lb-strip button.is-active { opacity: 1; border-color: #fff; }
.lb-strip img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 820px) {
  .lb-nav { display: none; } /* phones swipe */
  .lb-slide { padding: 4px 0; }
}
body.in-telegram .lb-close { visibility: hidden; } /* Telegram's own Back closes the viewer */

/* More photos of a listing, under the main gallery */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.photo-tile { display: block; padding: 0; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; aspect-ratio: 1; background: var(--surface-3); cursor: zoom-in; }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.photo-tile:hover img { transform: scale(1.04); }
.gallery .more { cursor: zoom-in; }

