
/* Pied de page du design K3 : fond foncé (--c-text), quatre colonnes, puis le copyright et la mention d'affiliation.
   Bords alignés sur le contenu des pages et sur l'en-tête (--page-gutter, --page-width de global.css) */
.site-footer,
.footer-bottom {
    --footer-pad-x: max(var(--page-gutter), (100% - var(--page-width)) / 2);
    background: var(--c-text);
}

.site-footer {
    padding: 48px var(--footer-pad-x) 28px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
    gap: 28px;
}

.footer-logo {
    margin: 0 0 4px;
}

.footer-logo a {
    color: #fff;
    font-size: var(--text-2xl);
    font-weight: 800;
    letter-spacing: -0.04em;
    text-decoration: none;
}

.footer-col__title {
    margin: 0 0 4px;
    color: #fff;
    font-size: var(--text-md);
    font-weight: 800;
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.footer-col ul {
    display: flex;
    flex-direction: column;
    gap: 2px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-col a {
    display: inline-block;
    padding: 4px 0;              /* zone tactile plus haute */
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: var(--text-md);
    transition: color 0.2s;
}

.footer-col a:hover {
    color: #fff;
}

.footer-social {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.footer-col .footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    transition: background 0.2s, color 0.2s;
}

.footer-col .footer-social a:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Copyright à gauche, mention d'affiliation à droite (design K3) */
.footer-bottom {
    padding: 20px var(--footer-pad-x) 40px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px 32px;
    /* trait au-dessus, à la largeur du contenu */
    background: linear-gradient(rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.15)) var(--footer-pad-x) 0 / calc(100% - 2 * var(--footer-pad-x)) 1px no-repeat,
                var(--c-text);
}

.footer-bottom__start {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 24px;
}

.footer-bottom__copy {
    margin: 0;
    font-size: var(--text-sm);
    color: rgba(255, 255, 255, 0.6);
}

.footer-bottom-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
}

.footer-bottom-links a {
    font-size: var(--text-sm);
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-bottom-links a:hover {
    color: #fff;
}

.footer-affiliate-disclaimer {
    max-width: 720px;
    margin: 0;
    font-size: var(--text-sm);
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.6);
}

/* Liens de la ligne du bas qui répètent les colonnes : seulement sur téléphone et dans l'app, où les colonnes sont masquées */
.footer-bottom-links__mobile {
    display: none;
}

/* Téléphone, tablette et application (barre du bas présente) : pied de page compact.
   Les colonnes répètent la barre du bas, son panneau « Plus » et l'accueil : il reste le logo et les réseaux sur une ligne,
   puis une ligne de liens (à propos, support, pages légales), le copyright et la mention d'affiliation */
@media (max-width: 1024px) {
    .site-footer {
        display: block;
        padding: 24px var(--footer-pad-x) 16px;
    }
    .footer-brand {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }
    .footer-brand ul,
    .footer-col:not(.footer-brand) {
        display: none;
    }
    .footer-logo {
        margin: 0;
    }
    .footer-social {
        margin-top: 0;
    }
    .footer-col .footer-social a {
        width: 32px;
        height: 32px;
    }

    /* Place pour la barre de navigation du bas (header.css) : réservée ici plutôt que sous le <body>,
       sinon une bande claire apparaît sous le pied de page quand la barre se masque au défilement */
    .footer-bottom {
        flex-direction: column;
        gap: 10px;
        padding-top: 16px;
        padding-bottom: calc(16px + 60px + env(safe-area-inset-bottom));
    }
    .footer-bottom__start {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .footer-bottom-links {
        order: -1;                       /* les liens avant le copyright */
        gap: 0 16px;
    }
    .footer-bottom-links a {
        padding: 4px 0;                  /* zone tactile plus haute */
    }
    .footer-bottom-links__mobile {
        display: inline-block;
    }
    .footer-bottom__copy {
        font-size: var(--text-xs);
    }
    .footer-affiliate-disclaimer {
        font-size: var(--text-2xs);
    }
}
