/* --- ID 198: mapbox - style --- */
/*********************************
 * HOMERENTAI — MAPBOX POPUP CLEAN
 *********************************/

:root {
  --hr-blue: #4C6FFF;
  --hr-text: #1f2a44;
  --hr-muted: #6b778c;
  --hr-shadow: 0 18px 50px rgba(15,23,42,.18);
}

/* ===============================
   MAP CONTAINER
   =============================== */
.hp-map.homerentai-home-map {
  border-radius: 28px;
  overflow: hidden;
  height: 420px;
  max-height: 52vh;
  box-shadow: var(--hr-shadow);
}

.hp-map.homerentai-home-map .mapboxgl-canvas,
.hp-map.homerentai-home-map .mapboxgl-canvas-container {
  width: 100%;
  height: 100%;
}

/* ===============================
   POPUP BASE (override Mapbox)
   =============================== */
.hp-map.homerentai-home-map .mapboxgl-popup {
  max-width: none !important; /* kill inline 240px */
  z-index: 60;
}

.hp-map.homerentai-home-map .mapboxgl-popup-content {
  background: #fff;
  border-radius: 18px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 22px 70px rgba(15,23,42,.22);
}

/* ===============================
   CARD STRUCTURE
   =============================== */
.hp-map.homerentai-home-map .hr-mapcard {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 14px;
  padding: 16px;
  width: 420px;           /* ✅ TAILLE FIXE DESKTOP */
  max-width: 100%;
  box-sizing: border-box;
}

.hr-mapcard__thumb {
  width: 120px;
  height: 90px;
  border-radius: 14px;
  overflow: hidden;
}

.hr-mapcard__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hr-mapcard__meta {
  min-width: 0; /* CRUCIAL */
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ===============================
   TEXT CLAMP (ANTI ESPACE VIDE)
   =============================== */
.hr-mapcard__city {
  font-size: 13px;
  color: var(--hr-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hr-mapcard__title {
  font-size: 18px;
  font-weight: 700;
  color: var(--hr-text);

  display: -webkit-box;
  -webkit-line-clamp: 2;          /* ✅ LIMITE FIXE */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===============================
   CTA
   =============================== */
.hr-mapcard__cta {
  margin-top: 8px;
  align-self: flex-start;
  padding: 8px 14px;
  border-radius: 999px;
  border: 2px solid var(--hr-blue);
  color: var(--hr-blue);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}



















/* ===== Skeleton image loading ===== */
.hr-mapcard__thumb {
  position: relative;
  background: #eef2f7;
  overflow: hidden;
}

.hr-mapcard__thumb.is-loading::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    #eef2f7 25%,
    #f6f9fc 37%,
    #eef2f7 63%
  );
  background-size: 200% 100%;
  animation: hr-shimmer 1.4s infinite;
  z-index: 1;
}

.hr-mapcard__thumb img {
  position: relative;
  z-index: 2;
  transition: opacity .25s ease;
}

.hr-mapcard__thumb.is-loading img {
  opacity: 0;
}

@keyframes hr-shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* ===== Mobile sheet ===== */
@media (max-width: 640px) {

  .hr-mobile-sheet__card {
    position: relative;
    background: rgba(255,255,255,.95);
    border-radius: 20px;
    padding: 14px;
    box-shadow: 0 18px 60px rgba(15,23,42,.22);
  }

  .hr-mobile-sheet__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid rgba(76,111,255,.25);
    background: #fff;
    color: #4C6FFF;
    font-size: 20px;
    line-height: 34px;
  }

  .hr-mobile-sheet .hr-mapcard {
    display: grid;
    grid-template-columns: 108px 1fr;
    gap: 12px;
    align-items: center;
  }

  .hr-mobile-sheet .hr-mapcard__thumb {
    width: 108px;
    height: 80px;
    border-radius: 16px;
  }

  .hr-mobile-sheet .hr-mapcard__title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}









/* ===============================
   MAP POPUP — DESKTOP SPACING FIX
   =============================== */
@media (min-width: 641px){

  .hp-map.homerentai-home-map .hr-mapcard{
    grid-template-columns: 160px 1fr; /* image un peu plus large */
    column-gap: 24px;                 /* ✅ ESPACE VISUEL CLAIR */
    row-gap: 0;
  }

  .hp-map.homerentai-home-map .hr-mapcard__thumb{
    width: 160px;
    height: 120px;
  }

  .hp-map.homerentai-home-map .hr-mapcard__meta{
    padding-right: 12px; /* respiration côté texte */
  }
}

