/* Annuaire des commerçants : galerie et fiche.
   Reprend l'apparence de l'app Glide : fond bleu nuit, cartes carrées à image claire,
   libellé bleu en petites capitales, nom en blanc, village en gris. */

.egh-annuaire,
.egh-fiche {
    --egh-carte-radius: 10px;
}

.egh-visuellement-cache {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* En-tête de la galerie */
.egh-annuaire-entete {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 24px;
    margin: 32px 0 20px;
}

.egh-annuaire-titre {
    margin: 0;
    font-family: var(--font-serif);
    font-size: clamp(2.4rem, 4vw, 3.4rem);
    color: var(--egh-text-white);
}

.egh-annuaire-intro {
    flex-basis: 100%;
    order: 3;
    margin: 0;
    color: var(--egh-text-gray);
}

.egh-annuaire-entete .egh-bouton {
    margin-left: auto;
}

/* Boutons */
.egh-bouton {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 999px;
    background: var(--egh-navbar-bg);
    color: var(--egh-text-white);
    font-weight: 600;
    font-size: 1.5rem;
    text-decoration: none;
}

.egh-bouton:hover {
    background: var(--egh-navbar-btn-active);
}

.egh-bouton-accent {
    background: var(--egh-accent-green);
    color: var(--egh-primary-dark);
}

.egh-bouton-accent:hover {
    background: #c6ec3c;
}

/* Filtres */
.egh-filtres {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

.egh-filtre input,
.egh-filtre select {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1px solid var(--egh-border-color);
    border-radius: 8px;
    background: var(--egh-secondary-dark);
    color: var(--egh-text-white);
    font-size: 1.6rem;
}

.egh-filtre input::placeholder {
    color: var(--egh-text-gray);
}

.egh-compteur,
.egh-vide {
    color: var(--egh-text-gray);
    font-size: 1.4rem;
    margin: 0 0 16px;
}

/* Galerie */
.egh-galerie {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 24px 18px;
    margin-bottom: 64px;
}

.egh-carte {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--egh-text-white);
    text-decoration: none;
}

.egh-carte[hidden] {
    display: none;
}

.egh-carte-image {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: var(--egh-carte-radius);
    background: #ffffff;
    transition: transform 0.15s ease;
}

.egh-carte:hover .egh-carte-image {
    transform: translateY(-2px);
}

.egh-carte-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.egh-carte-initiale {
    padding: 12px;
    color: var(--egh-navbar-bg);
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.2;
}

.egh-carte-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 8px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--egh-accent-blue);
}

.egh-carte-tags li {
    margin: 0;
}

.egh-carte-tags li[data-slug^="village-"] {
    color: var(--egh-text-gray);
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
}

.egh-carte-nom {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--egh-text-white);
}

/* Fiche : fond sombre comme l'app (custom.css force le clair avec !important) */
.gh-main.egh-fiche {
    background-color: var(--egh-primary-dark) !important;
    color: var(--egh-text-white) !important;
    padding: 0 0 64px !important;
}

.egh-fiche h1,
.egh-fiche h2,
.egh-fiche h3 {
    color: var(--egh-text-white) !important;
}

.egh-fiche .gh-content p,
.egh-fiche .gh-content li {
    color: #dfe3f0 !important;
}

.egh-fiche .gh-content strong {
    color: var(--egh-text-white);
}

.egh-fiche .gh-content a:not(.kg-btn) {
    color: var(--egh-accent-green);
}

.egh-fiche-banniere {
    height: clamp(160px, 28vw, 320px);
    background-size: cover;
    background-position: center;
    background-color: var(--egh-navbar-bg);
}

.egh-fiche-banniere-vide {
    height: 90px;
}

/* Sur une fiche, le bandeau du site laisse la place à la bannière du commerce */
body:has(.egh-fiche) .gh-banner {
    display: none;
}

.egh-fiche-fil {
    padding: 12px 0;
}

.egh-retour {
    display: inline-block;
    margin: 0;
    color: var(--egh-text-gray);
    font-size: 1.4rem;
    text-decoration: none;
}

.egh-retour:hover {
    color: var(--egh-accent-green);
}

.egh-fiche-identite {
    display: flex;
    gap: 24px;
    align-items: flex-end;
    margin-top: 12px;
}

.egh-fiche-logo {
    flex: 0 0 150px;
    width: 150px;
    height: 150px;
    margin-top: -90px;
    padding: 8px;
    object-fit: contain;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.egh-fiche-nom {
    margin: 4px 0 0;
    font-family: var(--font-serif);
    font-size: clamp(2.8rem, 5vw, 4.2rem);
    line-height: 1.1;
}

.egh-ouvert {
    margin: 8px 0 0;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--egh-text-gray);
}

.egh-ouvert::before {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 8px;
    border-radius: 50%;
    background: #e5484d;
}

.egh-ouvert.est-ouvert::before {
    background: var(--egh-accent-green);
}

.egh-fiche-contenu {
    margin-top: 32px;
}

.egh-fiche-contenu h2 {
    margin-top: 40px;
    font-size: 2.2rem;
}

/* Horaires */
.egh-fiche-contenu ul {
    padding-left: 0;
    list-style: none;
}

.egh-fiche-contenu li {
    margin: 4px 0;
}

.egh-fiche-contenu li.est-aujourdhui {
    color: var(--egh-accent-green) !important;
    font-weight: 700;
}

/* Boutons de contact, comme dans l'app */
.egh-fiche .kg-button-card {
    margin: 10px 0 0;
}

.egh-fiche .kg-button-card .kg-btn {
    display: flex;
    justify-content: center;
    width: 100%;
    max-width: 480px;
    height: 48px;
    border-radius: 10px;
    background: var(--egh-navbar-bg) !important;
    color: var(--egh-text-white) !important;
    font-weight: 600;
    font-size: 1.6rem;
}

.egh-fiche .kg-button-card .kg-btn:hover {
    background: var(--egh-navbar-btn-active) !important;
}

/* Photos */
.egh-fiche .kg-gallery-image img {
    border-radius: 10px;
}

.egh-fiche-actions {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--egh-border-color);
}

.egh-fiche-actions p {
    margin: 0 0 12px;
    color: var(--egh-text-gray);
}

.egh-fiche-articles {
    margin-top: 48px;
}

@media (max-width: 767px) {
    .egh-filtres {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .egh-filtre-recherche {
        grid-column: 1 / -1;
    }

    .egh-galerie {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px 12px;
    }

    .egh-annuaire-entete .egh-bouton {
        margin-left: 0;
    }

    .egh-fiche-identite {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .egh-fiche-logo {
        flex-basis: auto;
        width: 110px;
        height: 110px;
        margin-top: -70px;
    }
}

/* Fond sombre de l'app sur toute la largeur de la galerie */
.gh-main.egh-annuaire {
    /* !important : custom.css force .gh-main en blanc avec !important */
    background-color: var(--egh-primary-dark) !important;
    color: var(--egh-text-white) !important;
    padding-bottom: 32px;
}

.egh-annuaire .egh-annuaire-titre {
    color: var(--egh-text-white);
}

/* custom.css force tous les titres en sombre (!important) : on rétablit le blanc dans la galerie */
.egh-annuaire h1,
.egh-annuaire h2,
.egh-annuaire h3 {
    color: var(--egh-text-white) !important;
}

/* En-tête assemblé dans le modèle (bannière pleine largeur + identité) */
#egh-fiche-rendu {
    margin-top: 0;
}

.egh-fiche-contenu > .egh-fiche-entete {
    margin-top: 0;
}

.egh-fiche-entete .egh-fiche-identite {
    padding: 0 max(4vw, calc((100% - 920px) / 2));
}

.egh-fiche-entete .egh-carte-tags {
    margin: 0;
}

/* Page « Modèle fiche commerce » : aide affichée au-dessus du gabarit */
.egh-modele-aide {
    padding: 16px 20px;
    border-radius: 10px;
    background: #fff8d6;
    color: #4a3d00;
    font-size: 1.5rem;
}

.egh-carte,
.egh-carte-nom {
    min-width: 0;
    overflow-wrap: anywhere;
}
