/* =========================
   BASE – RGAA
========================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html { font-size: 100%; }

body {
    font-family: Arial, Helvetica, sans-serif;
    background-color: #f9f9f9;
    color: #333;
    line-height: 1.6;
    /* Logo en fond très clair, option B */
    background-image: url('images/loupiac.png');
    background-repeat: no-repeat;
    background-position: top right;
    background-size: 80px auto;
    opacity: 1;
}

/* Liens accessibles */
a {
    color: #2e5d4f;
    text-decoration: underline;
}

a:hover,
a:focus {
    text-decoration: none;
    outline: 3px solid #ffbf47;
    outline-offset: 3px;
}

/* Header */
header {
    background: #2e5d4f;
    color: white;
    padding: 1rem;
    text-align: center;
}

.header-top {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 0.5rem;
}

.armoiries {
    height: 60px;   /* hauteur fixe du logo */
    width: auto;
    margin-right: 15px;
}

.titre-mairie {
    font-size: 1.8rem;
    font-weight: bold;
    color: white;
}

/* Menu */
.menu a {
    margin: 0 10px;
    color: white;
    text-decoration: none;
    font-weight: bold;
}

.menu a:hover {
    text-decoration: underline;
}

/* Bouton menu mobile */
.menu-toggle {
    display: none;
    background: none;
    color: white;
    border: 2px solid white;
    padding: 0.4rem 0.8rem;
    font-size: 1.1rem;
    border-radius: 6px;
    cursor: pointer;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: inline-block;
        margin-top: 0.5rem;
    }

    .menu {
        display: none;
        margin-top: 1rem;
    }

    .menu.open {
        display: block;
    }

    .menu a {
        display: block;
        margin: 12px 0;
        font-size: 1.05rem;
    }

    .header-top {
        flex-direction: column;
    }
}


/* =========================
   BANNIÈRE
========================= */

.banner {
    background: url("https://mairie-loupiac-tarn.fr/wp-content/uploads/2021/01/mairie-loupiac.jpg")
        center / cover no-repeat;
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    font-weight: bold;
    text-shadow: 2px 2px 6px rgba(0,0,0,0.7);
}

/* =========================
   SECTIONS
========================= */

main {
    max-width: 1200px;
    margin: auto;
}

section { padding: 2.5rem 1rem; }

h2 {
    color: #2e5d4f;
    margin-bottom: 1rem;
}

/* =========================
   ACTUALITÉS
========================= */

.news {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.card {
    background: white;
    border-radius: 10px;
    padding: 1.2rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* =========================
   SERVICES
========================= */

.services {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.service {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.ec h3::before { content: "👶 "; }
.urb h3::before { content: "🏗️ "; }
.sco h3::before { content: "🎓 "; }
.assoc h3::before { content: "🤝 "; }

/* =========================
   AGENDA
========================= */

.agenda {
    background: #e2f0eb;
    padding: 1.5rem;
    border-radius: 10px;
}

.agenda ul { list-style: none; }

.agenda li {
    padding: 0.6rem 0;
    border-bottom: 1px solid #c5d6d0;
}

/* =========================
   HORAIRES
========================= */

.hours {
    background: #f0f8f5;
    padding: 1.5rem;
    border-radius: 10px;
}

/* =========================
   COWORKING – RÉSERVATION / FACTURE / CALENDRIER
========================= */

form fieldset {
    border: 1px solid #c5d6d0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

legend {
    font-weight: bold;
    color: #2e5d4f;
}

label {
    display: block;
    margin-bottom: 0.8rem;
}

input,
select {
    width: 100%;
    max-width: 300px;
    padding: 0.4rem;
    margin-top: 0.2rem;
}

button {
    background: #2e5d4f;
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 0.8rem;
}

button:hover { opacity: 0.9; }

.calendrier {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
}

.calendrier th,
.calendrier td {
    border: 1px solid #c5d6d0;
    padding: 0.6rem;
    text-align: center;
}

.calendrier th {
    background: #e2f0eb;
    color: #2e5d4f;
}

#facture {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f9f9f9;
    border-radius: 10px;
    border: 1px solid #c5d6d0;
}

.facture-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.facture-header img { height: 60px; }

/* =========================
   FOOTER
========================= */

footer {
    background: #2e5d4f;
    color: white;
    text-align: center;
    padding: 1.5rem;
    margin-top: 2rem;
}

footer a { color: white; }

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 768px) {

    .header-top { flex-direction: column; }

    .menu a {
        display: inline-block;
        margin: 10px 15px;
    }

    .banner {
        font-size: 1.5rem;
        height: 200px;
        padding: 1rem;
        text-align: center;
    }

    .facture-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* =========================
   IMPRESSION / PDF FACTURE
========================= */

@media print {
    body * { visibility: hidden; }
    #facture,
    #facture * { visibility: visible; }
    #facture {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        padding: 2rem;
    }
    button { display: none; }
}

/* =========================
   MENU MOBILE
========================= */

.menu-toggle {
    display: none;
    background: none;
    color: white;
    border: 2px solid white;
    padding: 0.4rem 0.8rem;
    font-size: 1.1rem;
    border-radius: 6px;
    cursor: pointer;
}

@media (max-width: 768px) {

    .menu-toggle { display: inline-block; margin-top: 0.5rem; }

    .menu {
        display: none;
        margin-top: 1rem;
    }

    .menu.open { display: block; }

    .menu a {
        display: block;
        margin: 12px 0;
        font-size: 1.05rem;
    }
}
