/* DA 2027, affinage 4 du 16/11/2026 (#407 à #416) : défauts du contrôle aveugle 3. Tout est sous html.da27, chargé après l'affinage 3. */

/* ---------- Mots composés (#407) : bloc de texte d'un seul tenant dans les parents en flex ou en grille ---------- */
html.da27 da-mots { display: inline; }

/* ---------- Bandeau de consentement au-dessus de tout, carte économique comprise (#409) ---------- */
html.da27 .consentement { z-index: 5000; }

/* ---------- Carte économique : en-tête de la carte à la hauteur de son contenu, titre jamais sous l'en-tête du site (#409) ---------- */
html.da27 { --ce-tete-h: 112px; }
html.da27 .ce-tete h1 { font-size: 1.5rem; line-height: 1.1; margin: 0; }
@media (min-width: 640px) {
    html.da27 { --ce-tete-h: 66px; }
    html.da27 .ce-tete h1 { font-size: clamp(1.5rem, 2.4vw, 2rem); }
}
/* téléphone en portrait : outils de la carte sur une seule colonne, qui défile au besoin, jamais sur la carte en deux colonnes */
@media (max-width: 767.98px) and (max-device-aspect-ratio: 1/1) {
    html.da27 .ce-barre { flex-wrap: nowrap; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; max-height: calc(100% - 128px); }
    html.da27 .ce-barre > * { flex: none; }
    /* tiroir fermé : titre et nombre de couches actives entiers ; libellés des couches entiers (la rangée défile) */
    html.da27 .ce-panneau:not([data-pos="1"]):not([data-pos="2"]) { height: 112px; }
    html.da27 .ce-bas { bottom: 128px; }
    html.da27 .ce-chip__nom { max-width: none; }

}

/* ---------- Grilles de cartes remplacées par des rangées éditoriales (#410) ----------
   Règle d'Alex : « jamais de tuile arrondie, de grille de cartes […] ni d'ombre dure ». Chaque liste devient une suite de rangées
   sur le fond de la page, séparées par un filet neutre de 1 px ; la hiérarchie vient de la typographie, pas d'une boîte. */

/* L'essentiel : sommaire numéroté, texte entier (plus de « … ») */
html.da27 #main-content .sp-essentiel .fx-w .fx-nav, html.da27 #main-content .sp-essentiel .fx-w .fx-bas { display: none; }
html.da27 #main-content .sp-essentiel__l.sp-essentiel__l { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; align-items: start; overflow: visible; counter-reset: essentiel; margin: 0; padding: 0; list-style: none; }
html.da27 #main-content .sp-essentiel > .sp-source { margin-block-end: 24px; }

html.da27 #main-content .sp-essentiel__l.sp-essentiel__l > .da-carte { grid-column: auto; flex: none; height: auto; background: none; border-radius: 0; box-shadow: none; transform: none; overflow: visible; counter-increment: essentiel; border-block-start: 1px solid var(--c-border); }
html.da27 #main-content .sp-essentiel__l > .da-carte:hover { transform: none; box-shadow: none; background: none; }
html.da27 #main-content .sp-essentiel__l > .da-carte:focus-within { outline: 0; }
html.da27 #main-content .sp-essentiel__l .da-carte-corps { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); column-gap: 16px; row-gap: 6px; align-items: baseline; height: auto; padding: 18px 0 20px; }
html.da27 #main-content .sp-essentiel__l .da-carte-corps::before { content: counter(essentiel, decimal-leading-zero); grid-row: 1 / span 3; font: 700 1.25rem/1 var(--font-display); color: var(--c-brand-soft-ink, #1853A2); font-variant-numeric: tabular-nums; }
html.da27 #main-content .sp-essentiel__l .da-carte-corps > * { grid-column: 2; }
html.da27 #main-content .sp-essentiel__l .da-carte-corps > .da-h3 { font: 700 1.125rem/1.3 var(--font-display); color: var(--c-text); text-wrap: balance; }
html.da27 #main-content .sp-essentiel__l .da-carte-corps > div { display: block; -webkit-line-clamp: unset; overflow: visible; color: var(--c-text-2); max-width: 68ch; text-wrap: pretty; }
html.da27 #main-content .sp-essentiel__l .da-carte-corps > div > * { display: inline; }
html.da27 #main-content .sp-essentiel__plus.sp-essentiel__plus { justify-self: start; position: static; margin: 2px 0 0; padding: 0; min-height: 44px; font-size: .9375rem; font-weight: 600; color: var(--c-action); text-decoration: underline; text-underline-offset: 3px; }
html.da27 #main-content .sp-essentiel__plus::after { content: none; }
@media (min-width: 1024px) {
    html.da27 #main-content .sp-essentiel__l.sp-essentiel__l { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 48px; }
    html.da27 #main-content .sp-essentiel__l.sp-essentiel__l > .da-carte { grid-column: auto; }
    html.da27 #main-content .sp-essentiel__l.sp-essentiel__l > .da-carte:last-child:nth-child(odd) { grid-column: 1 / -1; }
    html.da27 #main-content .sp-essentiel__l.sp-essentiel__l > .da-carte:last-child:nth-child(odd) .da-carte-corps > div { max-width: 80ch; }
}

/* Annuaires (entreprises, personnalités) : rangées logo + texte, deux colonnes sur grand écran */
html.da27 #main-content .an-grille { grid-template-columns: minmax(0, 1fr); gap: 0; }
html.da27 #main-content .an-grille > .an-tuile { min-height: 0; padding: 16px 0; background: none; border: 0; border-block-start: 1px solid var(--c-border); border-radius: 0; box-shadow: none; }
html.da27 #main-content .an-grille > .an-tuile:hover { box-shadow: none; background: none; }
html.da27 #main-content .an-grille > .an-tuile .an-tuile__logo { background: #fff; }
html.da27 #main-content .an-grille > .an-tuile .an-tuile__logo--sigle { background: var(--brand-50, #E6EDF3); }
@media (min-width: 1024px) { html.da27 #main-content .an-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; } }

/* Vidéos : rangées vignette + titre, une colonne */
html.da27 #main-content .vid-grille { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; margin: 0; padding: 0; list-style: none; }
html.da27 #main-content .vid-grille > .vid-carte { display: grid; grid-template-columns: 128px minmax(0, 1fr); column-gap: 16px; align-items: start; padding: 16px 0; background: none; border-radius: 0; border-block-start: 1px solid var(--c-border); grid-column: auto; }
html.da27 #main-content .vid-grille > .vid-carte .vid-carte__media { aspect-ratio: 16 / 9; width: 100%; height: auto; min-height: 0; }
html.da27 #main-content .vid-grille > .vid-carte .vid-carte__corps { padding: 0; }
@media (min-width: 768px) { html.da27 #main-content .vid-grille > .vid-carte { grid-template-columns: 224px minmax(0, 1fr); column-gap: 24px; } }

/* Chiffres clés des fiches d'établissement : bandeau de chiffres sans boîte, rangées pleines (jamais d'orpheline) */
html.da27 #main-content .vf-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; }
html.da27 #main-content .vf-kpi > .vf-kpi__item { background: none; border: 0; border-radius: 0; border-block-start: 1px solid var(--c-border); padding: 16px 16px 16px 0; }
@media (min-width: 768px) {
    html.da27 #main-content .vf-kpi { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    html.da27 #main-content .vf-kpi:has(> :nth-child(4):last-child), html.da27 #main-content .vf-kpi:has(> :nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    html.da27 #main-content .vf-kpi > .vf-kpi__item:nth-last-child(1):nth-child(3n + 1) { grid-column: 1 / -1; }
}

/* Chiffres du bandeau des fiches territoire : une ligne de chiffres séparés par un filet, sans case blanche */
html.da27 #main-content .fh__chiffres > li { background: none; }
html.da27 #main-content .fh__chiffres > li + li { border-inline-start: 1px solid var(--c-border); }

/* Comparaisons, sources de la carte, contacts : rangées sur le fond de la page */
html.da27 #main-content :is(.fc-tableaux > .fc-tableau, .ce-sources-grille > .ce-source-carte, .ui-contactpage__infos > .ui-contactpage__card, .gp-figs > .si-fig) { background: none; border: 0; border-radius: 0; box-shadow: none; border-block-start: 1px solid var(--c-border); padding-inline: 0; }
html.da27 #main-content .ce-sources-grille { gap: 0 32px; }

/* Communes membres, communes du canton : rangées photo + nom + chiffres, deux colonnes sur grand écran */
html.da27 .fc .pc-sections .cl-grille { grid-template-columns: minmax(0, 1fr); gap: 0; }
html.da27 .fc .pc-sections .cl-grille > li { gap: 4px; padding: 16px 0; border-block-start: 1px solid var(--c-border); }
html.da27 .fc .pc-sections .cl-grille > li > .ui-card { display: grid; grid-template-columns: 112px minmax(0, 1fr); column-gap: 16px; align-items: start; background: none; border-radius: 0; box-shadow: none; }
html.da27 .fc .pc-sections .cl-grille > li > .ui-card:hover { background: none; }
html.da27 .fc .pc-sections .cl-grille .ui-card__media { aspect-ratio: 4 / 3; height: auto; border-radius: 0; }
html.da27 .fc .pc-sections .cl-grille .ui-card__media img { width: 100%; height: 100%; object-fit: cover; }
html.da27 .fc .pc-sections .cl-grille .ui-card__corps { padding: 0; gap: 2px; }
html.da27 .fc .pc-sections .cl-grille .ui-card__titre { overflow: visible; white-space: normal; text-overflow: clip; }
html.da27 .fc .pc-sections .cl-grille .ui-card__pied { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 4px 0 0; padding: 0; border: 0; }
html.da27 .fc .pc-sections .cl-grille .credit-photo { margin: 0; padding-inline-start: 128px; }
@media (min-width: 1024px) {
    html.da27 .fc .pc-sections .cl-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; }
    html.da27 .fc .pc-sections .cl-grille > li > .ui-card { grid-template-columns: 136px minmax(0, 1fr); }
    html.da27 .fc .pc-sections .cl-grille .credit-photo { padding-inline-start: 152px; }
}

/* ---------- Textes coupés (#412) ---------- */
/* formulaire « grands projets » : deux colonnes, champs alignés en bas de ligne, unité de surface lisible */
html.da27 #main-content .gp-form__ligne:not(.gp-form__ligne--2) { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
html.da27 #main-content .gp-form__ligne:not(.gp-form__ligne--2) > .gp-form__surface { grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr) minmax(9rem, 12rem); }
html.da27 #main-content .gp-form__ligne--2 { align-items: end; }
@media (max-width: 479.98px) { html.da27 #main-content .gp-form__ligne:not(.gp-form__ligne--2) { grid-template-columns: minmax(0, 1fr); } }
/* encart « Ce que devient votre demande » : titre sur la largeur de l'encart */
html.da27 #main-content .gp-confidentialite > h3 { display: flex; align-items: center; gap: 10px; text-wrap: balance; }
html.da27 #main-content .gp-confidentialite > h3 > svg { flex: none; }
/* filtres d'Actualités : libellé au-dessus du menu, le menu prend toute la colonne et montre son choix en entier */
html.da27 #main-content .acr-filtres .acr-filtre { grid-template-columns: minmax(0, 1fr); row-gap: 4px; align-content: end; }
html.da27 #main-content .acr-filtres { align-items: end; }

/* liste des communes : rattachement sur deux lignes entières, jambages visibles */
html.da27 #main-content .cl-tuile__meta { white-space: normal; text-overflow: clip; overflow: visible; display: block; -webkit-line-clamp: unset; line-height: 1.4; }
/* carte des zones d'activités : la liste des communes passe sous la carte tant que la colonne serait trop étroite pour un nom entier */
@media (min-width: 1024px) and (max-width: 1439.98px) {
    html.da27 #main-content .si-map { grid-template-columns: minmax(0, 1fr); }
    html.da27 #main-content .si-map > .si-card .si-list { columns: 2 16rem; column-gap: 40px; }
    html.da27 #main-content .si-map > .si-card .si-list > li { break-inside: avoid; }
}

/* ---------- Vides et blocs inégaux (#413) ---------- */
/* accueil, « Le Val-d'Oise en chiffres » : quatre graphiques en deux rangées alignées ; l'anneau est centré dans la hauteur de sa rangée */
@media (min-width: 768px) {
    html.da27 .da-mag .da-mag__graphes:has(> :nth-child(4):last-child) { display: grid; columns: auto; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 48px; row-gap: 32px; align-items: stretch; }
    html.da27 .da-mag .da-mag__graphes:has(> :nth-child(4):last-child) > .da-mag__graphe { display: flex; flex-direction: column; margin: 0; }
    html.da27 #main-content .da-mag .da-mag__graphes:has(> :nth-child(4):last-child) > .da-mag__graphe > .ui-chart { flex: 1 1 auto; }
    html.da27 #main-content .da-mag .da-mag__graphe > .da-jauge .da-jauge__anneau { margin-block: auto; align-self: center; }
}
/* accueil, vidéo à la une : vignette visible quand la vidéo est en colonne (tablette), 640 px au plus pour rester nette */
html.da27 #main-content .da-mag .da-video--grand > .da-video__media { align-self: stretch; }
html.da27 #main-content .da-mag .da-video--grand > .da-video__corps { align-self: stretch; }
@media (min-width: 640px) and (max-width: 1023.98px) { html.da27 #main-content .da-mag .da-video--grand > .da-video__corps { padding-block-start: 16px; } }
/* galerie : légende à 8 px de la photo, comme les vignettes voisines */
html.da27 .da-mag .vz-regard > figcaption { margin-block-start: 0; }
/* chiffres collés (population atteignable…) : autant de colonnes que de chiffres, jamais de case vide */
@media (min-width: 600px) {
    html.da27 .at .tb-chiffres:has(> li:only-child) { grid-template-columns: minmax(0, 1fr); }
    html.da27 .at .tb-chiffres:has(> li:nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    html.da27 .at .tb-chiffres:has(> li:nth-child(4):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* recherche de l'en-tête : « Commune ou code postal » entier dès 1400 px */
@media (min-width: 1400px) { html.da27 .ui-entete__form { width: 280px; } }
@media (min-width: 1600px) { html.da27 .ui-entete__form { width: 300px; } }

/* rangées de chiffres : 2 colonnes sans filet sur smartphone (valeurs alignées à gauche), une seule rangée dès 768 px pour 4 chiffres */
@media (max-width: 767.98px) {
    html.da27 #main-content :is(.hub-chiffres .ui-kpi, .sp-chiffres) { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
    html.da27 #main-content :is(.hub-chiffres .ui-kpi .ui-kpi__item, .sp-chiffres .sp-chiffre):nth-child(n) { border-inline-start: 0; padding-inline: 0; }
    html.da27 #main-content :is(.hub-chiffres .ui-kpi .ui-kpi__item, .sp-chiffres .sp-chiffre):last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (min-width: 768px) {
    html.da27 #main-content :is(.hub-chiffres .ui-kpi, .sp-chiffres):has(> :nth-child(4):last-child) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    html.da27 #main-content :is(.hub-chiffres .ui-kpi, .sp-chiffres):has(> :nth-child(3):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    html.da27 #main-content :is(.hub-chiffres .ui-kpi .ui-kpi__item, .sp-chiffres .sp-chiffre):nth-child(n) { border-inline-start: 1px solid var(--c-border); padding-inline: 20px; }
    html.da27 #main-content :is(.hub-chiffres .ui-kpi .ui-kpi__item, .sp-chiffres .sp-chiffre):nth-child(n):first-child { border-inline-start: 0; padding-inline-start: 0; }
}
/* listes « Sur cette page » et listes simples : lien en ligne (numéro aligné sur la première ligne), zone tactile de 44 px par le remplissage */
@media (pointer: coarse), (max-width: 1023.98px) {
    html.da27 #main-content :is(ul, ol):not([class]) > li > a:not([class]) { display: inline; min-height: 0; min-width: 0; margin-block: 0; padding-block: 10px; }
}
/* grand écran : le contenu prend la largeur de l'en-tête et du pied de page (1 440 px), bords gauches alignés */
@media (min-width: 1600px) {
    html.da27 :is(.ui-wrap, .ui-bandeau__int, .da-home-in, .home-hero__in, .home--da .home-resources, .da-hero__int, .ofr-hero__titre, #main-content .max-w-7xl) { max-width: 1440px; }
}
/* légendes de photo : 8 px sous l'image partout (carrousel, galeries, accordéons) */
html.da27 #main-content figure.ui-photo-libre > figcaption { margin-block-start: 8px; }

/* ---------- Pied de page et partage (#415) ---------- */
/* un élément masqué (attribut hidden) le reste : jamais deux « Partager » côte à côte */
html.da27 #main-content :is(.nb-btn, .nb-partage, .ui-btn, .da-btn)[hidden] { display: none; }
html.da27 .ui-footer__reseaux a > .ui-picto { flex: none; }
html.da27 .ui-footer .ui-footer__reseaux a[data-reseau] { justify-content: flex-start; }

/* titres de vidéo, titres d'offre, descriptions des parcours de la carte : toujours entiers, jamais « … » (#412) */
html.da27 #main-content .vz-car .da-video .da-video__titre.da-video__titre, html.da27 #main-content .da-mag .da-video .da-video__titre.da-video__titre,
html.da27 :is(.da-video__titre, .ui-offer-card__title, .ce-parcours__desc) { display: block; -webkit-line-clamp: unset; line-clamp: none; overflow: visible; max-height: none; text-overflow: clip; }
/* même taille pour tous les chiffres d'une rangée (la taille ne dépend plus de la largeur de chaque case) */
html.da27 #main-content .hub-chiffres .ui-kpi .ui-kpi__valeur { font-size: clamp(1.375rem, 1rem + 1vw, 1.75rem); }
/* « L'essentiel » en version liens (smartphone) : sommaire en rangées numérotées, comme sur grand écran, sans pastille grise */
html.da27 #main-content .pc .sp-essentiel__liens { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; counter-reset: essentiel; }
html.da27 #main-content .pc .sp-essentiel__liens > li { counter-increment: essentiel; border-block-start: 1px solid var(--c-border); }
html.da27 #main-content .pc .sp-essentiel__liens .da-pastille { display: grid; grid-template-columns: 2.25rem minmax(0, 1fr); align-items: baseline; width: 100%; min-height: 44px; padding: 11px 0; background: none; border-radius: 0; font-weight: 600; line-height: 1.35; color: var(--c-text); }
html.da27 #main-content .pc .sp-essentiel__liens .da-pastille::before { content: counter(essentiel, decimal-leading-zero); font: 700 1rem/1 var(--font-display); color: var(--c-brand-soft-ink, #1853A2); font-variant-numeric: tabular-nums; }
html.da27 #main-content .pc .sp-essentiel__liens .da-pastille:hover { background: none; color: var(--c-action); text-decoration: underline; text-underline-offset: 3px; }
/* recherche de l'en-tête de 1280 à 1599 px : texte d'aide en 14 px pour tenir en entier */
@media (min-width: 1280px) and (max-width: 1599.98px) { html.da27 .ui-entete__form input { font-size: .875rem; } }
