/**
 * Annuaire structures — CSS v2025
 * BEM structure-card, inspiré manif-card
 * UIkit 3 (jl-*)
 */

/* ========================================
   FILTRES
   ======================================== */
.annuaire-filters {
    margin-bottom: 30px;
    background: #f7f7f7;
    border-bottom: 1px solid #ebebeb;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.annuaire-filters .jl-subnav {
    margin: 0;
    padding: 0;
    flex-wrap: nowrap;
}

.annuaire-filters .jl-subnav > * {
    padding-left: 8px;
}

.annuaire-filters .jl-subnav > :first-child {
    padding-left: 0;
}

.annuaire-filters__search {
    margin-left: auto;
    display: flex;
    align-items: center;
}

.annuaire-filters__search .jl-input {
    width: 200px;
    height: 34px;
}

/* Scroll pilules catégories (mobile) */
.annuaire-filters__cats {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    .annuaire-filters {
        flex-direction: column;
        align-items: stretch;
    }
    .annuaire-filters .jl-subnav {
        flex-wrap: wrap;
    }
    .annuaire-filters__search {
        margin-left: 0;
    }
    .annuaire-filters__search .jl-input {
        width: 100%;
    }
}

/* ========================================
   GRILLE
   ======================================== */
.annuaire-structures-grid {
    margin-top: 20px;
}

.annuaire-structures-grid [hidden] {
    display: none !important;
}

/* ========================================
   CARTE STRUCTURE (BEM)
   ======================================== */
.structure-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s, transform 0.3s;
    text-decoration: none;
    color: inherit;
}

.structure-card:hover {
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
    transform: translateY(-3px);
    text-decoration: none;
    color: inherit;
}

/* --- Cover (illustration) --- */
.structure-card__cover {
    position: relative;
    overflow: hidden;
    background: #e8e4df;
}

.structure-card__cover img {
    width: 100%;
    display: block;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.structure-card:hover .structure-card__cover img {
    transform: scale(1.05);
}

/* Logo bande sous la cover */
.structure-card__logo-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 70px;
    padding: 6px 12px;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
}

.structure-card__logo-strip img {
    max-width: 80%;
    max-height: 60px;
    object-fit: contain;
}

/* Type label (top-left) */
.structure-card__type {
    position: absolute;
    top: 0;
    left: 0;
    padding: 3px 10px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #fff;
    background: linear-gradient(135deg, #fe0000 0%, #d40000 100%);
    border-radius: 0 0 6px 0;
    z-index: 2;
    line-height: 1.6;
}

/* --- Fallback : logo centré sans cover --- */
.structure-card__media {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 120px;
    padding: 12px;
    background: #ffffff;
}

.structure-card__media img {
    max-width: 80%;
    max-height: 90px;
    object-fit: contain;
}

/* --- Body --- */
.structure-card__body {
    padding: 10px 12px 0;
    flex: 1;
}

.structure-card__title {
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 2px;
    color: #1a1a1a;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.structure-card:hover .structure-card__title {
    color: #c8102e;
}

.structure-card__subtitle {
    font-size: 11.5px;
    color: #888;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Footer --- */
.structure-card__footer {
    padding: 8px 12px;
    margin-top: auto;
    border-top: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    font-size: 11px;
    color: #999;
}

.structure-card__ville {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.structure-card__ville i {
    color: #c8102e;
    font-size: 10px;
}

.structure-card__ident {
    font-weight: 600;
    color: #555;
    white-space: nowrap;
}

.structure-card__sigle {
    font-style: italic;
    color: #aaa;
    white-space: nowrap;
}

/* Tags cachés pour recherche texte */
.structure-card__tags {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 639px) {
    .structure-card__body { padding: 8px 10px 0; }
    .structure-card__title { font-size: 12.5px; }
    .structure-card__footer { padding: 6px 10px; font-size: 10px; }
    .structure-card__logo-strip { height: 42px; }
    .structure-card__logo-strip img { max-height: 30px; }
}
