/*
Theme Name: Twentytwentyfive Child
Author: Christelle Stasse
Description: Thème enfant du site
Version: 1.0
Text Domain: twentytwentyfive-child
Template: twentytwentyfive
*/

/* menu hamburger sur tablette */
/** default is 600px pass to 1024px for button burger and container */
@media (max-width: 1035px) {
/* On affiche le hamburger sur tablette, SAUF si le menu est déjà ouvert */
  :not(.has-modal-open) .wp-block-navigation__responsive-container-open:not(.always-shown) {
    display: flex;
  }
}

@media (max-width: 1035px) {
.wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
    bottom: 0;
    display: none;
    left: 0;
    position: fixed;
    right: 0;
    top: 0;
  }
}

/* 1. Marge à gauche du bouton UNIQUEMENT sur PC (> 1035px) */
@media (min-width: 1036px) {
  /* On vise tous les conteneurs possibles créés par Gutenberg pour ce bouton */
  .wp-block-navigation .wp-block-navigation__container .btn-header,
  .wp-block-navigation .wp-block-navigation__container .wp-block-navigation-item.btn-header,
  .wp-block-navigation .wp-block-buttons.btn-header {
    margin-left: 2.5rem !important; /* Ajuste selon l'écart voulu (ex: 30px, 2.5rem) */
  }
}

/* 2. Remise à zéro et centrage dans le superposition mobile/tablette (≤ 1035px) */
@media (max-width: 1035px) {
  .wp-block-navigation__responsive-container .btn-header,
  .wp-block-navigation__responsive-container .btn-header .wp-block-button,
  .wp-block-navigation__responsive-container .btn-header .wp-block-button__link {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}

/* Correction du rognage du logo texte arrondi dans le tiroir mobile */
@media (max-width: 1035px) {
  /* 1. Laisse respirer le bloc du logo */
  .wp-block-site-logo,
  .wp-block-site-logo a,
  .wp-block-site-logo img {
    overflow: visible !important;
    padding-top: 8px !important; /* Laisse de la place pour la courbe supérieure du texte */
    box-sizing: content-box !important;
  }

  /* 2. Empêche la zone de titre/header de la modale de rogner les éléments */
  .wp-block-navigation__responsive-container-header {
    overflow: visible !important;
    min-height: auto !important;
    padding-top: 10px !important;
  }
}

/* Annule la marge supérieure native du Pied de page */

footer, 

.wp-block-template-part[data-type="footer"] {

    margin-block-start: 0 !important;

}

/*==============================================================================
  ACCESSIBILITÉ & HARMONISATION DU FOCUS (Twenty Twenty-Five)
==============================================================================*/

/* 1. DÉSACTIVATION DU FOCUS AU CLIC (SOURIS / TACTILE)
------------------------------------------------------------------------------*/
:root a:focus:not(:focus-visible),
:root button:focus:not(:focus-visible),
:root input:focus:not(:focus-visible),
:root textarea:focus:not(:focus-visible),
:root select:focus:not(:focus-visible) {
    outline: none !important;
    box-shadow: none !important;
}

/* 2. NEUTRALISATION STRICTE DE L'OMBRE / CONTOUR NATIVE DE TT25
------------------------------------------------------------------------------*/
:root *:focus-visible {
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
}

/* 3. FOCUS HACHURÉ ORANGE (#D68829) PAR DÉFAUT SUR LE SITE
------------------------------------------------------------------------------*/
:root *:focus-visible:not(.wp-block-button__link):not(.wp-element-button):not([type="submit"]):not(.ff-btn-submit):not(a) {
    outline: 2px dashed #D68829 !important;
    outline-offset: 4px !important;
}

/* 4. TROP FORT : FOCUS STRICTEMENT BLANC SUR TOUTES LES BALISES <a> (LIENS TEXTES)
   (Garantit la visibilité sur fond noir Header/Footer ET sur les groupes orange)
------------------------------------------------------------------------------*/
html body :is(a, .wp-block-social-link-anchor):focus-visible {
    outline-width: 2px !important;
    outline-style: dashed !important;
    outline-color: #ffffff !important;
    outline-offset: 4px !important;
    box-shadow: none !important;
}

/* 5. FOCUS HACHURÉ BLANC DANS HEADER ET FOOTER (POUR LES AUTRES ÉLÉMENTS)
------------------------------------------------------------------------------*/
:root header *:focus-visible,
:root footer *:focus-visible {
    outline: 2px dashed #ffffff !important;
    outline-offset: 4px !important;
}

/* 6. BOUTONS (Conserve la structure + Focus Blanc)
------------------------------------------------------------------------------*/
:root .wp-block-button__link,
:root .wp-element-button {
    padding-top: 0.6rem;
    padding-right: 2rem;
    padding-bottom: 0.4rem;
    padding-left: 2rem;
}

:root .wp-block-button__link:focus-visible,
:root .wp-element-button:focus-visible {
    outline: 2px dashed #ffffff !important;
    outline-offset: 4px !important;
    box-shadow: none !important;
}

/* 7. Focus visible sur les boutons à fond clair / bordure noire
------------------------------------------------------------------------------*/
:root .wp-block-button__link:focus-visible,
:root .wp-element-button:focus-visible {
    outline: 3px dashed #D68829 !important; /* Contour haché orange bien visible */
    outline-offset: 4px !important; /* Décalage pour séparer le focus de la bordure noire */
    box-shadow: none !important;
}

/* 8. LIEN D'ÉVITEMENT (SKIP LINK "ALLER AU CONTENU")
------------------------------------------------------------------------------*/
.skip-link.screen-reader-text:focus,
a.skip-link:focus,
:root .skip-link:focus-visible {
    position: fixed !important;
    top: 10px !important;
    left: 10px !important;
    z-index: 999999 !important;
    width: auto !important;
    height: auto !important;
    clip: auto !important;
    clip-path: none !important;
    opacity: 1 !important;
    background-color: #000000 !important;
    color: #ffffff !important;
    padding: 0.8rem 1.5rem !important;
    border-radius: 4px !important;
    border: 2px solid #D68829 !important;
    font-weight: bold !important;
    text-decoration: underline !important;
    outline: 2px dashed #D68829 !important;
    outline-offset: 4px !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5) !important;
}

/* Focus clavier sur l'icône de retour en haut */
#to_top_scrollup:focus-visible {
    display: inline-block !important;
    outline: 2px dashed #ffffff !important;
    outline-offset: 4px !important;
    opacity: 1 !important;
    box-shadow: none !important;
}

/*==============================================================================
  BOUTON FLUENT FORMS (#D68929) - ACCESSIBILITÉ & CHARTE
==============================================================================*/

/* 1. APPARENCE PAR DÉFAUT DU BOUTON FLUENT FORMS */
.fluentform .ff-btn-submit {
    background-color: #D68929 !important;
    border-color: #D68929 !important;
    color: #ffffff !important;
}

/* 2. CONTOUR HACHURÉ AU FOCUS CLAVIER (Tab) */
.fluentform .ff-btn-submit:focus-visible,
.fluentform button[type="submit"]:focus-visible {
    outline: 2px dashed #D68929 !important; /* Ou #000000 / #ffffff selon la lisibilité désirée */
    outline-offset: 4px !important;
    box-shadow: none !important;
}

/* 3. MAINTIENT DU ORANGE (#D68929) LORS DE L'ENVOI OU DU CLIC (CORRIGE LE BLEU NATIF) */
.fluentform .ff-btn-submit.ff-working,
.fluentform .ff-btn-submit:disabled,
.fluentform .ff-btn-submit:active {
    background-color: #D68929 !important;
    border-color: #D68929 !important;
    color: #ffffff !important;
    opacity: 0.8; /* Légère transparence pour indiquer le chargement sans passer au bleu */
}

/*==============================================================================
  FOCUS CLAVIER - LIEN RGPD / POLITIQUE DE CONFIDENTIALITÉ (FLUENT FORMS)
==============================================================================*/

/* Focus sur le lien dans la case à cocher RGPD de Fluent Forms */
.fluentform .ff-el-form-check-label a:focus-visible,
.fluentform .ff-checkbox-label a:focus-visible {
    outline: 2px dashed #000000 !important; /* Contour haché noir très lisible sur fond blanc */
    outline-offset: 3px !important;
    box-shadow: none !important;
}