body {
    width: auto;
    height: auto;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    overflow-x: hidden;
    margin: 0 15%;
    margin-top: -100px;
    box-sizing: border-box;
}

@media (max-width: 1200px) {
    body {
        margin-left: 10%;
        margin-right: 10%;
    }
}

@media (max-width: 768px) {
    body {
        margin-left: 5%;
        margin-right: 5%;
    }
}

@media (max-width: 480px) {
    body {
        margin: 2%;
    }
}
/* Stabilise la largeur et centre les images */
article img {
  display: block;
  width: 100%;
  max-width: 670px; /* ou 900px si tu préfères plus large */
  height: auto;
  margin: 0 auto;
}

html { overflow-y: scroll; }

img {
    display: block;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

code {
    background-color: #e3e0e0;
    border-radius: 3px;
    padding-top: 2px;
    box-sizing: border-box;
}

h1 {
    font-size: 2em;
}

h2 {
    color: #337EA9;
    padding-bottom: 1%;
    padding-top: 10%;
    font-size: 1.8em;
}

h3 {
    color: #448361;
    padding-top: 2%;
    font-size: 1.5em;
}

p {
    padding-top: 2%;
}

a {
    text-decoration: none;
    color: #337EA9;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

table, th, td {
    border: 1px solid #ddd;
}

th, td {
    padding: 12px;
    text-align: left;
}

th {
    background-color: #333;
    color: white;
}

.conclusionBlock {
    border: 1px solid #db6262;
    padding: 15px;
    padding-top: 0px;
    border-radius: 5px;
    background-color: #f9f9f9;
    max-width: 100%;
    box-sizing: border-box;
    margin: 15px auto;
}

@media (max-width: 768px) {
    .conclusionBlock {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .conclusionBlock {
        padding: 8px;
        font-size: 0.9em;
    }
}

.figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 1em auto;
    max-width: 100%;
}

.figure img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.figure-caption {
    font-size: 0.8em;
    color: #555;
    margin-top: 0.5em;
    font-style: italic;
    text-align: center;
    margin-bottom: 1.5em;
}

/* Styles pour les formules KaTeX en mode display uniquement */
.katex-display {
    display: block;
    max-width: 100%;      /* S'assure que les formules ne dépassent pas la largeur de l'écran */
    overflow-x: auto;     /* Active un défilement horizontal si nécessaire */
    white-space: nowrap;  /* Empêche les formules de se casser */
}

@media (max-width: 768px) {
    .katex-display {
        font-size: 0.9em;  /* Taille ajustée pour écrans moyens */
    }
}

@media (max-width: 480px) {
    .katex-display {
        font-size: 0.8em;           /* Taille réduite pour petits écrans */
        transform: scale(0.9);       /* Échelle de réduction supplémentaire */
        transform-origin: left top;  /* Maintient l’alignement à gauche */
    }
}
