/* Optimisation responsive et utilisation de variables CSS */

/* Définition des variables pour la cohérence */
:root {
    --primary-color: #133f70;
    --primary-color-dark: #0f3260;
    --text-color-light: #fff;
    --border-radius: 0.26vw;
    --spacing-xs: 0.521vw;
    --spacing-s: 1vw;
    --spacing-m: 1.563vw;
    --spacing-l: 3.125vw;
    --font-size-xs: clamp(10px, 0.8vw, 12px);
    --font-size-s: clamp(14px, 1.2vw, 18px);
    --font-size-m: clamp(18px, 1.5vw, 24px);
    --font-size-l: clamp(24px, 3.5vw, 48px);
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Body */
body {
    background-image: url('../Medias/images/filigrane_marianne.webp');
    background-attachment: fixed;
    background-position: center;
    background-size: cover;
    font-family: Arial, sans-serif;
    color: var(--primary-color);
    height: 100vh;
    padding-top: 7vw;
    padding-bottom: var(--spacing-l);
}

.display_none {
    display: none
}

/* Bouton principal */
.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--text-color-light);
    padding: var(--spacing-s) calc(var(--spacing-s) * 2);
    text-decoration: none;
    border-radius: var(--border-radius);
    margin-top: var(--spacing-xs);
    transition: background 0.3s;
    font-size: var(--font-size-s);
    border: none;
    cursor: pointer;
}

.btn:hover {
    background-color: var(--primary-color-dark);
}

/* Formulaires contact */
.contact .container {
    padding: var(--spacing-m);
}

.contact form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.contact form input,
.contact form textarea,
.form-contact input,
.form-contact textarea {
    padding: var(--spacing-xs);
    width: 100%;
    border: 0.052vw solid #ccc;
    margin-bottom: var(--spacing-s);
    font-size: var(--font-size-s);
    border-radius: var(--border-radius);
    resize: vertical;
}

.form-contact button {
    width: 100%;
    padding: var(--spacing-xs);
    background-color: var(--primary-color);
    color: var(--text-color-light);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: var(--font-size-s);
    transition: background 0.3s;
}

.form-contact button:hover {
    background-color: var(--primary-color-dark);
}

/* Page content */
.page-content {
    /* padding: var(--spacing-l) 5%; */
    padding-bottom: 6vw; /* Ajouté pour éviter d'aller sous le footer */
}

.page-content h1 {
    font-size: var(--font-size-l);
    margin-bottom: var(--spacing-xs);
    color: var(--primary-color);
}

.white {
    color:white;
}

.page-content p,
.page-content ul {
    font-size: var(--font-size-s);
}

/* News */
.news article {
    margin-bottom: var(--spacing-m);
}

/* Responsive breakpoints */
@media (max-width: 1024px) {
    .page-content {
        padding: var(--spacing-m) 3%;
    }

    .btn {
        font-size: 1em;
        padding: 2vw 4vw;
    }
}

@media (max-width: 768px) {
    .page-content {
        padding: var(--spacing-m) 2vw;
    }

    .btn {
        font-size: 1em;
        padding: 3vw 6vw;
    }

    .contact .container {
        padding: var(--spacing-s);
    }
}

@media (max-width: 480px) {
    .page-content {
        padding: var(--spacing-s) 2vw;
    }

    .btn {
        font-size: 1em;
        padding: 4vw 8vw;
    }

    .contact form input,
    .contact form textarea,
    .form-contact input,
    .form-contact textarea {
        font-size: 1em;
        padding: 2vw;
    }
}


.texte-limite {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    /* limite à 3 lignes */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 4.5em;
    /* approximativement 3 lignes à 1.5em par ligne */
    line-height: 1.5em;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 1.45vw;
    border-radius: 0.48vw;
    width: 20vw;
    max-width: 90%;
}

input,
textarea {
    width: 100%;
    margin-bottom: 0.48vw;
    padding: 0.98vw;
    box-sizing: border-box;
}

.news-item button {
    margin-top: 0.48vw;
    background: red;
    color: white;
    border: none;
    padding: 0.25vw 0.48vw;
    cursor: pointer;
    border-radius: 0.25vw;
}

/* HEADER */
header {
    background-color: var(--primary-color);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 7vw;
    width: 100%;
    display: flex;
}

.header-left,
.header-right {
    width: 50%;
    position: relative;
}

.logo {
    position: absolute;
    height: auto;
    width: auto;
    max-height: 90%;
    max-width: 150px;
    margin-left: 5%;
    top: var(--spacing-xs);
    aspect-ratio: auto;
}

nav {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 5%;
}

nav ul {
    display: flex;
    gap: 2vw;
    list-style: none;
}

nav a {
    color: var(--text-color-light);
    text-decoration: none;
    font-size: clamp(14px, 1.3vw, 18px);
    transition: font-weight 0.3s;
}

nav a:hover {
    text-decoration: underline;
}



footer p {
    color: var(--text-color-light);
    text-decoration: none;
    font-size: clamp(12px, 1.2vw, 16px);
    transition: font-weight 0.3s;
}

/*p a {
    color: var(--text-color-light);
    text-decoration: none;
    font-size: clamp(12px, 1.2vw, 16px);
    transition: font-weight 0.3s;
}*/

p a:hover {
    text-decoration: underline;
}

p .consentement a:hover {
    font-weight: bold;
}

/* BLOC PAGE GUIDE */
.centrage_titre_padding_1_8vw {
    text-align: center;
    padding: 1.8vw;
}

.no_border {
    border: none;
}

.padding_0_104vw {
    padding: 0.104vw
}

.padding_0_521vw {
    padding: 0.521vw
}

.padding_gauche_5percent {
    padding-left: 5%
}

.border_solid_0_052vw {
    border: solid 1px var(--primary-color);
}

.border_solid_0_052vw_coin0_26vw {
    border: solid 1px var(--primary-color);
    border-radius: 0.26vw;
}

.border_solid_0_104vw {
    border: solid 0.104vw var(--primary-color);
}

caption {
    caption-side: top;
}

.bold {
    font-weight: bold;
}

.largeur_100_percent {
    width: 100%
}

.largeur_25_percent {
    width: 25%
}

.largeur_75_percent {
    width: 75%
}

.marge_auto {
    margin: auto;
}

.marge_droite_0_26vw {
    margin-right: 0.26vw
}

.marge_gauche_0_26vw {
    margin-left: 0.26vw
}

.largeur_50_percent {
    width: 50%;
}

.largeur_45_percent {
    width: 45%;
    margin-bottom: 5.208vw;
}

.image_guide_fiscal_guide {
    width: 100%;
}

.fond_guide {
    padding-left: 5%;
    color: var(--primary-color);
    top: 7vw;
    width: 100%;
    height: 100%;
}

/* SECTION BANNIERE */
.fond_accueil {
    background-image: url('../Medias/images/Banniere_accueil.webp');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    padding-left: 5%;
    color: var(--text-color-light);
    position: fixed;
    top: 7vw;
    width: 100%;
    height: 100%
}

.arriere_plan_form_guide {
    background-color: #f2f0e960;
    padding: var(--spacing-m)
}

.box {
    margin: var(--spacing-xs);
}

.centrage_element {
    display: flex;
    justify-content: center;
}

.container_text_conditions {
    width: 75%;
    flex-wrap: wrap;
    margin: auto;
    padding: 2vw;
}

.container_text_guide {
    width: 50%;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin: auto;
    padding: 0.781vw;
}

.container_guide {
    width: 50%;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin: auto;
    border: 0.104vw solid var(--primary-color)
}

.image_container_guide,
.form_container_guide {
    flex: 1;
}

.image_container_guide {
    width: 100%;
    height: auto;
    display: block;
}

.form_container_guide {
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.police_size_1vw {
    font-size: 1vw;
}

.police_size_1_2vw {
    font-size: 1.2vw;
}

.police_size_1_5vw {
    font-size: 1.5vw;
}

.police_size_1_8vw {
    font-size: 1.8vw;
}

.form_guide {
    width: 25%;
    display: block;
    float: left;
}

.largeur_75percent {
    width: 75%;
}

.largeur_100percent {
    width: 100%;
}

.coche_form_guide {
    width: 2.083vw;
    display: block;
    float: left;
    text-align: left
}

.centrage {
    text-align: center;
}

.italique {
    font-style: italic;
}

.police_0_8vw {
    font-size: 0.8vw;
}

.police_gras_1vw {
    font-weight: bold;
    font-size: 1vw;
}

.police_gras_1_3vw {
    font-weight: bold;
    font-size: 1.3vw;
}

.police_gras_3vw {
    font-weight: bold;
    font-size: 3vw;
}

h1 {
    font-weight: bold;
    font-size: 1.5vw;
}

.texte_justify {
    text-align: justify;
}

.centrage_vertical_horizontal {
    display: grid;
    align-items: center;
    justify-items: center;
}

.hauteur_ligne_1_5vw {
    line-height: 1.5vw;
}

.hauteur_ligne_2vw {
    line-height: 2vw;
}

.hauteur_ligne_2_5vw {
    line-height: 2.5vw;
}

.padding_top_bottom_0_5vw {
    padding-top: 0.5vw;
    padding-bottom: 0.5vw;
}

.padding_top_bottom_2vw {
    padding-top: 2vw;
    padding-bottom: 2vw;
}

.padding_left_right_0 {
    padding-left: 0;
    padding-right: 0;
}

.label_guide_centre_1_563vw {
    height: 1.563vw;
    display: flex;
    align-items: center;
}

.consentement {
    text-align: justify;
    font-size: clamp(10px, 0.6vw, 12px);
    font-style: italic;
}

form {
    max-width: 400px;
    margin: auto;
}

.captcha {
    font-weight: bold;
}

.error {
    color: red;
}

.centrage_page_div {
    margin: auto
}

.hauteur_5_208vw {
    height: 5.208vw;
}

.hauteur_1_5vw {
    height: 1.5vw;
}

.hauteur_3vw {
    height: 3vw;
}

.fond_accueil-left h1 {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: var(--spacing-xs);
}

.fond_accueil-left p {
    font-size: 1em;
    margin-bottom: 1.042vw;
}

.fond_accueil-left button,
button {
    padding: var(--spacing-xs) calc(var(--spacing-xs) * 2);
    background-color: var(--primary-color);
    color: var(--text-color-light);
    border: none;
    cursor: pointer;
    font-size: 1em;
    transition: background 0.3s;
}

.fond_accueil-left button:hover,
button:hover {
    background-color: #1a5bb8;
}

/* POPUP */
#popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease-in-out, visibility 0s linear 0.3s;
}

#popup.is-visible {
    visibility: visible;
    opacity: 1;
}

#popup form {
    background: white;
    padding: var(--spacing-m);
    border-radius: 0.521vw;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    width: 15.625vw;
}

#popup input,
#popup textarea {
    padding: var(--spacing-xs);
    width: 100%;
    border: 0.052vw solid #ccc;
}

#popup button {
    background-color: var(--primary-color);
    color: var(--text-color-light);
    padding: var(--spacing-xs);
    border: none;
    cursor: pointer;
}

/* TELECHARGER GUIDE CORPS DE D'ACCUEIL */
.section_telecharger_guide_accueil {
    background-color: #f2f0e9;
    background-size: cover;
    background-position: center;
    height: 100vh;
    display: flex;
    align-items: center;
    padding-left: 5%;
}

/* Footer */
footer {
    font-size: clamp(12px, 1.2vw, 16px);
    background-color: var(--primary-color);
    color: var(--text-color-light);
    position: fixed;
    width: 100%;
    bottom: 0;
    height: 3.125vw;
    padding: 1rem 2vw;
}

/* Responsive */
@media (max-width: 480px) {
    nav ul {
        flex-direction: column;
        gap: var(--spacing-xs);
    }

    .banniere {
        flex-direction: column;
        text-align: center;
        padding: var(--spacing-xs);
    }
}

/* ********************************************************* */
/*   ACTUALITÉS – alternance image / texte & module admin     */
/* ********************************************************* */

/* cache la barre admin par défaut */
#admin-login.display-none {
    display: none;
}

/* container des articles */
#actualites-container {
    display: flex;
    flex-direction: column;
    gap: 3vw;
}

/* article de base */
.actu {
    display: flex;
    align-items: stretch;
    gap: 2vw;
    margin-bottom: 3vw;
}

/* alternance */
.actu.left-img {
    flex-direction: row;
}

.actu.right-img {
    flex-direction: row-reverse;
}

/* conteneur image */
.image-container {
    flex: 0 0 35%;
    /* 35% de la largeur disponible */
    max-height: 20vw;
    /* hauteur fixe relative à la largeur */
    overflow: hidden;
    border-radius: var(--border-radius);
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* conteneur texte */
.text-container {
    flex: 1;
    max-height: 20vw;
    /* même hauteur que l’image */
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1vw;
    background: #f9f9f9;
    border-radius: var(--border-radius);
}

.text-container h2 {
    margin-bottom: 0.5em;
    font-size: var(--font-size-m);
}

.text-container p {
    font-size: var(--font-size-s);
    overflow: auto;
    /* scroll si texte trop long */
}

/* responsive : empile image & texte sur petit écran */
@media (max-width: 768px) {
    .actu {
        flex-direction: column !important;
    }

    .image-container,
    .text-container {
        max-height: none;
        width: 100%;
    }
}