/* ==========================================================================
   Correctifs responsive + accessibilité (RGAA 4.1.2) – Mairie de La Palme
   Ajouté le 14/11/2026. Fichier autonome : pour annuler, retirer son
   enqueue dans functions.php (bloc "A11Y FIXES").
   Règle de largeur des rows : 92 % mobile/tablette (<= 980px), 80 % desktop.
   ========================================================================== */

/* ---------- 1. Focus visible (RGAA 10.7) ---------- */
/* Divi met outline:0 sur :focus. On rétablit un contour clavier uniquement. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible,
.et_pb_button:focus-visible,
.fc-button:focus-visible,
.owl-prev:focus-visible,
.owl-next:focus-visible,
.owl-dot:focus-visible {
    outline: 3px solid #1d3f73 !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 5px #ffffff !important;
}

/* ---------- 2. Contrastes (RGAA 3.2) ---------- */
/* Numéros d'urgence du footer : #4EBDC3 sur #E9F2F6 = 1,96:1 -> 5,06:1 */
body .et-l--footer .et_pb_module.et_pb_blurb .et_pb_blurb_description a[href^="tel"] {
    color: #137177 !important;
}
/* Méta des articles (date, catégories) : 2,23:1 -> 5,74:1 */
body .post-meta,
body .post-meta a,
body .post-meta .published,
body #page-container .et_pb_module .et_pb_post .post-meta,
body #page-container .et_pb_module .et_pb_post .post-meta a {
    color: #137177 !important;
}
/* Tableau "Visiter La Palme" : #45B8C6 sur #FBF9F7 = 2,24:1 -> 5,47:1 */
body.page-id-285379 .et_pb_text_inner td b,
body.page-id-285379 .et_pb_text_inner td strong {
    color: #137177 !important;
}
/* Agenda : jours hors mois #D1D1D1 = 1,52:1 -> 4,54:1 */
.fc-day-top.fc-other-month {
    opacity: 1 !important;
}
.fc-other-month .fc-day-number {
    color: #767676 !important;
}

/* ---------- 3. Liens dans le texte (RGAA 10.6) ---------- */
/* Seuls les liens pris dans une phrase sont soulignés en permanence
   (classe ajoutée par a11y-fixes.js quand le lien n'est pas seul dans son
   paragraphe). Les liens isolés (cartes, listes, footer, coordonnées) ne
   sont soulignés qu'au survol et au focus. */
body #page-container a.a11y-inline-link {
    text-decoration: underline !important;
    text-underline-offset: 2px;
}
.et_pb_text_inner a:not(.et_pb_button):hover,
.et_pb_text_inner a:not(.et_pb_button):focus-visible,
.et_pb_blurb_description a:hover,
.et_pb_blurb_description a:focus-visible,
.al-card a:hover,
.al-card a:focus-visible {
    text-decoration: underline !important;
}

/* ---------- 4. Largeur des rows ---------- */

/* 4a. Pages : rows à 80 % (ou 98 %) sur mobile/tablette -> 92 % */
@media (max-width: 980px) {
    body.page-id-221 .et-l--post .et_pb_row_0,            /* Accueil */
    body.page-id-221 .et-l--post .et_pb_row_1,
    body.page-id-283817 .et-l--post .et_pb_row_0,         /* Mot du Maire */
    body.page-id-282560 .et-l--post .et_pb_row_1,         /* Bulletins municipaux */
    body.page-id-285379 .et-l--post .et_pb_row:not(.et_pb_row_inner), /* Visiter La Palme */
    body.page-id-283633 .et-l--post .et_pb_row:not(.et_pb_row_inner), /* Histoire */
    body.page-id-285093 .et-l--post .et_pb_row_1,         /* Guide des associations */
    body.page-id-284014 .et-l--post .et_pb_row:not(.et_pb_row_inner), /* PLU */
    body.page-id-284078 .et-l--post .et_pb_row_0,         /* Démarches professionnels */
    body.page-id-283338 .et-l--post .et_pb_row_0,         /* Démarches associations */
    body.page-id-282587 .et-l--post .et_pb_row_1 {        /* Agenda */
        width: 92% !important;
        max-width: 92% !important;
    }
}

/* 4b. Pages : rows à 100 % partout -> 92 % / 80 % */
body.page-id-284110 .et-l--post .et_pb_row:not(.et_pb_row_inner),  /* Assistantes maternelles */
body.page-id-283688 .et-l--post .et_pb_row:not(.et_pb_row_inner) { /* Numéros utiles */
    width: 80% !important;
    max-width: 1500px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}
@media (max-width: 980px) {
    body.page-id-284110 .et-l--post .et_pb_row:not(.et_pb_row_inner),
    body.page-id-283688 .et-l--post .et_pb_row:not(.et_pb_row_inner) {
        width: 92% !important;
        max-width: 92% !important;
    }
}

/* 4c. Footer (gabarit Theme Builder) */
@media (max-width: 980px) {
    .et-l--footer .et_pb_row_0_tb_footer,
    .et-l--footer .et_pb_row_2_tb_footer,
    .et-l--footer .et_pb_row_3_tb_footer {
        width: 92% !important;
        max-width: 92% !important;
    }
}
@media (min-width: 981px) {
    .et-l--footer .et_pb_row_3_tb_footer {
        width: 80% !important;
        max-width: 1500px !important;
    }
}

/* 4d. Archives (actualités, catégories) */
@media (max-width: 980px) {
    body.archive .et-l--body .et_pb_row_1_tb_body,
    body.archive .et-l--body .et_pb_row_2_tb_body,
    body.blog .et-l--body .et_pb_row_1_tb_body,   /* page Actualités (page des articles) */
    body.blog .et-l--body .et_pb_row_2_tb_body {
        width: 92% !important;
        max-width: 92% !important;
    }
}

/* 4e. Articles : row_0 (fil d'Ariane) et row_2 (contenu). row_1 (titre) en attente de validation. */
@media (max-width: 980px) {
    body.single-post .et-l--body .et_pb_row_0_tb_body,
    body.single-post .et-l--body .et_pb_row_2_tb_body {
        width: 92% !important;
        max-width: 92% !important;
    }
}

/* 4e bis. Bandeau titre des pages (580px) et titre des articles (880px) -> 92 % / 80 %
   (validé par Khalid le 14/11 ; le Hero de l'accueil n'est pas concerné) */
body:not(.home) .et-l--body .et_pb_section_0_tb_body > .et_pb_row:not(.et_pb_row_inner) {
    width: 80% !important;
    max-width: 1500px !important;
}
@media (max-width: 980px) {
    body:not(.home) .et-l--body .et_pb_section_0_tb_body > .et_pb_row:not(.et_pb_row_inner) {
        width: 92% !important;
        max-width: 92% !important;
    }
}

/* Le filet jaune sous le titre garde sa largeur d'origine (290px) */
body:not(.home) .et-l--body .et_pb_section_0_tb_body .et_pb_divider {
    max-width: 290px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* 4e ter. Barre de copyright du footer : la bande reste pleine largeur,
   son contenu est aligné sur les rows (80 % desktop / 92 % mobile). */
body #page-container .et-l--footer .et_pb_row.et_pb_row_4_tb_footer {
    padding-left: max(10%, calc((100% - 1500px) / 2)) !important;
    padding-right: max(10%, calc((100% - 1500px) / 2)) !important;
}
@media (max-width: 980px) {
    body #page-container .et-l--footer .et_pb_row.et_pb_row_4_tb_footer {
        padding-left: 4% !important;
        padding-right: 4% !important;
    }
}

/* 4f. Fiches associations / entreprises (gabarit sans Theme Builder) */
@media (max-width: 980px) {
    body.single-associations .container,
    body.single-entreprises .container {
        width: 92% !important;
        max-width: 92% !important;
    }
}

/* 4g. Liste des événements (The Events Calendar) */
body.post-type-archive-tribe_events .tribe-common-l-container {
    width: 80%;
    max-width: 1500px;
    padding-left: 0 !important;
    padding-right: 0 !important;
    box-sizing: border-box;
}
@media (max-width: 980px) {
    body.post-type-archive-tribe_events .tribe-common-l-container {
        width: 92%;
    }
}

/* ---------- 5. Débordements horizontaux ---------- */
/* Tableaux de contenu : défilement dans leur conteneur (wrapper ajouté en JS) */
.a11y-table-scroll {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.a11y-table-scroll > table {
    min-width: 100%;
}
/* Carrousel d'articles de l'accueil (+5 px) et liste événements (+2 px) */
.df-posts-wrap {
    max-width: 100%;
}
#page-container {
    overflow-x: clip;
}

/* ---------- 6. Dock mobile du menu ---------- */
/* Le dock fixe masquait le bas de page et le bouton "remonter". */
@media (max-width: 980px) {
    body.has-lpm-dock {
        padding-bottom: 76px;
    }
    body.has-lpm-dock .et_pb_scroll_top {
        bottom: 88px !important;
    }
}

/* ---------- 7. Texte réservé aux lecteurs d'écran ---------- */
.a11y-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ---------- 8. Fiches associations / entreprises (single-*.php) ---------- */
.lp-acteur__wrap {
    width: 80%;
    max-width: 1500px;
    margin: 0 auto;
}
.lp-acteur__head {
    background: #24445c;
    color: #ffffff;
    padding: 150px 0 48px;
    text-align: center;
}
.lp-acteur__crumbs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    background: #fec424;
    color: #24445c;
    font-size: 14px;
    padding: 4px 12px;
    border-radius: 4px;
    margin-bottom: 20px;
}
.lp-acteur__crumbs a {
    color: #24445c;
}
.lp-acteur__crumbs a:hover,
.lp-acteur__crumbs a:focus-visible {
    text-decoration: underline;
}
.lp-acteur .lp-acteur__title {
    font-family: 'Montserrat', Helvetica, Arial, sans-serif;
    font-weight: 700;
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.15;
    text-transform: uppercase;
    color: #ffffff;
    padding: 0;
    margin: 0;
}
.lp-acteur__title::after {
    content: "";
    display: block;
    width: 120px;
    height: 4px;
    background: #fec424;
    margin: 18px auto 0;
}
.lp-acteur__activity,
.lp-acteur__tags {
    margin: 14px 0 0;
    padding: 0;
    color: #ffffff;
    font-weight: 600;
}
.lp-acteur__tags {
    font-weight: 400;
    color: #e9f2f6;
}
.lp-acteur__body {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 48px;
    padding: 56px 0 24px;
    align-items: start;
}
.lp-acteur__body--solo {
    grid-template-columns: minmax(0, 560px);
    justify-content: center;
}
.lp-acteur__media img {
    display: block;
    max-width: 220px;
    height: auto;
    border-radius: 8px;
    margin-bottom: 24px;
}
.lp-acteur__desc {
    color: #444;
    font-size: 16px;
    line-height: 1.7;
}
.lp-acteur__infos {
    background: #e9f2f6;
    border-radius: 8px;
    padding: 24px 28px;
}
.lp-acteur__infos h2 {
    font-family: 'Montserrat', Helvetica, Arial, sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #24445c;
    padding: 0 0 12px;
    margin: 0 0 12px;
    border-bottom: 3px solid #fec424;
}
.lp-acteur__infos dl {
    margin: 0;
}
.lp-acteur__infos dt {
    font-weight: 700;
    color: #24445c;
    margin-top: 14px;
}
.lp-acteur__infos dd {
    margin: 2px 0 0;
    color: #333;
    overflow-wrap: anywhere;
}
.lp-acteur__infos a {
    color: #137177;
}
.lp-acteur__infos a:hover,
.lp-acteur__infos a:focus-visible {
    text-decoration: underline;
}
.lp-acteur__foot {
    padding: 8px 0 64px;
}
.lp-acteur__body--solo + .lp-acteur__foot {
    text-align: center;
}
.lp-acteur__back {
    display: inline-block;
    border: 2px solid #24445c;
    color: #24445c;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 6px;
}
.lp-acteur__back:hover {
    background: #24445c;
    color: #ffffff;
}
@media (max-width: 980px) {
    .lp-acteur__wrap {
        width: 92%;
    }
    .lp-acteur__head {
        padding: 110px 0 36px;
    }
    .lp-acteur__body,
    .lp-acteur__body--solo {
        grid-template-columns: 1fr;
        gap: 28px;
        padding-top: 36px;
    }
}

/* ---------- 9. Ajouts audit Ara (15/11/2026) ---------- */
/* RGAA 3.3 : bordure des champs de formulaire à 3:1 minimum */
body .wpforms-container .wpforms-form input[type="text"],
body .wpforms-container .wpforms-form input[type="email"],
body .wpforms-container .wpforms-form input[type="tel"],
body .wpforms-container .wpforms-form input[type="url"],
body .wpforms-container .wpforms-form input[type="number"],
body .wpforms-container .wpforms-form select,
body .wpforms-container .wpforms-form textarea {
    border-color: #767676 !important;
}
body .wpforms-container .wpforms-form input[type="checkbox"],
body .wpforms-container .wpforms-form input[type="radio"] {
    accent-color: #24445c;
}
/* RGAA 11.10 : mention des champs obligatoires */
.lp-req-note {
    font-size: 14px;
    color: #444;
    margin: 0 0 16px;
    padding: 0;
}
