/* ois-commun.css — styles partagés par l'accueil et les fiches statiques :
   cotes (IBM Plex Mono), cartouche de niveau, cartouche compact, légende des niveaux.
   Couleurs uniquement par variables CSS (jetons définis dans :root de chaque page). */

/* Cotes : références d'actif, surfaces, rangs, pourcentages. Jamais en texte courant ni en titre. */
.cote { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-weight: 400; }

/* ─── Cartouche de niveau ───────────────────────────────────────────────── */
.cartouche {
  --ct-fond: var(--navy);
  --ct-chiffre: var(--gold);
  display: grid; grid-template-columns: 1fr 1fr 104px;
  border: 1.5px solid var(--navy); background: var(--white); color: var(--ink);
  max-width: 560px; font-family: 'Inter', sans-serif;
}
.ct-titre { grid-column: 1 / 3; grid-row: 1; display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-right: 1px solid var(--navy); }
.ct-titre-nom { font-family: 'Playfair Display', serif; font-size: 15px; line-height: 1.25; color: var(--navy); }
.ct-titre-sous { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ardoise); }
.ct-niveau {
  grid-column: 3; grid-row: 1 / span 4; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 10px 6px; text-align: center; background: var(--ct-fond);
}
.ct-chiffre { font-family: 'Playfair Display', serif; font-size: 34px; font-weight: 700; line-height: 1; color: var(--ct-chiffre); }
.ct-libelle { font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; line-height: 1.3; color: var(--white); overflow-wrap: anywhere; }
.ct-case { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 7px 10px 8px; border-top: 1px solid var(--navy); }
.ct-case:nth-of-type(odd) { border-right: 1px solid var(--navy); }
.ct-label { font-size: 9.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ardoise); }
.ct-val { font-size: 13px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.ct-val .cote { font-weight: 400; }
.cartouche--ref  { --ct-fond: var(--ardoise); --ct-chiffre: var(--gold-light); }
.cartouche--prel { border: 1.5px dashed var(--prel); --ct-fond: var(--prel); --ct-chiffre: var(--white); }
@media (max-width: 560px) { .cartouche { grid-template-columns: 1fr 1fr 84px; } }

/* ─── Cartouche compact (cartes, listes, légende) ───────────────────────── */
.cmini { display: inline-flex; align-items: stretch; border: 1px solid var(--navy); background: var(--white); font-family: 'Inter', sans-serif; line-height: 1; white-space: nowrap; vertical-align: middle; }
.cmini-n { display: flex; align-items: center; padding: 4px 7px; font-family: 'Playfair Display', serif; font-size: 13px; font-weight: 700; color: var(--gold); background: var(--navy); }
.cmini-l { display: flex; align-items: center; padding: 4px 8px; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--navy); }
.cmini--ref { border-color: var(--ardoise); }
.cmini--ref .cmini-n { background: var(--ardoise); color: var(--gold-light); }
.cmini--ref .cmini-l { color: var(--ardoise); }
.cmini--prel { border: 1px dashed var(--prel); }
.cmini--prel .cmini-n { background: var(--prel); color: var(--white); }
.cmini--prel .cmini-l { color: var(--prel); }

/* ─── Légende des niveaux : cadre à deux lignes ─────────────────────────── */
.legende-niveaux { margin: 0 0 18px; border: 1.5px solid var(--navy); background: var(--white); }
.ln-ligne { display: grid; grid-template-columns: 30px minmax(0, 1fr); }
.ln-ligne + .ln-ligne { border-top: 1px solid var(--rule); }
.ln-etiquette { display: flex; align-items: center; justify-content: center; padding: 8px 0; background: var(--navy); color: var(--white); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; writing-mode: vertical-rl; transform: rotate(180deg); }
.ln-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ln-col { padding: 12px 14px; border-left: 1px solid var(--rule); }
.ln-col:first-child { border-left: none; }
.ln-col--prel { background: var(--prel-pale); }
.ln-desc { margin: 8px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--ardoise); }
.ln-etats { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; padding: 12px 14px; }
.ln-lecture { font-size: 12.5px; font-weight: 600; color: var(--navy); }
.ln-etat { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink); }
.ln-sw { flex: none; display: block; }
@media (max-width: 760px) {
  .ln-ligne { grid-template-columns: minmax(0, 1fr); }
  .ln-etiquette { writing-mode: horizontal-tb; transform: none; justify-content: flex-start; padding: 6px 14px; }
  .ln-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ln-col:nth-child(odd) { border-left: none; }
  .ln-col:nth-child(n+3) { border-top: 1px solid var(--rule); }
}
@media (max-width: 480px) {
  .ln-cols { grid-template-columns: minmax(0, 1fr); }
  .ln-col { border-left: none; border-top: 1px solid var(--rule); }
  .ln-col:first-child { border-top: none; }
}

/* Pastille NPS d'un prélancement */
.nps-row.is-prel { font-size: 11px; font-style: italic; color: var(--prel); }

/* ─── Façade de services ────────────────────────────────────────────────── */
.facade { display: block; width: 100%; height: auto; }
.facade--fiche { max-width: 720px; }
.f-fond { fill: var(--navy); }
.f-corps { fill: var(--navy-dark); stroke: var(--navy-line); stroke-width: .6; }
.f-sol { stroke: var(--gold); stroke-width: 1.5; }
.w-on { fill: var(--gold); }
.w-off { fill: var(--navy-deep); stroke: var(--navy-line); stroke-width: .6; }
.w-na { fill: none; stroke: var(--gold); stroke-width: .8; stroke-dasharray: 2 1.5; }
.w-prog { fill: url(#hatch-or); stroke: var(--gold); stroke-width: .6; }
.hatch-trait { stroke: var(--gold); stroke-width: 1.1; }
.f-lab { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 8px; fill: var(--gold-light); }

/* Légende de la façade */
.legende-facade { display: flex; flex-direction: column; gap: 10px; }
.lf-lecture { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--ardoise); }
.lf-items { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.lf-item { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink); }
.lf-sw { flex: none; display: block; }

/* ─── Couverture typographique (photo absente) : cartes et bannière de fiche ── */
.photo-vide, .icard-photo.photo-vide, .fiche-banniere.photo-vide { position: relative; background-color: var(--navy); background-image: linear-gradient(color-mix(in srgb, var(--gold) 7%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--gold) 7%, transparent) 1px, transparent 1px); background-size: 32px 32px; }
.couv { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; padding: 48px 16px 14px; }
.couv-nom { font-family: 'Playfair Display', serif; font-size: 26px; font-weight: 700; line-height: 1.15; color: var(--gold); display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.couv-sous { font-size: 10.5px; letter-spacing: .08em; color: rgba(255,255,255,.75); }

/* ─── Bannière photo de la fiche ────────────────────────────────────────── */
.fiche-banniere { position: relative; aspect-ratio: 5 / 2; overflow: hidden; background: linear-gradient(135deg, var(--cream-dark), var(--cream)); border-radius: 10px 10px 0 0; }
.fiche-banniere img { display: block; width: 100%; height: 100%; object-fit: cover; }
.fiche-banniere .couv { padding: 24px 28px; }
.fiche-banniere .couv-nom { font-size: 40px; }
@media (max-width: 560px) { .fiche-banniere .couv-nom { font-size: 28px; } .fiche-banniere .couv { padding: 16px 18px; } }

/* ─── Offre de services (façade de la fiche) ────────────────────────────── */
.offre-sous { margin: 0 0 12px; font-size: 13px; color: var(--ardoise); }
.offre-legende { margin-top: 14px; }

/* ─── Position dans le secteur ──────────────────────────────────────────── */
.pos-secteur { max-width: 560px; }
.pos-svg { display: block; width: 100%; height: auto; overflow: visible; }
.pos-axe { stroke: var(--rule-strong); stroke-width: 2; stroke-linecap: round; }
.pos-med-parc { stroke: var(--ardoise); stroke-width: 1.5; stroke-dasharray: 3 3; }
.pos-med-sect { stroke: var(--navy); stroke-width: 1.5; }
.pos-pt { fill: var(--white); stroke: var(--navy); stroke-width: 1.5; }
.pos-moi { fill: var(--gold); stroke: var(--navy); stroke-width: 2; }
.pos-txt { font-size: 10.5px; fill: var(--ardoise); }
.pos-txt-sect { fill: var(--navy); }
.pos-sous { margin: 10px 0 0; font-size: 13px; color: var(--ink); }

/* ─── Services, par catégorie ───────────────────────────────────────────── */
.sc-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 22px 28px; }
.sc-cat-titre { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--rule); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--navy); }
.sc-cat-n { font-size: 11px; font-weight: 400; letter-spacing: 0; color: var(--gold-deep); }
.sc-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.sc-item { display: flex; align-items: center; gap: 10px; }
.sc-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.sc-label { font-size: 13px; line-height: 1.3; color: var(--ink); }
.sc-etat { font-size: 10.5px; }
.sc-present .sc-etat { color: var(--green); }
.sc-off .sc-etat { color: var(--ardoise); }
.sc-na .sc-etat { color: var(--navy); }
.sc-prog .sc-etat { color: var(--gold-deep); }

/* Sur écran étroit, façade et position gardent leur taille de lecture et défilent horizontalement */
.defile { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 640px) {
  .defile .facade--fiche { min-width: 484px; }
  .defile .pos-svg { min-width: 560px; }
}

/* ─── Légende des marqueurs de la carte ─────────────────────────────────── */
.legende-carte { margin: 0 0 14px; }
.lc-titre { margin-bottom: 6px; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--navy); }
.lc-items { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 24px; font-size: 12.5px; color: var(--ardoise); }
.lc-item { display: inline-flex; align-items: center; gap: 8px; }
.lc-item svg { flex: none; display: block; overflow: visible; }
.lc-groupe { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--navy); }
.lc-groupe .mk-cluster-n { font-size: 11px; }
