/* RESET */
body, html {
    margin: 0;
    padding: 0;
}

/* HEADER FIXÉ */
.menu {
    position: fixed;
    top: 0;
}

/* MAIN */
main {
    flex: 1;
    width: 100%;
    overflow-y: auto;
    padding: 10px;
    margin-top: 10px;
    margin-bottom: 60px;
    box-sizing: border-box;
}

/* TITRE PRINCIPAL */
.titre h1 {
    text-align: center;
    margin: 15px 0px -15px;
}

/* BLOCS DE CATÉGORIE */
.categorie-block {
    width: 100%;
    display: block;
    clear: both;
    margin-bottom: 40px;
    padding: 20px;
    border-radius: 12px;
    box-sizing: border-box;
    background-color: rgba(0, 255, 0, 0.1); /* vert clair */
}
.categorie-block h2 {
    display: block;
    width: 100%;
    margin: 0 auto 10px;
    padding: 0;
    text-align: center;
    font-size: 1.4em;
    color: #333;
    box-sizing: border-box;
    overflow-wrap: break-word;
}

/* CONTENEUR POUR LES CARTES */
.tableaux-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

/* CARTE DE TABLEAU */
.carte-tableau {
    width: calc(25% - 20px);
    box-sizing: border-box;
    border: 1px solid #ddd;
    border-radius: 10px;
    overflow: hidden;
    padding: 10px;
    background-color: #fff;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    height: auto;
}
.carte-tableau:hover {
    transform: scale(1.05);
}
.carte-tableau a {
    text-decoration: none;
    color: black;
}

/* IMAGE */
.image-container {
    width: 100%;
    height: 200px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}
.image-container img {
    max-height: 100%;
    max-width: 100%;
    object-fit: cover;
    display: block;
    border-radius: 10px;
}

/* CONTENU CARTE */
.carte-contenu {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.carte-contenu h3 {
    margin: 10px 0;
}
.carte-contenu p {
    margin: 5px 0;
}

/* ACTIONS */
.carte-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
}
.carte-actions a {
    text-decoration: none;
    font-weight: bold;
}
.carte-actions a:hover {
    text-decoration: underline;
}

/* TITRE RÉDUIT POUR LONGS TEXTES */
.titrefiche, .titrefiche1 {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    text-align: center;
    font-size: 0.8em;
}

/* TOOLTIPS */
.tooltip .tooltiptext {
    visibility: hidden;
    width: 220px;
    background-color: #333;
    color: #fff;
    text-align: left;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    white-space: pre-line;
    pointer-events: none;
}
.tooltip:hover .tooltiptext:not(.clicked) {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -60%);
}
.tooltip .tooltiptext.clicked {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -60%);
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .titre h1 {
        margin: 2px;
    }
    .tableaux-container {
        flex-direction: column;
        align-items: center;
    }
    .carte-tableau {
        width: 95% !important;
    }
    .categorie-block h2 {
        font-size: 1.3em;
    }
}