/* =====================================================================
   POLICE MARIANNE
   ===================================================================== */

   @font-face {
    font-family: "Marianne";
    src: url("lib/fonts/Marianne-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: "Marianne";
    src: url("lib/fonts/Marianne-Bold.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    font-family: "Marianne", Arial, sans-serif;
}

#map {
    width: 100%;
    height: 100vh;
}

/* =====================================================================
   TITRE PRINCIPAL DE LA CARTE
   ===================================================================== */

.map-title {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: white;
    padding: 8px 20px;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(0, 0, 0, .2);
    font-family: "Marianne", Arial, sans-serif;
    font-weight: 700;
    font-size: 16px;
}

.legend {
    background: white;
    padding: 10px;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(0, 0, 0, .2);
}

/* =====================================================================
   SIDEBAR
   ===================================================================== */

.leaflet-sidebar {
    background-color: #ffffff;
}

.leaflet-sidebar-content {
    padding: 0 55px 15px 0 !important;
    box-sizing: border-box !important;
    width: 100% !important;
    overflow-x: hidden !important;
    background-color: #ffffff !important;
}

.leaflet-sidebar-pane {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    background-color: #ffffff !important;
}

/* Élargissement de la sidebar uniquement quand elle est ouverte */
.leaflet-sidebar:not(.collapsed) {
    width: 550px !important;
}

/* =====================================================================
   TYPOGRAPHIE
   ===================================================================== */

.leaflet-sidebar-header,
#sidebar-title,
h2,
h3 {
    font-family: "Marianne", sans-serif;
    font-weight: 700;
    font-size: 21px;
}

.leaflet-sidebar-content p,
.leaflet-sidebar-content td,
.leaflet-sidebar-content th,
.leaflet-sidebar-content div {
    font-family: "Marianne", sans-serif;
    font-weight: 400;
    font-size: 14px;
}

.leaflet-sidebar-content p,
.leaflet-sidebar-content li {
    text-align: justify;
}

.leaflet-sidebar-content p,
.leaflet-sidebar-content div,
.leaflet-sidebar-content li,
.leaflet-sidebar-content td,
.leaflet-sidebar-content th {
    overflow-wrap: break-word !important;
    word-wrap: break-word !important;
    max-width: 100% !important;
}

.leaflet-sidebar-content table {
    width: 100% !important;
    table-layout: fixed !important;
}

table th {
    width: 120px;
}

#home-content,
#commune-card,
.leaflet-sidebar-pane > p {
    padding-left: 8px;
    box-sizing: border-box;
}

#home-title {
    text-align: left !important;
    font-weight: bold;
    font-size: 22px;
    margin-bottom: 10px;
	line-height: 1.15
}

/* =====================================================================
   COULEURS PERSONNALISÉES SIDEBAR (vert #398373)
   ===================================================================== */

/* Bande d'en-tête en haut de chaque panneau de la sidebar */
.leaflet-sidebar-header {
    background-color: #398373 !important;
    color: #ffffff !important;
    text-align: left !important;
    height: 48px !important;
    display: flex !important;
    align-items: center !important;
    box-sizing: border-box !important;
    padding-left: 8px !important;
}

/* Header spécifique du panneau Accueil : sur une seule ligne */
#home .leaflet-sidebar-header {
    text-transform: uppercase;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Bande des onglets à gauche de la sidebar */
.leaflet-sidebar-tabs {
    background-color: rgba(57, 131, 115, 0.5) !important;
}

/* Onglets de gauche : dimensions + survol + onglet actif */
.leaflet-sidebar-tabs > ul > li {
    height: 48px;
}

.leaflet-sidebar-tabs > ul > li > a {
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.leaflet-sidebar-tabs > ul > li:hover,
.leaflet-sidebar-tabs > ul > li.active {
    background-color: #398373 !important;
}

.leaflet-sidebar-tabs > ul > li:hover > a,
.leaflet-sidebar-tabs > ul > li.active > a,
.leaflet-sidebar-tabs > ul > li:hover > a svg,
.leaflet-sidebar-tabs > ul > li.active > a svg {
    color: #ffffff !important;
    fill: #ffffff !important;
}

/* Bouton "Retour à l'accueil" : couleur + position plus basse */
#close-card {
    background-color: #398373 !important;
    border-color: #398373 !important;
    color: #ffffff !important;
    margin-top: 40px;
    margin-bottom: 20px;
}

/* =====================================================================
   CONTENU ACCUEIL (anciens styles inline)
   ===================================================================== */

.home-logo {
    text-align: left;
    margin-bottom: 20px;
}

.home-logo img {
    max-width: 100%;
    height: auto;
}

/* Fiche projet (cachée au départ, affichée en JS) */
#commune-card {
    display: none;
}


/* Décale le texte du panneau "En savoir plus" de 3 lignes environ */
#info > p:first-of-type {
    margin-top: 100px;
}

/* Descend un peu la card de détails de la commune */
#sidebar-content .card {
    margin-top: 30px;
}

#sidebar-title {
    margin-top: 30px;
}