/*
 * IMMGO — Écrans du patrimoine : synoptique des étages, aperçu de la grille, carte schématique, photos
 * Auteur : Jacks Ngalangala
 */

/* ─── Carte schématique des sites (préfixe cs-) ─── */
.cs {
  margin: 0;
  border-radius: var(--r-moyen);
  background: radial-gradient(120% 90% at 30% 20%, var(--surface) 0%, var(--surface-douce) 70%);
  border: 1px solid var(--trait);
  overflow: hidden;
}
.cs-svg {
  display: block;
  width: 100%;
  height: auto;
}
.cs-grille {
  stroke: var(--trait);
  stroke-width: 1;
  stroke-dasharray: 2 6;
}
.cs-boussole path {
  fill: var(--texte-faible);
}
.cs-boussole text {
  fill: var(--texte-faible);
  font-size: 13px;
  font-weight: var(--graisse-forte);
}
.cs-point {
  cursor: pointer;
  outline: none;
}
.cs-halo {
  fill: var(--or);
  opacity: 0.14;
  transition: opacity var(--duree) var(--courbe);
}
.cs-disque {
  fill: var(--or);
  stroke: var(--surface);
  stroke-width: 3;
}
.cs-nom {
  fill: var(--texte);
  font-size: 18px;
  font-weight: var(--graisse-forte);
  paint-order: stroke;
  stroke: var(--surface);
  stroke-width: 4px;
}
.cs-detail {
  fill: var(--texte-second);
  font-size: 15px;
  paint-order: stroke;
  stroke: var(--surface);
  stroke-width: 4px;
}
.cs-au-survol {
  opacity: 0;
  transition: opacity var(--duree) var(--courbe);
}
.cs-point:hover .cs-au-survol,
.cs-point:focus-visible .cs-au-survol,
.cs-actif .cs-au-survol {
  opacity: 1;
}
.cs-point:hover .cs-halo,
.cs-point:focus-visible .cs-halo,
.cs-actif .cs-halo {
  opacity: 0.35;
}
.cs-point:focus-visible .cs-disque,
.cs-actif .cs-disque {
  fill: var(--or-fonce);
}
.carte-page {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: var(--e-6);
  align-items: start;
}

/* ─── Deux champs côte à côte (couple indissociable : latitude + longitude) ─── */
.grille-deux {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--e-4);
}

@media (max-width: 1023px) {
  .carte-page {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 599px) {
  .grille-deux {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ─── Aperçu de la grille d'un immeuble (préfixe ag-) ─── */
.ag {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--trait);
  border-radius: var(--r-grand);
  background: var(--surface);
  overflow: hidden;
}
.ag-niveau {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--e-4);
  padding: var(--e-3) var(--e-4);
  border-bottom: 1px solid var(--trait);
}
.ag-niveau:last-child {
  border-bottom: 0;
}
.ag-tete {
  display: flex;
  flex-direction: column;
}
.ag-libelle {
  font-weight: var(--graisse-forte);
}
.ag-compte {
  font-size: var(--taille-petit);
  color: var(--texte-second);
}
.ag-lots {
  display: flex;
  flex-wrap: wrap;
  gap: var(--e-2);
}
.ag-lot {
  min-width: 52px;
  padding: var(--e-1) var(--e-2);
  border-radius: var(--r-petit);
  background: var(--or-pale);
  border: 1px solid var(--or-trait);
  font-size: var(--taille-petit);
  font-weight: var(--graisse-forte);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.ag-vide {
  font-size: var(--taille-petit);
  color: var(--texte-faible);
}
.ag-pas {
  display: flex;
  gap: var(--e-2);
}

/* ─── Synoptique par étage (préfixe sy-) ─── */
.sy-legende {
  display: flex;
  flex-wrap: wrap;
  gap: var(--e-2);
}
.sy {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--trait);
  border-radius: var(--r-moyen);
  overflow: hidden;
}
.sy-etage {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 36px;
  align-items: center;
  gap: var(--e-4);
  padding: var(--e-3) var(--e-4);
  border-bottom: 1px solid var(--trait);
  background: var(--surface);
}
.sy-etage:nth-child(even) {
  background: var(--surface-douce);
}
.sy-etage:last-child {
  border-bottom: 0;
}
.sy-niveau {
  display: flex;
  flex-direction: column;
}
.sy-libelle {
  font-weight: var(--graisse-forte);
}
.sy-compte {
  font-size: var(--taille-legende);
  color: var(--texte-second);
}
.sy-lots {
  display: flex;
  flex-wrap: wrap;
  gap: var(--e-2);
}
.sy-lot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  min-height: 52px;
  padding: var(--e-1) var(--e-2);
  border: 1px solid transparent;
  border-radius: var(--r-petit);
  font: inherit;
  cursor: pointer;
  transition:
    transform var(--duree) var(--courbe),
    box-shadow var(--duree) var(--courbe);
}
.sy-lot:hover {
  transform: translateY(-1px);
  box-shadow: var(--ombre-2);
}
.sy-lot:focus-visible {
  outline: none;
  box-shadow: var(--anneau);
}
.sy-numero {
  font-weight: var(--graisse-titre);
  font-variant-numeric: tabular-nums;
}
.sy-type {
  font-size: 11px;
  letter-spacing: 0.04em;
  opacity: 0.8;
}
.sy-succes {
  background: var(--succes-pale);
  border-color: rgba(46, 125, 79, 0.25);
  color: var(--succes);
}
.sy-attention {
  background: var(--attention-pale);
  border-color: rgba(154, 100, 16, 0.25);
  color: var(--attention);
}
.sy-info {
  background: var(--info-pale);
  border-color: rgba(47, 98, 168, 0.25);
  color: var(--info);
}
.sy-danger {
  background: var(--danger-pale);
  border-color: rgba(179, 38, 30, 0.25);
  color: var(--danger);
}
.sy-or {
  background: var(--or-pale);
  border-color: var(--or-trait);
  color: var(--or-texte);
}
.sy-neutre {
  background: var(--neutre-pale);
  border-color: var(--trait-fort);
  color: var(--neutre);
}

@media (max-width: 599px) {
  .ag-niveau,
  .sy-etage {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .ag-lots,
  .sy-lots {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

/* ─── Paramètres : valeurs communes en étiquettes (préfixe pa-) ─── */
.pa-etiquettes {
  display: flex;
  flex-wrap: wrap;
  gap: var(--e-2);
}
.pa-etiquette {
  padding: var(--e-2) var(--e-4);
  border: 1px solid var(--trait);
  border-radius: var(--r-pilule);
  background: var(--surface-douce);
  font-size: var(--taille-petit);
  font-weight: var(--graisse-moyenne);
}
.pa-inactive {
  color: var(--texte-faible);
  text-decoration: line-through;
}

/* Pied de l'aperçu : « Revenir » à gauche, création à droite ; sur téléphone, création en pleine largeur au-dessus */
.ag-pied {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--e-3);
  padding-top: var(--e-6);
  border-top: 1px solid var(--trait);
}
@media (max-width: 599px) {
  .ag-pied {
    flex-direction: column-reverse;
    align-items: stretch;
  }
}
