/* -------------
    SOMMAIRE
------------- */

/*
    @AUTHOR : Nicolas BOUDOT

    FORM
    Stylisation des formulaires
*/

/*
  00 - GÉNÉRAL
        Gravity Form
        Gravity Form - Erreurs
        Search & Filter
  01 - RECHERCHE (Widget - Header)
*/



/* -----------------
  00 - GÉNÉRAL
----------------- */

label,
select,
textarea,
input {
    font-family: var(--font-primary);
}

label {
    display: block;
    margin-bottom: 5px;
}

select,
textarea,
input {
    background-color: var(--gray-200);
    border: 1px solid #BABABA;
    outline: none;
    padding: 12px;
    width: 100%;
}

    /* Focus */
    select:focus,
    textarea:focus,
    input:focus {
        border: 1px solid var(--color-primary);
    }

    /* Disabled */
    select:disabled,
    textarea:disabled,
    input:disabled {
        border: 1px solid var(--color-primary);
    }

/* Enlève l'icône flèche par défaut d'un select */
select {
    -moz-appearance: none;
    -webkit-appearance: none;
        appearance: none;
	background-image: url('/wp-content/themes/frennly/img/charte/arrow.svg');
	background-position: center right 22px;
	background-size: auto 11px;
    background-repeat: no-repeat;
}

    /* Bouton dropdown du select */
    select::-ms-expand {
        display: none;
    }

select option {
    padding: 10px;
}

/* Checkbox et Radios */
input[type="radio"],
input[type="checkbox"] {
    margin: 2px 6px 0 0;
    width: auto;
}

/* -----------------
  00 - GÉNÉRAL
        Gravity Form
----------------- */

.gform_title {
    text-align: center;
}

/* Label masqué depuis le BO */
.hidden_label .gfield_label {
    display: none;
}

/* "*" indique les champs nécessaires */
.gform_required_legend {
    display: none;
}

.gfield_required {
    margin-left: 5px;
}

/* @changelog 2024-01-29 [EVOL] (Nicolas) Marge entre les lignes du formulaire */
.gform_fields > * {
    margin-bottom: 15px;
}

/* Input */
div.gfmc-field div:not(.gchoice) {
    padding-bottom: 0;
}

/* Select */
.gchoice {
    display: flex;
    align-items: flex-start;
}

/* Dépot de fichier */
input[type="file"] {
    border: none;
    padding: 0;
}

/* Dépot de fichiers */
.gform_drop_area {
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px dashed var(--green-gray);
    margin-bottom: 6px;
    padding: 26px 0;
}

.gform_drop_instructions {
    margin-bottom: 10px;
}

.gfield_description,
.gform_fileupload_rules {
    display: block;
    color: var(--color-secondary);
    font-size: 1.4rem;
    width: 100%;
    margin-top: 6px;
}

    .gform_fileupload_multifile + .gform_fileupload_rules {
        text-align: center;
    }

/* Nom du fichier joint */
.ginput_preview_list {
    order: 3;
}

.ginput_preview_list .ginput_preview {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 10px;
}

.ginput_preview_list .ginput_preview > span:not(:first-child) {
    margin-left: 5px;
}

/* Poids */
.gfield_fileupload_filesize {
    margin-right: 5px;
}

    .gfield_fileupload_filesize::before {
        content: "- ";
    }

/* Pourcentage */
.gfield_fileupload_progress {
    display: none;
}

/* HTML */
.gfield--type-html {
    color: var(--color-secondary);
    font-size: 1.2rem;
    margin-bottom: 8px;
}

/* RGPD */
.gfield--type-consent {
    margin-bottom: 8px;
}

.gfield--type-consent .ginput_container_consent {
    display: flex;
    align-items: flex-start;
}

.gfield--type-consent .ginput_container_consent input {
    margin-top: 1px;
}

.gfield--type-consent .ginput_container_consent label {
    color: var(--color-secondary);
    font-size: 1.4rem;
    margin-bottom: 0;
}

/* Bouton d'envoi */
.gform_button {
    background-color: var(--color-primary);
    color: var(--white);
    width: auto;
}

    .gform_button:hover {
        background-color: var(--color-quaternary);
        color: var(--white);
        border-color: transparent;
    }

.gfield::before{
    display: none;
}


/* -----------------------------
  00 - GÉNÉRAL
        Gravity Form - Erreurs
----------------------------- */

.gform_submission_error {
    color: var(--red);
    text-align: center;
    margin-bottom: 15px;
}

.gfield_error {
    display: flex;
    flex-wrap: wrap;
}

.gfield_error > label {
    order: 1;
}

.gfield_validation_message:not(:empty) {
    display: inline-block;
    order: 2;
    padding: 2px 12px;
    background-color: var(--red);
    color: var(--white);
    margin-left: auto;
}

.gfield_error > .ginput_container {
    order: 3;
    width: 100%;
}



/* -------------------------
  00 - GÉNÉRAL
        Search & Filter
------------------------- */

.searchandfilter ul {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

    @media (min-width: 992px) {
        .searchandfilter ul {
            flex-direction: row;
            align-items: center;
        }
    }

.searchandfilter ul li {
    padding: 0;
    width: calc(100% / (12 / 6) - 5px);
}

    @media (min-width: 992px) {
        .searchandfilter ul li {
            width: calc(100% / (12 / 3) - 10px);
        }
    }

    /* Before */
    .searchandfilter ul li::before {
        content: none;
    }

    /* Surcharge des frères de li */
    .searchandfilter ul li + li {
        margin-top: 0;
    }

.searchandfilter ul li label {
    width: 100%;
}

/* Select */
[data-sf-field-input-type*="select"] > label::before {
    content: "\e91b";
    pointer-events: none;
    position: absolute;
    right: 13px;
    top: 50%;
    color: var(--color-tertiary);
    font-family: 'icomoon';
    font-size: 1rem;
    transform: translateY(-50%);
}

.sf-input-select {
    background-image: none;
    color: var(--color-tertiary);
    font-weight: 700;
    border: 1px solid var(--color-quaternary);
    border-radius: 4px;
    outline: none;
    padding: 10px 14px;
    width: 100%;
}



/* ---------------------------------
  01 - RECHERCHE (Widget - Header)
--------------------------------- */

.search-form {
    position: relative;
}

.search-field {
    border: none;
    font-size: 1.4rem;
    font-weight: 400;
    line-height: 1.5;
    padding: 10px 14px;
    width: 420px;
    max-height: 40px;
}

.search-submit {
    cursor: pointer;
    position: absolute;
    top: 50%;
    right: 4px;
    background-color: var(--color-quaternary);
    color: var(--white);
    border: none;
    font-size: 1.7rem;
    line-height: 1;
    padding: 8px;
    transform: translateY(-50%);
}
