/* DA 2027 (#366) : mise en page homogène de la famille « offres » (liste, atterrissages type et type x commune). Tout est sous html.da27 ; aucun texte ni donnée ne change. */

/* ---------- Atterrissages : une colonne, rythme 24 px ---------- */
html.da27 .at { display: grid; gap: 24px; margin-block-start: 24px; }
html.da27 .at > section, html.da27 .at section { margin-block-start: 0; }
html.da27 .at > p { margin: 0; }
html.da27 .at section > h2 { margin-block: 0 16px; }
html.da27 .at .tb-note, html.da27 .at .ui-source { max-width: none; }
html.da27 .at .tb-note { margin-block: 12px 0; }
html.da27 .at .ui-source { margin-block: 8px 0; }
html.da27 .td-communes { margin-block-start: 24px; }
html.da27 .td-communes > h2 { margin-block: 0 16px; }

/* chiffres : cases collées, 3 + 2 pour cinq, 2 + 2 pour quatre */
html.da27 .at-sec-chiffres > .tb-liste { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1px; margin: 0; background: var(--c-border); border: 1px solid var(--c-border); border-radius: var(--r-xl); overflow: hidden; }
html.da27 .at-sec-chiffres > .tb-liste > li { grid-column: span 6; border: 0; border-radius: 0; background: var(--c-surface); padding: clamp(16px, 2.2vw, 24px) clamp(18px, 2.6vw, 28px); font-family: var(--font-display); font-weight: 700; font-size: 1rem; line-height: 1.35; display: flex; align-items: center; }
@media (min-width: 700px) {
    html.da27 .at:not(.at-duo) .at-sec-chiffres > .tb-liste > li { grid-column: span 2; }
    html.da27 .at:not(.at-duo) .at-sec-chiffres > .tb-liste > li:last-child:nth-child(3n + 1) { grid-column: span 6; }
    html.da27 .at:not(.at-duo) .at-sec-chiffres > .tb-liste > li:last-child:nth-child(3n + 2), html.da27 .at:not(.at-duo) .at-sec-chiffres > .tb-liste > li:nth-last-child(2):nth-child(3n + 1) { grid-column: span 3; }
    html.da27 .at:not(.at-duo) .at-sec-chiffres > .tb-liste > li:first-child:nth-last-child(4), html.da27 .at:not(.at-duo) .at-sec-chiffres > .tb-liste > li:first-child:nth-last-child(4) ~ li { grid-column: span 3; }
}
@media (min-width: 700px) and (max-width: 999.98px) {
    html.da27 .at-duo .at-sec-chiffres > .tb-liste > li { grid-column: span 2; }
    html.da27 .at-duo .at-sec-chiffres > .tb-liste > li:last-child:nth-child(3n + 1) { grid-column: span 6; }
    html.da27 .at-duo .at-sec-chiffres > .tb-liste > li:last-child:nth-child(3n + 2), html.da27 .at-duo .at-sec-chiffres > .tb-liste > li:nth-last-child(2):nth-child(3n + 1) { grid-column: span 3; }
    html.da27 .at-duo .at-sec-chiffres > .tb-liste > li:first-child:nth-last-child(4), html.da27 .at-duo .at-sec-chiffres > .tb-liste > li:first-child:nth-last-child(4) ~ li { grid-column: span 3; }
}

/* chiffres + carte côte à côte (ordinateur) : deux colonnes égales, la carte remplit la hauteur */
@media (min-width: 1000px) {
    html.da27 .at-duo { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    html.da27 .at-duo > * { grid-column: 1 / -1; }
    html.da27 .at-duo > .at-sec-chiffres { grid-column: 1; grid-row: 1; }
    html.da27 .at-duo > .at-carte-bloc { grid-column: 2; grid-row: 1; align-content: center; }
}

/* carte : panneau pleine largeur, centrée, légende dessous */
html.da27 .at-carte-bloc { background: var(--brand-50); border-radius: var(--r-lg); padding: clamp(16px, 2.4vw, 28px); display: grid; gap: 12px; justify-items: center; }
html.da27 .at-carte { width: 100%; max-width: none; max-height: 340px; background: transparent; border: 0; border-radius: 0; }
html.da27 .at-legende { margin: 0; justify-content: center; }

/* questions-réponses : accordéons */
html.da27 .at-faq-acc { display: grid; gap: 10px; }
html.da27 .at-faq-acc .da-acc + .da-acc { margin-block-start: 0; }
html.da27 .at-faq-acc .da-acc__rep { padding: 0 22px 20px; }
html.da27 .at-faq-acc .da-acc__rep p { margin: 0; max-width: 75ch; }

/* accès : chiffres collés */
html.da27 .at .tb-chiffres { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin: 0 0 12px; background: var(--c-border); border: 1px solid var(--c-border); border-radius: var(--r-xl); overflow: hidden; }
html.da27 .at .tb-chiffres > li { background: var(--c-surface); border: 0; border-radius: 0; padding: clamp(16px, 2.4vw, 28px); }
@media (max-width: 599.98px) { html.da27 .at .tb-chiffres { grid-template-columns: minmax(0, 1fr); } }

/* cartes compactes : commune, zone, lien */
html.da27 .at section:not(.at-sec-chiffres) > .tb-liste, html.da27 .td-communes .tb-liste { margin: 0; padding: 0; list-style: none; }
html.da27 .at section:not(.at-sec-chiffres) > .tb-liste > li, html.da27 .td-communes .tb-liste > li { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-lg); padding: 14px 18px; display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 64px; min-width: 0; }
html.da27 .td-communes .tb-lien { min-height: 0; }
html.da27 .td-communes .tb-meta { margin: 0; }

/* liens de fin de page : cartes de liens, rangées pleines */
html.da27 .tc-liens { background: transparent; border: 0; box-shadow: none; padding: 0; margin-block-start: 24px; }
html.da27 .tc-liens > h2 { margin-block: 24px 12px; }
html.da27 .tc-liens > h2:first-child { margin-block-start: 0; }
html.da27 .tc-liens .ui-empty__list, html.da27 .offres-explorer .ui-empty__list { margin: 0; padding: 0; list-style: none; }
html.da27 .tc-liens .ui-empty__list > li, html.da27 .offres-explorer .ui-empty__list > li { display: flex; min-width: 0; }
html.da27 .tc-liens .ui-suggestion, html.da27 .offres-explorer .ui-suggestion { flex: 1 1 auto; width: 100%; justify-content: flex-start; text-align: start; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-lg); padding: 14px 18px; min-height: 56px; line-height: 1.3; }
html.da27 .offres-explorer { padding-block: 24px 24px; }
html.da27 .offres-explorer__t { margin: 0 0 16px; }

/* cartes d'offre : 16 px entre cartes, pas d'ombre au repos */
html.da27 .ui-offer-grid, html.da27 .ui-catalogue--offres .ui-offer-grid { gap: 16px; }
html.da27 .ui-offer-card { box-shadow: none; border: 1px solid var(--c-border); }
@media (max-width: 699.98px) {
    html.da27 .tc-liens .ui-suggestion, html.da27 .offres-explorer .ui-suggestion { font-size: .9375rem; padding: 12px 14px; }
    html.da27 .at section:not(.at-sec-chiffres) > .tb-liste > li, html.da27 .td-communes .tb-liste > li { padding: 12px 14px; }
}

/* grilles de cartes compactes en rangées pleines (2, 3 puis 4 par rangée ; reste réparti sur la dernière rangée) */
@media (max-width: 699.98px) {
    html.da27 .at section:not(.at-sec-chiffres) > .tb-liste { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
    html.da27 .at section:not(.at-sec-chiffres) > .tb-liste > li { grid-column: span 6; }
    html.da27 .at section:not(.at-sec-chiffres) > .tb-liste > li:last-child:nth-child(2n + 1) { grid-column: span 12; }
}
@media (min-width: 700px) and (max-width: 1099.98px) {
    html.da27 .at section:not(.at-sec-chiffres) > .tb-liste { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
    html.da27 .at section:not(.at-sec-chiffres) > .tb-liste > li { grid-column: span 4; }
    html.da27 .at section:not(.at-sec-chiffres) > .tb-liste > li:last-child:nth-child(3n + 1) { grid-column: span 12; }
    html.da27 .at section:not(.at-sec-chiffres) > .tb-liste > li:last-child:nth-child(3n + 2) { grid-column: span 6; }
    html.da27 .at section:not(.at-sec-chiffres) > .tb-liste > li:nth-last-child(2):nth-child(3n + 1) { grid-column: span 6; }
}
@media (min-width: 1100px) {
    html.da27 .at section:not(.at-sec-chiffres) > .tb-liste { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
    html.da27 .at section:not(.at-sec-chiffres) > .tb-liste > li { grid-column: span 3; }
    html.da27 .at section:not(.at-sec-chiffres) > .tb-liste > li:last-child:nth-child(4n + 1) { grid-column: span 12; }
    html.da27 .at section:not(.at-sec-chiffres) > .tb-liste > li:last-child:nth-child(4n + 2) { grid-column: span 6; }
    html.da27 .at section:not(.at-sec-chiffres) > .tb-liste > li:nth-last-child(2):nth-child(4n + 1) { grid-column: span 6; }
    html.da27 .at section:not(.at-sec-chiffres) > .tb-liste > li:last-child:nth-child(4n + 3) { grid-column: span 4; }
    html.da27 .at section:not(.at-sec-chiffres) > .tb-liste > li:nth-last-child(2):nth-child(4n + 2) { grid-column: span 4; }
    html.da27 .at section:not(.at-sec-chiffres) > .tb-liste > li:nth-last-child(3):nth-child(4n + 1) { grid-column: span 4; }
}
@media (max-width: 699.98px) {
    html.da27 .td-communes .tb-liste { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
    html.da27 .td-communes .tb-liste > li { grid-column: span 6; }
    html.da27 .td-communes .tb-liste > li:last-child:nth-child(2n + 1) { grid-column: span 12; }
}
@media (min-width: 700px) and (max-width: 1099.98px) {
    html.da27 .td-communes .tb-liste { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
    html.da27 .td-communes .tb-liste > li { grid-column: span 4; }
    html.da27 .td-communes .tb-liste > li:last-child:nth-child(3n + 1) { grid-column: span 12; }
    html.da27 .td-communes .tb-liste > li:last-child:nth-child(3n + 2) { grid-column: span 6; }
    html.da27 .td-communes .tb-liste > li:nth-last-child(2):nth-child(3n + 1) { grid-column: span 6; }
}
@media (min-width: 1100px) {
    html.da27 .td-communes .tb-liste { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
    html.da27 .td-communes .tb-liste > li { grid-column: span 3; }
    html.da27 .td-communes .tb-liste > li:last-child:nth-child(4n + 1) { grid-column: span 12; }
    html.da27 .td-communes .tb-liste > li:last-child:nth-child(4n + 2) { grid-column: span 6; }
    html.da27 .td-communes .tb-liste > li:nth-last-child(2):nth-child(4n + 1) { grid-column: span 6; }
    html.da27 .td-communes .tb-liste > li:last-child:nth-child(4n + 3) { grid-column: span 4; }
    html.da27 .td-communes .tb-liste > li:nth-last-child(2):nth-child(4n + 2) { grid-column: span 4; }
    html.da27 .td-communes .tb-liste > li:nth-last-child(3):nth-child(4n + 1) { grid-column: span 4; }
}
@media (max-width: 699.98px) {
    html.da27 .tc-liens .ui-empty__list { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
    html.da27 .tc-liens .ui-empty__list > li { grid-column: span 6; }
    html.da27 .tc-liens .ui-empty__list > li:last-child:nth-child(2n + 1) { grid-column: span 12; }
}
@media (min-width: 700px) and (max-width: 1099.98px) {
    html.da27 .tc-liens .ui-empty__list { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
    html.da27 .tc-liens .ui-empty__list > li { grid-column: span 4; }
    html.da27 .tc-liens .ui-empty__list > li:last-child:nth-child(3n + 1) { grid-column: span 12; }
    html.da27 .tc-liens .ui-empty__list > li:last-child:nth-child(3n + 2) { grid-column: span 6; }
    html.da27 .tc-liens .ui-empty__list > li:nth-last-child(2):nth-child(3n + 1) { grid-column: span 6; }
}
@media (min-width: 1100px) {
    html.da27 .tc-liens .ui-empty__list { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
    html.da27 .tc-liens .ui-empty__list > li { grid-column: span 3; }
    html.da27 .tc-liens .ui-empty__list > li:last-child:nth-child(4n + 1) { grid-column: span 12; }
    html.da27 .tc-liens .ui-empty__list > li:last-child:nth-child(4n + 2) { grid-column: span 6; }
    html.da27 .tc-liens .ui-empty__list > li:nth-last-child(2):nth-child(4n + 1) { grid-column: span 6; }
    html.da27 .tc-liens .ui-empty__list > li:last-child:nth-child(4n + 3) { grid-column: span 4; }
    html.da27 .tc-liens .ui-empty__list > li:nth-last-child(2):nth-child(4n + 2) { grid-column: span 4; }
    html.da27 .tc-liens .ui-empty__list > li:nth-last-child(3):nth-child(4n + 1) { grid-column: span 4; }
}
@media (max-width: 699.98px) {
    html.da27 .offres-explorer .ui-empty__list { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
    html.da27 .offres-explorer .ui-empty__list > li { grid-column: span 6; }
    html.da27 .offres-explorer .ui-empty__list > li:last-child:nth-child(2n + 1) { grid-column: span 12; }
}
@media (min-width: 700px) and (max-width: 1099.98px) {
    html.da27 .offres-explorer .ui-empty__list { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
    html.da27 .offres-explorer .ui-empty__list > li { grid-column: span 4; }
    html.da27 .offres-explorer .ui-empty__list > li:last-child:nth-child(3n + 1) { grid-column: span 12; }
    html.da27 .offres-explorer .ui-empty__list > li:last-child:nth-child(3n + 2) { grid-column: span 6; }
    html.da27 .offres-explorer .ui-empty__list > li:nth-last-child(2):nth-child(3n + 1) { grid-column: span 6; }
}
@media (min-width: 1100px) {
    html.da27 .offres-explorer .ui-empty__list { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
    html.da27 .offres-explorer .ui-empty__list > li { grid-column: span 3; }
    html.da27 .offres-explorer .ui-empty__list > li:last-child:nth-child(4n + 1) { grid-column: span 12; }
    html.da27 .offres-explorer .ui-empty__list > li:last-child:nth-child(4n + 2) { grid-column: span 6; }
    html.da27 .offres-explorer .ui-empty__list > li:nth-last-child(2):nth-child(4n + 1) { grid-column: span 6; }
    html.da27 .offres-explorer .ui-empty__list > li:last-child:nth-child(4n + 3) { grid-column: span 4; }
    html.da27 .offres-explorer .ui-empty__list > li:nth-last-child(2):nth-child(4n + 2) { grid-column: span 4; }
    html.da27 .offres-explorer .ui-empty__list > li:nth-last-child(3):nth-child(4n + 1) { grid-column: span 4; }
}

/* reste de 1 : jamais de case seule ; 4 colonnes → dernière rangée de 5 en 3 + 2, 3 colonnes → 4 en 2 + 2 */
@media (min-width: 700px) and (max-width: 1099.98px) {
    html.da27 .tc-liens .ui-empty__list > li:nth-last-child(4):nth-child(3n + 1), html.da27 .tc-liens .ui-empty__list > li:nth-last-child(4):nth-child(3n + 1) ~ li { grid-column: span 6; }
    html.da27 .offres-explorer .ui-empty__list > li:nth-last-child(4):nth-child(3n + 1), html.da27 .offres-explorer .ui-empty__list > li:nth-last-child(4):nth-child(3n + 1) ~ li { grid-column: span 6; }
    html.da27 .at section:not(.at-sec-chiffres) > .tb-liste > li:nth-last-child(4):nth-child(3n + 1), html.da27 .at section:not(.at-sec-chiffres) > .tb-liste > li:nth-last-child(4):nth-child(3n + 1) ~ li { grid-column: span 6; }
    html.da27 .td-communes .tb-liste > li:nth-last-child(4):nth-child(3n + 1), html.da27 .td-communes .tb-liste > li:nth-last-child(4):nth-child(3n + 1) ~ li { grid-column: span 6; }
}
@media (min-width: 1100px) {
    html.da27 .tc-liens .ui-empty__list > li:nth-last-child(5):nth-child(4n + 1), html.da27 .tc-liens .ui-empty__list > li:nth-last-child(5):nth-child(4n + 1) ~ li { grid-column: span 4; }
    html.da27 .tc-liens .ui-empty__list > li:nth-last-child(5):nth-child(4n + 1) ~ li:nth-last-child(-n + 2) { grid-column: span 6; }
    html.da27 .offres-explorer .ui-empty__list > li:nth-last-child(5):nth-child(4n + 1), html.da27 .offres-explorer .ui-empty__list > li:nth-last-child(5):nth-child(4n + 1) ~ li { grid-column: span 4; }
    html.da27 .offres-explorer .ui-empty__list > li:nth-last-child(5):nth-child(4n + 1) ~ li:nth-last-child(-n + 2) { grid-column: span 6; }
    html.da27 .at section:not(.at-sec-chiffres) > .tb-liste > li:nth-last-child(5):nth-child(4n + 1), html.da27 .at section:not(.at-sec-chiffres) > .tb-liste > li:nth-last-child(5):nth-child(4n + 1) ~ li { grid-column: span 4; }
    html.da27 .at section:not(.at-sec-chiffres) > .tb-liste > li:nth-last-child(5):nth-child(4n + 1) ~ li:nth-last-child(-n + 2) { grid-column: span 6; }
    html.da27 .td-communes .tb-liste > li:nth-last-child(5):nth-child(4n + 1), html.da27 .td-communes .tb-liste > li:nth-last-child(5):nth-child(4n + 1) ~ li { grid-column: span 4; }
    html.da27 .td-communes .tb-liste > li:nth-last-child(5):nth-child(4n + 1) ~ li:nth-last-child(-n + 2) { grid-column: span 6; }
}
