/* ENCART PIED 1 - GRILLE DE TUILES
 *
 * Sous-composant partagé par les dix pieds de page : chaque règle est
 * préfixée par le hook de l'hôte + la racine (CLAUDE.md §4.12), pour passer
 * devant les `.footer-X .col li`, `.footer-X ul`… des hôtes.
 *
 * Couleurs : l'hôte pose la couleur de texte qui va avec SON fond ; l'encart
 * la reprend (`inherit`) et en dérive filets et aplats par `currentColor`.
 * Lisible sur un footer --primary comme sur un footer --white.
 */

[data-footer] .encart-pied-1 {
    display: block;
    color: inherit;
    background: none;
    max-width: 1300px;
    margin: 0 auto;
    padding: clamp(2rem, 4vw, 3rem) clamp(1rem, 3vw, 1.5rem) clamp(1.75rem, 3.5vw, 2.5rem);
    border-top: 1px solid color-mix(in srgb, currentColor 15%, transparent);
    border-bottom: 1px solid color-mix(in srgb, currentColor 15%, transparent);
    box-sizing: border-box;
    width: 100%;
}

[data-footer] .encart-pied-1 .encart-pied-1__inner {
    max-width: 1100px;
    margin: 0 auto;
    text-align: center;
}

/* ---- Titre centré entre deux filets --------------------------- */
[data-footer] .encart-pied-1 .encart-pied-1__entete {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin: 0 0 14px;
}

[data-footer] .encart-pied-1 .encart-pied-1__filet {
    flex: 1;
    max-width: clamp(60px, 10vw, 120px);
    height: 1px;
    background: color-mix(in srgb, currentColor 30%, transparent);
}

[data-footer] .encart-pied-1 .encart-pied-1__titre,
[data-footer] .encart-pied-1 .encart-pied-1__titre:hover {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: inherit;
    font-family: var(--font-heading);
    font-size: clamp(0.88rem, 1.4vw, 1rem);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    white-space: nowrap;
}

[data-footer] .encart-pied-1 .encart-pied-1__titre-texte {
    color: inherit;
}

[data-footer] .encart-pied-1 .encart-pied-1__titre-icone {
    width: 1em;
    height: 1em;
    flex-shrink: 0;
    opacity: 0.85;
}

/* ---- Sous-titre ------------------------------------------------ */
[data-footer] .encart-pied-1 .encart-pied-1__sous-titre {
    margin: 0 0 32px;
    color: inherit;
    opacity: 0.65;
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-style: italic;
    line-height: 1.5;
    letter-spacing: 0.02em;
}

/* ---- Grille ---------------------------------------------------- */
[data-footer] .encart-pied-1 .encart-pied-1__grille {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

[data-footer] .encart-pied-1 .encart-pied-1__item {
    display: flex;
    margin: 0;
    padding: 0;
    color: inherit;
}

/* Une tuile est un <a> (élément avec URL) ou un <span> (sans URL). */
[data-footer] .encart-pied-1 .encart-pied-1__tuile {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin: 0;
    padding: 13px 16px;
    color: inherit;
    font-family: var(--font-body);
    border: 1px solid color-mix(in srgb, currentColor 12%, transparent);
    border-radius: 6px;
    background: color-mix(in srgb, currentColor 5%, transparent);
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease;
}

[data-footer] .encart-pied-1 a.encart-pied-1__tuile--lien {
    cursor: pointer;
}

[data-footer] .encart-pied-1 a.encart-pied-1__tuile--lien:hover,
[data-footer] .encart-pied-1 a.encart-pied-1__tuile--lien:focus-visible {
    color: inherit;
    background: color-mix(in srgb, currentColor 12%, transparent);
    border-color: color-mix(in srgb, currentColor 35%, transparent);
}

[data-footer] .encart-pied-1 a.encart-pied-1__tuile--lien:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

[data-footer] .encart-pied-1 .encart-pied-1__tuile-icone {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    opacity: 0.85;
}

[data-footer] .encart-pied-1 .encart-pied-1__tuile-libelle {
    color: inherit;
    font-family: var(--font-body);
    font-size: 0.83rem;
    font-weight: 500;
    line-height: 1.35;
    letter-spacing: 0.02em;
    text-align: left;
}

/* ---- Intitulé de métier (multi-métiers seulement, §4.16-17) ----
 * Surface utilitaire : un intitulé et un filet, comme les colonnes des
 * footers. Le texte garde la couleur de l'hôte (fond inconnu) ; seul le filet
 * prend la teinte du métier, de la couleur de l'hôte vers --secondary. */
[data-footer] .encart-pied-1 .encart-pied-1__metier {
    --m-couleur: color-mix(in oklab, currentColor, var(--secondary) var(--m-melange, 0%));
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 10px 0 0;
    padding: 0;
    color: inherit;
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    text-align: left;
}

[data-footer] .encart-pied-1 .encart-pied-1__metier:first-child {
    margin-top: 0;
}

[data-footer] .encart-pied-1 .encart-pied-1__metier::after {
    content: "";
    flex: 1;
    height: 2px;
    background: var(--m-couleur);
    opacity: 0.6;
}

/* ---- Responsive ------------------------------------------------ */
@media (max-width: 1024px) {
    [data-footer] .encart-pied-1 .encart-pied-1__grille {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    [data-footer] .encart-pied-1 .encart-pied-1__grille {
        gap: 10px;
    }

    [data-footer] .encart-pied-1 .encart-pied-1__tuile {
        flex-direction: column;
        gap: 6px;
        padding: 11px 10px;
        text-align: center;
    }

    [data-footer] .encart-pied-1 .encart-pied-1__tuile-libelle {
        font-size: 0.75rem;
        text-align: center;
    }

    [data-footer] .encart-pied-1 .encart-pied-1__titre,
    [data-footer] .encart-pied-1 .encart-pied-1__titre:hover {
        white-space: normal;
    }
}

@media (max-width: 360px) {
    [data-footer] .encart-pied-1 .encart-pied-1__grille {
        grid-template-columns: 1fr;
    }
}
