/**
 * Main wrapper for the public directory.
 */
.glem-directory-wrapper {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    font-size: 16px;
}

/**
 * Top area containing filters and map placeholder.
 */
.glem-directory-top {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 0;
    margin-bottom: 36px;
}

/**
 * Green filter panel, similar to the reference layout.
 */
.glem-directory-filters {
    background: #E5FEFF;
    color: var(--e-global-color-primary) !important;
    padding: 24px;
}

/**
 * Filter labels.
 */
.glem-directory-filters label {
    display: block;
    margin: 0 0 8px;
    font-weight: 600;
    color: var(--e-global-color-primary) !important;
}

/**
 * Filter fields.
 */
.glem-directory-filters select,
.glem-directory-filters input {
    width: 100%;
    min-height: 40px;
    margin: 0 0 18px;
    padding: 8px 10px;
    border: 0;
    border-radius: 0;
    background: #ffffff !important;
    color: #222222;
    font-size: 15px;
}

/**
 * Filter buttons.
 */
.glem-filter-button,
.glem-reset-button {
    display: block;
    width: 100%;
    min-height: 40px;
    margin-top: 10px;
    padding: 9px 14px;
    border: 0;
    border-radius: 0;
    background: var(--e-global-color-secondary);
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
}

/**
 * Slightly darker hover state for buttons.
 */
.glem-filter-button:hover,
.glem-reset-button:hover {
    background: var(--e-global-color-primary);
    color: #ffffff;
}

/**
 * Map placeholder area.
 */
.glem-directory-map {
    min-height: 390px;
    background: #eeeeee;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--e-global-color-primary);
    font-weight: 600;
}

/**
 * Table wrapper.
 */
.glem-directory-table-wrap {
    width: 100%;
    overflow-x: auto;
}

/**
 * Directory table.
 */
.glem-directory-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

/**
 * Table cells.
 */
.glem-directory-table th,
.glem-directory-table td {
    padding: 13px 12px;
    border: 0;
    text-align: left;
    vertical-align: top;
}

/**
 * Table header.
 */
.glem-directory-table th {
    color: var(--e-global-color-primary);
    font-weight: 700;
    background: #ffffff;
}

/**
 * Alternating row background, similar to the reference site.
 */
/* .glem-directory-table tbody tr:nth-child(odd) {
    background: #E5FEFF !important;
} */

.glem-directory-table tbody tr:nth-child(even) {
    background: #ffffff;
}

/**
 * Load more button below the directory table.
 */
.glem-load-more-button {
    display: inline-block;
    margin: 24px 0 0;
    padding: 11px 22px;
    border: 0;
    border-radius: 0;
    background: var(--e-global-color-secondary);
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

/**
 * Load more hover state.
 */
.glem-load-more-button:hover {
    background: var(--e-global-color-primary);
    color: #ffffff;
}

/**
 * Message shown when a search returns no matching entries.
 */
.glem-directory-no-results {
    margin: 0 0 24px;
    padding: 16px 18px;
    background: #E5FEFF;
    color: var(--e-global-color-primary);
    font-size: 15px;
    font-weight: 600;
}

/**
 * Keep directory elements from being affected too much by theme/table defaults.
 */
.glem-directory-wrapper * {
    box-sizing: border-box;
}

/**
 * Improve spacing between the filters and the table area.
 */
.glem-directory-wrapper {
    line-height: 1.45;
}

/**
 * Make the map placeholder closer to the site's blue palette.
 */
.glem-directory-map {
    background: #E5FEFF;
    border-left: 1px solid rgba(0, 61, 76, 0.12);
}

/**
 * Improve table readability without forcing alternating blue rows.
 */
.glem-directory-table tbody tr {
    border-bottom: 1px solid rgba(0, 61, 76, 0.12);
}

/**
 * Prevent very long treatment method text from making the table too awkward.
 */
.glem-directory-table td {
    line-height: 1.4;
}

/**
 * Make table headers more consistent with the site's dark blue.
 */
.glem-directory-table th {
    font-size: 14px;
    letter-spacing: 0.01em;
}

/**
 * Improve keyboard accessibility for buttons and fields.
 */
.glem-directory-filters select:focus,
.glem-directory-filters input:focus,
.glem-filter-button:focus,
.glem-reset-button:focus,
.glem-load-more-button:focus {
    outline: 2px solid var(--e-global-color-secondary);
    outline-offset: 2px;
}

/**
 * Make the load more button align visually with the table.
 */
.glem-load-more-button {
    min-height: 42px;
}

/**
 * Better small-screen behavior.
 */
@media (max-width: 768px) {
    .glem-directory-filters {
        padding: 20px;
    }

    .glem-filter-button,
    .glem-reset-button {
        text-align: center;
    }
}

/**
 * Mobile layout.
 */
@media (max-width: 768px) {
    .glem-directory-top {
        grid-template-columns: 1fr;
    }

    .glem-directory-map {
        min-height: 260px;
    }

    .glem-directory-table {
        min-width: 850px;
    }
}

/**
 * Mobile stacked table layout.
 *
 * On mobile, the normal table becomes stacked cards:
 * Label on the left, value on the right.
 */
@media (max-width: 768px) {
    .glem-directory-table-wrap {
        overflow-x: visible;
    }

    .glem-directory-table {
        min-width: 0;
        width: 100%;
        border-collapse: collapse;
    }

    .glem-directory-table thead {
        display: none;
    }

    .glem-directory-table,
    .glem-directory-table tbody,
    .glem-directory-table tr,
    .glem-directory-table td {
        display: block;
        width: 100%;
    }

    .glem-directory-table tr {
        margin: 0 0 22px;
        border-bottom: 0;
        background: #ffffff;
    }

    .glem-directory-table tbody tr:nth-child(odd),
    .glem-directory-table tbody tr:nth-child(even) {
        background: transparent;
    }

    .glem-directory-table td {
        display: grid;
        grid-template-columns: 42% 58%;
        gap: 16px;
        padding: 14px 12px;
        border-bottom: 1px solid rgba(0, 61, 76, 0.12);
        background: #ffffff;
        color: #111111;
    }

    .glem-directory-table tr:nth-child(odd) td {
        background: #E5FEFF;
    }

    .glem-directory-table td::before {
        font-weight: 600;
        color: #111111;
    }

    .glem-directory-table td:nth-child(1)::before {
        content: "Nom";
    }

    .glem-directory-table td:nth-child(2)::before {
        content: "Méthodes";
    }

    .glem-directory-table td:nth-child(3)::before {
        content: "Adresse";
    }

    .glem-directory-table td:nth-child(4)::before {
        content: "Code postal";
    }

    .glem-directory-table td:nth-child(5)::before {
        content: "Ville";
    }

    .glem-directory-table td:nth-child(6)::before {
        content: "Téléphone";
    }
}