/* ============================================================================
   The Prop Guru — Property Detail Gallery
   Page-owned asset: loaded only on properties-detail.php
   Self-contained; does not modify enhancements.css
   ============================================================================ */

/* ---------- Main gallery wrapper ----------------------------------------- */
.tpg-gallery-wrap {
  position: relative;
  margin-bottom: 12px;
}

/* Main image */
.tpg-main-img-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: #111;
  cursor: zoom-in;
  aspect-ratio: 16/9;
}
.tpg-main-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.35s ease;
}
.tpg-main-img-wrap img.tpg-fading {
  opacity: 0;
}

/* Click-to-expand hint overlay */
.tpg-expand-hint {
  position: absolute;
  bottom: 12px;
  right: 14px;
  background: rgba(0,0,0,0.52);
  color: #fff;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  pointer-events: none;
  letter-spacing: 0.02em;
}

/* Photo count badge */
.tpg-photo-count {
  position: absolute;
  bottom: 12px;
  left: 14px;
  background: rgba(0,0,0,0.52);
  color: #fff;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  pointer-events: none;
}

/* ---------- Thumbnail carousel ------------------------------------------- */
.tpg-thumbs-wrap {
  position: relative;
  margin-top: 8px;
}
.tpg-thumbs-track {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding-bottom: 4px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.tpg-thumbs-track::-webkit-scrollbar { display: none; }

.tpg-thumb {
  flex: 0 0 90px;
  height: 62px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.22s ease, transform 0.22s ease;
  position: relative;
}
.tpg-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
.tpg-thumb.active {
  border-color: #eb6753;
  transform: translateY(-2px);
}
.tpg-thumb:not(.active):hover {
  border-color: rgba(235,103,83,0.45);
}

/* Thumb arrow buttons */
.tpg-thumb-arrow {
  display: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  background: rgba(255,255,255,0.9);
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  font-size: 13px;
  color: #333;
  transition: background 0.2s;
}
.tpg-thumb-arrow:hover { background: #fff; }
.tpg-thumb-arrow.left  { left: 0; }
.tpg-thumb-arrow.right { right: 0; }
.tpg-thumbs-wrap:hover .tpg-thumb-arrow { display: flex; }

/* ---------- Lightbox -------------------------------------------------------- */
.tpg-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.94);
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.tpg-lightbox.open {
  display: flex;
}

.tpg-lb-img-wrap {
  position: relative;
  max-width: 92vw;
  max-height: 82vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tpg-lb-img-wrap img {
  max-width: 92vw;
  max-height: 80vh;
  object-fit: contain;
  display: block;
  border-radius: 6px;
  transition: opacity 0.28s ease, transform 0.28s ease;
  transform-origin: center center;
  user-select: none;
}
.tpg-lb-img-wrap img.tpg-lb-fading {
  opacity: 0;
}

/* Lightbox controls */
.tpg-lb-close {
  position: fixed;
  top: 18px;
  right: 22px;
  background: rgba(255,255,255,0.13);
  border: none;
  color: #fff;
  font-size: 26px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  transition: background 0.2s;
  line-height: 1;
}
.tpg-lb-close:hover { background: rgba(255,255,255,0.26); }

.tpg-lb-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.13);
  border: none;
  color: #fff;
  font-size: 22px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  transition: background 0.2s;
}
.tpg-lb-arrow:hover { background: rgba(255,255,255,0.26); }
.tpg-lb-arrow.prev { left: 16px; }
.tpg-lb-arrow.next { right: 16px; }

/* Counter + zoom toolbar */
.tpg-lb-footer {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 10001;
}
.tpg-lb-counter {
  color: rgba(255,255,255,0.8);
  font-size: 13px;
  min-width: 60px;
  text-align: center;
}
.tpg-lb-zoom-btn {
  background: rgba(255,255,255,0.13);
  border: none;
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  transition: background 0.2s;
}
.tpg-lb-zoom-btn:hover { background: rgba(255,255,255,0.26); }

/* Hide arrows when only 1 image */
.tpg-lightbox[data-count="1"] .tpg-lb-arrow { display: none; }

/* ---------- Property Highlights section ---------------------------------- */
.tpg-highlights-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px 20px;
}
.tpg-highlights-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: #555;
}
.tpg-highlights-list li .tpg-hl-icon {
  color: #eb6753;
  font-size: 15px;
  margin-top: 2px;
  flex-shrink: 0;
}

/* ---------- Amenities badge grid ----------------------------------------- */
.tpg-amenity-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tpg-amenity-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f5f5f5;
  border: 1px solid #e8e8e8;
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 13px;
  color: #444;
  transition: background 0.2s, border-color 0.2s;
}
.tpg-amenity-badge i {
  color: #eb6753;
  font-size: 13px;
}
.tpg-amenity-badge:hover {
  background: #fff4f2;
  border-color: #eb6753;
}

/* ---------- Nearby table ------------------------------------------------- */
.tpg-nearby-table {
  width: 100%;
  border-collapse: collapse;
}
.tpg-nearby-table tr {
  border-bottom: 1px solid #f0f0f0;
}
.tpg-nearby-table tr:last-child { border-bottom: none; }
.tpg-nearby-table td {
  padding: 8px 4px;
  font-size: 14px;
  color: #555;
}
.tpg-nearby-table td:first-child {
  font-weight: 600;
  color: #333;
  width: 55%;
}
.tpg-nearby-label-icon {
  color: #eb6753;
  margin-right: 7px;
  font-size: 13px;
}
.tpg-nearby-dist {
  background: #fff4f2;
  color: #eb6753;
  border-radius: 12px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
  display: inline-block;
}

/* ---------- Similar properties ------------------------------------------- */
.tpg-similar-card {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  background: #fff;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  margin-bottom: 20px;
}
.tpg-similar-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.13);
}
.tpg-similar-card .sim-img {
  width: 100%;
  height: 170px;
  object-fit: cover;
  display: block;
}
.tpg-similar-card .sim-body {
  padding: 14px 16px;
}
.tpg-similar-card .sim-price {
  color: #eb6753;
  font-weight: 700;
  font-size: 15px;
}
.tpg-similar-card .sim-name {
  font-size: 14px;
  font-weight: 600;
  color: #222;
  margin: 4px 0 2px;
  line-height: 1.3;
}
.tpg-similar-card .sim-loc {
  font-size: 12px;
  color: #888;
}
.tpg-similar-card .sim-link {
  display: inline-block;
  margin-top: 10px;
  font-size: 13px;
  color: #eb6753;
  font-weight: 600;
  text-decoration: none;
}
.tpg-similar-card .sim-link:hover { text-decoration: underline; }

/* ---------- Share buttons ------------------------------------------------- */
.tpg-share-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.tpg-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.2s;
}
.tpg-share-btn:hover { opacity: 0.88; transform: translateY(-1px); }
.tpg-share-btn.wa  { background: #25d366; color: #fff; }
.tpg-share-btn.fb  { background: #1877f2; color: #fff; }
.tpg-share-btn.cp  { background: #f0f0f0; color: #333; }
.tpg-share-copied  { font-size: 12px; color: #eb6753; display: none; margin-top: 4px; }

/* ---------- Location block ----------------------------------------------- */
.tpg-location-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 6px;
}
.tpg-loc-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f7f7f7;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 13px;
  color: #444;
}
.tpg-loc-chip i { color: #eb6753; }

/* ---------- Responsive ----------------------------------------------- */
@media (max-width: 767px) {
  .tpg-main-img-wrap { aspect-ratio: 4/3; }
  .tpg-thumb { flex: 0 0 72px; height: 50px; }
  .tpg-lb-arrow.prev { left: 6px; }
  .tpg-lb-arrow.next { right: 6px; }
  .tpg-highlights-list { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .tpg-highlights-list { grid-template-columns: 1fr; }
}

/* ---------- Fix: disable hover-zoom on detail page main image ----------- */
/* enhancements.css .tpg-zoom:hover img causes dark edge vignette here     */
.tpg-main-img-wrap {
  background: #f5f5f5 !important; /* remove dark #111 background */
}
.tpg-main-img-wrap img {
  transform: none !important;     /* disable scale zoom on hover */
  transition: opacity 0.35s ease !important;
}
.tpg-main-img-wrap:hover img {
  transform: none !important;     /* explicitly block .tpg-zoom:hover img */
}
/* Also disable the card hover lift on detail gallery */
.tpg-gallery-wrap .tpg-card:hover,
.tpg-gallery-wrap:hover {
  transform: none !important;
  box-shadow: none !important;
}

/* ---------- Fix: detail page elements must always be visible ------------ */
/* Scroll-reveal on this page causes content to stay invisible              */
/* (WOW.js + IntersectionObserver conflict on property detail page)         */
.body_content [data-tpg].tpg-reveal,
.body_content .wow {
  opacity: 1 !important;
  transform: none !important;
  visibility: visible !important;
  animation: none !important;
}
/* Keep only the gallery image fade transition (opacity on img swap) */
#tpgMainImg {
  transition: opacity 0.35s ease !important;
}

/* ============================================================================
   MAIN IMAGE TIDY-UP
   Neutralise the dark backdrop + cap height so the main image isn't a giant
   black letterbox when a sample image is small/transparent. Click opens the
   lightbox (handled in property-gallery.js).
   ============================================================================ */
.tpg-main-img-wrap {
  background: #f3f4f6;
  cursor: default;
  aspect-ratio: 16 / 9;
  max-height: none;   /* full container width */
  width: 100%;
}
