/* === ARTICLE - Styles spécifiques aux articles et contenu long === */

/* === INFO BOX / INFOBOX === */

#titre_trad {
    float: left;
    width: 84px;
    margin: 0 1rem 1rem 0;
    text-align: center;
}

#titre_trad .translated-text {
    padding: 0;
    overflow-x: hidden;
    overflow-y: visible;
}

#info_box.infobox {
    color: var(--Or1);
    margin: 0 0 1rem 1rem;
    background: #f9f9f9;
    border-radius: 15px;
    font-size: 90%;
    box-sizing: border-box;
    overflow-x: hidden;
    padding: 5px;
}

#info_box table {
    width: 100% !important;
    max-width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    box-sizing: border-box;
}

#info_box th,
#info_box td {
    padding: .2em;
    text-align: left;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    max-width: 0;
}

#info_box table [width],
#info_box table td[width],
#info_box table th[width] {
    width: auto !important;
}

.infobox th {
    background: var(--Marron5);
    text-align: center;
    padding: .2em;
}

.infobox ul {
    margin: 0;
    padding-left: 1em;
}

#info_box .col-left {
    width: 35% !important;
}

#info_box .col-right {
    width: 65% !important;
}

.infobox .poste-list {
    padding: 0px !important;
}

.infobox .poste-list .poste-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: .3rem;
}

#info_box .logo {
    margin: 5px;
}

#info_box .logo img {
    width: 35px !important;
}

/* === TAGS === */

.tag {
    background-color: var(--tag-color, #ddd);
    color: #fff;
    padding: 2px 6px;
    border-radius: 15px;
    font-size: 1rem;
}

.fixed-tags {
    position: fixed;
    bottom: 5px;
    right: 5px;
    z-index: 1000;
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    padding: 5px 8px;
    border-radius: 15px;
    width: fit-content;
    max-width: 95vw;
    margin-left: 0;
}

/* === FAVORITE TOGGLE === */

.favorite-toggle {
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--Or2);
    float: right;
}

/* === ARTICLE FLOW DESKTOP === */

@media (min-width: 769px) {
    #titre_trad {
        float: left;
        margin: 0 12px 12px 0;
    }
}

/* === ARTICLE FLOW MOBILE === */

@media (max-width: 769px) {
    .tag {
        font-size: 0.7rem;
    }

    .article-actions {
        gap: .4rem;
    }

    .article-actions .btn {
        padding: .25rem .5rem;
        font-size: .825rem;
        border-radius: .5rem;
        line-height: 1.15;
    }

    /* Stopper les floats */
    #titre_trad,
    #info_box.infobox {
        float: none;
        max-width: 100%;
        margin: 0;
    }

    /* Grille mobile : trad | titre+intro, puis infobox, puis corps */
    .article-flow {
        display: grid;
        grid-template-columns: 68px 1fr;
        grid-template-areas:
            "trad title"
            "trad intro"
            "info info"
            "corps corps";
        column-gap: 12px;
        row-gap: 8px;
    }

    #titre_trad {
        grid-area: trad;
        width: 70px;
    }

    h1.centered-content {
        grid-area: title;
        margin: 0;
    }

    #intro {
        grid-area: intro;
        margin: 0;
    }

    #info_box {
        grid-area: info;
        width: 100% !important;
        max-width: 14rem !important;
        justify-self: center;
        text-align: center;
    }

    #info_box table {
        width: 100% !important;
        table-layout: fixed !important;
        border-collapse: collapse;
    }

    #corps {
        grid-area: corps;
        grid-column: 1 / -1;
    }

    #info_box.infotab table th,
    #info_box.infotab table td {
        white-space: normal;
        word-break: break-word;
        overflow-wrap: anywhere;
    }
}

/* === TABLEAUX - Colonnes de même largeur === */

/* Classe appliquée automatiquement à tous les tableaux générés par Markdown */
table.equal-columns {
    table-layout: fixed;
    width: 100%;
}

table.equal-columns td,
table.equal-columns th {
    word-wrap: break-word;
    overflow-wrap: break-word;
}