/* villa-map-view.css — Phase 5h · split map+sidebar layout for /properties/
 *
 * Loads on /properties/ only. Kicks in when the guest toggles Map view.
 */

/* ============================================================ */
/* Split container                                              */
/* ============================================================ */
.mps-map-wrap {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(320px, 2fr);
  gap: 0;
  height: 720px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #e8e2d4;
  box-shadow: 0 10px 30px rgba(28, 36, 56, 0.06);
  background: #fbf7ee;
}
@media (max-width: 900px) {
  .mps-map-wrap {
    grid-template-columns: 1fr;
    height: auto;
  }
}

/* ============================================================ */
/* Map canvas                                                    */
/* ============================================================ */
.mps-map-canvas {
  height: 100%;
  min-height: 480px;
  background: #f4efe6;
}
@media (max-width: 900px) {
  .mps-map-canvas {
    height: 400px;
  }
}

/* ============================================================ */
/* Sidebar                                                       */
/* ============================================================ */
.mps-map-sidebar {
  display: flex;
  flex-direction: column;
  background: #fbf7ee;
  border-left: 1px solid rgba(185, 162, 127, 0.28);
  min-height: 0; /* required so inner list can scroll */
}
@media (max-width: 900px) {
  .mps-map-sidebar {
    border-left: 0;
    border-top: 1px solid rgba(185, 162, 127, 0.28);
    max-height: 60vh;
  }
}

.mps-map-sidebar-head {
  padding: 14px 18px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(185, 162, 127, 0.20);
  background: #fdfbf5;
}
.mps-map-sidebar-count {
  font-weight: 600;
  color: #354766;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
}
.mps-map-sidebar-hint {
  font-size: 0.75rem;
  color: #8a8377;
  text-align: right;
}
@media (max-width: 600px) {
  .mps-map-sidebar-hint { display: none; }
}

.mps-map-sidebar-list {
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}

/* Subtle scrollbar */
.mps-map-sidebar-list::-webkit-scrollbar { width: 6px; }
.mps-map-sidebar-list::-webkit-scrollbar-thumb { background: rgba(185, 162, 127, 0.4); border-radius: 3px; }
.mps-map-sidebar-list::-webkit-scrollbar-thumb:hover { background: rgba(185, 162, 127, 0.7); }

/* ============================================================ */
/* Card (collapsed state)                                        */
/* ============================================================ */
.mps-map-card {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  padding: 10px;
  background: #ffffff;
  border: 1px solid rgba(185, 162, 127, 0.28);
  border-radius: 12px;
  cursor: pointer;
  transition: box-shadow 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
  position: relative;
}
.mps-map-card:hover,
.mps-map-card:focus-visible,
.mps-map-card.is-hover {
  border-color: #c7b08f;
  box-shadow: 0 4px 14px rgba(185, 143, 79, 0.20);
  outline: none;
}
.mps-map-card.is-hover {
  transform: translateY(-1px);
}
.mps-map-card.is-expanded {
  grid-template-columns: 1fr;
  background: #fffdf7;
  border-color: #c7b08f;
  box-shadow: 0 8px 24px rgba(185, 143, 79, 0.18);
  cursor: default;
}

.mps-map-card-hero {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  background: #f0ebe0;
  transition: aspect-ratio 0.18s ease;
}
.mps-map-card.is-expanded .mps-map-card-hero {
  aspect-ratio: 16 / 9;
  margin-bottom: 12px;
}
.mps-map-card-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.mps-map-card-idx {
  position: absolute;
  top: 6px;
  left: 6px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #354766;
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.mps-map-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.mps-map-card-name {
  margin: 0;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.25;
  color: #1c2438;
  /* clamp to 2 lines so all collapsed cards align */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mps-map-card-specs {
  margin: 0;
  font-size: 0.78rem;
  color: #6f6a5f;
  line-height: 1.35;
}
.mps-map-card-poi-preview {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: #a86a3a;
  font-weight: 500;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mps-map-card-footer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 4px;
  gap: 8px;
}
.mps-map-card-price {
  font-weight: 600;
  color: #a86a3a;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}
.mps-map-card-price small {
  font-weight: 400;
  color: #8a8377;
  font-size: 0.72rem;
}
.mps-map-card-cta {
  font-size: 0.8rem;
  color: #354766;
  text-decoration: none;
  font-weight: 600;
  padding: 2px 0;
}
.mps-map-card-cta:hover { color: #c7b08f; }

/* ============================================================ */
/* Expanded state POI grid                                       */
/* ============================================================ */
.mps-map-card-expanded {
  grid-column: 1 / -1;
  padding: 6px 2px 2px;
}
.mps-map-poi-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
  padding: 10px 12px;
  background: rgba(185, 162, 127, 0.08);
  border-radius: 8px;
}
.mps-map-poi-row {
  display: grid;
  grid-template-columns: 20px 76px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 0.82rem;
  color: #4a4638;
  line-height: 1.35;
}
.mps-map-poi-row + .mps-map-poi-row {
  border-top: 1px dashed rgba(185, 162, 127, 0.35);
}
.mps-map-poi-icon {
  font-size: 1.05rem;
  text-align: center;
}
.mps-map-poi-label {
  font-weight: 600;
  color: #354766;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.mps-map-poi-name {
  color: #1c2438;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mps-map-poi-dist {
  color: #a86a3a;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-size: 0.78rem;
  white-space: nowrap;
}
.mps-map-poi-empty {
  margin: 6px 0;
  font-size: 0.82rem;
  color: #8a8377;
  text-align: center;
  font-style: italic;
}

/* ============================================================ */
/* Leaflet overrides — match the cream/gold aesthetic            */
/* ============================================================ */
.mps-map-wrap .leaflet-container {
  font-family: 'Inter', system-ui, sans-serif;
  background: #eae4d5;
}
.mps-map-wrap .leaflet-control-zoom a {
  color: #354766;
  background: #ffffff;
  border-color: rgba(185, 162, 127, 0.5);
}
.mps-map-wrap .leaflet-control-zoom a:hover {
  background: #fbf7ee;
}
.mps-map-wrap .leaflet-control-attribution {
  background: rgba(255, 255, 255, 0.85);
  font-size: 10px;
  padding: 2px 6px;
}
.mps-map-wrap .leaflet-popup-content-wrapper {
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(28, 36, 56, 0.18);
}

/* Active pin glow */
.mps-villa-pin.is-active span {
  animation: mpsMapPinPulse 1.6s ease-in-out infinite;
}
@keyframes mpsMapPinPulse {
  0%, 100% { box-shadow: 0 4px 10px rgba(199, 176, 143, 0.6), 0 0 0 0 rgba(199, 176, 143, 0.4); }
  50%      { box-shadow: 0 4px 10px rgba(199, 176, 143, 0.6), 0 0 0 10px rgba(199, 176, 143, 0.05); }
}
