/* Navigateur d'immeuble par étages (style Le 700 / Logisco).
   Tout dérive des tokens --sgl-* (hérités du thème). Aucune couleur de marque en dur. */

.sgl-nav { margin: var(--sgl-gap) 0; }

/* Bascule de vue Liste / Par immeuble (dans le sélecteur et la modale) */
.sgl-viewtabs { display: inline-flex; gap: 4px; padding: 4px; margin: 0 0 var(--sgl-gap);
  border: 1px solid var(--sgl-color-border); border-radius: 999px; background: color-mix(in srgb, currentColor 4%, transparent); }
.sgl-viewtabs .sgl-viewtab {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; margin: 0;
  padding: .5em 1.1em; border: 0 !important; border-radius: 999px !important;
  background: transparent !important; color: var(--sgl-color-heading, inherit) !important;
  font-weight: 600; font-size: .92rem; text-transform: none; letter-spacing: normal; box-shadow: none;
  transition: background .15s ease, color .15s ease;
}
.sgl-viewtabs .sgl-viewtab:hover { background: color-mix(in srgb, var(--sgl-color-accent) 10%, transparent) !important; }
.sgl-viewtabs .sgl-viewtab.is-active {
  background: var(--sgl-color-accent) !important; color: var(--sgl-on-accent, #fff) !important;
}
.sgl-viewtab-i { width: 18px; height: 18px; vertical-align: -3px; }
.sgl-view[hidden] { display: none; }
.sgl-nav-loading { opacity: .55; transition: opacity .15s ease; pointer-events: none; }

/* A11y : focus clavier visible (barre d'étages, onglets, pastilles d'immeuble) */
.sgl-nav .sgl-floor:focus-visible,
.sgl-viewtabs .sgl-viewtab:focus-visible,
.sgl-nav-bchip:focus-visible {
  outline: 2px solid var(--sgl-color-accent);
  outline-offset: 2px;
}
/* Respect des préférences de mouvement réduit */
@media (prefers-reduced-motion: reduce) {
  .sgl-nav *, .sgl-viewtabs * { transition-duration: .01ms !important; animation: none !important; }
  .sgl-nav .sgl-floor:hover, .sgl-nav-bchip:hover { transform: none !important; }
  .sgl-nav-panel { animation: none !important; }
}

/* Pastilles de choix d'immeuble */
.sgl-nav-buildings { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: var(--sgl-gap); }
.sgl-nav-bchip {
  padding: .5em 1em; border-radius: 999px; text-decoration: none;
  border: 1px solid var(--sgl-color-border); color: var(--sgl-color-heading, inherit);
  font-size: .9rem; font-weight: 600; transition: all .15s ease; background: var(--sgl-color-surface, #fff);
}
.sgl-nav-bchip:hover { border-color: var(--sgl-color-accent); color: var(--sgl-color-accent); }
/* LD-25 : un onglet visite garde sa couleur (le theme parent peignait a:visited en
   violet ; la regle est retiree du theme, ceci garantit l'onglet quoi qu'il arrive). */
.sgl-nav-bchip:visited { color: var(--sgl-color-heading, inherit); border-color: var(--sgl-color-border); }
.sgl-nav-bchip:visited:hover { border-color: var(--sgl-color-accent); color: var(--sgl-color-accent); }
.sgl-nav-bchip.is-active, .sgl-nav-bchip.is-active:visited { background: var(--sgl-color-accent); color: var(--sgl-on-accent, #fff); border-color: transparent; }
/* LD-25 : fil d'Ariane des pages d'immeubles et des fiches en bleu marine du site,
   visite ou non (le bleu vif de Bootstrap disparait) ; la page courante reste grise. */
.rank-math-breadcrumb a, .rank-math-breadcrumb a:visited { color: var(--sgl-color-heading, #152447); text-decoration: none; }
.rank-math-breadcrumb a:hover, .rank-math-breadcrumb a:focus-visible { color: var(--sgl-color-accent, #de4d09); }
.rank-math-breadcrumb .last { color: var(--sgl-color-muted, #6b7280); }
.sgl-nav-bchip.is-active { background: var(--sgl-color-accent); color: var(--sgl-on-accent, #fff); border-color: transparent; }

/* Onglets d'immeubles d'une page d'immeuble (LD-05) : deux groupes, un trait
   entre les deux. Les groupes restent cote a cote tant qu'il y a la place, et
   le trait devient horizontal quand la ligne se replie sur mobile. */
.sgl-nav-buildings--onglets { align-items: center; row-gap: 8px; }
.sgl-nav-bgroup { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sgl-nav-bgroup--suite {
  border-left: 1px solid var(--sgl-color-border);
  padding-left: 14px; margin-left: 6px;
}
@media (max-width: 640px) {
  .sgl-nav-bgroup--suite {
    border-left: 0; padding-left: 0; margin-left: 0;
    border-top: 1px solid var(--sgl-color-border); padding-top: 10px; width: 100%;
  }
}

.sgl-nav-head { margin-bottom: var(--sgl-gap); }

/* Bandeau façade réelle de l'immeuble.
   Image en hauteur DÉFINIE (object-fit:cover) -> zéro CLS et zéro déformation ;
   titre + bandes se superposent en absolu. */
.sgl-nav-head--facade { position: relative; border-radius: var(--sgl-radius); overflow: hidden; }
/* Le bandeau est servi en deux cadrages (LD-19) : l'enveloppe <picture> ne
   doit pas casser la mise en page de l'image qu'elle contient. */
.sgl-nav-facade-pic { display: block; line-height: 0; }
.sgl-nav-head--facade .sgl-nav-facade { display: block !important; width: 100% !important;
  height: clamp(190px, 24vw, 260px) !important; max-width: none !important; object-fit: cover !important; margin: 0 !important;
  /* LD-22 : cadrage vertical choisi par le client, immeuble par immeuble (reglage « Position verticale du bandeau »). */
  object-position: 50% var(--sgl-bandeau-y, 50%) !important; }
/* LD-22 : sur ordinateur, les photos 2560 x 800 du client n'etaient visibles que sur une
   tranche de 260 px (toits coupes). Le bandeau atteint 440 px des 1920 px de large et
   reste entre 360 et 440 px de 1440 a 1920 px. Le mobile (moins de 768 px) ne change pas. */
@media (min-width: 768px) { .sgl-nav-head--facade .sgl-nav-facade { height: clamp(360px, 23vw, 440px) !important; } }
.sgl-nav-head--facade .sgl-nav-facade-ov { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; pointer-events: none;
  padding: 22px 20px 16px; color: #fff;
  background: linear-gradient(to top, rgba(0,0,0,.72), rgba(0,0,0,.28) 55%, rgba(0,0,0,0)); }

.sgl-nav-head--facade .sgl-nav-title { color: #fff; margin: 0 0 .15em; text-shadow: 0 1px 8px rgba(0,0,0,.35); }
.sgl-nav-head--facade .sgl-nav-sub { color: rgba(255,255,255,.92); opacity: 1; }
.sgl-nav-head--facade .sgl-nav-sub strong { color: #fff; }
@media (max-width: 600px) { .sgl-nav-facade { height: 165px; } }
.sgl-nav-title { margin: 0 0 .2em; }
.sgl-nav-sub { margin: 0; opacity: .8; font-size: .98rem; }
.sgl-nav-sub strong { color: var(--sgl-color-accent); font-size: 1.1em; }
.sgl-nav-sep { opacity: .4; margin: 0 .3em; }

/* Corps : plans à gauche (façade + plan de l'étage), logements à droite */
.sgl-nav-body { display: grid; grid-template-columns: minmax(230px, 300px) 1fr; gap: var(--sgl-gap); align-items: start; }


/* Cellules = logements de l'étage */
.sgl-floor-cells { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; flex: 1; min-width: 0; }
.sgl-cell { display: inline-block; width: 11px; height: 11px; border-radius: 2px; flex: none;
  background: color-mix(in srgb, currentColor 14%, transparent); box-sizing: border-box; }
.sgl-cell.is-disponible { background: var(--sgl-color-accent); }
.sgl-cell.is-bientot { background: color-mix(in srgb, var(--sgl-color-accent) 45%, transparent); }
.sgl-cell.is-loue { background: transparent; border: 1.5px solid color-mix(in srgb, currentColor 30%, transparent); }
.sgl-cell-more { font-size: .7rem; font-weight: 700; opacity: .7; margin-left: 2px; }
.sgl-floor.is-active .sgl-cell.is-disponible { background: #fff; }
.sgl-floor.is-active .sgl-cell.is-bientot { background: color-mix(in srgb, #fff 55%, transparent); }
.sgl-floor.is-active .sgl-cell.is-loue { border-color: color-mix(in srgb, #fff 55%, transparent); }

.sgl-floor-badge {
  flex: none; font-size: .7rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase;
  padding: .18em .55em; border-radius: 999px; white-space: nowrap;
  background: color-mix(in srgb, currentColor 10%, transparent);
}
.sgl-floor-badge.is-dispo { background: color-mix(in srgb, var(--sgl-color-accent) 16%, transparent); color: var(--sgl-color-accent); }
.sgl-floor.is-active .sgl-floor-badge { background: color-mix(in srgb, #fff 22%, transparent); color: inherit; }

/* Sol + légende */
.sgl-nav-ground {
  margin: 4px 2px 0; padding: 8px 4px 2px; flex: none;
  display: flex; justify-content: center; gap: 14px; font-size: .74rem; opacity: .75;
  border-top: 3px solid color-mix(in srgb, currentColor 22%, transparent);
}
.sgl-legend { display: inline-flex; align-items: center; gap: 5px; }
.sgl-legend .sgl-cell { width: 10px; height: 10px; }

/* Panneau d'étage */
.sgl-nav-panels { min-height: 200px; }
.sgl-nav-panel[hidden] { display: none; }
.sgl-nav-panel { animation: sgl-nav-fade .25s ease; }
@keyframes sgl-nav-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.sgl-nav-panel-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.sgl-nav-panel-head h3 { margin: 0; }
.sgl-nav-panel-sub { font-size: .9rem; opacity: .7; }
.sgl-nav-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }

/* Responsive : la tour devient une grille de 2 colonnes au-dessus du panneau
   (tous les étages visibles d'un coup, pas de défilement horizontal caché). */
@media (max-width: 860px) {
  .sgl-nav-body { grid-template-columns: 1fr; }
}

/* Carte interactive des immeubles (Leaflet auto-hébergé) */
.sgl-nav-map { height: 340px; margin-bottom: var(--sgl-gap); border-radius: var(--sgl-radius);
  overflow: hidden; border: 1px solid var(--sgl-color-border); background: color-mix(in srgb, currentColor 5%, transparent); z-index: 0; }
.sgl-nav-map .leaflet-container { font: inherit; }
.sgl-nav-buildings.is-mapon { opacity: .85; }            /* pastilles = repli discret sous la carte */
.sgl-pin-wrap { background: none !important; border: 0 !important; }
.sgl-pin { position: relative; width: 46px; height: 46px; }
.sgl-pin-img { display: block; width: 46px; height: 46px; border-radius: 50%;
  background-size: cover; background-position: center; background-color: color-mix(in srgb, var(--sgl-color-accent) 30%, #cbd5e1);
  border: 3px solid #fff; box-shadow: 0 4px 12px rgba(0,0,0,.35); }
.sgl-pin.has-dispo .sgl-pin-img { border-color: var(--sgl-color-accent); }
.sgl-pin-badge { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 999px; background: #6b7280; color: #fff; font-size: 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.sgl-pin.has-dispo .sgl-pin-badge { background: var(--sgl-color-accent); }
.sgl-pin.has-dispo::after { content: ''; position: absolute; inset: -3px; border-radius: 50%;
  border: 2px solid var(--sgl-color-accent); animation: sgl-pulse 1.8s ease-out infinite; pointer-events: none; }
@keyframes sgl-pulse { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(1.65); opacity: 0; } }
.sgl-pin-pop { text-align: center; min-width: 150px; }
.sgl-pin-pop strong { display: block; font-size: 1rem; color: var(--sgl-color-heading, inherit); }
.sgl-pin-pop span { display: block; font-size: .8rem; opacity: .7; }
.sgl-pin-pop em { display: block; font-style: normal; font-weight: 700; color: var(--sgl-color-accent); margin: 4px 0 8px; font-size: .85rem; }
.sgl-pin-go { width: 100%; background: var(--sgl-color-accent); color: #fff; border: 0; border-radius: 8px;
  padding: .55em 1em; font-weight: 700; cursor: pointer; }
/* La bulle du marqueur mene a la page de l'immeuble : le meme bouton, en lien.
   La couleur est repetee sur le selecteur de lien, sinon celle du theme gagne
   et le texte sort en bleu sur fond orange. */
a.sgl-pin-go,
a.sgl-pin-go:link,
a.sgl-pin-go:visited,
a.sgl-pin-go:hover,
a.sgl-pin-go:focus,
a.sgl-pin-go:active { display: block; box-sizing: border-box; text-align: center;
  color: #fff; text-decoration: none; }
.sgl-pin-go:hover { filter: brightness(1.05); }
@media (prefers-reduced-motion: reduce) { .sgl-pin.has-dispo::after { animation: none; } }

/* Logements loués repliés dans un panneau d'étage */
.sgl-nav .sgl-show-loues { margin: 14px 0 10px; font-size: .85rem; cursor: pointer; text-transform: none; letter-spacing: normal;
  background: transparent !important; color: var(--sgl-color-accent) !important;
  border: 1px solid color-mix(in srgb, var(--sgl-color-accent) 45%, transparent) !important; border-radius: calc(var(--sgl-radius) * .5) !important; box-shadow: none !important; }
.sgl-nav .sgl-show-loues:hover { background: color-mix(in srgb, var(--sgl-color-accent) 8%, transparent) !important; }
.sgl-nav-grid--loues { margin-top: 8px; }
.sgl-nav-panel-sub strong { color: var(--sgl-color-accent); }

.sgl-pin-img--letter { display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #fff, #f3e9e2); color: var(--sgl-color-accent, #333); font-weight: 800; font-size: 20px; font-family: var(--sgl-font-heading, inherit); }

/* ---------------------------------------------------------------------------
   Plans interactifs (SGL_Plans) : façade cliquable + plan d'étage vu de haut.
   Les polygones sont des pourcentages dans un viewBox 0 0 100 100 : aucun
   calcul en JS, le plan reste exact à toutes les largeurs.
   Mise en page : plan à gauche, liste filtrable des logements à droite.
--------------------------------------------------------------------------- */
.sgl-nav-body--plans { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.sgl-nav-plans { display: grid; gap: .6rem; min-width: 0; position: sticky; top: 1rem; }

/* Le SVG doit recouvrir l'image AU PIXEL : tout rembourrage ou bordure héritée du
   thème sur <figure>/<img> décalerait les polygones. On remet donc tout à zéro. */
.sgl-pmap { position: relative; margin: 0; padding: 0; border: 0; line-height: 0;
  border-radius: var(--sgl-radius, 10px); overflow: hidden; background: #f3f4f6; }
.sgl-pmap-frame { position: relative; line-height: 0; }
.sgl-pmap picture { display: block; margin: 0; padding: 0; }
.sgl-plan-img { display: block; width: 100%; height: auto; margin: 0; padding: 0; border: 0; max-width: none; }
.sgl-plan-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.sgl-plan-cap, .sgl-plan-legend { line-height: 1.35; }

.sgl-plan-zone { cursor: pointer; }
.sgl-plan-zone polygon {
  fill: rgba(255, 255, 255, 0);
  stroke: rgba(255, 255, 255, .55);
  stroke-width: var(--sgl-sw, 2);
  transition: fill .14s ease, stroke .14s ease;
}
.sgl-plan-zone:focus { outline: none; }
.sgl-plan-zone:focus-visible polygon { stroke: #111; stroke-width: calc(var(--sgl-sw, 2) * 2.5); }

/* Façade : un polygone par étage. Au repos la photo reste nue (un léger voile
   seulement, pour que la bande se devine) ; c'est l'étage VISÉ qui s'habille de
   l'accent du thème - jamais un vert en dur, qui jure avec la marque du site. */
.sgl-plan-zone--floor polygon { stroke: rgba(255, 255, 255, .42); }
.sgl-plan-zone--floor.is-disponible polygon { fill: rgba(255, 255, 255, .06); }
.sgl-plan-zone--floor.is-complet polygon { fill: rgba(17, 24, 39, .14); }
.sgl-plan-zone--floor.is-absent polygon { fill: rgba(17, 24, 39, .06); stroke: rgba(255,255,255,.2); }
.sgl-plan-zone--floor:hover polygon,
.sgl-plan-zone--floor.is-hot polygon {
  fill: color-mix(in srgb, var(--sgl-color-accent, #0f766e) 34%, transparent);
  stroke: rgba(255, 255, 255, .95); stroke-width: calc(var(--sgl-sw, 2) * 1.6); }
.sgl-plan-zone--floor.is-complet:hover polygon,
.sgl-plan-zone--floor.is-complet.is-hot polygon { fill: rgba(17, 24, 39, .42); }
/* Les étages non visés s'effacent légèrement : l'œil va droit à celui qu'on survole. */
.sgl-pmap--facade:hover .sgl-plan-svg .sgl-plan-zone--floor:not(:hover) polygon { stroke: rgba(255, 255, 255, .22); }

/* Étiquettes d'étage : pastilles HTML posées sur l'axe vertical calculé côté
   serveur (label_axis), donc parfaitement alignées malgré la perspective. */
.sgl-plan-tags { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.sgl-plan-tag {
  position: absolute; transform: translate(-50%, -50%);
  /* Trois colonnes FIXES : l etiquette, la pastille de compte, la chevron.
     Avec un simple space-between, « complet » et « 2 libres » n ont pas la meme
     largeur et le chevron ne figure que sur les etages libres : les pastilles
     ne s alignaient donc ni a gauche ni a droite (releve du client, 4 novembre
     2026). La grille reserve la colonne du chevron meme quand il est absent. */
  display: inline-grid; grid-template-columns: 6.4em 5.4em .8em;
  align-items: center; justify-items: start; gap: .35em;
  min-width: 13.3em; box-sizing: border-box;
  padding: .26em .3em .26em .66em; border-radius: 999px;
  /* longhand : « font: … inherit » invalide la règle entière dans les navigateurs. */
  /* Point 24 : les pastilles étaient trop petites, surtout sur téléphone, où le
     plancher de 10px rendait le compte illisible. On monte le plancher à 13px. */
  font-weight: 600; font-size: clamp(13px, 1.05vw, 15px); line-height: 1;
  letter-spacing: .01em; white-space: nowrap;
  /* Posées sur une photo (ciel clair, mur pâle, pelouse), des pastilles
     translucides disparaissaient par endroits : on garde l'effet verre mais
     avec un fond assez dense, un liseré clair et une ombre portée pour que le
     libellé reste lisible SUR N'IMPORTE QUEL fond. */
  color: #fff; background: rgba(17, 24, 39, .84);
  -webkit-backdrop-filter: blur(7px) saturate(1.2); backdrop-filter: blur(7px) saturate(1.2);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .55);
  box-shadow: 0 2px 12px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(255, 255, 255, .34);
  transition: background .18s ease, transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}
.sgl-plan-tag-n { line-height: 1; }
/* Le compte de logements libres porte son mot : « 2 libres », jamais un chiffre
   nu, que le client confondait avec le numéro d'étage (son point 24). */
.sgl-plan-tag-d {
  display: inline-flex; align-items: center; justify-content: center; gap: .28em;
  justify-self: stretch;
  height: 1.55em; padding: 0 .5em; box-sizing: border-box; border-radius: 999px;
  background: rgba(255, 255, 255, .94); color: #111827;
  font-size: .84em; font-weight: 700; line-height: 1;
}
.sgl-plan-tag-c { font-size: 1.14em; font-weight: 800; font-variant-numeric: tabular-nums; }
.sgl-plan-tag-u { font-weight: 600; letter-spacing: .01em; }
/* Un étage qui a de la place est VERT et porte un chevron : l'œil le trouve
   d'un coup et comprend qu'on peut cliquer. */
.sgl-plan-tag.is-disponible { background: rgba(6, 78, 59, .9); }
.sgl-plan-tag.is-disponible .sgl-plan-tag-d { background: #34d399; color: #052e26; }
.sgl-plan-tag-go { justify-self: center; font-size: 1.15em; font-weight: 700; opacity: .85; }
.sgl-plan-tags--clic .sgl-plan-tag.is-disponible { cursor: pointer; }
/* Immeuble bas : les pastilles se touchent. On raccourcit plutot que de les
   effacer, et le compte reste en couleur donc toujours distinct de l'etage. */
.sgl-plan-tags.is-compact .sgl-plan-tag { grid-template-columns: 5.2em 2.6em; min-width: 8.4em; }
.sgl-plan-tags.is-compact .sgl-plan-tag {
  padding: .2em .26em .2em .5em; font-size: clamp(11px, .86vw, 13px);
}
.sgl-plan-tags.is-compact .sgl-plan-tag-u,
.sgl-plan-tags.is-compact .sgl-plan-tag-go { display: none; }
.sgl-plan-tags.is-compact .sgl-plan-tag-d { padding: 0 .4em; }
.sgl-plan-tags--clic .sgl-plan-tag.is-disponible:hover { transform: translate(-50%, -50%) scale(1.05); }
/* Un étage complet se distingue par SA PASTILLE DE COMPTE, pas en s'effaçant :
   baisser l'opacité de toute l'étiquette la rendait illisible sur la photo. */
.sgl-plan-tag.is-complet, .sgl-plan-tag.is-absent { opacity: 1; background: rgba(17, 24, 39, .74); }
.sgl-plan-tag.is-complet .sgl-plan-tag-d, .sgl-plan-tag.is-absent .sgl-plan-tag-d {
  background: rgba(255, 255, 255, .72); color: #4b5563; font-weight: 600;
}
.sgl-plan-tag.is-on {
  background: color-mix(in srgb, var(--sgl-color-accent, #0f766e) 92%, #000);
  transform: translate(-50%, -50%) scale(1.07); opacity: 1;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .34), inset 0 0 0 1px rgba(255, 255, 255, .34);
}
.sgl-plan-tag.is-on .sgl-plan-tag-d { background: #fff; color: var(--sgl-color-accent, #0f766e); }
/* Étage visé : les autres pastilles reculent, sans disparaître. */
.sgl-plan-tags.is-aiming .sgl-plan-tag:not(.is-on) { opacity: .78; }
.sgl-pmap--floor { border-radius: 0; background: transparent; overflow: visible; }
.sgl-pmap--floor .sgl-pmap-frame { border-radius: var(--sgl-radius, 10px); overflow: hidden; background: #fff; }
/* Les planches d'étage sont des portraits très hauts (jusqu'à 1 pour 1,6).
   Étirées à la largeur de la colonne, elles débordaient l'écran : on n'en
   voyait qu'un logement à la fois. On les borne donc en HAUTEUR, comme les
   plans paysage de L'Allié, et le cadre se rétrécit avec l'image pour que
   les zones cliquables restent exactement superposées. */
.sgl-pmap--floor .sgl-pmap-frame { width: fit-content; max-width: 100%; margin-inline: auto; }
.sgl-pmap--floor .sgl-plan-img { width: auto; max-width: 100%; height: auto; max-height: var(--sgl-plan-hmax, 440px); }
/* L'invite est posée sur l'image : elle ne doit JAMAIS intercepter le curseur,
   sinon elle mange la bande du bas (immeuble large et bas comme L'Aromate).
   Elle s'effpace au survol, puisque son texte est justement l'invite à survoler. */
/* La consigne se lit SOUS la photo : posée dessus, elle venait buter contre
   l'étiquette de l'étage le plus bas. Elle s'efface dès qu'on survole, la
   consigne ayant alors servi. */
.sgl-pmap--facade .sgl-plan-cap {
  margin: .5rem 0 0; padding: 0;
  font-size: .82rem; color: var(--sgl-color-muted, #6b7280);
  transition: opacity .18s ease;
}
.sgl-pmap--facade:hover .sgl-plan-cap,
.sgl-pmap--facade:focus-within .sgl-plan-cap { opacity: .35; }
/* Pas de survol sur un ecran tactile : on y lit la consigne « touchez ». */
.sgl-plan-cap-tactile { display: none; }
@media (hover: none) {
  .sgl-plan-cap-souris { display: none; }
  .sgl-plan-cap-tactile { display: inline; }
}

/* Plan d'étage : un polygone par logement, couleur = disponibilité du flux. */
.sgl-plan-zone--unit polygon { stroke: rgba(17, 24, 39, .45); stroke-width: var(--sgl-sw, 2); }
.sgl-plan-zone--unit.is-disponible polygon { fill: rgba(22, 163, 74, .3); }
.sgl-plan-zone--unit.is-bientot polygon { fill: rgba(217, 119, 6, .32); }
.sgl-plan-zone--unit.is-loue polygon { fill: rgba(17, 24, 39, .24); }
.sgl-plan-zone--unit.is-absent polygon { fill: rgba(17, 24, 39, .05); }
.sgl-plan-zone--unit:hover polygon { fill: color-mix(in srgb, var(--sgl-color-accent, #0f766e) 58%, transparent); stroke: #111; stroke-width: calc(var(--sgl-sw, 2) * 2); }
.sgl-plan-zone--unit.is-loue:hover polygon { fill: rgba(17, 24, 39, .5); }
.sgl-plan-zone--unit.is-bientot:hover polygon { fill: rgba(217, 119, 6, .6); }
/* Numéros de logement : mêmes pastilles HTML que sur la façade, donc une seule
   écriture dans tout le module (et la police du thème, pas celle du plan). */
.sgl-plan-nums { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.sgl-plan-num {
  position: absolute; transform: translate(-50%, -50%);
  padding: .12em .34em; border-radius: 5px;
  font-weight: 700; font-size: clamp(9px, .72vw, 12px); line-height: 1;
  font-variant-numeric: tabular-nums; white-space: nowrap;
  color: #111827; background: rgba(255, 255, 255, .88);
  box-shadow: 0 0 0 1px rgba(17, 24, 39, .14);
}
.sgl-plan-num.is-loue { color: #4b5563; background: rgba(255, 255, 255, .7); }
.sgl-plan-num.is-absent { opacity: .45; }

/* Planches d'architecte : le numéro est DÉJÀ imprimé dans le logement et la
   pastille vient se poser exactement dessus (position relevée sur l'image).
   Elle est donc dessinée DANS le svg - elle suit l'image à n'importe quelle
   taille, dans la colonne comme dans le plan agrandi - et elle est opaque,
   sinon le chiffre imprimé dessous transparaîtrait. */
.sgl-plan-nums-svg { pointer-events: none; }
.sgl-plan-nsvg rect { fill: #fff; stroke: rgba(17, 24, 39, .22); stroke-width: calc(var(--sgl-sw, 2) * 1); }
.sgl-plan-nsvg text {
  fill: #111827; font-weight: 700; font-family: inherit;
  font-variant-numeric: tabular-nums;
}
.sgl-plan-nsvg.is-loue text { fill: #4b5563; }
.sgl-plan-nsvg.is-absent { opacity: .45; }

/* Cartouche « Niveau N » gravé dans le plan du client : on le recouvre et on
   réécrit le titre dans la typographie du site. Le rectangle vient de
   sgl_plans[…]['etages'][n]['titre'] (en % de l'image). */
.sgl-plan-cartouche {
  position: absolute; z-index: 3; display: flex; align-items: center; justify-content: flex-start;
  padding: 0 .4rem; background: #fff; pointer-events: none;
}
/* Sur une planche redessinee il n'y a rien a recouvrir : le badge flotte. */
.sgl-plan-cartouche.is-libre { background: none; padding: 0; }
.sgl-plan-cartouche-t {
  display: inline-flex; align-items: center; padding: .32em .7em; border-radius: 999px;
  background: var(--sgl-color-accent, #0f766e); color: var(--sgl-on-accent, #fff);
  font-weight: 700; font-size: clamp(10px, .86vw, 14px); line-height: 1.1; white-space: nowrap;
}

.sgl-plan-legend { display: flex; flex-wrap: wrap; gap: .75rem; padding: .45rem .2rem 0; font-size: .78rem; color: #4b5563; }
.sgl-plan-key { display: inline-flex; align-items: center; gap: .3rem; }
.sgl-plan-key::before { content: ""; width: .7rem; height: .7rem; border-radius: 2px; border: 1px solid rgba(17,24,39,.35); }
.sgl-plan-key.is-disponible::before { background: rgba(22, 163, 74, .45); }
.sgl-plan-key.is-bientot::before { background: rgba(217, 119, 6, .45); }
.sgl-plan-key.is-loue::before { background: rgba(17, 24, 39, .3); }

/* Barre d'étage sous la façade : flèche · étage courant · flèche. Une seule
   ligne, donc rien à aligner entre des libellés de longueurs différentes
   (« 1er étage » / « 2e étage ») - c'est ce qui donnait un rail de travers. */
.sgl-nav-floorbar {
  display: flex; align-items: stretch; gap: .5rem; margin: .7rem 0 0;
}
.sgl-nav-floorbar .sgl-floorbar-step {
  flex: 0 0 auto; width: 2.2rem; display: inline-flex; align-items: center; justify-content: center;
  padding: 0; border: 1px solid var(--sgl-color-border, rgba(17,24,39,.16));
  border-radius: var(--sgl-radius, 10px); background: var(--sgl-color-surface, #fff);
  color: var(--sgl-color-heading, inherit); font-size: .62rem; line-height: 1; cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.sgl-nav-floorbar .sgl-floorbar-step:hover:not(:disabled) {
  border-color: var(--sgl-color-accent); color: var(--sgl-color-accent);
}
.sgl-nav-floorbar .sgl-floorbar-step:disabled { opacity: .35; cursor: default; }
.sgl-floorbar-cur { flex: 1 1 auto; min-width: 0; }
/* Un seul étage visible à la fois : celui qui est affiché.
   Les thèmes qui habillent les <button> (L'Allié) gagnaient sur ce display:none et
   empilaient les neuf étages en pastilles sous la barre : on verrouille la règle. */
.sgl-floor--cur,
.sgl-nav-floorbar button.sgl-floor--cur { display: none !important; }
.sgl-nav-floorbar button.sgl-floor--cur.is-active { display: flex !important; }
.sgl-nav-floorbar .sgl-floor--cur.is-active {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: .25rem .6rem; width: 100%;
  padding: .5rem .8rem; border: 1px solid var(--sgl-color-border, rgba(17,24,39,.16));
  border-radius: var(--sgl-radius, 10px); background: var(--sgl-color-surface, #fff);
  color: var(--sgl-color-heading, inherit); text-align: left; cursor: default;
}
.sgl-floorbar-n { font-weight: 700; font-size: 1rem; line-height: 1.2; }
.sgl-floorbar-m {
  font-size: .82rem; line-height: 1.2; opacity: .72; font-variant-numeric: tabular-nums;
}
.sgl-floorbar-m.is-dispo { opacity: 1; color: var(--sgl-color-accent); font-weight: 600; }
/* Pastille de disponibilite de la barre d'etage (point 24). Verte et plus grosse
   que le texte voisin quand il reste de la place, grise et discrete sinon. */
.sgl-floorbar-d {
  display: inline-flex; align-items: center; padding: .16em .62em; border-radius: 999px;
  background: rgba(17, 24, 39, .08); color: #4b5563;
  font-size: .82rem; font-weight: 600; line-height: 1.25; font-variant-numeric: tabular-nums;
}
.sgl-floorbar-d.is-dispo { background: #047857; color: #fff; font-size: .9rem; font-weight: 700; }
@media (max-width: 600px) {
  .sgl-floorbar-n { font-size: 1.1rem; }
  .sgl-floorbar-d { font-size: .9rem; }
  .sgl-floorbar-d.is-dispo { font-size: 1rem; padding: .2em .7em; }
}

@media (max-width: 860px) {
  .sgl-nav-body--plans { grid-template-columns: 1fr; }
  .sgl-nav-plans { position: static; }
}

/* Libellés d'étage serrés (immeuble bas) : visibles seulement quand on vise la bande. */
.sgl-plan-tag.is-dim { opacity: 0; }
.sgl-plan-tag.is-dim.is-on { opacity: 1; }
.sgl-plan-tags.is-aiming .sgl-plan-tag.is-dim:not(.is-on) { opacity: 0; }

/* Agrandir le plan : bouton discret dans la légende, puis plan plein écran. */
/* Le thème habille agressivement les <button> : on reprend la main. */
.sgl-pmap .sgl-plan-legend button.sgl-plan-zoom {
  margin: 0 0 0 auto; border: 1px solid var(--sgl-line, #e5e7eb); background: #fff;
  border-radius: 999px; padding: .2rem .7rem; font-family: inherit; font-weight: 400;
  font-size: .78rem; line-height: 1.4; letter-spacing: 0; text-transform: none;
  color: var(--sgl-ink, #111827); cursor: pointer; box-shadow: none; width: auto; min-width: 0;
}
.sgl-pmap .sgl-plan-legend button.sgl-plan-zoom:hover,
.sgl-pmap .sgl-plan-legend button.sgl-plan-zoom:focus-visible {
  border-color: var(--sgl-accent, #d94f1e); background: #fff; color: var(--sgl-ink, #111827);
}
.sgl-plan-legend { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }

.sgl-plan-modal {
  border: 0; border-radius: var(--sgl-radius, 10px); padding: 0; background: #fff;
  width: fit-content; max-width: 96vw; max-height: 92vh; overflow: auto;
}
.sgl-plan-modal::backdrop { background: rgba(17, 24, 39, .72); }
.sgl-plan-modal .sgl-pmap-frame { position: relative; line-height: 0; width: fit-content; max-width: 100%; }
/* Un relevé d'étage est un portrait très haut : borné à la seule largeur, il
   dépassait l'écran et il fallait défiler pour voir le bas de l'immeuble. On
   le borne donc aussi en HAUTEUR - le plan entier tient dans la fenêtre, comme
   le plan paysage de L'Allié. */
.sgl-plan-modal .sgl-plan-img {
  display: block; width: auto; height: auto;
  max-width: 96vw; max-height: 84vh;
}
/* La legende recopiee sous le plan agrandi : hors de son <figure>, elle n'a
   plus la gouttiere de la planche en ligne. On la lui redonne, et le plan est
   borne a 84vh (au lieu de 92) pour que les deux tiennent dans la fenetre. */
.sgl-plan-modal .sgl-plan-modal-legend {
  padding: .55rem .9rem .75rem; margin: 0; line-height: 1.35;
  justify-content: center; background: #fff;
}
.sgl-plan-modal .sgl-plan-svg { position: absolute; inset: 0; width: 100%; height: 100%; }

/* Le plan agrandi vit desormais dans un conteneur defilable : la boite de
   dialogue ne defile plus elle-meme, donc le « x » et la legende restent a
   leur place quand on se deplace dans une grande planche. */
.sgl-plan-modal { display: flex; flex-direction: column; overflow: hidden; }
.sgl-plan-modal .sgl-plan-modal-scroll {
  overflow: auto; min-height: 0; max-width: 96vw; max-height: 84vh;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
}
/* Mode « deplacement » (telephone, plan en longueur) : la planche depasse
   volontairement l'ecran pour que chaque logement redevienne visable au doigt.
   La largeur est posee en pixels par le script, d'apres la plus petite zone. */
.sgl-plan-modal.is-pan .sgl-pmap-frame { width: auto; max-width: none; }
.sgl-plan-modal.is-pan .sgl-plan-img { max-width: 100%; max-height: none; width: 100%; height: auto; }
.sgl-plan-modal .sgl-plan-pan-hint {
  margin: 0; padding: .45rem .9rem 0; text-align: center;
  font-size: .78rem; line-height: 1.3; opacity: .7;
}
/* Le « × » héritait du bouton du thème : un rectangle large (padding 10px 50px,
   line-height 30px) dans lequel le glyphe tombait décentré. On reprend la main
   avec une sélectivité suffisante pour battre le thème - pastille ronde de
   2 rem, glyphe centré par flex, aucun padding ni interligne hérité. */
.sgl-plan-modal button.sgl-plan-modal-close,
dialog.sgl-plan-modal .sgl-plan-modal-close {
  position: absolute; top: .5rem; right: .5rem; z-index: 2;
  width: 2rem; height: 2rem; min-width: 0; min-height: 0; max-width: none;
  padding: 0; margin: 0; box-shadow: none;
  border: 1px solid var(--sgl-line, #e5e7eb);
  /* le thème impose sa couleur de bouton et des coins carrés en !important */
  background: #fff !important; border-radius: 999px !important;
  color: var(--sgl-ink, #111827) !important;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.1rem; line-height: 1; letter-spacing: 0; text-align: center;
  text-transform: none; cursor: pointer;
}
.sgl-plan-modal button.sgl-plan-modal-close:hover,
.sgl-plan-modal button.sgl-plan-modal-close:focus-visible {
  border-color: var(--sgl-accent, #d94f1e); color: var(--sgl-accent, #d94f1e);
}

/* ── Uniformité des immeubles ───────────────────────────────────────────────
   Tous les immeubles montrent LA MÊME vue : la façade surmontée d'une colonne
   de pastilles d'étage, puis le plan vu de haut de l'étage choisi, qui est
   lui-même le sélecteur de logement. Quand le client n'a pas fourni de relevé
   de façade, la photo du complexe tient ce rôle et les pastilles deviennent
   elles-mêmes les zones cliquables (classe .sgl-plan-tags--clic) : le
   comportement visuel ne change pas, seule la source de l'image change. */
.sgl-plan-tags--clic { pointer-events: none; }
.sgl-plan-tags--clic .sgl-plan-tag { pointer-events: auto; }
/* Les pastilles sont des <a> : on blinde contre les thèmes qui habillent tous
   les liens (soulignement, couleur de marque) comme pour les <button>. */
.sgl-nav a.sgl-facade-pill, .sgl-nav a.sgl-facade-pill:hover, .sgl-nav a.sgl-facade-pill:focus {
  /* le thème repeint ses liens au survol : le libellé virait au bleu sur la
     pastille orange de l'étage visé. On garde le blanc dans tous les états. */
  text-decoration: none !important; cursor: pointer; color: #fff !important;
}
/* La photo d'un complexe est un cadrage libre (ciel, rue, stationnement) : on
   l'assombrit légèrement pour que les pastilles restent lisibles par-dessus. */
/* Façade sans relevé : la photo du complexe cadrée sur sa partie bâtie.
   Le cadre est la fenêtre ; l'image, agrandie et décalée en position absolue
   par un style calculé côté PHP, se recentre sur l'immeuble. */
.sgl-pmap--photo .sgl-pmap-frame {
  /* Format de la façade de L'Allié : le même cadre pour tous les complexes. */
  position: relative; aspect-ratio: 754 / 528;
  border-radius: var(--sgl-radius, 10px); overflow: hidden; background: #0b1220;
}
/* « contain » et non « cover » : l'immeuble se voit EN ENTIER, jamais rogné.
   Les pastilles d'étage sont placées côté serveur sur la bande réellement
   occupée par la photo, elles suivent donc ce cadrage. */
.sgl-pmap--photo .sgl-plan-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; max-width: none;
  filter: saturate(.92) brightness(.86);
}
.sgl-pmap--photo .sgl-plan-fond {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; max-width: none; margin: 0; padding: 0; border: 0;
  transform: scale(1.18); filter: blur(26px) saturate(.7) brightness(.45);
}

/* Plan d'étage issu d'une planche d'architecte : même composant que le plan
   vectoriel, plus le nom du bâtiment quand l'étage en couvre plusieurs et le
   lien vers le PDF d'origine. */
.sgl-plan-bat { font-weight: 700; color: var(--sgl-color-heading, #1c2430); }
.sgl-nav a.sgl-plan-dl { font-weight: 600; }

/* Type du logement sous son numero : le client devait remonter a la legende
   pour savoir si le 13 etait un 3 1/2 ou un 4 1/2. */
.sgl-plan-nsvg--type rect { opacity: .92; }
.sgl-plan-nsvg--type text { font-weight: 600; }
.sgl-plan-num-t {
  display: block; font-size: .82em; font-weight: 600; line-height: 1.05;
  opacity: .85;
}

/* Un lien telephonique garde la couleur de son contexte : sur iOS il virait au
   bleu systeme, avec une icone, au milieu d un bouton ou d un bandeau. */
.sgl a[href^="tel:"],
.sgl-chat a[href^="tel:"] { color: inherit; -webkit-text-fill-color: currentColor; text-decoration: none; }
.sgl a[href^="tel:"]:hover { text-decoration: underline; }

/* Premier niveau de navigation : une carte par immeuble (points 1, 6 et 7 du
   client, Logisco en reference). */
.sgl-immeubles { margin: 0 0 2rem; }
.sgl-imm-titre { margin: 0 0 .25rem; }
.sgl-imm-compte { margin: 0 0 1rem; opacity: .75; }
/* LD-08 : la section « Nos immeubles » etait enfermee dans la colonne de
   texte du theme (1100 px), ou cinq colonnes ne tiennent jamais. Sur grand
   ecran elle sort de cette colonne et va chercher la largeur de la fenetre,
   plafonnee a 2400 px et centree. En dessous, rien ne change. */
@media (min-width: 1400px) {
  .sgl-immeubles,
  .sgl-selector {
    width: calc(100vw - 4rem);
    max-width: 2400px;
    margin-inline: calc(50% - min(1200px, 50vw - 2rem));
  }
}

/* LD-08 : grille fluide mais plafonnee a cinq colonnes. La largeur minimale
   d'une carte est en pixels CSS : zoomer agrandit donc les cartes et reduit le
   nombre de colonnes, comme l'exige l'accessibilite. Le « max » empeche une
   sixieme colonne quelle que soit la largeur, et la grille cesse de s'elargir
   au-dela de 2400 px pour que les cartes ne deviennent pas demesurees. */
.sgl-imm-grid {
  --sgl-imm-min: 280px;
  --sgl-imm-gap: 1.25rem;
  display: grid;
  gap: var(--sgl-imm-gap);
  grid-template-columns: repeat(auto-fill, minmax(max(var(--sgl-imm-min), (100% - 4 * var(--sgl-imm-gap)) / 5), 1fr));
  max-width: 2400px;
  margin-inline: auto;
}
/* Toutes les cartes d'une rangee ont la meme hauteur, et chaque ligne commence
   a la meme hauteur d'une carte a l'autre : la zone du titre est reservee pour
   deux lignes, sinon un nom long decale tout ce qui suit. */
.sgl-imm-card { display: flex; flex-direction: column; overflow: hidden; height: 100%; }
.sgl-imm-card .sgl-card-body { display: flex; flex-direction: column; flex: 1 1 auto; text-align: left; }
.sgl-imm-card .sgl-card-title { min-height: calc(2 * 1.25em); margin-top: 0; }
.sgl-imm-card .sgl-card-meta { min-height: 1.3em; }
.sgl-imm-card .sgl-imm-types { margin-top: auto; }
.sgl-imm-card.is-complet { opacity: .72; }
.sgl-imm-media { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; }
.sgl-imm-media .sgl-card-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sgl-imm-sansphoto {
  display: flex; align-items: center; justify-content: center; width: 100%; height: 100%;
  font-size: 3rem; font-weight: 700; color: #fff;
  background: color-mix(in srgb, var(--sgl-color-accent, #0f766e) 70%, #111);
}
.sgl-imm-prix {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 1.6rem .8rem .6rem;
  color: #fff; font-size: .95rem;
  background: linear-gradient(to top, rgba(17, 24, 39, .78), rgba(17, 24, 39, 0));
}
.sgl-imm-prix strong { font-size: 1.25rem; }
.sgl-imm-dispo { margin: .35rem 0 .5rem; font-weight: 600; opacity: .7; }
.sgl-imm-dispo.is-dispo { color: #15803d; opacity: 1; }
.sgl-imm-types { display: flex; flex-wrap: wrap; gap: .3rem; list-style: none; margin: 0; padding: 0; }
.sgl-imm-type {
  padding: .12em .5em; border-radius: 999px; font-size: .85rem;
  background: rgba(17, 24, 39, .06); color: rgba(17, 24, 39, .45);
}
.sgl-imm-type.is-libre { background: rgba(22, 163, 74, .14); color: #15803d; font-weight: 600; }

/* Telephone : la pastille d etage debordait du cadre a gauche (mesure du
   4 novembre : bord gauche a -5 px sur un ecran de 390). On resserre les trois
   colonnes plutot que de laisser le libelle sortir de l image. */
@media (max-width: 520px) {
  .sgl-plan-tag { grid-template-columns: 4.9em 4.5em .7em; min-width: 10.6em; padding-left: .5em; }
  .sgl-plan-tag-d { padding: 0 .35em; }
}

/* LD-33 : rangee « Type de logement » au-dessus du selecteur et de la grille. Sur
   mobile elle defile a l'horizontale sur une seule ligne. */
.sgl-nav-types { display: flex; align-items: center; gap: 10px 14px; margin: 0 0 var(--sgl-gap); min-width: 0; }
.sgl-nav-types-l { font-weight: 700; font-size: .92rem; color: var(--sgl-color-heading, inherit); flex: 0 0 auto; }
.sgl-nav-types-row { display: flex; gap: 8px; flex-wrap: wrap; min-width: 0; flex: 1 1 auto; }
.sgl-type-btn { display: inline-flex; align-items: center; gap: .45em; padding: .45em .95em; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--sgl-color-border); background: var(--sgl-color-surface, #fff); color: var(--sgl-color-heading, inherit);
  font: inherit; font-size: .9rem; font-weight: 600; line-height: 1.3; transition: all .15s ease; }
.sgl-type-btn:hover { border-color: var(--sgl-color-accent); color: var(--sgl-color-accent); }
.sgl-type-btn.is-active { background: var(--sgl-color-accent); color: var(--sgl-on-accent, #fff); border-color: transparent; }
.sgl-type-btn .sgl-type-n { font-size: .78em; font-weight: 700; padding: .1em .5em; border-radius: 999px; background: color-mix(in srgb, currentColor 14%, transparent); }
.sgl-type-btn.is-complet, .sgl-type-btn[disabled] { color: var(--sgl-color-muted, #6b7280); background: var(--sgl-color-soft, #f3f4f6); border-color: transparent; cursor: default; }
.sgl-type-btn.is-complet .sgl-type-n { background: transparent; padding: 0; font-weight: 600; text-transform: lowercase; }
@media (max-width: 767px) {
  .sgl-nav-types { flex-direction: column; align-items: stretch; gap: 6px; }
  .sgl-nav-types-row { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; scrollbar-width: thin; }
  .sgl-type-btn { flex: 0 0 auto; white-space: nowrap; }
}
/* Etage sans logement du type choisi : la zone reste cliquable, mais grisee. */
.sgl-plan-zone--floor.is-type-vide polygon { fill: rgba(17, 24, 39, .22); stroke: rgba(255, 255, 255, .25); }
.sgl-plan-tag.is-complet .sgl-plan-tag-u { opacity: .85; }
.sgl-empty--type { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.sgl-empty--type p { margin: 0; }
