/* ============================================================
   ASSOCIATIONS LOGOS - Frontend Styles (Rectangle / Card)
   ============================================================ */

/* Grille principale */
.asso-logos-grid {
    display: grid;
    grid-template-columns: repeat(var(--asso-cols, 5), 1fr);
    gap: 20px;
    padding: 20px 0;
    width: 100%;
    box-sizing: border-box;
}

/* Carte rectangulaire */
.asso-logos-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: #ffffff;
    border: 2px solid var(--asso-color, #2271b1);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: default;
}

.asso-logos-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Zone image rectangulaire */
.asso-logos-circle {
    width: 100%;
    height: var(--asso-size, 120px);
    border-radius: 0;
    border: none;
    border-bottom: 2px solid var(--asso-color, #2271b1);
    overflow: hidden;
    background: #f4f7fb;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    cursor: zoom-in;
}

.asso-logos-circle img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    padding: 8px;
    box-sizing: border-box;
    transition: transform 0.3s ease;
}

/* Icône loupe au survol */
.asso-logos-circle::after {
    content: "🔍";
    position: absolute;
    top: 6px;
    right: 8px;
    font-size: 16px;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4));
}

.asso-logos-circle:hover::after {
    opacity: 1;
}

.asso-logos-circle:hover img {
    transform: scale(1.08);
}

/* ============================================================
   MODAL ZOOM
   ============================================================ */

#asso-zoom-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.82);
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    animation: assoFadeIn 0.2s ease;
    cursor: zoom-out;
}

#asso-zoom-overlay.active {
    display: flex;
}

@keyframes assoFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

#asso-zoom-box {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 24px 64px rgba(0,0,0,0.5);
    animation: assoZoomIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: default;
    position: relative;
}

@keyframes assoZoomIn {
    from { transform: scale(0.7); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

#asso-zoom-img-wrap {
    width: 100%;
    background: #f4f7fb;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
    min-height: 260px;
}

#asso-zoom-img-wrap img {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
    display: block;
}

#asso-zoom-footer {
    padding: 14px 20px;
    background: var(--asso-zoom-color, #2271b1);
    text-align: center;
}

#asso-zoom-abbr {
    display: block;
    font-weight: 700;
    font-size: 16px;
    color: #fff;
    letter-spacing: 1px;
    text-transform: uppercase;
}

#asso-zoom-nom {
    display: block;
    font-size: 12px;
    color: rgba(255,255,255,0.85);
    margin-top: 3px;
    line-height: 1.4;
}

#asso-zoom-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: rgba(0,0,0,0.25);
    border: none;
    color: #fff;
    font-size: 20px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 2;
}

#asso-zoom-close:hover {
    background: rgba(0,0,0,0.5);
}

@media (max-width: 480px) {
    #asso-zoom-box { max-width: 95vw; }
    #asso-zoom-img-wrap { min-height: 180px; padding: 16px; }
    #asso-zoom-img-wrap img { max-height: 200px; }
}

/* Bandeau inférieur coloré */
.asso-logos-label {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 6px;
    background: var(--asso-color, #2271b1);
    box-sizing: border-box;
    min-height: 48px;
    justify-content: center;
}

.asso-abbr {
    font-weight: 700;
    font-size: 13px;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    line-height: 1.2;
}

.asso-nom {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.3;
    word-break: break-word;
    hyphens: auto;
}

/* Message vide */
.asso-logos-empty {
    color: #888;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (min-width: 1200px) {
    .asso-logos-grid {
        gap: 24px;
    }
}

/* Tablettes paysage */
@media (max-width: 1024px) {
    .asso-logos-grid {
        grid-template-columns: repeat(4, 1fr);
        --asso-size: 100px;
        gap: 16px;
    }
}

/* Tablettes portrait */
@media (max-width: 768px) {
    .asso-logos-grid {
        grid-template-columns: repeat(3, 1fr);
        --asso-size: 90px;
        gap: 14px;
    }
    .asso-abbr { font-size: 12px; }
    .asso-nom  { font-size: 9px; }
}

/* Mobile */
@media (max-width: 480px) {
    .asso-logos-grid {
        grid-template-columns: repeat(2, 1fr);
        --asso-size: 80px;
        gap: 12px;
    }
    .asso-abbr { font-size: 11px; }
    .asso-nom  { font-size: 9px; }
    .asso-logos-label { padding: 6px 4px; min-height: 40px; }
}

/* Très petit mobile */
@media (max-width: 360px) {
    .asso-logos-grid {
        grid-template-columns: repeat(2, 1fr);
        --asso-size: 70px;
        gap: 10px;
    }
}
