/* Bloc Accueil (blocs_home) — le logo cliquable.
   Structure seule ; la peau (padding, couleur du texte) vient du socle du
   bloc ou du site. `:where` garde la spécificité à zéro : les utilitaires
   atb-* et le CSS perso gagnent toujours. */

:where(.atb-home) {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 100%;
    text-decoration: none;
    color: inherit;
    line-height: 1;
}

/* Les tailles sont définies de proche en proche (colonne → lien → icône) pour
   que l'icône puisse RÉTRÉCIR dans une colonne plus étroite qu'elle : la
   largeur demandée est un maximum, jamais un débordement. */
:where(.atb-home__icon) {
    display: inline-flex;
    align-items: center;
    flex: 0 1 auto;
    min-width: 0;
}

/* La largeur se pose sur l'ENVELOPPE de l'icône (`.atgf-icon`, produite par
   le champ at_icon) : c'est elle que custom.css dimensionne — l'image et le
   SVG y sont à 100 % (`.atgf-icon--media img { width: 100% }`, 0-2-1, qui
   battrait toute règle posée ici sur l'image elle-même). Une icône en police
   (Font Awesome, dashicons) se dimensionne par la taille de police. */
:where(.atb-home__icon) > .atgf-icon {
    width: var(--atb-home-width, auto);
    max-width: 100%;
    flex: 0 1 auto;
    min-width: 0;
    font-size: var(--atb-home-width, 2rem);
    line-height: 1;
}

:where(.atb-home__icon) > .atgf-icon--fa,
:where(.atb-home__icon) > .atgf-icon--dashicons {
    width: auto;
}

:where(.atb-home__text) {
    display: flex;
    flex-direction: column;
    gap: 0.15em;
    line-height: 1.2;
}

:where(.atb-home__name) {
    font-family: var(--atb-font-heading, inherit);
    font-weight: 700;
}

:where(.atb-home__tagline) {
    font-size: 0.8em;
    opacity: 0.7;
}

:where(.atb-home--current) {
    cursor: default;
}

/* Icône compacte : l'une ou l'autre, jamais les deux. */
.atb-home__icon--sm {
    display: none;
}

@media (max-width: 767.98px) {
    .atb-home--has-sm > .atb-home__icon:not(.atb-home__icon--sm) {
        display: none;
    }

    .atb-home__icon--sm {
        display: inline-flex;
    }

    :where(.atb-home__icon) > .atgf-icon {
        width: var(--atb-home-width-sm, var(--atb-home-width, auto));
        font-size: var(--atb-home-width-sm, var(--atb-home-width, 2rem));
    }

    :where(.atb-home__icon) > .atgf-icon--fa,
    :where(.atb-home__icon) > .atgf-icon--dashicons {
        width: auto;
    }
}
