/* --- 1. POLICE ET BASES --- */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700&display=swap');

:root {
    --dark: #4C5765;
    --blue: #0097DB;
    --green: #88BF52;
    --orange: #F2912D;
    --grey-bg: #BCBEC1;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--grey-bg);
    margin: 0;
    color: #333;
}

/* --- 2. HEADER --- */
header {
    background-color: var(--dark);
    color: white;
    padding: 10px 30px;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
}

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

header img { height: 45px; margin-right: 20px; }
.titles h1 { margin: 0; font-size: 1.2rem; letter-spacing: 1px; }
.titles p { margin: 0; font-size: 0.75rem; }

#logout-btn {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid white;
    color: white;
    padding: 6px 12px;
    width: auto;
    font-size: 0.8rem;
    cursor: pointer;
    border-radius: 5px;
}

/* --- 3. STRUCTURE ET GRILLE (LE MUR) --- */
#app { 
    max-width: 1400px; 
    margin: 0 auto; 
    padding: 20px; 
}

.grid {
    display: grid;
    grid-template-columns: 300px 1fr; /* Colonne gauche 300px, droite prend le reste */
    gap: 25px;
    align-items: start;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.hidden { display: none !important; }

.card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* --- 4. FORMULAIRES ET BOUTONS --- */
input, textarea, select {
    width: 100%;
    padding: 10px;
    margin: 8px 0;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
    font-family: inherit;
}

button {
    cursor: pointer;
    border: none;
    font-weight: 600;
    transition: 0.2s;
}

.bg-blue { background: var(--blue); color: white; }
.bg-green { background: var(--green); color: white; }
.bg-grey { background: #6F89AE; color: white; }

/* --- 5. CONNEXION (LOGIN BOX) --- */
#login-block.card {
    max-width: 450px;
    margin: 80px auto;
    padding: 30px;
    text-align: center;
}

.login-header {
    background-color: var(--dark);
    margin: -30px -30px 20px -30px;
    padding: 20px;
    border-radius: 12px 12px 0 0;
}

.logo-circle {
    width: 180px;
    height: auto;
}

.separator { margin: 15px 0; color: #888; font-size: 0.8rem; }

/* --- 6. WIDGETS (HORLOGE & CALENDRIER) --- */
#clock {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--blue);
    text-align: center;
}

#holidays {
    margin-top: 10px;
}

/* --- 7. RESPONSIVE (POUR MOBILE) --- */
@media (max-width: 850px) {
    .grid {
        grid-template-columns: 1fr; /* Une seule colonne sur petit écran */
    }
}
/* --- 8. ADAPTATION MOBILE (RESPONSIVE) --- */

@media (max-width: 850px) {
    /* 1. On passe la grille en une seule colonne */
    .grid {
        grid-template-columns: 1fr; 
        gap: 15px;
        margin: 10px auto;
    }

    /* 2. On change l'ordre : Le calendrier passe sous le mur pour libérer de la place */
    .sidebar {
        order: 2; /* Passe en deuxième */
    }
    
    .main-content {
        order: 1; /* Le mur de messages passe en premier */
    }

    /* 3. On réduit la taille du header pour gagner de la place */
    header {
        padding: 10px 15px;
    }

    .header-content {
        flex-direction: column; /* Empile le logo et le bouton déconnexion */
        gap: 10px;
        text-align: center;
    }

    .header-left {
        flex-direction: column;
        gap: 5px;
    }

    header img {
        margin-right: 0;
        height: 35px;
    }

    .titles h1 {
        font-size: 1.1rem;
    }

    /* 4. On ajuste la boîte de connexion pour qu'elle prenne toute la largeur mobile */
    #login-block.card {
        margin: 20px auto;
        width: 95%;
        padding: 20px;
    }

    /* 5. On agrandit les zones cliquables (boutons/champs) pour les doigts */
    button, input, textarea {
        font-size: 16px !important; /* Évite le zoom automatique sur iPhone */
        padding: 14px !important;
    }
}
.post-title { font-weight: 700; font-size: 1.2rem; margin: 5px 0; color: #4C5765; }
.post-meta { font-size: 0.8rem; color: #6F89AE; display: flex; justify-content: space-between; }
.btn-del { background: none; border: none; cursor: pointer; color: #F2912D; }

.filter-bar { display: flex; gap: 10px; margin-bottom: 15px; overflow-x: auto; padding-bottom: 5px; }
.filter-bar button { width: auto; padding: 8px 15px; background: white; color: var(--dark); border: 1px solid #ddd; }
.filter-bar button:hover { background: var(--blue); color: white; }

/* Calendrier */
.cal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-weight: bold; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.cal-day { padding: 5px; cursor: pointer; border-radius: 4px; font-size: 0.8rem; }
.cal-day:hover { background: #eee; }
.cal-day.ferie { background: var(--orange); color: white; }
.cal-day-head { font-weight: bold; font-size: 0.7rem; color: var(--dark); }

.post-admin-actions {
    display: flex;
    gap: 10px;
}

.btn-edit, .btn-del {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 0 5px;
}

.btn-edit:hover { transform: scale(1.2); }

.comment-section input {
    background: white !important;
}

.post-actions button:hover {
    text-decoration: underline;
}