/* ==========================================================================
   Fauscyliac mod Wiki - feuille de style
   ========================================================================== */

/* --- Base ---------------------------------------------------------------- */

html {
    font-family: Arial, Helvetica, sans-serif;
    box-sizing: border-box;
}

*, *::before, *::after {
    box-sizing: inherit;
}

body {
    margin: 0;
    background-color: rgb(12, 12, 12);
    color: white;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: green;
}

h1 { color: rgb(0, 255, 0); }
h2 { color: rgb(100, 255, 100); }
h3 { color: rgb(150, 255, 150); }
h4 { color: rgb(200, 255, 200); }
h5 { color: rgb(210, 255, 210); }

/* --- Couleurs utilitaires ------------------------------------------------ */

.jaune       { color: rgb(255, 255, 0); }
.bleu        { color: rgb(48, 114, 255); }
.rouge       { color: red; }
.orange      { color: orange; }
.orange-rose { color: rgb(205, 119, 119); }
.vert        { color: rgb(0, 255, 0); }
.violet      { color: rgb(148, 41, 255); }
.gris        { color: rgb(96, 96, 96); }

/* --- Tailles d'images (remplacent les attributs width/height en %) -------- */

.img-5  { width: 5%;  min-width: 48px; }
.img-30 { width: 30%; min-width: 140px; }
.img-40 { width: 40%; min-width: 160px; }
.img-60 { width: 60%; min-width: 200px; }

/* --- Sections dépliantes ------------------------------------------------- */

section {
    background-color: rgb(21, 21, 21);
    border: 5px solid rgb(30, 30, 30);
}

/* Les sous-sections internes gardent le fond du chapitre. */
.contenu-section section {
    border-width: 3px;
}

.titre-section {
    padding: 10px;
    cursor: pointer;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    user-select: none;
}

.titre-section h2,
.titre-section h3 {
    margin: 0;
}

.titre-section:hover h3,
.titre-section:focus-visible h3 {
    color: rgb(200, 255, 200);
}

.titre-section:hover h2,
.titre-section:focus-visible h2 {
    color: rgb(150, 255, 150);
}

.titre-section:focus-visible {
    outline: 2px solid rgb(0, 255, 0);
    outline-offset: -2px;
}

/* Icône déroulante dessinée en CSS : aucun fichier image à charger. */
.icone-deroulante {
    display: inline-block;
    width: 0;
    height: 0;
    flex: 0 0 auto;
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-top: 13px solid rgb(0, 160, 0);
    transition: transform 0.3s ease;
}

.icone-deroulante.rotate {
    transform: rotate(180deg);
}

.contenu-section {
    padding: 10px;
    display: none;
}

.contenu-section.ouvert {
    display: block;
}

/* --- Sommaire fixe ------------------------------------------------------- */

#sommaire {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    width: 140px;
    max-height: 100vh;
    overflow-y: auto;
    background-color: rgb(18, 18, 18);
    border: 3px solid rgb(30, 30, 30);
    transition: width 0.2s ease;
}

#sommaire.sommaire-ouvert {
    width: 250px;
}

#sommaire ul {
    margin: 0 0 0 10px;
    padding-left: 8px;
    list-style: none;
}

#sommaire a {
    display: block;
    padding: 1px 0;
    color: rgb(0, 100, 0);
    text-decoration: none;
    font-size: small;
}

#sommaire a:hover,
#sommaire a:focus-visible {
    text-decoration: underline;
    color: rgb(0, 255, 0);
}

/* --- Contenu principal --------------------------------------------------- */

#contenu-principal {
    margin-left: 152px;
    padding: 0 12px;
    transition: margin-left 0.2s ease;
}

body.marge-agrandie #contenu-principal {
    margin-left: 262px;
}

.entete {
    font-size: small;
    margin-top: 0;
    padding-top: 10px;
}

.entete p {
    margin: 4px 0;
}

/* --- Barre de progression ------------------------------------------------ */

#progress-bar {
    width: 100px;
    height: 15px;
    border-radius: 5px;
    vertical-align: middle;
    border: none;
    background-color: #212121;
}

#progress-bar::-webkit-progress-bar {
    background-color: #212121;
    border-radius: 5px;
}

#progress-bar::-webkit-progress-value {
    background: linear-gradient(to right, #007b00, #00ff00);
    border-radius: 5px;
}

#progress-bar::-moz-progress-bar {
    background: linear-gradient(to right, #007b00, #00ff00);
    border-radius: 5px;
}

/* --- Tableaux de loot ---------------------------------------------------- */

/* Les tables de loot sont larges : on les fait défiler seules plutôt que
   d'imposer un défilement horizontal à toute la page. */
.table-scroll {
    overflow-x: auto;
    margin-bottom: 12px;
}

table {
    border-collapse: collapse;
    border: 4px solid green;
}

td {
    border: 2px solid rgb(0, 255, 0);
    padding: 10px;
}

th {
    border: 3px solid rgb(0, 84, 0);
    padding: 10px;
}

.titleloot {
    font-size: x-large;
    font-weight: 1000;
}

/* --- Mobile / petits écrans ---------------------------------------------- */

@media (max-width: 900px) {
    #sommaire {
        width: 100%;
        max-height: 45vh;
        border-width: 0 0 3px 0;
    }

    #sommaire.sommaire-ouvert {
        width: 100%;
    }

    #contenu-principal,
    body.marge-agrandie #contenu-principal {
        margin-left: 0;
        padding-top: 52px;
    }

    .img-5,
    .img-30,
    .img-40,
    .img-60 {
        width: auto;
        max-width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    #sommaire,
    #contenu-principal,
    .icone-deroulante {
        transition: none;
    }
}
