/* ============================================================
   ecriVOSGES — Atlas vivant
   Feuille autonome et entièrement limitée à la page atlas.php.
   ============================================================ */

.ev-atlas-page #col2bis {
  margin: 0;
  padding: 0;
}

.ev-atlas-page .atlas-page {
  padding: 30px 30px 38px;
  color: var(--ev-ink, #252321);
}

.ev-atlas-page .atlas-page h1,
.ev-atlas-page .atlas-page h2,
.ev-atlas-page .atlas-page p {
  float: none;
  width: auto;
  height: auto;
}

.ev-atlas-page .atlas-page h1 {
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  color: var(--ev-wine, #781f25);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(2.35rem, 5vw, 3.85rem);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.025em;
}

.ev-atlas-page .atlas-page h2 {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ev-ink, #252321);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: 0;
  text-transform: none;
}

.atlas-intro {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 30px;
  align-items: end;
  margin: 0 0 24px;
  padding: 4px 0 24px 20px;
  border-bottom: 1px solid var(--ev-line, #ded7ca);
}

.atlas-intro::before {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 24px;
  left: 0;
  width: 5px;
  background: var(--ev-wine, #781f25);
}

.atlas-surtitre,
.atlas-mini-titre {
  margin: 0 0 5px !important;
  color: var(--ev-wine, #781f25);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.2;
  text-transform: uppercase;
}

.atlas-chapeau {
  max-width: 680px;
  margin: 0 !important;
  color: var(--ev-muted, #6d6760);
  font-size: 1.02rem;
  line-height: 1.55;
}

.atlas-retour {
  margin: 0 0 12px !important;
}

.ev-atlas-page .atlas-retour a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 5px 10px;
  border: 1px solid var(--ev-line, #ded7ca);
  background: var(--ev-paper, #fffdf8);
  color: var(--ev-wine, #781f25) !important;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
}

.ev-atlas-page .atlas-retour a:hover {
  border-color: var(--ev-wine, #781f25);
  background: var(--ev-wine-soft, #f2e5e3);
}

.atlas-raccourcis {
  display: grid;
  gap: 5px;
  min-width: 185px;
  padding-bottom: 2px;
}

.ev-atlas-page .atlas-raccourcis a {
  position: relative;
  padding: 3px 20px 3px 0;
  color: var(--ev-ink, #252321) !important;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: right;
  text-decoration: none;
}

.atlas-raccourcis a::after {
  content: "→";
  position: absolute;
  right: 0;
  color: var(--ev-wine, #781f25);
}

.ev-atlas-page .atlas-raccourcis a:hover {
  color: var(--ev-wine, #781f25) !important;
}

.atlas-filtres {
  margin: 0 0 15px;
  padding: 19px 20px 20px;
  border: 1px solid var(--ev-line, #ded7ca);
  border-top: 4px solid var(--ev-wine, #781f25);
  background:
    linear-gradient(135deg, rgba(120, 31, 37, 0.035) 25%, transparent 25%) 0 0 / 18px 18px,
    var(--ev-cream, #f4efe5);
}

.atlas-filtres-entete,
.atlas-carte-entete,
.atlas-resultats-entete {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.atlas-filtres-entete {
  align-items: center;
  margin-bottom: 16px;
}

.atlas-reset,
.atlas-bouton-secondaire,
.atlas-effacer-lieu,
.atlas-plus {
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid var(--ev-wine, #781f25);
  border-radius: 0;
  background: transparent;
  color: var(--ev-wine, #781f25);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.atlas-reset:hover,
.atlas-bouton-secondaire:hover,
.atlas-effacer-lieu:hover,
.atlas-plus:hover {
  background: var(--ev-wine, #781f25);
  color: #fff;
}

.atlas-filtres-grille {
  display: grid;
  grid-template-columns: minmax(250px, 1.4fr) minmax(135px, 0.65fr) minmax(190px, 0.95fr) minmax(190px, 1fr);
  gap: 12px;
  align-items: stretch;
}

.atlas-controle {
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid #d8cec0;
  background: rgba(255, 253, 248, 0.9);
}

.atlas-controle legend,
.atlas-legende {
  display: block;
  margin: 0 0 8px;
  padding: 0;
  color: var(--ev-ink, #252321);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-transform: uppercase;
}

.atlas-aide {
  margin: -3px 0 9px !important;
  color: var(--ev-muted, #6d6760);
  font-size: 0.7rem;
  line-height: 1.3;
}

.atlas-annees {
  display: grid;
  gap: 9px;
}

.atlas-annees-exactes {
  display: flex;
  align-items: center;
  gap: 9px;
}

.atlas-annees-exactes label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ev-muted, #6d6760);
  font-size: 0.78rem;
  white-space: nowrap;
}

.atlas-annees-exactes input[type="number"] {
  width: 88px;
  min-height: 42px;
  padding: 6px 7px;
  border: 2px solid #aaa197;
  border-radius: 0;
  background: #fff;
  color: var(--ev-wine, #781f25);
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
}

.atlas-annees-exactes input[type="number"]:focus {
  border-color: var(--ev-wine, #781f25);
}

.atlas-curseurs {
  display: grid;
  grid-template-columns: 38px minmax(130px, 1fr);
  gap: 2px 9px;
  align-items: center;
}

.atlas-curseurs label {
  color: var(--ev-muted, #6d6760);
  font-size: 0.7rem;
  font-weight: 700;
}

.atlas-curseurs input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  min-width: 0;
  height: 34px;
  margin: 0;
  background: transparent;
  accent-color: var(--ev-wine, #781f25);
  cursor: pointer;
}

.atlas-curseurs input[type="range"]::-moz-range-track {
  height: 8px;
  border: 1px solid #b7aa99;
  border-radius: 8px;
  background: #ded4c4;
}

.atlas-curseurs input[type="range"]::-moz-range-progress {
  height: 8px;
  border-radius: 8px;
  background: var(--ev-wine, #781f25);
}

.atlas-curseurs input[type="range"]::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--ev-wine, #781f25);
  box-shadow: 0 0 0 2px var(--ev-wine, #781f25), 0 2px 6px rgba(0, 0, 0, 0.22);
  cursor: grab;
}

.atlas-curseurs input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  border: 1px solid #b7aa99;
  border-radius: 8px;
  background: #ded4c4;
}

.atlas-curseurs input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 26px;
  height: 26px;
  margin-top: -10px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--ev-wine, #781f25);
  box-shadow: 0 0 0 2px var(--ev-wine, #781f25), 0 2px 6px rgba(0, 0, 0, 0.22);
  cursor: grab;
}

.atlas-choix {
  display: grid;
  gap: 6px;
}

.atlas-choix label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 25px;
  color: var(--ev-ink, #252321);
  font-size: 0.82rem;
  cursor: pointer;
}

.atlas-choix input {
  margin: 0;
  accent-color: var(--ev-wine, #781f25);
}

.atlas-controle input[type="search"] {
  width: 100%;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid #aaa197;
  border-radius: 0;
  background: #fff;
  color: var(--ev-ink, #252321);
  font: inherit;
  font-size: 0.84rem;
}

.atlas-statut {
  margin: 0 0 15px;
  padding: 9px 14px;
  background: var(--ev-wine, #781f25);
  color: #fff;
  font-size: 0.86rem;
  letter-spacing: 0.01em;
}

.atlas-statut strong {
  font-size: 1.03em;
}

.atlas-espace {
  display: grid;
  grid-template-columns: minmax(0, 1.62fr) minmax(290px, 0.78fr);
  gap: 16px;
  align-items: stretch;
}

.atlas-carte-cadre,
.atlas-resultats {
  min-width: 0;
  border: 1px solid var(--ev-line, #ded7ca);
  background: #fff;
}

.atlas-carte-cadre {
  display: flex;
  min-height: 670px;
  flex-direction: column;
}

.atlas-carte-entete,
.atlas-resultats-entete {
  min-height: 77px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--ev-line, #ded7ca);
  background: var(--ev-paper, #fffdf8);
}

.atlas-carte-zone {
  position: relative;
  flex: 1;
  min-height: 535px;
}

#atlas-carte {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 535px;
  background: #e8e4dc;
}

.atlas-carte-vide {
  position: absolute;
  z-index: 500;
  top: 50%;
  left: 50%;
  width: min(300px, calc(100% - 40px));
  margin: 0 !important;
  padding: 18px;
  border: 1px solid var(--ev-line, #ded7ca);
  background: rgba(255, 253, 248, 0.96);
  box-shadow: 0 8px 28px rgba(49, 38, 29, 0.14);
  color: var(--ev-muted, #6d6760);
  font-size: 0.86rem;
  text-align: center;
  transform: translate(-50%, -50%);
}

.atlas-legende-carte {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  min-height: 55px;
  align-items: center;
  padding: 11px 15px;
  border-top: 1px solid var(--ev-line, #ded7ca);
  background: #f8f4ec;
  color: var(--ev-muted, #6d6760);
  font-size: 0.72rem;
  line-height: 1.25;
}

.atlas-legende-carte span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.atlas-puce {
  display: inline-block;
  width: 11px;
  height: 11px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.atlas-puce-naissance {
  color: #781f25;
  background: #d7a6a1;
}

.atlas-puce-deces {
  color: #244759;
  background: #9dbcca;
}

.atlas-puce-mixte {
  color: #775617;
  background: #d6bd79;
}

.atlas-resultats {
  display: flex;
  height: 670px;
  flex-direction: column;
}

.atlas-resultats-entete {
  flex: 0 0 auto;
}

.atlas-resultats-detail {
  min-height: 18px;
  margin: 4px 0 0 !important;
  color: var(--ev-muted, #6d6760);
  font-size: 0.75rem;
  line-height: 1.25;
}

.atlas-effacer-lieu {
  max-width: 105px;
  min-height: 32px;
  padding: 5px 8px;
  font-size: 0.68rem;
  line-height: 1.15;
}

.atlas-liste-resultats {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #baa88e #f5f0e7;
}

.atlas-fiche {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  padding: 12px 13px;
  border-bottom: 1px solid #ece6dc;
  background: #fff;
}

.atlas-fiche:hover {
  background: #fbf7ef;
}

.atlas-portrait,
.atlas-portrait-vide {
  width: 48px;
  height: 60px;
  border: 1px solid #cdbfa8;
  background: #ede4d5;
  object-fit: cover;
}

.atlas-portrait-vide {
  display: grid;
  place-items: center;
  color: var(--ev-wine, #781f25);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.12rem;
  font-weight: 700;
}

.atlas-fiche-corps {
  min-width: 0;
}

.ev-atlas-page .atlas-nom {
  display: inline;
  color: var(--ev-wine, #781f25) !important;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.04rem;
  font-weight: 700;
  line-height: 1.1;
  text-decoration: none;
}

.ev-atlas-page .atlas-nom:hover {
  text-decoration: underline;
}

.atlas-badge-auteur {
  display: inline-block;
  margin-left: 5px;
  padding: 1px 5px;
  background: var(--ev-wine-soft, #f2e5e3);
  color: var(--ev-wine, #781f25);
  font-size: 0.57rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.4;
  text-transform: uppercase;
  vertical-align: 2px;
}

.atlas-dates,
.atlas-metiers,
.atlas-lieux {
  margin: 3px 0 0 !important;
  color: var(--ev-muted, #6d6760);
  font-size: 0.7rem;
  line-height: 1.3;
}

.atlas-lieux {
  color: #4d4944;
}

.atlas-relations {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.atlas-relation {
  padding: 2px 6px;
  border: 1px solid currentColor;
  border-radius: 10px;
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 1.15;
}

.atlas-relation-naissance {
  color: #781f25;
  background: #f7e9e7;
}

.atlas-relation-deces {
  color: #244759;
  background: #e8f0f3;
}

.atlas-vide-resultats {
  margin: 0 !important;
  padding: 30px 18px;
  color: var(--ev-muted, #6d6760);
  font-size: 0.82rem;
  text-align: center;
}

.atlas-plus {
  flex: 0 0 auto;
  width: calc(100% - 26px);
  margin: 10px 13px;
  background: var(--ev-wine, #781f25);
  color: #fff;
}

.atlas-plus:hover {
  background: var(--ev-wine-dark, #511318);
}

.atlas-alerte {
  margin: 20px 0;
  padding: 18px 20px;
  border-left: 5px solid var(--ev-wine, #781f25);
  background: var(--ev-cream, #f4efe5);
  color: var(--ev-ink, #252321);
}

/* Leaflet : accord avec la typographie et la palette du site. */
.ev-atlas-page .leaflet-container {
  font-family: "Source Sans 3", Helvetica, Arial, sans-serif;
}

.ev-atlas-page .leaflet-popup-content-wrapper,
.ev-atlas-page .leaflet-popup-tip {
  border-radius: 0;
  background: var(--ev-paper, #fffdf8);
}

.ev-atlas-page .leaflet-popup-content {
  min-width: 165px;
  margin: 12px 15px;
}

.atlas-popup-nom {
  color: var(--ev-wine, #781f25);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.1;
}

.atlas-popup-compte {
  margin-top: 4px;
  color: var(--ev-muted, #6d6760);
  font-size: 0.75rem;
}

.atlas-popup-aide {
  margin-top: 7px;
  color: #4d4944;
  font-size: 0.67rem;
  font-style: italic;
}

@media (max-width: 980px) {
  .ev-atlas-page .atlas-page {
    padding: 26px 22px 32px;
  }

  .atlas-filtres-grille {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .atlas-controle-large {
    grid-column: 1 / -1;
  }

  .atlas-espace {
    grid-template-columns: minmax(0, 1.35fr) minmax(270px, 0.8fr);
  }
}

@media (max-width: 760px) {
  .ev-atlas-page .atlas-page {
    padding: 22px 16px 28px;
  }

  .atlas-intro {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .atlas-raccourcis {
    grid-template-columns: repeat(3, 1fr);
  }

  .ev-atlas-page .atlas-raccourcis a {
    padding: 7px 0 0;
    border-top: 1px solid var(--ev-line, #ded7ca);
    text-align: left;
  }

  .atlas-raccourcis a::after {
    display: none;
  }

  .atlas-espace {
    grid-template-columns: 1fr;
  }

  .atlas-carte-cadre {
    min-height: 540px;
  }

  .atlas-carte-zone,
  #atlas-carte {
    min-height: 405px;
  }

  .atlas-resultats {
    height: auto;
    max-height: 690px;
  }

  .atlas-liste-resultats {
    max-height: 560px;
  }
}

@media (max-width: 560px) {
  .atlas-filtres {
    padding: 16px 14px;
  }

  .atlas-filtres-grille {
    grid-template-columns: 1fr;
  }

  .atlas-controle-large {
    grid-column: auto;
  }

  .atlas-annees-exactes {
    flex-wrap: wrap;
  }

  .atlas-curseurs {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .atlas-raccourcis {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .atlas-carte-entete {
    align-items: center;
  }

  .atlas-bouton-secondaire {
    max-width: 120px;
    line-height: 1.15;
  }

  .atlas-legende-carte span:last-child {
    width: 100%;
  }
}

@media print {
  .atlas-filtres,
  .atlas-carte-cadre,
  .atlas-reset,
  .atlas-effacer-lieu,
  .atlas-plus,
  .atlas-raccourcis {
    display: none !important;
  }

  .ev-atlas-page .atlas-page {
    padding: 0;
  }

  .atlas-espace {
    display: block;
  }

  .atlas-resultats {
    height: auto;
    border: 0;
  }

  .atlas-liste-resultats {
    overflow: visible;
  }
}
