body {
    background-color: #fdfaf5;
    /* Un blanc "crème" très léger, comme du papier parchemin */
    color: #333;
    /* Un gris très foncé, plus doux que le noir pur pour la lecture */
}

/*Un petit effet au survol des cartes pour faire "pro"*/
.w3-card:hover {
    box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2);
    transition: 0.3s;
}

/* Défilement fluide */
html {
    scroll-behavior: smooth;
}

img {
    display: block;
    margin: auto;
    width: 30%;
}

div {
    margin: auto;
    text-align: center;
}

/* Optionnel : Justifier le texte pour un look plus "livre" */
p {
    font-size: 18px;
    text-align: justify;
    line-height: 1.6;
    /* Aère aussi les lignes pour plus de confort */
    /* Crée un espace automatique après chaque paragraphe */
    margin-bottom: 20px;
}

.mySlides {
    display: none;
}

/* Conteneur principal */
.layout-container {
  display: flex;
  flex-direction: column;
  gap: 20px; /* Espace entre le haut et le bas */
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px;
}

/* Image du haut (1280x720) */
.hero-image img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid #ccc;
}

/* Grille du bas */
.bottom-grid {
  display: grid;
  /* Répartition des colonnes selon tes dimensions (640px | 700px | 640px) */
  grid-template-columns: 1fr 1.1fr 1fr; 
  gap: 15px;
  align-items: start;
}

/* Colonnes latérales (Campo 3) */
.side img {
  width: 100%;
  aspect-ratio: 640 / 960; /* Respecte le format vertical */
  object-fit: cover;
  border: 1px solid #ccc;
}

/* Colonne centrale (Les deux Campo 2) */
.center {
  display: flex;
  flex-direction: column;
  gap: 15px; /* Espace entre les deux images du centre */
}

.center img {
  width: 100%;
  aspect-ratio: 700 / 525; /* Respecte le format paysage */
  object-fit: cover;
  border: 1px solid #ccc;
}

.layout-container {
    padding: 20px;
    background-color: #f9f7f2; /* Le petit ton crème que tu aimais bien */
}

/* La liste est cachée par défaut */
.weeks-list {
    display: none !important;
    list-style: none;
    padding-left: 15px;
}

/* La liste s'affiche quand on ajoute la classe 'open' via JS */
.weeks-list.open {
    display: block !important;
}

/* Optionnel : un peu de couleur pour les liens en mode sombre */
body.dark-mode .weeks-list li a {
    color: #4CAF50 !important; /* Ton vert fétiche */
    padding: 8px 10px;         /* Un peu d'espace pour cliquer facilement */
    display: block;            /* Toute la ligne est cliquable */
    text-decoration: none;     /* Enlève le soulignement moche */
    border-bottom: 1px solid #333; /* Une petite ligne discrète entre chaque semaine */
    transition: background 0.3s;
}

body.dark-mode .weeks-list li a:hover {
    background-color: #222;
    color: #81C784 !important; /* Un vert un peu plus clair au survol */
}

body.dark-mode .w3-container h5 a {
    color: #e0e0e0 !important;
    text-decoration: none;
}

body.dark-mode .w3-container h5 a:hover {
    color: #4CAF50 !important; /* Le vert au survol */
}

/* Effet au survol des mois */
.month-btn:hover {
    background-color: rgba(0, 0, 0, 0.1); /* Gris léger le jour */
    cursor: pointer;
}

body.dark-mode .month-btn:hover {
    background-color: rgba(255, 255, 255, 0.1); /* Blanc léger la nuit */
    color: #4CAF50 !important;
}

/* --- ADAPTATION MODE SOMBRE --- */

/* Le bouton du mois */
body.dark-mode .month-btn {
    background-color: transparent !important;
    color: #4CAF50 !important; /* Vert pour bien lire le mois */
    border-bottom: 1px solid #333; /* Une petite ligne séparatrice */
    border: none !important;
    width: 100%;
    text-align: left;
    font-weight: bold;
    padding: 10px 5px; /* Ajout d'un petit espacement pour le confort */
    display: flex;     /* Aligne le texte et l'icône proprement */
    justify-content: space-between; /* Place la flèche à droite si tu préfères */
    align-items: center;
    cursor: pointer;
}

/* L'icône spécifique à l'intérieur du bouton sombre */
body.dark-mode .month-btn .fa {
    margin-left: 10px;
    color: #4CAF50; /* Ton vert fétiche pour la flèche */
    transition: transform 0.3s; /* Pour que le changement de flèche soit fluide */
}

/* Petit bonus : Changement de couleur au survol en mode sombre */
body.dark-mode .month-btn:hover {
    color: #4CAF50;
    background-color: rgba(255, 255, 255, 0.05);
}

/* On force le fond du menu latéral en noir/gris très foncé */
body.dark-mode #main-menu {
    background-color: #1a1a1a !important; /* Un gris presque noir */
    color: #e0e0e0 !important; /* Texte clair */
}

body.dark-mode #main-menu img {
    filter: brightness(0.8) contrast(1.2);
    background-color: transparent !important;
}

/* On s'assure que la zone des semaines (l'accordéon ouvert) soit aussi sombre */
body.dark-mode .weeks-list {
    background-color: #222 !important; /* Un peu plus clair pour créer du relief */
}


body.dark-mode #main-menu a {
    color: #ffffff !important; /* Ou le vert #4CAF50 pour le style */
}

/* Le petit bouton rond */
.info-button {
    margin-top: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #5d4037;
    background: #fff;
    color: #5d4037;
    font-weight: bold;
    font-style: italic;
    cursor: pointer;
    /* opacity: 0; */
    /* Diventa invisibile */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
}

.info-button:hover {
    transform: scale(1.1);
    /* opacity: 0.1;*/
    /* Appare appena quando ci passi sopra col mouse */
}

/* La fenêtre surgissante (Modal) */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    /* On met un chiffre très haut pour passer devant TOUT */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    /* Fond plus sombre pour bien voir la différence */
}

.modal-content {
    background-color: #fdfaf3;
    margin: 15% auto;
    padding: 25px;
    border: 1px solid #d7ccc8;
    width: 80%;
    max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
}

.close {
    color: #8d6e63;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

h1 {
    text-align: center;
    color: #6da35b;
}

.demo-section {
    max-width: 700px;
    margin: 40px auto;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #fff;
}

.demo-button-container {
    text-align: center;
    margin: 30px 0;
}

/* Style du bouton retour en haut */
#myBtn {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 30px;
    z-index: 99;
    border: none;
    outline: none;
    background-color: #4CAF50;
    color: white;
    cursor: pointer;
    padding: 15px;
    border-radius: 50%;
    /* Bouton rond */
    width: 50px;
    height: 50px;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
}

#myBtn:hover {
    background-color: #dc143c;
}

/* Pour les deux petites photos du bas et la photo large du haut à droite */
.block-photo {
    width: 100%;
    height: 250px;
    /* Ajustez cette hauteur selon votre préférence */
    object-fit: cover;
    /* Recadre l'image proprement sans l'écraser */
    display: block;
}

/* Pour la grande photo de gauche */
/* Elle doit faire environ 2x la hauteur d'une petite + l'espace du milieu */
.block-photo-large {
    width: 100%;
    height: 516px;
    /* 250px + 250px + 16px de marge */
    object-fit: cover;
    display: block;
}

/* On retire les paddings inutiles des containers pour que les photos touchent les bords */
.w3-container {
    padding: 0 !important;
}

/* On définit les hauteurs pour garder la structure propre */
.block-photo-large {
    height: 516px;
    /* Ajustez selon vos photos */
    width: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.block-photo {
    height: 250px;
    /* Ajustez selon vos photos */
    width: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

/* Indispensable pour que l'image ne dépasse pas du cadre en zoomant */
.img-container {
    overflow: hidden;
    background-color: #f1f1f1;
    /* Couleur de fond en attendant le chargement */
}

/* L'effet de zoom au survol */
.img-container:hover .block-photo,
.img-container:hover .block-photo-large {
    transform: scale(1.1);
}

/* --- MENU LATÉRAL VERT (Accordéon) --- */
#main-menu {
    position: fixed;
    top: 0;
    left: -260px;
    width: 260px;
    height: 100%;
    background-color: #e8f0e5;
    /* Vert très doux */
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
    transition: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2000;
    padding-top: 20px;
    border-right: 2px solid #6da35b;
}

#main-menu.show {
    left: 0;
}

/* Style de l'année 2026 dans le menu */
.year-title {
    padding: 10px 25px;
    font-weight: bold;
    color: #6da35b;
    font-size: 20px;
    border-bottom: 2px solid #6da35b;
    margin-bottom: 10px;
}

/* Boutons des mois (Accordéon) */
.month-btn {
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    padding: 12px 25px;
    font-size: 20px;
    color: #333;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s;
}

.month-btn:hover {
    background-color: #d8e4d3;
}

/* Liste des semaines cachée */
.weeks-list {
    list-style: none;
    padding: 0;
    margin: 0;
    background-color: rgba(255, 255, 255, 0.3);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.weeks-list.open {
    max-height: 300px;
}

.weeks-list li a {
    display: block;
    padding: 8px 40px !important;
    font-size: 17px !important;
    color: #555 !important;
    text-decoration: none;
}

.weeks-list li a:hover {
    background-color: #c7d8c2;
    color: #000 !important;
}

/* --- BOUTON DE MENU (Le déclencheur) --- */
.hamburger-box {
    display: inline-flex !important;
    align-items: center;
    padding: 6px 16px !important;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #ccc !important;
    background-color: #f8f8f8 !important;
}

.hamburger-box.active .fa-caret-down {
    transform: rotate(180deg);
}

/* --- EFFET OMBRE PORTÉE (Pour vos boutons internes) --- */
/* S'applique à tous vos boutons ronds (Febbraio, Merla, etc.) */
.w3-button.w3-round-xlarge {
    transition: all 0.3s ease !important;
}

.w3-button.w3-round-xlarge:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2) !important;
    /* L'ombre portée */
    transform: translateY(-3px);
    /* Le petit saut vers le haut */
}

.w3-button {
    /* Espacements : 5px haut/bas, 2px gauche/droite */
    margin: 5px 2px;
    /* Force l'espace en bas pour le mobile */
    margin-bottom: 8px !important;
    /* Sécurité pour les longs textes */
    white-space: normal;
    /* Retour à la ligne automatique */
    max-width: 100%;
    /* Ne dépasse jamais du téléphone */
    line-height: 1.4;
    /* Confort de lecture si 2 lignes */

    /* Bonus : évite que le texte ne colle aux bords du bouton */
    padding: 8px 16px;
}

/* Pour que les boutons ne touchent pas le haut de l'écran mobile */
.w3-panel,
header {
    margin-top: 15px !important;
}

/* Ajoute de l'espace sur les côtés pour tout le contenu */
article,
.main-content,
.w3-container {
    padding-left: 20px !important;
    padding-right: 20px !important;
}

footer,
.w3-padding-32 {
    margin-top: 40px;
    /* Donne de l'espace au-dessus des boutons de navigation */
    margin-bottom: 40px;
    /* Donne de l'espace sous les boutons */
}

/* Ajustements pour le mode sombre */
body.dark-mode {
    background-color: #121212;
    color: #e0e0e0;
}

body.dark-mode .w3-bar {
    background-color: #333 !important;
}

body.dark-mode .w3-button {
    background-color: #555 !important;
    color: #e0e0e0 !important;
    border: 1px solid #777 !important;
}

body.dark-mode .w3-button:hover {
    background-color: #777 !important;
}

body.dark-mode img {
    filter: brightness(.8) contrast(1.2);
    transition: filter 0.3s ease;
    border-radius: 4px; /* Un tout petit arrondi pour adoucir les angles */
    border: 1px solid #333; /* Un cadre très discret pour séparer l'image du fond noir */
}