/* ================================================================
   Annuaire LRS — Feuille de style front-end v1.0.0
   ================================================================ */

:root {
    --alrs-primary:  #1a3a5c;
    --alrs-accent:   #e8a020;
    --alrs-bg:       #f7f8fc;
    --alrs-card:     #ffffff;
    --alrs-border:   #dde3f0;
    --alrs-radius:   8px;
    --alrs-shadow:   0 2px 8px rgba(26,58,92,.08);
    --alrs-font:     'Segoe UI', system-ui, sans-serif;
}

/* ── Conteneur ─────────────────────────────────────────────────── */
.alrs-wrapper {
    font-family: var(--alrs-font);
    background: var(--alrs-bg);
    border-radius: var(--alrs-radius);
    padding: 0 0 40px;
    max-width: 100%;
}

/* ── Titre ─────────────────────────────────────────────────────── */
.alrs-header { margin-bottom: 20px; }
.alrs-titre  { margin: 0; line-height: 1.2; letter-spacing: -.02em; }

/* ── Fil d'Ariane ──────────────────────────────────────────────── */
.alrs-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 20px;
    padding: 10px 16px;
    background: var(--alrs-card);
    border: 1px solid var(--alrs-border);
    border-radius: var(--alrs-radius);
    font-size: 13px;
}
.alrs-bc-link {
    color: var(--alrs-primary);
    font-weight: 600;
    text-decoration: none;
}
.alrs-bc-link:hover { color: var(--alrs-accent); }
.alrs-bc-sep    { color: #aab; font-size: 16px; line-height: 1; }
.alrs-bc-current { color: var(--alrs-accent); font-weight: 700; }

/* ── Barre de recherche ────────────────────────────────────────── */
.alrs-search-wrap {
    position: relative;
    width: 100% !important;
    display: block !important;
    margin-bottom: 20px;
    box-sizing: border-box;
}
.alrs-search {
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 13px 48px 13px 44px;
    border: 2px solid var(--alrs-border);
    border-radius: var(--alrs-radius);
    font-size: 15px;
    font-family: var(--alrs-font);
    background: var(--alrs-card);
    color: var(--alrs-primary);
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    display: block !important;
}
.alrs-search:focus {
    border-color: var(--alrs-accent);
    box-shadow: 0 0 0 3px rgba(232,160,32,.15);
}
.alrs-search-icon {
    position: absolute;
    left: 14px; top: 50%;
    transform: translateY(-50%);
    color: var(--alrs-primary);
    opacity: .45;
    pointer-events: none;
    display: flex; align-items: center;
}
.alrs-search-clear {
    position: absolute;
    right: 12px; top: 50%;
    transform: translateY(-50%);
    background: none; border: none;
    cursor: pointer; font-size: 20px;
    color: #aab; padding: 0 4px;
    display: none;
}

/* ── Filtres hiérarchiques ─────────────────────────────────────── */
.alrs-filtres {
    margin-bottom: 24px;
    padding: 18px 20px;
    background: var(--alrs-card);
    border: 1px solid var(--alrs-border);
    border-left: 4px solid var(--alrs-accent);
    border-radius: var(--alrs-radius);
    box-shadow: var(--alrs-shadow);
}
.alrs-filtres-titre {
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 700;
    color: var(--alrs-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.alrs-filtres-count {
    font-weight: 400;
    color: #8898aa;
    font-size: 12px;
}
.alrs-filtres-liste {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.alrs-filtre-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: var(--alrs-bg);
    color: var(--alrs-primary);
    border: 1.5px solid var(--alrs-border);
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--alrs-font);
    text-decoration: none;
    cursor: pointer;
    transition: all .18s;
    white-space: nowrap;
}
.alrs-filtre-btn:hover {
    background: var(--alrs-accent);
    color: #fff;
    border-color: var(--alrs-accent);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(232,160,32,.3);
}
.alrs-filtre-btn.alrs-filtre-actif {
    background: var(--alrs-primary);
    color: #fff;
    border-color: var(--alrs-primary);
}
.alrs-filtre-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    background: rgba(255,255,255,.25);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
}
.alrs-filtre-btn:not(:hover):not(.alrs-filtre-actif) .alrs-filtre-count {
    background: var(--alrs-border);
    color: var(--alrs-primary);
}

/* ── Barre d'outils (résultats + bascule vue) ──────────────────── */
.alrs-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 12px;
    flex-wrap: wrap;
}
.alrs-resultats {
    margin: 0;
    font-size: 13.5px;
    color: #6b7f99;
}
.alrs-resultats strong { color: var(--alrs-primary); }

.alrs-vue-toggle {
    display: flex;
    gap: 4px;
    background: var(--alrs-card);
    border: 1px solid var(--alrs-border);
    border-radius: 6px;
    padding: 3px;
}
.alrs-vue-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #8898aa;
    cursor: pointer;
    transition: all .15s;
}
.alrs-vue-btn:hover { background: var(--alrs-bg); color: var(--alrs-primary); }
.alrs-vue-btn.alrs-vue-actif {
    background: var(--alrs-primary);
    color: #fff;
}

/* ── Grille de fiches ──────────────────────────────────────────── */
.alrs-fiches.alrs-vue-grille {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}
.alrs-fiches.alrs-vue-liste {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ── Carte fiche ───────────────────────────────────────────────── */
.alrs-fiche {
    background: var(--alrs-card);
    border: 1px solid var(--alrs-border);
    border-radius: var(--alrs-radius);
    box-shadow: var(--alrs-shadow);
    overflow: hidden;
    transition: box-shadow .2s, transform .18s;
    display: flex;
    flex-direction: column;
}
.alrs-fiche:hover {
    box-shadow: 0 6px 22px rgba(26,58,92,.13);
    transform: translateY(-2px);
}

/* Vue liste : horizontal */
.alrs-vue-liste .alrs-fiche {
    flex-direction: row;
    align-items: flex-start;
}

/* ── Miniature ─────────────────────────────────────────────────── */
.alrs-fiche-thumb {
    flex-shrink: 0;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: var(--alrs-bg);
}
.alrs-vue-liste .alrs-fiche-thumb {
    width: 140px;
    aspect-ratio: 1;
}
.alrs-fiche-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s;
}
.alrs-fiche:hover .alrs-fiche-thumb img { transform: scale(1.04); }

/* ── Corps de la fiche ─────────────────────────────────────────── */
.alrs-fiche-corps {
    flex: 1;
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.alrs-fiche-titre {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--alrs-primary);
    line-height: 1.3;
}
.alrs-fiche-titre a {
    color: inherit;
    text-decoration: none;
}
.alrs-fiche-titre a:hover { color: var(--alrs-accent); }

/* Tags de niveaux cliquables */
.alrs-fiche-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.alrs-fiche-tag {
    display: inline-block;
    padding: 2px 10px;
    background: #eef2ff;
    color: var(--alrs-primary);
    border-radius: 50px;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s;
}
.alrs-fiche-tag:hover {
    background: var(--alrs-accent);
    color: #fff;
}

/* Champs personnalisés */
.alrs-fiche-champs {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.alrs-champ-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 13px;
}
.alrs-champ-row dt {
    flex-shrink: 0;
    font-weight: 600;
    color: #6b7f99;
    min-width: 80px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.alrs-champ-row dd {
    margin: 0;
    color: var(--alrs-primary);
    word-break: break-word;
}
.alrs-champ-row dd a {
    color: var(--alrs-accent);
    text-decoration: none;
}
.alrs-champ-row dd a:hover { text-decoration: underline; }

/* Extrait */
.alrs-fiche-extrait {
    font-size: 13.5px;
    color: #4a5568;
    line-height: 1.65;
    flex: 1;
}
.alrs-fiche-extrait p { margin: 0; }

/* Bouton voir */
.alrs-fiche-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: auto;
    padding: 8px 16px;
    background: var(--alrs-primary);
    color: #fff;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    align-self: flex-start;
    transition: background .15s;
}
.alrs-fiche-btn:hover { background: var(--alrs-accent); }

/* ── Vide ──────────────────────────────────────────────────────── */
.alrs-vide {
    padding: 48px;
    text-align: center;
    color: #8898aa;
    font-style: italic;
    font-size: 15px;
}

/* ── Pagination ────────────────────────────────────────────────── */
.alrs-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 32px;
    justify-content: center;
}
.alrs-pg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    background: var(--alrs-card);
    color: var(--alrs-primary);
    border: 2px solid var(--alrs-border);
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    font-family: var(--alrs-font);
    transition: all .15s;
}
.alrs-pg-btn:hover {
    background: var(--alrs-accent);
    border-color: var(--alrs-accent);
    color: #fff;
}
.alrs-pg-actif {
    background: var(--alrs-primary);
    border-color: var(--alrs-primary);
    color: #fff;
    pointer-events: none;
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .alrs-fiches.alrs-vue-grille {
        grid-template-columns: 1fr;
    }
    .alrs-vue-liste .alrs-fiche {
        flex-direction: column;
    }
    .alrs-vue-liste .alrs-fiche-thumb {
        width: 100%;
        aspect-ratio: 16/9;
    }
    .alrs-filtre-btn { font-size: 12px; padding: 6px 11px; }
    .alrs-search { font-size: 14px; }
}

/* ════════════════════════════════════════════════════════════════
   BARRE DE RECHERCHE AVEC DÉROULEURS
   ════════════════════════════════════════════════════════════════ */
.alrs-search-form { margin-bottom: 20px; }

.alrs-search-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    background: var(--alrs-card);
    border: 1.5px solid var(--alrs-border);
    border-radius: 12px;
    padding: 10px 12px;
    box-shadow: var(--alrs-shadow);
}

.alrs-select {
    flex: 1;
    min-width: 160px;
    height: 46px;
    padding: 0 36px 0 14px;
    border: 1.5px solid var(--alrs-border);
    border-radius: 8px;
    font-size: 14px;
    font-family: var(--alrs-font);
    color: var(--alrs-primary);
    background: var(--alrs-bg);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%231a3a5c' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: border-color .2s;
    outline: none;
    box-sizing: border-box;
    line-height: 46px;
}
.alrs-select:focus { border-color: var(--alrs-accent); }

.alrs-search-text {
    flex: 2;
    min-width: 160px;
    height: 46px;
    padding: 0 14px;
    border: 1.5px solid var(--alrs-border);
    border-radius: 8px;
    font-size: 14px;
    font-family: var(--alrs-font);
    color: var(--alrs-primary);
    background: var(--alrs-bg);
    outline: none;
    transition: border-color .2s;
    box-sizing: border-box;
}
.alrs-search-text:focus { border-color: var(--alrs-accent); }

.alrs-search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 46px;
    padding: 0 22px;
    background: var(--alrs-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    font-family: var(--alrs-font);
    cursor: pointer;
    white-space: nowrap;
    transition: background .18s;
    box-sizing: border-box;
}
.alrs-search-btn:hover { background: var(--alrs-accent); }

.alrs-reset-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    background: none;
    color: #8898aa;
    border: 1.5px solid var(--alrs-border);
    border-radius: 8px;
    font-size: 18px;
    text-decoration: none;
    transition: all .15s;
    flex-shrink: 0;
    box-sizing: border-box;
}
.alrs-reset-btn:hover {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fca5a5;
}

@media (max-width:640px) {
    .alrs-search-bar { flex-direction: column; }
    .alrs-select, .alrs-search-text, .alrs-search-btn { width: 100%; }
    .alrs-reset-btn { width: 100%; }
}
