/* Variables de couleurs */
:root {
    /* Couleurs principales */
    --color-background:#d8d8d8;/*#556269*/ 
    --color-green: linear-gradient(45deg,#49c6ff 20%, #4df9ff 100%);/*couleur 01 -ref tout-*/
    --color-purple:linear-gradient(135deg,#0b96f8 20%, #0b4ef9 100%);/*couleur 02 -ref 2d-*/
    --color-orange: linear-gradient(135deg,#eeeb82 20%, #22f665 100%);/*couleur 03 -ref 3d-*/
    --color-yellow: #4dc9ff;/*couleur svg*/
    --color-butt:#f44a0f;/*couleur du bouton contact*/
    --color-back:#f7f7f7;/*couleur du footer */
    
    /* Couleurs secondaires */
    --color-blue-light:#f7f9f8;/*colo bouton secondaire 01*/
    --color-blue: #b6b0ee;/*colo bouton secondaire 02*/
    --color-beige: blue;/*colo non utilisée*/
    
    /* Couleurs de texte */
    --color-aprop:#0279cc;/*couleur texte a propos*/
    --color-text-dark: #161206;/*couleur du h1 qui*/
    --color-text-light:#161206;/*couleur principale du texte*/
    --color-text-aprop:#161206;/*couleur du texte a propos*/
    --color-text-strong: #0b97f9 ;/*couleur texte a propos strong*/
    --color-outline: none; /*#0F0F0F */
    
    /* Couleurs d'état */
    --color-hover: rgba(0, 0, 0, 0.1);/*couleur hover bouton sociaux*/
    --color-shadow: rgba(0, 0, 0, 0.2);/*couleur shadow pour bouton contact*/
    --color-shadow-strong: rgba(0, 0, 0, 0.3);
}

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

html, body, header {
    width: 100%;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    background: var(--color-background);
}

body {
    min-height: 100vh;
    position: relative;
}

body, h2, h3, p, img, div {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    font-weight: 400;
}

h1 {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Red Hat Display', cursive;
    font-weight: 700;
    
    
}

button,a {
        font-family: 'Red Hat Display', cursive;
    font-weight: 900;
    
}

/* HEADER */
header {
    display: flex;
    width: 100%;
    height: 30vh;
    position: relative;
    overflow: hidden;
    min-height: 200px;
    max-height: 400px;
}

.header-left {
    display: flex;
    align-items: center;
}

.centre {
    position: absolute;
    left: 20px;
    bottom: 20px;
    z-index: 2;
}

.header-center {
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: auto;
    background: var(--color-background);
}

#riveCanvas {
    position: relative;
    top: 50%;
    align-items: center;
    width: auto;
    height: 100%;
    max-height: 100%;
    object-fit: contain;
}

.header-left a {
    color: var(--color-text-dark);
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 5px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.header-left a:hover {
    background: var(--color-hover);
    transform: translateY(-2px);
}

.respimg{
  display:none;
  text-align: center; /* Centre le contenu du div */
margin: 0 auto; /* Centre le div lui-même */
}

.respimg svg{
 display: block;
  margin: auto;
  
  width: 100%;
  max-width: 200px;
  height:auto;
  

}

/*.respimg img{
   margin: 0 auto; /* Redondant avec text-align:center mais utile pour certains navigateurs */
  /*width: 100%;
  max-width: 200px;
  height: auto;
  display: inline-block; /* Important pour que text-align:center fonctionne */ 
/*}*/

.qui{
    padding: 50px 50px 20px 50px;
    text-align: center;
    color:var(--color-text-dark);
}
.qui mark{
    color:var(--color-green);
    font-weight:bolder;
    background: transparent;
}

.svg{
    height: 50px;
  width: 50px;
  fill:var(--color-yellow);
}

.svg:hover{
      fill:var(--color-butt);
}

/* boutons RESEAUX SOCIAUX */
.social-links {
    display: flex;
    justify-content: flex-start; /* 'left' n'est pas une valeur valide pour justify-content, utilisez flex-start */
    align-items: center; /* Centre verticalement les éléments */
    gap: 20px;
    margin: 0px 0 20px 0; /* Supprime le margin auto pour permettre l'alignement à gauche */
    /*padding-left: 20px;  Ajoute un padding à gauche pour décaler légèrement du bord */
    
}

.social-links a {
    color: var(--color-text-dark);
    text-decoration: none;
    padding-top: 10px;
    padding-bottom: 10px;
    border-radius: 5px;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex; /* Assure que les liens se comportent comme des flex containers */
    align-items: center; /* Centre le contenu verticalement */
}

.social-links a:hover {
    /*background: var(--color-hover);*/
    /* transform: translateY(-2px); */
    transform:scale(1.2,1.2);
}

/* Si vous avez besoin d'ajuster spécifiquement les SVG à l'intérieur des liens */
.social-links .svg {
    display: flex;
    justify-content: center;
    align-items: center;
    
}


/* BUTTONS */
.buttons {
    padding: 10px; /* Réduit de 20px à 10px */
    margin: 20px auto; /* Réduit de 40px à 20px */
    width: 80%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
    outline: none;
    overflow: visible;
}

.buttons button {
    border: none;
    outline: none;
    box-shadow: none;
    color: var(--color-text-light);
}

.primary-buttons {
    display: flex;
    justify-content: center;
    align-content: center;
    transition: all 0.3s ease;
    overflow: visible;
}

.primary-buttons-row {
    display: flex;
    gap: 10px;
    height: auto;
    overflow: visible;
    padding: 5px 0; /* Ajoute un peu d'espace au-dessus et en-dessous */
}

.buttons button.large {
    white-space: nowrap;
    font-size: 18px;
    padding: 25px 40px;
    border-radius: 30px;
    box-shadow: none;
    height: auto; /* Permet au bouton de s'adapter à son contenu */
    line-height: normal; /* Évite les problèmes de ligne de base */
    overflow: visible !important; /* Force le contenu à être visible */
    display: flex; /* Utilise flexbox pour un meilleur alignement */
    align-items: center; /* Centre verticalement le texte */
    justify-content: center; /* Centre horizontalement le texte */
    min-height: 50px; /* Hauteur minimale pour assurer une bonne visibilité */
}

#categoriesButton { 
    outline: none;
    border: none; /* Ajout pour s'assurer qu'il n'y a pas de bordure */
    height: auto;
    line-height: normal;
    overflow: visible !important;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    margin-top: 10px; /* Assure un bon espacement avec les boutons du dessus */
    transition: opacity 0.3s ease, transform 0.3s ease; /* Animation pour l'apparition/disparition */
}

.secondary-buttons {
    display: grid;
    grid-template-columns: repeat(3, auto);
    justify-content: start;
    gap: 8px;
    width: fit-content;
    height: auto; /* Changé de hauteur fixe à auto */
    overflow: visible;
}

.buttons button.small {
    white-space: nowrap;
    font-size: 14px;
    padding: 8px 20px;
    border-radius: 20px;
    justify: flex-start;/*avant c'était juste start */
    outline: 1px solid var(--color-outline);/*contour*/
    height: auto;
    line-height: normal;
    overflow: visible !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Couleurs des boutons */
.buttons button.small:nth-child(odd) {
    background: var(--color-blue);
}

.buttons button.small:nth-child(even) {
    background: var(--color-blue-light);
}

.buttons button.large:nth-child(1) {
    background: var(--color-green);
}

.buttons button.large:nth-child(2) {
    background: var(--color-purple);
}

.buttons button.large:nth-child(3) {
    background: var(--color-orange);
}

/* CONTAINER */
.container {
    display: flex;
    flex-wrap: wrap;
    width: 80%;
    margin: 0 auto;
    justify-content: center;
    gap: 20px;
    padding-bottom: 100px;
}

.box {
    flex: 1 1 calc(20% - 20px);
    max-width: calc(20% - 20px);
    margin: 10px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 10px;
    overflow: hidden;
     outline: 1px solid var(--color-outline);/*contour*/
}

.box-image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.box:hover .box-image {
    transform: scale(1.05);
}

.box.expanded {
    flex: 1 1 100%;
    max-width: 100%;
    margin: 20px 0;
}

.box.expanded .box-image {
    display: none;
}

/* Box Content et Iframe */
.box-content {
    display: none;
    width: 100%;
    color: var(--color-text-light);
    padding: 20px;
    border-radius: 10px;
}

/* Couleurs des articles */
.box:nth-child(3n+1) .box-content {
    background: var(--color-orange);
}

.box:nth-child(3n+2) .box-content {
    background: var(--color-green);
}

.box:nth-child(3n+3) .box-content {
    background: var(--color-purple);
}

.box.expanded .box-content {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

/* Style par défaut (paysage) */
.box-iframe {
    width: 60%;
    height: auto;
}

.box-iframe iframe {
    width: 100%;
    height: 100%;
    aspect-ratio: 16/9;
    /*min-height: 400px;*/
}

.box-description {
    width: 30%;
    height: auto;
    padding: 0 20px;
}

.box-description h1 {
    margin-bottom: 20px;
}

.box-description p {
    font-weight: 300;
}

.box-description strong {
    font-weight: 800;
}

.box-description small{
    margin-top: 1em;
    /*padding-bottom:20px;*/
}

.sml {
        margin-top: 10px;
        margin-bottom: 10px;
        display: block;
    }

.box-description a {
    /*font-weight: 500;*/
    background: var(--color-blue);
    margin-top: 20px;
    padding: 20px;
    color: var(--color-text-light);
    text-decoration: none;
    border-radius: 20px;
    display: inline-block;
}

/* INFO CONTAINER */
.info-container {
    display: flex;
    width: 100%;
    margin-top: 400px auto;
    background: var(--color-back);
    padding: 20px 200px 100px 200px;
}

.info-left {
    width: 35%;
    padding-right: 20px;
}

.info-left img {
    width: 100%;
    border-radius: 10px;
    transition: transform 0.3s ease;
}

.info-right {
    width: 65%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.about-content {
    margin-top: 20px;
}

.about-content p {
    margin-bottom: 15px;
    line-height: 1.6;
    color: var(--color-text-aprop);
}

.about-content strong {
    color: var(--color-text-strong);
    font-weight: 600;
}

.info-right h1 {
    font-size: 2.5em;
    font-weight: 700;
    color: var(--color-aprop);
    margin-bottom: 20px;
}

/* FLOATING BUTTON */
.floating-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--color-butt);
    color: white;
    padding: 20px 35px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    font-size: 18px;
    box-shadow: 0 4px 8px var(--color-shadow);
    transition: all 0.3s ease;
    z-index: 1000;
    letter-spacing: 1px;
}

.floating-button:hover {
    background: var(--color-purple);
    transform: translateY(-3px);
    box-shadow: 0 8px 15px var(--color-shadow-strong);
    padding: 22px 38px;
}


/* MODAL */
.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: var(--color-shadow);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: #fefefe;
    margin: 10% auto;
    padding: 30px;
    border-radius: 15px;
    width: 80%;
    max-width: 600px;
    box-shadow: 0 4px 20px var(--color-shadow);
    position: relative;
}

#contactForm button {
   color:white;
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #666;
}

.close:hover {
    color: #000;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.form-group textarea {
    height: 120px;
    resize: vertical;
}

.modal-content button {
    background: var(--color-butt);
    color: var(--color-text-light);
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.modal-content h2 {
    color: var(--color-green);
    font-weight:500;
    padding-bottom:30px;
}

.modal-content button:hover {
    background: var(--color-orange);
    transform: translateY(-2px);
}

/* Animation pour faire apparaître/disparaître le bouton de sous-catégories */
@keyframes fadeOut {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.8); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

/* Ajuster l'espace quand le bouton des sous-catégories est masqué */
.categories-active .small-buttons {
    opacity: 1;
    visibility: visible;
    height: auto;
    margin-top: 0; /* Réduit l'espace du bouton manquant */
    padding-top: 10px; /* Ajoute un peu d'espace en haut */
    transition: all 0.3s ease;
}

/* S'assurer que le bouton de catégories apparaît avec une transition fluide */
#categoriesButton {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.menu-container:not(.categories-active) #categoriesButton {
    animation: fadeIn 0.3s forwards;
}

.menu-container.categories-active #categoriesButton {
    animation: fadeOut 0.3s forwards;
}

/* MEDIA QUERIES */
@media screen and (max-width: 768px) {
    header {
        height: 150px;
        max-height: 150px;
    }
    
    .container {
        width: 90%;
        gap: 15px;
    }

    .box {
        flex: 1 1 calc(50% - 15px);
        max-width: calc(50% - 15px);
        margin: 0;
    }
    
    .box-content{
         padding: 15px; /* Réduire le padding */
    }

    .box.expanded .box-content {
        flex-direction: column;
    }

    .box-iframe {
        width: 100%;
        height: auto;
        padding: 0;
    }
    
    .box-iframe iframe {
        aspect-ratio: 16/9;
        min-height: 150px; /* Réduire cette valeur */
        max-height: 350px; /* Ajouter une hauteur maximale */
        
    }

    .box-description {
        width: 100%;
        padding: 7px 0 0 0;
    }

    .info-container {
        flex-direction: column;
        padding: 20px;
        padding-bottom:80px;
    }

.info-left {
        width: 100%;
        max-width: 300px;        /* Nouveau */
        margin: 0 auto;          /* Nouveau */
        padding: 0;
    }

    .info-left, .info-right {
        width: 100%;
        padding: 10px 0;
    }

   
    
    .about-content p {
        font-size: 0.95em;
    }
    
    .about-content {
        margin-bottom:10%;
    }
    
     .info-right {
        width: 100%;
        padding: 20px 10px;      /* Modifié */
    }

 .info-right h1 {
        font-size: 2em;
        margin-top: 20px;
        text-align: center;      /* Nouveau */
    }

    .about-content p {
        font-size: 1em;          /* Modifié de 0.95em à 1em */
        line-height: 1.6;        /* Nouveau */
        margin-bottom: 15px;     /* Nouveau */
        text-align: left;        /* Nouveau */
        word-wrap: break-word;   /* Nouveau */
        hyphens: auto;           /* Nouveau */
    }
    
    /* Ajustements pour les sous-catégories sur mobile */
    .categories-active .small-buttons {
        margin-top: 0;
        padding-top: 5px;
    }
    
    .secondary-buttons {
        justify-content: center;
    }
    
    .social-links {
        margin: auto; 
    }
}

@media screen and (max-width: 768px) and (orientation: portrait) {
    .buttons {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 90%;
        max-width: 90vw;
        padding: 10px; /* Réduit de 15px à 10px */
        min-height: auto;
        margin: 20px auto;
        overflow: visible;
    }

    .primary-buttons {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
        width: 100%;
        margin-bottom: 15px;
        overflow: visible;
    }

    .buttons button.large {
        white-space: normal;
        font-size: clamp(14px, 2vw, 18px);
        padding: 15px 25px;
        width: 100%;
        max-width: 300px;
        min-height: 45px; /* Légèrement plus petit sur mobile */
    }

    .secondary-buttons {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        width: 100%;
        height: auto;
        justify-content: center;
        overflow: visible;
    }

    .buttons button.small {
        white-space: normal;
        font-size: 12px;
        padding: 10px 15px;
        width: 100%;
        text-align: center;
        overflow: visible !important;
    }

    #categoriesButton {
        width: 100%; /* Au lieu de 20% pour qu'il s'adapte à la largeur disponible */
        padding: 15px 25px; /* Assurer que le padding est cohérent */
        white-space: normal; /* Permet le retour à la ligne du texte */
        box-sizing: border-box; /* Inclure padding dans la largeur */
        min-height: 45px; /* Légèrement plus petit sur mobile */
        overflow: visible !important;
        margin: 10px auto;
    }
    
    /* Pour annuler le positionnement qui pourrait causer des problèmes en mode portrait */
    .main-active .primary-buttons {
        margin-bottom: 0; /* Annule la marge négative qui pourrait causer des problèmes */
        position: static; /* Revient à un positionnement normal */
        top: 0;
    }
    
    
    
}

@media screen and (max-width: 480px) and (orientation: portrait) {
    .secondary-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
}

.hidden {
    display: none;
}

/* Classes minimales pour le menu hiérarchique */
.menu-container {
    width: 80%;
    margin: 40px auto;
    position: relative;
    height: auto;
    overflow: visible;
    padding-bottom: 20px; /* Espace en bas pour éviter les coupures */
}

/* Style pour le bouton principal - Adapté à votre style existant */
.main-button {
    background: var(--color-green);
    color: var(--color-text-light);
    padding: 25px 40px;
    border-radius: 30px;
    font-size: 18px;
    border: none;
    outline: 1px solid var(--color-outline);
    box-shadow: none;
    font-family: 'Red Hat Display', cursive;
    font-weight: 900;
    cursor: pointer;
    text-align: center;
    display: block;
    margin: 0 auto 20px auto;
    width: fit-content;
    height: auto;
    overflow: visible;
}

/* Animation pour le bouton principal */
@keyframes pulsate {
    0% { transform: scale(1); }
    25% { transform: scale(1.1); }
    100% { transform: scale(0); opacity: 0; }
}

.main-button.clicked {
    animation: pulsate 0.5s forwards;
}

/* États pour les conteneurs de boutons */
.big-buttons, .small-buttons {
    opacity: 0;
    visibility: hidden;
    height: 0;
    overflow: visible; /* Changé de hidden à visible pour éviter les coupures */
    transition: all 0.3s ease;
}

/* Style pour le bouton Sous catégories */
#categoriesButton {
   background: var(--color-blue);
    display: block;
    margin: 15px auto;
    padding: 25px 40px; /* Même padding que les boutons large */
    border-radius: 30px;
    font-size: 15px;
    width: auto; /* Au lieu d'une largeur fixe en pourcentage */
    min-width: 200px; /* Largeur minimale */
    max-width: 90%; /* Limite la largeur maximale */
}

/* Classes pour les états actifs */
.main-active .big-buttons {
    opacity: 1;
    visibility: visible;
    height: auto !important; /* Force la hauteur automatique quand visible */
    overflow: visible !important;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.main-active .main-button {
    height: 0;
    padding: 0;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    position: absolute;
}

.categories-active .small-buttons {
    opacity: 1;
    visibility: visible;
    height: auto;
    transition: all 0.3s ease;
}

/* Animation de fade in */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.main-active .big-buttons {
    animation: fadeIn 0.4s forwards;
}

.categories-active .small-buttons {
    animation: fadeIn 0.4s forwards;
}

/* Pour que les boutons "tout 3d 2d" apparaissent à la place de l'ancien bouton */
.main-active .primary-buttons {
    position: relative;
    top: -40px; /* Ajustez cette valeur selon votre besoin pour positionner les boutons */
    margin-bottom: -50px; /* Compenser l'espace créé par le top négatif */
    z-index: 1;
}