/* DA 2027, reprise 1 du 17/11/2026 (#426 à #437) : défauts du contrôle aveugle 4. Tout est sous html.da27, chargé après l'affinage 4. */

/* ---------- Mots et nombres coupés, tableaux (#428) ---------- */
/* fiche d'établissement : la liste d'identité passe sous la photo quand la place manque, au lieu d'une colonne de 50 px */
html.da27 .fr-identite { flex-wrap: wrap; }
html.da27 .fr-identite > .fr-dl { flex: 1 1 360px; min-width: min(100%, 360px); container-type: inline-size; }
@container (max-width: 479.98px) { html.da27 .fr-dl > div { grid-template-columns: minmax(0, 1fr); gap: 2px; } }
html.da27 .fr-dl dd { overflow-wrap: break-word; hyphens: manual; }
/* tableaux empilés sur téléphone : le nom de la ligne passe à la ligne au lieu d'être coupé */
@media (max-width: 639.98px) {
    html.da27 #main-content :is(.sp-table, .fr-table, .si-table) tbody th { white-space: normal; overflow-wrap: break-word; }
}
/* chiffres clés : un nombre ne se coupe jamais ; sur téléphone sa taille suit la largeur de la colonne */
html.da27 #main-content :is(.tb-n, .sp-chiffre__n, .ne-bloc__n, .fh__n, .si-fig__n, .vf-kpi__n) { white-space: normal; overflow-wrap: normal; word-break: keep-all; hyphens: manual; }   /* les chiffres ont des espaces insécables : ils ne se coupent pas ; une valeur en mots passe à la ligne entre les mots */
@media (max-width: 479.98px) {
    html.da27 #main-content .fc .pc-sections :is(.tb-n, .sp-chiffre__n, .ne-bloc__n) { font-size: clamp(1.25rem, 6vw, 1.75rem); line-height: 1.2; }
}

/* ---------- Débordements (#429) ---------- */
/* collectivités des commercialisateurs : 3 colonnes égales, une collectivité seule en fin de liste prend la rangée */
@media (min-width: 640px) {
    html.da27 .cm27 .cm27-collec { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    html.da27 .cm27 .cm27-collec > * { grid-column: auto; }
    html.da27 .cm27 .cm27-collec > :nth-child(2n+1):last-child { grid-column: 1 / -1; }
}
@media (min-width: 1024px) {
    html.da27 .cm27 .cm27-collec { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    html.da27 .cm27 .cm27-collec > :nth-child(2n+1):last-child { grid-column: auto; }
    html.da27 .cm27 .cm27-collec > :nth-child(3n+1):last-child { grid-column: 1 / -1; }
    html.da27 .cm27 .cm27-collec > :nth-child(3n+2):last-child { grid-column: span 2; }
}
html.da27 #main-content .cm27-collec__n { overflow-wrap: break-word; hyphens: manual; }
html.da27 #main-content .cm27-collec > li > a { align-content: start; }
/* carte économique : « Tout effacer » entier ; sur téléphone en portrait, les pastilles des couches actives (déjà listées dans le
   tiroir « Couches et parcours ») ne passent plus sous la barre d'outils */
html.da27 .ce-panneau__tete > .ce-btn { flex: none; white-space: nowrap; }
@media (max-width: 767.98px) and (max-device-aspect-ratio: 1/1) {
    html.da27 .ce-haut .ce-chips { display: none; }
}

/* ---------- Offres des fiches commune, canton, intercommunalité (#430, #431) ----------
   Même forme que le catalogue (#398) : une offre par rangée sur le fond de la page, filet neutre de 1 px, ni carte blanche ni
   grille ; sur téléphone la photo passe au-dessus, sur toute la largeur (plus de colonnes de 145 px). */
html.da27 #main-content .fc-offres { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
html.da27 #main-content .fc-offres > .ui-offer-card { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; padding-block: 20px; background: none; border: 0; border-radius: 0; box-shadow: none; overflow: visible; }
html.da27 #main-content .fc-offres > .ui-offer-card + .ui-offer-card { border-block-start: 1px solid var(--c-border); }
html.da27 #main-content .fc-offres > .ui-offer-card:first-child { padding-block-start: 4px; }
html.da27 #main-content .fc-offres .ui-offer-card__media { border-radius: 0; }
html.da27 #main-content .fc-offres .ui-offer-card__body { padding: 14px 0 0; gap: 6px; }
html.da27 #main-content .fc-offres .ui-offer-card__title { min-height: 0; margin: 0; }
html.da27 #main-content .fc-offres .ui-offer-card__place { margin: 0; }
html.da27 #main-content .fc-offres .ui-offer-card__foot { margin-block-start: 6px; justify-content: flex-start; gap: 4px 24px; }
html.da27 #main-content .fc-offres .cmp-actions { padding: 6px 0 0; background: none; border: 0; }
@media (min-width: 640px) {
    html.da27 #main-content .fc-offres > .ui-offer-card { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); grid-template-rows: auto 1fr; column-gap: 28px; }
    html.da27 #main-content .fc-offres .ui-offer-card__media { grid-row: 1 / span 2; align-self: start; }
    html.da27 #main-content .fc-offres .ui-offer-card__body { grid-column: 2; padding-block-start: 0; }
    html.da27 #main-content .fc-offres .cmp-actions { grid-column: 2; align-self: end; }
}

/* ---------- Fiches commune, canton, intercommunalité et offre : une seule feuille, pas de panneau dans le panneau (#431) ----------
   Les sections se suivent sur une même feuille blanche, séparées par un filet neutre de 1 px ; les blocs internes (graphiques,
   chiffres, pictogrammes, services) perdent leur aplat gris et se posent sur la feuille. */
html.da27 #main-content .fc .pc-sections { gap: 0; }
html.da27 #main-content .fc .pc-sections > .pc-section,
html.da27 #main-content .fc .pc-sections > .pc-section + .pc-section { border: 0; }
html.da27 #main-content .fc .pc-sections > .pc-section + .pc-section { border-block-start: 1px solid var(--c-border); }
html.da27 #main-content .ui-fiche__main > .ui-fiche__section { margin-block-start: 0; }
html.da27 #main-content .ui-fiche__main > .ui-fiche__section + .ui-fiche__section { border-block-start: 1px solid var(--c-border); }
html.da27 #main-content :is(.fc .pc-section, .ui-fiche__section) :is(.ui-chart, .sp-chiffres, .tb-chiffres, .fr__item, .osc-carte, .si-card, .vf-kpi__item, .ui-panel, .sp-chiffre) { background: none; }
html.da27 #main-content :is(.fc .pc-section, .ui-fiche__section) .ui-chart:not(.da-mag__graphe .ui-chart) { padding: 0; }
/* fiche offre : le bandeau de pictogrammes n'est plus affiché pour une seule donnée, déjà reprise dans « Caractéristiques » (#434) */
html.da27 #main-content section.fr:has(.fr__liste > .fr__item:only-child) { display: none; }

/* ---------- Boutons sans cadre (#431) : aplat clair, survol plus soutenu, focus visible ---------- */
html.da27 .nb-btn:not(.nb-btn--plein) { border-color: transparent; background: var(--brand-50, #F2F6F9); }
html.da27 .nb-btn:not(.nb-btn--plein):hover { border-color: transparent; background: var(--brand-100, #E4ECF2); color: var(--nb-marque); }
html.da27 .nb-btn.est-fait { border-color: transparent; background: #E7F4EC; }
/* tiroir du menu (téléphone, tablette) : Connexion et Créer un compte en aplat clair, sans cadre */
html.da27 .ui-tiroir__liens--duo a { border: 0; border-radius: 0; background: var(--brand-50, #F2F6F9); }
html.da27 .ui-tiroir__liens--duo a:hover { background: var(--brand-100, #E4ECF2); }
/* questions fréquentes (zones d'activités et autres pages) : rangées sur le fond de la page, filet neutre de 1 px, plus de tuiles */
html.da27 #main-content .da-acc { background: none; border-block-end: 1px solid var(--c-border); }
html.da27 #main-content .da-acc + .da-acc { margin-block-start: 0; }
html.da27 #main-content .da-acc:first-of-type { border-block-start: 1px solid var(--c-border); }
html.da27 #main-content .da-acc > summary { padding-inline: 0; }
html.da27 #main-content .da-acc > summary:hover { background: none; text-decoration: underline; text-underline-offset: 3px; }
html.da27 #main-content .da-acc__rep { padding-inline: 0; }
/* dans les sections à marge interne (pages S'implanter), le texte des questions s'aligne sur celui de la section */
html.da27 #main-content .pc :is(.sp-corps, .gp-corps, .dcr-contenu) .da-acc > summary, html.da27 #main-content .pc :is(.sp-corps, .gp-corps, .dcr-contenu) .da-acc__rep { padding-inline: var(--mep-pad, 0); }

/* ---------- Pages précédente et suivante, sommaire numéroté (#432) ---------- */
html.da27 body .dcr-voisines ul > li > a { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; }
html.da27 body .dcr-voisines ul > li.dcr-voisines__suiv > a { align-items: flex-end; }
html.da27 body .dcr-voisines__sens, html.da27 body .dcr-voisines__titre { display: block; }
/* sommaire « Sur cette page » : chaque entrée garde sa propre hauteur (44 px au moins), sans chevauchement ni décalage de numéro */
html.da27 #main-content .sf .sf-a { margin-block: 0; }   /* la règle des 44 px de da27-affinage.css (marge négative) exclut .sf-a */
html.da27 #main-content .sf ol > li { display: block; }

/* ---------- Contraste et zones tactiles (#435) ---------- */
html.da27 .gp-figs .si-fig__s a, html.da27 .si-fig__s a { color: #0058B0; }   /* 5,37:1 sur #DDE3E9, 6,95:1 sur blanc */
@media (pointer: coarse), (max-width: 1023.98px) {
    html.da27 #main-content :is(a.si-mandat__titre, .si-mandat__titre a, .si-fig__s a, a.pz-anciens__nom, .pz-anciens__nom a, a.iee-barres__l, .iee-barres__l a, .home-nouvelles a, .vf-ico > a, .si-elu__comptes > a, .gp-src > a, .act-carte__credit > a, .cm27-chiffres > a) {
        display: inline-block; padding-block: max(0px, calc((44px - 1lh) / 2)); margin-block: min(0px, calc((1lh - 44px) / 2)); }
}
/* focus visible partout, champs compris */
html.da27 :is(input, select, textarea):focus-visible, html.da27 a.ui-offer-card__link:focus-visible { outline: 3px solid var(--ui-focus, #ffbf47); outline-offset: 2px; }
html.da27 #main-content .home-resources li > a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding-block: 0; margin-block: 0; }
@media (pointer: coarse), (max-width: 1023.98px) {
    html.da27 #main-content :is(.vf-ico, .si-elu__comptes, .act-carte__source) > a { min-width: 44px; text-align: center; }
}
/* repères des grands projets : zone de 44 px, pastille visible de 36 px inchangée */
html.da27 .si-pin span { width: 36px; height: 36px; }
@media (pointer: coarse), (max-width: 1023.98px) {
    html.da27 #main-content .fh__rattach a, html.da27 #main-content .fh :is(p, span) > a { display: inline-block; padding-block: max(0px, calc((44px - 1lh) / 2)); margin-block: min(0px, calc((1lh - 44px) / 2)); }
}

/* ---------- Typographie et vides (#437, #434) ---------- */
/* annuaire : extrait en texte courant, titres des fichiers détachés du filet qui les précède */
html.da27 .act section.ui-panel.pf > p.pf__extrait { font-weight: 400; }
html.da27 .act section.ui-panel.pf .pf__liste > li { padding-block-start: 16px; }
html.da27 .act section.ui-panel.pf .pf__liste h3 { margin-block: 0 8px; }
/* actualités, « À la une » : texte posé sur le fond à côté de la photo, sans case blanche à moitié vide */
@media (min-width: 768px) {
    html.da27 #main-content .act-carte--une { background: none; align-items: center; gap: clamp(20px, 2.5vw, 40px); }
    html.da27 #main-content .act-carte--une .act-carte__media { aspect-ratio: 3 / 2; min-height: 0; }
    html.da27 #main-content .act-carte--une .act-carte__corps { padding: 0; background: none; }
}
@media (min-width: 768px) { html.da27 #main-content .act-carte--une .act-carte__titre { font-size: clamp(22px, 1.9vw, 28px); line-height: 1.25; } }
/* fiches, chiffres en grille de 2 sous 900 px : un chiffre seul ou le dernier d'un nombre impair prend toute la largeur (plus de case grise vide) */
@media (max-width: 899.98px) {
    html.da27 .fc .pc-sections :is(.sp-chiffres, .tb-chiffres, .ne-bloc__chiffres, .si-figs) > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}

/* ---------- Accueil (#434) ---------- */
/* actualités : titres limités à 4 lignes, même corps sur les trois colonnes */
html.da27 #main-content .da-actus .da-h3 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; overflow: hidden; font-size: 1rem; line-height: 1.35; }
html.da27 #main-content .da-actus .da-carte { align-items: flex-start; }
/* graphiques en paires : même hauteur, « Voir les données » et la source alignés en bas */
html.da27 .da-mag .da-mag__graphes { align-items: stretch; }
html.da27 .da-mag__graphe { display: flex; flex-direction: column; }
html.da27 .da-mag__graphe > .ui-chart { flex: 1 1 auto; display: flex; flex-direction: column; }
html.da27 #main-content .da-mag .da-mag__graphe > .ui-chart > .ui-chart__donnees { margin-block-start: auto; }
/* la hauteur libre du graphique le plus court se répartit entre ses rangées (aucun vide sous le graphique) */
html.da27 #main-content .da-mag .da-mag__graphe > .ui-chart > :is(.ui-chart__barres, .ui-chart__anneau) { flex: 1 1 auto; align-content: space-around; }
html.da27 #main-content .da-mag .da-mag__graphe > .ui-chart > .ui-chart__anneau { align-items: center; }

/* ---------- Pied de page (#437) ---------- */
/* 1024 à 1279 px : bloc du CEEVO au-dessus, liens sur toute la largeur en 4 colonnes égales */
@media (min-width: 1024px) and (max-width: 1279.98px) {
    html.da27 .ui-footer__haut { grid-template-columns: minmax(0, 1fr); gap: var(--s-5); }
    html.da27 .ui-footer__nav { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
/* téléphone : réseaux en 2 colonnes, langue et « Valider » sur la même ligne, partenaires 2 par ligne */
@media (max-width: 639.98px) {
    html.da27 .ui-footer__reseaux { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
    html.da27 .ui-footer__langue { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; }
    html.da27 .ui-footer__langue > label { grid-column: 1 / -1; }
    html.da27 .ui-footer__langue > select { width: 100%; min-width: 0; }
    html.da27 .ui-footer ul.ui-footer__partenaires { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
}
/* commercialisateurs : photo d'ouverture sans angle arrondi ; dès 1280 px, légende en colonne à droite de la photo (photo à 960 px au plus, source de 1000 px, donc nette ; plus de vide à droite) */
html.da27 .cm27 > section .vz-piece > :is(.ui-photo-libre, .vz-grande) .ui-figure { border-radius: 0; }
@media (min-width: 1280px) {
    html.da27 .cm27 > section .vz-piece > .ui-photo-libre { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 0 clamp(24px, 2.5vw, 40px); align-items: end; }
    html.da27 .cm27 > section .vz-piece > .ui-photo-libre .ui-figure { width: 100%; max-width: 960px; max-height: none; aspect-ratio: 21 / 9; }
    html.da27 .cm27 > section .vz-piece > .ui-photo-libre .ui-photo-libre__legende { display: flex; flex-direction: column; gap: 6px; margin: 0; }
    html.da27 .cm27 > section .vz-piece > .ui-photo-libre .ui-photo-libre__texte { font-size: 1.125rem; font-weight: 600; color: var(--c-text); }
}

/* ---------- Alignements (#433) ---------- */
/* recherche sur mesure : vérification anti-robot et envoi alignés sur le texte des blocs du formulaire */
html.da27 .rsm-page form.rsm-form > :is(.maj-captcha, p) { padding-inline: clamp(20px, 2.6vw, 32px); }
/* barre de partage en bas de page : centrée comme la colonne de la page (elle restait collée à gauche au-delà de 1280 px) */
html.da27 .nb-outils.ui-wrap { margin-inline: auto; }
/* vidéo en définition standard (640 px au plus) : son panneau prend la largeur de l'image, sans écart d'un seul côté */
html.da27 .da-videos-piece--grand > .da-video--sd { max-inline-size: 640px; }
/* chiffres clés des fiches : le corps du chiffre suit la largeur de sa case (« 3 031 €/m² » tient en 768 et 1024 px) */
html.da27 #main-content .fc .pc-sections li.sp-chiffre { container-type: inline-size; }
html.da27 #main-content .fc .pc-sections li.sp-chiffre .sp-chiffre__n { font-size: clamp(1.125rem, 14cqi, 1.75rem); }
@media (pointer: coarse), (max-width: 1023.98px) { html.da27 #main-content .act-carte__credit > a { min-height: 44px; } }
/* vidéos glissées dans une case étroite (plafonds d'aide) : une vidéo par vue, sur toute la largeur de la case */
html.da27 #main-content .vf-plafond .vz-car--video > .da-video { flex: 0 0 100%; min-width: 100%; max-width: 100%; }
/* pays d'origine des investisseurs : cases d'au moins 240 px, les noms longs (« néerlandaises ») ne se coupent plus */
@media (min-width: 768px) { html.da27 #main-content .ip-tuiles { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); } }
html.da27 #main-content .ip-tuile__drapeau { border-radius: 0; }
@media (max-width: 479.98px) { html.da27 #main-content .fc .pc-sections .ne-bloc__l { font-size: .8125rem; overflow-wrap: normal; hyphens: manual; } }
/* tablettes et téléphones : liens isolés, de tableau, de fil d'Ariane et d'échelle à 44 px de haut et de large au moins */
@media (pointer: coarse), (max-width: 1024px) {
    html.da27 #main-content :is(.sp-parcours__titre > a, a.vf-echelle__lien, .si-ilo__coord > a, p.fil-compteur > a, p.acr-pages > a, div.text-xs > a, td > a.si-link, div > a.sp-lien, p > a.sp-lien, dd > a, li > a.si-link) {
        display: inline-block; min-width: 44px; min-height: 44px; padding-block: max(0px, calc((44px - 1lh) / 2)); margin-block: min(0px, calc((1lh - 44px) / 2)); }
    html.da27 nav.ui-help > a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }
}
/* la règle des 44 px des liens de liste (da27-affinage.css, jusqu'à 1023,98 px) vaut aussi pour la tablette en paysage (1024 px) */
@media (min-width: 1024px) and (max-width: 1024px) {
    html.da27 #main-content :is(li:not(.cm27-offres > li):not(.hub-tuile__liens > li), dd, h3, h4) > a:not(.sf-a):not(.ui-btn):not(.da-btn):not(.da-pastille):not(.da-carte):not(.da-carte-corps) {
        display: inline-block; max-width: 100%; padding-block: max(0px, calc((44px - 1lh) / 2)); margin-block: min(0px, calc((1lh - 44px) / 2)); }
}
@media (pointer: coarse), (max-width: 1024px) { html.da27 #main-content a.sp-lien.sp-lien:not(.ui-btn):not(.da-btn) { box-sizing: border-box; min-height: 44px; } }
