/*
Theme Name: FABwp Starter Theme
Author: Fabien Planet
Description: Starter thème pour le Full Site Editing
Requires at least: 6.5
Tested up to: 6.5
Requires PHP: 7.0
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: fabwp
*/

/* ajouter la class hide-on-mobile sur un block pour le cacher sur version mobile */
@media screen and (max-width:991px){
    .hide-on-mobile {
        display: none !important;
    }
}
@media screen and (max-width:781px){
    .hide-on-mobile-wp {
        display: none;
    }
}
/* ajouter la class hide-on-desktop sur un block pour qu'il apparaisse que sur version mobile */
@media screen and (min-width:782px){
    .hide-on-desktop-wp {
        display: none;
    }
}
@media screen and (min-width:992px){
    .hide-on-desktop {
        display: none !important;
    }
}

.is-relative {
    position: relative;
}

html {
    scroll-behavior: smooth;
}
.no-click > a,
a.no-click {
    pointer-events: none;
}
.no-click > a:hover,
a.no-click:hover {
    text-decoration: none;
    opacity: 1;
}

.is-sticky {
    position: sticky !important;
    top: calc(91px + var(--wp-admin--admin-bar--height) + var(--wp--preset--spacing--s));
}

/* HEADER */
header:has(>.is-sticky) {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
}
:is(.admin-bar) header:has(>.is-sticky) {
    top: var(--wp-admin--admin-bar--height);
}
header:has(>.is-sticky) + main {
    margin-top: var(--wp--custom--header--height);
}
header,
header #header-block {
    transition: all 250ms ease-in-out;
    background-color: var(--wp--custom--color--false-white);
    box-shadow: 0 4px 18px 0px rgba(45,34,30,.2);
}
header .wp-block-site-logo img {
    transition: all 250ms ease-in-out;
}
@media screen and (min-width:992px){
    header.reduce .wp-block-site-logo img {
        width: 150px;
        height: auto;
    }
}
header nav.wp-block-navigation .wp-block-navigation__container.wp-block-navigation li + li::before,
header .fwp-menu-mobile nav.wp-block-navigation .wp-block-navigation__container.wp-block-navigation li::before {
    content: '';
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: calc(var(--wp--preset--spacing--s) / 2 * -1);
    right: auto;
    width: 2px;
    background-color: var(--wp--custom--color--brand-500);
}
@media screen and (max-width:991px){
    header .wp-block-site-logo img {
        width: 120px;
        height: auto;
    }
}

/* BODY */
body.freeze {
    overflow-y: hidden;
}

.is-border-right {
    position: relative;
}
.is-border-right::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(var(--wp--preset--spacing--xs) * -1);
    right: auto;
    width: 2px;
    background-color: var(--wp--custom--color--brand-500);
}

/* FOOTER */
footer .is-border-right::before {
    top: -24px;
    left: calc(var(--wp--preset--spacing--s) * -1);
}


/* Animation du block détail effet accordéon */
details {

    @media (prefers-reduced-motion: no-preference) {
        interpolate-size: allow-keywords;
    }

    &::details-content {
        box-sizing: border-box;
        opacity: 0;
        block-size: 0;
        overflow-y: clip; 
        transition: content-visibility 500ms allow-discrete,
                    opacity 500ms,
                    block-size 500ms;
    }

    &[open]::details-content {
        opacity: 1;
        block-size: auto;
        transition: content-visibility 500ms allow-discrete,
                    opacity 500ms,
                    block-size 500ms;
    }

}

.coca-bais-container {
    border-radius: var(--wp--custom--radius--image);
}

.reassurance-sous-menu {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}
.illustration-sous-menu {
    border-radius: var(--wp--custom--radius--m-fluid);
}
.sous-menu-titre {
    text-transform: uppercase;
}
.sous-menu-titre a {
    color: var(--wp--custom--color--false-white);
    text-decoration: none;
}
.sous-menu-titre a:hover {
    color: var(--wp--custom--color--brand-500);
    text-decoration: none;
}
.sous-menu-deco-titre {
    position: relative;
}
.sous-menu-deco-titre::after {
    content: '';
    position: absolute;
    top: auto;
    bottom: 6px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--wp--custom--color--brand-500);
}


/* Cible uniquement les écrans tactiles */
@media (pointer: coarse) {
  header>.wp-block-group nav[aria-label="Menu principal"] .fwp-mega-menu-nav a {
    pointer-events: none; /* Rend le lien incliquable */
    cursor: default;      /* Supprime le curseur de survol */
    color: inherit;       /* Optionnel : garde la couleur du texte normal */
    text-decoration: none;/* Optionnel : supprime le soulignement */
  }
}


/* FORM */
input:is([type="text"],[type="email"],[type="tel"]), textarea {
    width: 100%;
    min-height: 40px;
    border-radius: 6px;
    border: solid 1px var(--wp--custom--color--theme-300);
    padding: var(--wp--preset--spacing--xxs) var(--wp--preset--spacing--xs);
    box-sizing: border-box;
    font-size: var(--wp--preset--font-size--text);
    color: var(--wp--custom--color--false-black);
}
.wpcf7-form .nowrap {
    flex-wrap: nowrap;
    align-items: flex-start;
}
.wpcf7-form .margin-top-null p {
    margin-top: 0;
}
.wpcf7-form-control.wpcf7-checkbox {
    margin-block-start: var(--wp--preset--spacing--xxs);
    display: flex;
    flex-direction: column;
}
.wpcf7-form-control.wpcf7-acceptance {
    line-height: 1;
}
.wpcf7-form .wpcf7-not-valid {
    border-color: var(--wp--custom--color--error-500);
}
.wpcf7-form label:has(input.wpcf7-not-valid) {
    color: var(--wp--custom--color--error-500);
}