/* Map popups + theme variants + image carousel */

/* ── Map popups ──────────────────────────────────────── */
.fnd-popup-wrap .leaflet-popup-content-wrapper {
  background: rgba(20, 18, 30, 0.97) !important;
  border: 1px solid rgba(167, 139, 250, 0.4) !important;
  color: var(--text-hi) !important;
  border-radius: 6px !important;
  padding: 0 !important;
  box-shadow: 0 12px 32px rgba(0,0,0,0.6) !important;
  overflow: hidden;
}
.fnd-popup-wrap .leaflet-popup-content {
  margin: 0 !important;
  padding: 0 !important;
  width: 220px !important;
  font-family: var(--font-sans) !important;
}
.fnd-popup-wrap .leaflet-popup-tip {
  background: rgba(20, 18, 30, 0.97) !important;
  border: 1px solid rgba(167, 139, 250, 0.4) !important;
}
.fnd-popup-wrap .leaflet-popup-close-button {
  color: rgba(255,255,255,0.6) !important;
  font-size: 18px !important;
  padding: 4px 8px !important;
}
.fnd-popup-img {
  width: 100%;
  height: 110px;
  background-size: cover;
  background-position: center;
}
.fnd-popup-body { padding: 10px 12px 12px; }
.fnd-popup-title {
  font-size: 13px; font-weight: 600; line-height: 1.3;
  color: var(--text-hi); margin-bottom: 2px;
}
.fnd-popup-addr {
  font-size: 10px; color: var(--text-lo);
  letter-spacing: 0.04em; margin-bottom: 8px;
  text-transform: uppercase;
}
.fnd-popup-row {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 4px;
}
.fnd-popup-price {
  font-family: var(--font-mono); font-size: 14px; font-weight: 600;
  color: var(--accent);
}
.fnd-popup-meta {
  font-size: 10px; color: var(--text-lo);
}
.fnd-popup-id {
  font-size: 9px; color: var(--text-faint);
  letter-spacing: 0.12em; padding-top: 4px;
  border-top: 1px solid rgba(255,255,255,0.06);
  text-transform: uppercase;
}

/* ── Image carousel on property cards ───────────────── */
.rg-prop__media {
  position: relative;
  overflow: hidden;
}
.rg-carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.18);
  color: var(--text-hi);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
  z-index: 3;
  font-size: 14px;
}
.rg-carousel-arrow:hover { background: rgba(0,0,0,0.85); }
.rg-prop__media:hover .rg-carousel-arrow { opacity: 1; }
.rg-carousel-arrow.is-prev { left: 8px; }
.rg-carousel-arrow.is-next { right: 8px; }
.rg-carousel-dots {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex; gap: 4px;
  z-index: 3;
  pointer-events: none;
}
.rg-carousel-dots > span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  transition: background 0.2s, width 0.2s;
}
.rg-carousel-dots > span.is-on {
  background: var(--text-hi);
  width: 14px;
  border-radius: 3px;
}

/* ── LIGHT THEME ─────────────────────────────────────── */
:root[data-theme="light"] {
  --bg-base: #f5f4f0;
  --bg-raised: #ffffff;
  --surface-1: #ffffff;
  --surface-2: #f0eee8;
  --surface-3: #e7e5dd;
  --text-hi: #1a1820;
  --text-mid: #4a4655;
  --text-lo: #7a7585;
  --text-faint: #b8b3c0;
  --line: rgba(20, 18, 30, 0.10);
  --line-strong: rgba(20, 18, 30, 0.18);
  --accent: #7c3aed;
  --accent-glow: rgba(124, 58, 237, 0.3);
  --accent-wash: rgba(124, 58, 237, 0.08);
  --ok: #059669;
  --ok-wash: rgba(5, 150, 105, 0.10);
  --bad: #dc2626;
  --bad-wash: rgba(220, 38, 38, 0.10);
  --warn: #d97706;
}

/* Light-theme adjustments for the deep background */
:root[data-theme="light"] .rg-page-bg::before {
  background:
    radial-gradient(ellipse 50% 40% at 18% 12%, rgba(124, 58, 237, 0.10), transparent 60%),
    radial-gradient(ellipse 40% 30% at 82% 22%, rgba(56, 189, 248, 0.06), transparent 60%),
    radial-gradient(ellipse 60% 50% at 50% 90%, rgba(124, 58, 237, 0.06), transparent 70%);
}
:root[data-theme="light"] .rg-page-bg::after {
  background-image:
    linear-gradient(to right, rgba(20,18,30,0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(20,18,30,0.04) 1px, transparent 1px);
}
:root[data-theme="light"] .rg-bg-grain { opacity: 0.15; }
:root[data-theme="light"] .rg-bg-corners > span { color: rgba(20,18,30,0.35); }
:root[data-theme="light"] .rg-bg-corners > span::before,
:root[data-theme="light"] .rg-bg-corners > span::after { background: rgba(20,18,30,0.20); }

:root[data-theme="light"] .rg-hero__copy::before {
  background: linear-gradient(135deg, rgba(255,255,255,0.85), rgba(255,255,255,0.65));
  border: 1px solid rgba(20,18,30,0.08);
}
:root[data-theme="light"] .rg-index-ribbon {
  background: rgba(255,255,255,0.95);
  color: var(--text-hi);
  border-color: rgba(124,58,237,0.4);
}

/* Light-theme map: switch to light Carto tiles */
:root[data-theme="light"] .phn-map-real .leaflet-container { background: #f0eee8; }

/* Theme toggle button */
.fnd-theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 4px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  color: var(--text-mid);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.fnd-theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
