/* ============================================================
   BTP FINCOOP 1.8.2 — ACCUEIL CARTOGRAPHIQUE
   Couleurs franches, textes nets, fond éclairci.
   ============================================================ */


/* ============================================================
   1. STRUCTURE GÉNÉRALE (Sans Sidebar)
   ============================================================ */
.app-no-sidebar .app-shell { display: block; }
.app-no-sidebar .main-area { width: 100%; min-width: 0; }
.app-no-sidebar .content { margin: auto; }
.app-no-sidebar .eyebrow { letter-spacing: .1em; }


/* ============================================================
   2. FILIGRANE DE FOND (Watermark) — FOND ÉCLAIRCI
   ============================================================ */
.map-home-page {
  background-color: #f9fbfd;
  background-image: url("../img/fond5.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
}

.map-home-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: rgba(255, 255, 255, 0.55);
  pointer-events: none;
}

.map-home-page .content {
  padding: 0;
  max-width: none;
  background: transparent;
}

.map-home-page .messages {
  padding: 12px 24px;
  margin: 0;
}

.map-home-page .topbar {
  position: relative;
  z-index: 60;
  border-bottom: 1px solid var(--line);
}


/* ============================================================
   3. EN-TÊTE EXPLORATEUR : LOGO + DRAPEAU RDC
   ============================================================ */
.map-explorer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e2e8f0;
}

.map-explorer-logo {
  display: block;
  height: 38px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
}

.map-explorer-flag {
  display: block;
  width: 32px;
  height: auto;
  border-radius: 4px;
  border: 1px solid #cbd7e4;
  box-shadow: 0 1px 4px rgba(16, 42, 67, .15);
  flex: none;
}


/* ============================================================
   4. ZONE CARTE (Map Home) — FOND ÉCLAIRCI
   ============================================================ */
.map-home {
  position: relative;
  min-height: 670px;
  height: calc(100dvh - 80px);
  background: #f0f5fa;
  isolation: isolate;
  overflow: hidden;
}



.province-map {
  height: 100%;
  width: 100%;
  background: #fff;
  z-index: 0;
  font-family: inherit;
}

/* --- Contrôles Leaflet --- */
.province-map .leaflet-control-attribution {
  background: #fff;
  color: #52657b;
  font-size: 10px;
  max-width: 85vw;
}

.province-map .leaflet-control-zoom {
  border: 1px solid #cbd7e4 !important;
  box-shadow: 0 3px 12px #102a4314;
  border-radius: 10px;
  overflow: hidden;
  margin: 24px;
}

.province-map .leaflet-control-zoom a {
  width: 44px;
  height: 44px;
  line-height: 44px;
  color: var(--navy);
  border: 0;
}

.province-map .leaflet-control-zoom a + a { border-top: 1px solid var(--line); }
.province-map .leaflet-control-zoom a:hover { background: #edf3f9; }


/* ============================================================
   5. PANNEAU EXPLORATEUR (Gauche)
   ============================================================ */
.map-explorer {
  position: absolute;
  top: 28px;
  left: 28px;
  width: 324px;
  z-index: 30;
  background: #fff;
  border: 1px solid #d7e1ed;
  border-top: 4px solid var(--navy);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 8px 26px #102a4310;
}

.map-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .055em;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 7px;
}

.map-kicker span {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
}

/* Titre principal du panneau */
.map-explorer-title {
  font-size: 33px;
  line-height: 1.15;
  letter-spacing: -1px;
  color: var(--heading);
  margin: 18px 0 12px;
  font-weight: 700;
}

.map-explorer > p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0 0 20px;
}


/* ============================================================
   6. RECHERCHE & FILTRES
   ============================================================ */
.map-search-wrap {
  position: relative;
  min-width: 0;
}

.map-search-wrap input {
  width: 100%;
  height: 46px;
  padding: 0 12px 0 36px;
  border: 1px solid #c8d5e4;
  background: #f7f9fc;
  border-radius: 9px;
  color: var(--heading);
  font: inherit;
  font-size: 14px;
}

.map-search-wrap input::placeholder { color: #65778b; }
.map-search-wrap input:focus { background: #fff; border-color: var(--navy); }

.map-search-icon {
  position: absolute;
  left: 12px;
  top: 5px;
  font-size: 25px;
  color: var(--navy);
}

.map-search-results {
  position: absolute;
  top: 51px;
  left: 0;
  right: 0;
  z-index: 40;
  max-height: 280px;
  overflow: auto;
  background: #fff;
  border: 1px solid #cbd7e4;
  border-radius: 10px;
  box-shadow: 0 8px 24px #102a4320;
  padding: 6px;
}

.map-search-results[hidden] { display: none; }

.map-search-results button,
.map-search-results a {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px;
  border: 0;
  border-radius: 7px;
  background: white;
  color: var(--heading);
  cursor: pointer;
  text-decoration: none;
  white-space: normal;
  font-size: 13px;
}

.map-search-results button:hover,
.map-search-results a:hover { background: var(--accent-soft); }

.map-search-results strong,
.map-search-results small {
  display: block;
  overflow-wrap: anywhere;
}

.map-search-results small { font-size: 12px; color: var(--muted); margin-top: 4px; }
.map-search-results p { padding: 8px; font-size: 13px; }

/* --- Filtres --- */
.map-filter-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  min-width: 0;
}

.map-filter-row select {
  min-width: 0;
  flex: 1;
  height: 44px;
  padding: 0 8px;
  font: inherit;
  font-size: 12px;
  color: var(--heading);
  border: 1px solid #c8d5e4;
  border-radius: 9px;
  background: #fff;
}

.map-filter-row button {
  flex: none;
  min-height: 44px;
  border: 1px solid #c8d5e4;
  background: white;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 0 10px;
  color: var(--navy);
}

.map-filter-row button:hover { background: #edf3f9; border-color: var(--navy); }

/* --- Compteur --- */
.map-counter {
  margin-top: 18px;
  color: var(--navy);
  font-size: 13px;
  font-weight: 600;
  border-top: 1px solid var(--line);
  padding-top: 15px;
}

.map-explorer .map-location-notice {
  font-size: 11px;
  margin: 10px 0 0;
  color: var(--accent-hover);
}


/* ============================================================
   7. LÉGENDE & SIGNATURE
   ============================================================ */
.map-legend {
  position: absolute;
  z-index: 20;
  bottom: 35px;
  left: 28px;
  display: flex;
  gap: 10px 17px;
  flex-wrap: wrap;
  max-width: calc(100% - 140px);
  background: #fff;
  border: 1px solid #d7e1ed;
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 12px;
  color: #40566f;
  box-shadow: 0 4px 16px #102a4310;
}

.map-legend-title {
  width: 100%;
  color: var(--heading);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .03em;
}

.map-legend span { display: flex; align-items: center; gap: 7px; }
.map-legend i { display: block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.pin-project { background: #dc2626; }

.map-signature {
  position: absolute;
  bottom: 39px;
  right: 95px;
  font-size: 10px;
  letter-spacing: .08em;
  color: #52657b;
  pointer-events: none;
}

.map-signature span { margin: 0 9px; }


/* ============================================================
   8. MARQUEURS DE LA CARTE
   ============================================================ */
.province-label {
  padding: 2px 4px;
  border: 0;
  background: none;
  box-shadow: none;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  white-space: normal;
  text-align: center;
  line-height: 1.2;
  pointer-events: none;
  text-shadow: 0 1px 0 #102a4366;
}

.province-label:before { display: none; }

.project-pin-icon { background: none; border: 0; }

.project-pin {
  display: block;
  width: 32px;
  height: 32px;
  transform: rotate(-45deg);
  border-radius: 50% 50% 50% 2px;
  border: 3px solid #fff;
  background: #dc2626;
  box-shadow: 0 0 0 1px #102a4355, 0 3px 6px #102a4340;
  position: relative;
}

.project-pin span {
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--navy);
  transform: rotate(45deg);
}

.project-pin-icon:hover,
.project-pin-icon:focus { z-index: 1000 !important; }

.project-pin-icon:focus-visible {
  outline: 3px solid var(--heading);
  outline-offset: 5px;
  border-radius: 8px;
}


/* ============================================================
   9. POPUPS DE PROJET
   ============================================================ */
.province-map .leaflet-popup-content-wrapper {
  border-radius: 14px;
  box-shadow: 0 8px 24px #102a4326;
}

.map-project-popup { font-family: inherit; }

.map-project-popup small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin: 0 0 7px;
  text-transform: uppercase;
  letter-spacing: .025em;
}

.map-project-popup strong {
  display: block;
  font-size: 17px;
  color: var(--heading);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.map-project-popup p {
  font-size: 13px;
  line-height: 1.65;
  color: #52657b;
  max-height: 125px;
  overflow: auto;
  margin: 11px 0;
}

.map-project-popup a {
  display: block;
  border-radius: 8px;
  background: var(--accent);
  padding: 12px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  min-height: 44px;
}

.map-project-popup a:hover { background: var(--accent-hover); }

.map-project-popup + .map-project-popup {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 14px;
}


/* ============================================================
   10. MESSAGES DE CHARGEMENT & FALLBACK
   ============================================================ */
.map-load-message {
  position: absolute;
  top: 48%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  font-size: 14px;
  box-shadow: 0 6px 24px #102a4320;
  max-width: 280px;
}

.map-load-message[hidden] { display: none; }

.map-no-js {
  position: absolute;
  bottom: 125px;
  left: 30px;
  background: #fff;
  padding: 20px;
}


/* ============================================================
   11. ACCESSIBILITÉ
   ============================================================ */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* ============================================================
   12. MEDIA QUERIES
   ============================================================ */

/* --- Très grands écrans (≥1600px) --- */
@media (min-width: 1600px) {
  .map-explorer {
    left: 40px;
    top: 40px;
    width: 350px;
    padding: 28px;
  }
  .map-explorer-title { font-size: 38px; }
}

/* --- Tablettes (≤900px) --- */
@media (max-width: 900px) {
  .map-explorer {
    top: 18px;
    left: 18px;
    right: 18px;
    width: auto;
    padding: 18px 22px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, .9fr);
    gap: 10px 12px;
  }
  
  /* L'en-tête prend toute la largeur */
  .map-explorer-header { grid-column: 1 / -1; }
  
  .map-explorer-title,
  .map-explorer > p,
  .map-counter { grid-column: 1 / -1; }
  
  .map-explorer-title { font-size: 28px; margin: 0; }
  .map-explorer-title br { display: none; }
  .map-explorer > p { margin: 0; }
  .map-filter-row { margin: 0; }
  .map-search-wrap input { font-size: 16px; }
  .map-counter { margin: 0; padding-top: 10px; }
  .map-explorer .map-location-notice { margin: 0; }
  .map-signature { display: none; }
  .map-legend { left: 18px; bottom: 29px; }
  .province-label { font-size: 11px; }
}

/* --- Mobile (≤600px) --- */
@media (max-width: 600px) {
  .map-explorer-header {
    margin-bottom: 12px;
    padding-bottom: 10px;
  }
  .map-explorer-logo { height: 32px; max-width: 110px; }
  .map-explorer-flag { width: 26px; }

  .map-home {
    min-height: 700px;
    height: calc(100dvh - 110px);
  }
  .map-explorer {
    left: 12px;
    right: 12px;
    top: 12px;
    width: auto;
    padding: 14px 16px;
    border-radius: 14px;
    display: block;
  }
  .map-explorer-title { font-size: 23px; margin: 7px 0; }
  .map-explorer > p { font-size: 12px; margin-bottom: 11px; }
  .map-search-wrap input { height: 44px; }
  .map-filter-row { margin-top: 8px; }
  .map-filter-row select { font-size: 13px; }
  .map-counter { border: 0; padding: 0; margin: 9px 0 0; font-size: 11px; }
  .map-explorer .map-location-notice { margin-top: 6px; }
  .map-legend {
    left: 12px;
    right: 12px;
    bottom: 29px;
    max-width: none;
    padding: 10px 12px;
    gap: 7px 12px;
    font-size: 11px;
    justify-content: center;
  }
  .map-legend-title { justify-content: center; font-size: 10px; }
  .province-label { font-size: 10px; }
  .province-map .leaflet-control-zoom { margin: 12px; margin-bottom: 120px; }
  .province-map .leaflet-control-attribution { font-size: 9px; }

  .map-home-page .user-menu .user-info,
  .map-home-page .user-menu .avatar { display: none; }
  .map-home-page .topbar { gap: 8px; }
  .map-home-page .topbar-heading { flex-basis: 170px; }
  .map-home-page .eyebrow { font-size: 9px; }
  .map-home-page .topbar-title { font-size: 13px; }
  .map-home-page .home-brand .brand-mark { width: 34px; height: 34px; }
  .map-home-page .button { font-size: 12px; padding-inline: 12px; }
  .map-load-message { top: 60%; }
}