/* ============================================================
   Commercial Connection — Property Gallery v1
   ============================================================ */

.cc-gallery {
  font-family: 'DM Sans', system-ui, sans-serif;
  margin: 32px 0;
}

/* ── Main Image ─────────────────────────────────────────────── */
.cc-gallery__main {
  position: relative;
  background: #0f1e35;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  cursor: pointer;
}

.cc-gallery__hero {
  width: 100%;
  max-width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  position: relative;
  z-index: 1;
  transition: opacity .2s;
}
.cc-gallery, .cc-gallery__main { min-width: 0; max-width: 100%; }
/* Blurred backdrop fills the letterbox bars when the photo doesn't fit
   the 16:9 aspect — same image, scaled cover, blurred and dimmed. */
.cc-gallery__main-bg {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  filter: blur(28px) brightness(.85);
  transform: scale(1.15);
  opacity: .7;
  z-index: 0;
  pointer-events: none;
}
.cc-gallery__main:hover .cc-gallery__hero { opacity: .93; }

/* Nav arrows */
.cc-gallery__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.88);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #0f1e35;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
  transition: background .15s, transform .15s;
  z-index: 2;
  padding: 0;
}
.cc-gallery__nav--prev { left: 12px; }
.cc-gallery__nav--next { right: 12px; }
.cc-gallery__nav:hover { background: #fff; transform: translateY(-50%) scale(1.08); }

/* Count badge */
.cc-gallery__count {
  position: absolute;
  bottom: 12px;
  right: 14px;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: .03em;
}

/* ── Thumbnails ─────────────────────────────────────────────── */
.cc-gallery__thumbs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
  scrollbar-color: #cdd5e0 transparent;
}

.cc-gallery__thumb {
  flex-shrink: 0;
  width: 90px;
  height: 64px;
  border-radius: 5px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color .15s, opacity .15s;
  opacity: .7;
}
.cc-gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cc-gallery__thumb:hover { opacity: .9; }
.cc-gallery__thumb.is-active {
  border-color: #2251b8;
  opacity: 1;
}

/* ── Lightbox ───────────────────────────────────────────────── */
.cc-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  align-items: center;
  justify-content: center;
}
.cc-lightbox.is-open { display: flex; }

.cc-lightbox__bg {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.9);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  cursor: zoom-out;
}
.cc-lightbox__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.65);
  pointer-events: none;
}
.cc-lightbox.is-open .cc-lightbox__bg {
  filter: blur(40px) brightness(.5);
  transform: scale(1.15);
}

.cc-lightbox__img-wrap {
  position: relative;
  z-index: 1;
  max-width: 90vw;
  max-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cc-lightbox__img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 8px 48px rgba(0,0,0,.5);
  display: block;
}

.cc-lightbox__close {
  position: fixed;
  top: 18px;
  right: 22px;
  background: rgba(255,255,255,.15);
  border: none;
  color: #fff;
  font-size: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
  padding: 0;
}
.cc-lightbox__close:hover { background: rgba(255,255,255,.3); }

.cc-lightbox__nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.15);
  border: none;
  color: #fff;
  font-size: 36px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
  padding: 0;
  line-height: 1;
}
.cc-lightbox__nav--prev { left: 18px; }
.cc-lightbox__nav--next { right: 18px; }
.cc-lightbox__nav:hover { background: rgba(255,255,255,.28); }

.cc-lightbox__count {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,.7);
  font-size: 13px;
  font-family: 'DM Sans', system-ui, sans-serif;
  z-index: 2;
}

/* ── Responsive ─────────────────────────────────────────────── */

/* Desktop/tablet: hide nav arrows, user clicks image to open lightbox */
@media (min-width: 601px) {
  .cc-gallery__nav { display: none; }
}

/* Mobile: show arrows, smaller size */
@media (max-width: 600px) {
  .cc-gallery__nav { width: 32px; height: 32px; font-size: 18px; }
  .cc-gallery__thumb { width: 70px; height: 50px; }
  .cc-lightbox__nav { width: 40px; height: 40px; font-size: 26px; }
  .cc-lightbox__nav--prev { left: 8px; }
  .cc-lightbox__nav--next { right: 8px; }
}
