/* ==========================================================================
   Pied de page du site public — partials/_hp_footer.html.twig.

   D'apres la maquette validee de l'accueil : fond gris clair, colonne de
   1200 px, grille de 12 colonnes (marque sur 4, puis trois listes de liens),
   ligne de base separee par un filet. Ecrit contre public/css/tokens.css,
   sans valeur de couleur brute.
   ========================================================================== */

/* Le chassis pose un « © Stackly » minuscule sous la page des visiteurs non
   connectes. Des que ce pied est charge, il fait double emploi. */
body > footer:not(.pft) {
    display: none;
}

.pft {
    --pft-colonne: 1200px;

    padding: var(--space-10) max(var(--gutter-page), calc((100% - var(--pft-colonne)) / 2)) 28px;
    border-top: 1px solid var(--border);
    background: var(--surface-sunken);
    color: var(--ink-muted);
    font-family: var(--font-ui);
}

.pft :where(p, ul, li) {
    margin: 0;
    padding: 0;
}

.pft ul {
    list-style: none;
}

.pft-grille {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--space-6);
}

/* ---------- Marque --------------------------------------------------------- */
.pft-marque {
    grid-column: 1 / span 4;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.pft-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-brand);
    font-size: 19px;
    font-weight: var(--weight-bold);
    letter-spacing: -0.02em;
    color: var(--ink);
}

.pft-desc {
    max-width: 300px;
    font-size: var(--text-body);
    line-height: var(--lh-normal);
}

/* ---------- Colonnes de liens ---------------------------------------------- */
.pft-col {
    grid-column: span 2;
    font-size: 14px;
    line-height: var(--lh-normal);
}

.pft-col:nth-of-type(1) { grid-column: 6 / span 2; }
.pft-col:nth-of-type(3) { grid-column: 10 / span 3; }

.pft-titre {
    margin-bottom: var(--space-1);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    color: var(--ink);
}

.pft-col ul {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.pft a {
    color: var(--ink-secondary);
    text-decoration: none;
    border-radius: var(--radius-chip);
}

.pft a:hover {
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.pft a:focus-visible {
    outline: 2px solid var(--info);
    outline-offset: 2px;
}

/* ---------- Ligne de base -------------------------------------------------- */
.pft-base {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--space-2) var(--space-4);
    margin-top: var(--space-8);
    padding-top: 18px;
    border-top: 1px solid var(--border);
    font-size: 14px;
}

/* ---------- Tablette et telephone ------------------------------------------ */
@media (max-width: 960px) {
    .pft-grille {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: var(--space-8) var(--space-6);
    }

    .pft-marque,
    .pft-col:nth-of-type(n) {
        grid-column: auto;
    }

    .pft-marque {
        grid-column: 1 / -1;
    }
}

@media (max-width: 640px) {
    /* Au telephone, le pied tient en peu de hauteur : Outils et Stackly cote
       a cote, les informations legales en une ligne qui se replie. */
    .pft {
        padding-top: var(--space-8);
    }

    .pft-grille {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--space-6) var(--space-4);
    }

    .pft-marque {
        gap: var(--space-2);
    }

    .pft-col:nth-of-type(3) {
        grid-column: 1 / -1;
    }

    .pft-col:nth-of-type(3) ul {
        flex-direction: row;
        flex-wrap: wrap;
        column-gap: var(--space-4);
    }

    .pft-col:nth-of-type(3) a {
        min-height: 28px;
        font-size: var(--text-sm);
    }

    .pft-col ul {
        gap: 0;
    }

    /* Une cible de toucher de 32 px par lien. */
    .pft-col a {
        display: inline-flex;
        align-items: center;
        min-height: 32px;
    }

    .pft-base {
        margin-top: var(--space-6);
    }
}
