/* ═══════════════════════════════════════════════════════════════════
   SwissArchery Clubs – Frontend Styles v2.2 (v1.0.13)
   ═══════════════════════════════════════════════════════════════════ */

.sac-clubs-wrapper {
    --sac-primary: #385FF6;
    --sac-primary-hover: #2548D4;
    --sac-secondary: #555;
    --sac-border: #e0e0e0;
    --sac-bg-light: #f9f9f9;
    --sac-bg-header: #f4f4f4;
    --sac-text: #333;
    --sac-radius: 4px;
    font-family: inherit;
    color: var(--sac-text);
    line-height: 1.5;
    max-width: 100%;
    box-sizing: border-box;
}
.sac-clubs-wrapper *, .sac-clubs-wrapper *::before, .sac-clubs-wrapper *::after {
    box-sizing: border-box;
}

/* ─── Filtres ─────────────────────────────────────────────────────── */
.sac-filters {
    background: var(--sac-bg-light);
    border: 1px solid var(--sac-border);
    border-radius: var(--sac-radius);
    padding: 16px;
    margin-bottom: 16px;
}
.sac-filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}
.sac-filter-search { flex: 1 1 220px; }
.sac-filter-canton { flex: 0 1 260px; }
.sac-filter-toggle { flex: 0 0 auto; }
.sac-filters-info {
    margin-top: 10px;
    font-size: 0.85em;
    color: #666;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}
.sac-filters-info p { margin: 0; }
.sac-count { font-weight: 600; color: var(--sac-primary); }

/* ─── Inputs ──────────────────────────────────────────────────────── */
.sac-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--sac-border);
    border-radius: var(--sac-radius);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}
.sac-input:focus {
    outline: none;
    border-color: var(--sac-primary);
    box-shadow: 0 0 0 2px rgba(56, 95, 246, 0.15);
}
.sac-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--sac-border);
    border-radius: var(--sac-radius);
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    cursor: pointer;
}

/* ─── Boutons (haute spécificité pour primer Elementor) ───────────── */
.sac-clubs-wrapper .sac-btn.sac-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    padding: 8px 16px !important;
    border: none !important;
    border-radius: var(--sac-radius) !important;
    font-size: 14px !important;
    font-family: inherit !important;
    cursor: pointer !important;
    text-decoration: none !important;
    transition: background-color 0.2s, color 0.2s !important;
    line-height: 1.4 !important;
    white-space: nowrap !important;
    box-shadow: none !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    min-height: 0 !important;
    margin: 0 !important;
}
.sac-clubs-wrapper .sac-btn.sac-btn-sm { padding: 4px 8px !important; font-size: 12px !important; }

/* ─── LOT 3 v1.0.13 : Boutons "Site web" / "Contact" toujours en bleu SAA ─── */
.sac-clubs-wrapper .sac-btn.sac-btn-primary,
.sac-clubs-wrapper a.sac-btn.sac-btn-primary,
.sac-clubs-wrapper button.sac-btn.sac-btn-primary {
    background: #385FF6 !important;
    color: #fff !important;
    border-color: #385FF6 !important;
    border: 1px solid #385FF6 !important;
}
.sac-clubs-wrapper .sac-btn.sac-btn-primary:hover,
.sac-clubs-wrapper a.sac-btn.sac-btn-primary:hover,
.sac-clubs-wrapper button.sac-btn.sac-btn-primary:hover {
    background: #2548D4 !important;
    color: #fff !important;
    border-color: #2548D4 !important;
}
.sac-clubs-wrapper .sac-btn.sac-btn-primary svg { stroke: #fff !important; }

.sac-clubs-wrapper .sac-btn.sac-btn-outline {
    background: transparent !important;
    border: 1px solid var(--sac-primary) !important;
    color: var(--sac-primary) !important;
}
.sac-clubs-wrapper .sac-btn.sac-btn-outline:hover,
.sac-clubs-wrapper .sac-btn.sac-btn-outline.active {
    background: var(--sac-primary) !important;
    color: #fff !important;
}

/* ─── Carte ───────────────────────────────────────────────────────── */
.sac-map-container {
    margin-bottom: 16px;
    border: 1px solid var(--sac-border);
    border-radius: var(--sac-radius);
    overflow: hidden;
}

/* ─── En-tête de liste ────────────────────────────────────────────── */
.sac-list-header {
    display: flex;
    align-items: center;
    background: var(--sac-bg-header);
    border: 1px solid var(--sac-border);
    border-radius: var(--sac-radius);
    padding: 12px 16px;
    font-weight: 700;
    font-size: 0.9em;
    margin-bottom: 4px;
}

/* ─── Colonnes (clubs) — LOT 1 v1.0.13 : 6 colonnes avec accessibilité séparée ─── */
.sac-col-logo      { flex: 0 0 70px;  text-align: center; margin-right: 20px; }
.sac-col-name      { flex: 1 1 26%;   padding: 0 12px; }
.sac-col-address   { flex: 1 1 16%;   padding: 0 12px; }
.sac-col-perf      { flex: 0 0 140px; padding: 0 8px; text-align: center; }
.sac-col-access    { flex: 0 0 90px;  padding: 0 8px; text-align: center; }
.sac-col-actions   { flex: 0 0 230px; padding: 0 4px; display: flex; gap: 6px; justify-content: flex-end; align-items: center; flex-wrap: nowrap; }

/* ─── Filtre centres de performance / accessibilité ──────────────── */
.sac-filter-perf { flex: 0 1 220px; }
.sac-filter-accessible { flex: 0 1 220px; }

/* ─── Badge centre de performance / badge accessibilité ──────────── */
.saa-perf-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    line-height: 1.2;
}
.saa-perf-badge--none {
    background: transparent;
    color: #9ca3af;
    text-transform: none;
    font-weight: 400;
    padding: 3px 4px;
}
/* Badge accessibilité : rond plein bleu identique typologie au badge centre */
.saa-perf-badge.saa-perf-badge--access {
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 50%;
    background: #385FF6;
    color: #fff;
    transition: transform 0.15s ease;
}
.saa-perf-badge.saa-perf-badge--access:hover { transform: scale(1.08); }
.saa-perf-badge.saa-perf-badge--access svg {
    display: block;
    width: 16px;
    height: 16px;
    color: #fff;
    fill: currentColor;
}
@media (prefers-reduced-motion: reduce) {
    .saa-perf-badge.saa-perf-badge--access { transition: none; }
}

/* ─── Sous-titre canton ──────────────────────────────────────────── */
.sac-canton-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    margin-top: 12px;
    background: #e8e8e8;
    border: 1px solid var(--sac-border);
    border-radius: var(--sac-radius);
    font-weight: 700;
    font-size: 0.95em;
    color: var(--sac-text);
}
.sac-canton-heading:first-child { margin-top: 0; }
.sac-canton-flag {
    width: 22px;
    height: 16px;
    object-fit: contain;
}

/* ─── Rangée club ─────────────────────────────────────────────────── */
.sac-club-row {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border: 1px solid var(--sac-border);
    border-top: none;
    background: #fff;
    transition: background-color 0.15s;
    min-height: 56px;
}
.sac-club-row:first-child { border-top: 1px solid var(--sac-border); }
.sac-club-row:nth-child(even) { background: #f8f9fb; }
.sac-club-row:hover { background: #eef1f7; }
.sac-club-row.sac-hidden { display: none; }

/* ─── Logo ────────────────────────────────────────────────────────── */
.sac-club-logo {
    max-width: 50px;
    max-height: 50px;
    width: auto;
    height: auto;
    object-fit: contain;
}
.sac-logo-placeholder { display: block; width: 50px; height: 50px; }

/* ─── Drapeaux cantonaux (inline dans la liste clubs) ─────────────── */
.sac-flag-icon {
    width: 20px;
    height: 14px;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 4px;
    border-radius: 2px;
}

.sac-assoc-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.88em;
    color: #555;
}

/* ─── No results ──────────────────────────────────────────────────── */
.sac-no-results {
    text-align: center;
    padding: 32px 16px;
    color: #888;
    font-style: italic;
}

/* ─── Modale ──────────────────────────────────────────────────────── */
.sac-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sac-modal-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}
.sac-modal-content {
    position: relative;
    background: #fff;
    border-radius: 8px;
    padding: 28px 32px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    z-index: 1;
}
.sac-modal-close {
    position: absolute;
    top: 12px; right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    line-height: 1;
    padding: 4px;
}
.sac-modal-close:hover { color: #000; }
.sac-modal-title {
    margin: 0 0 20px;
    font-size: 1.2em;
    color: var(--sac-text);
}
.sac-form-group { margin-bottom: 14px; }
.sac-form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 0.9em;
}
.sac-form textarea.sac-input { resize: vertical; min-height: 100px; }
.sac-form-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}
.sac-status { font-size: 0.9em; }
.sac-status.success { color: #256B18; }
.sac-status.error   { color: #D51313; }


/* ═══════════════════════════════════════════════════════════════════
   ASSOCIATIONS CANTONALES – [swissarchery_associations]
   ═══════════════════════════════════════════════════════════════════ */

.sac-assoc-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.sac-assoc-card {
    border: 1px solid var(--sac-border);
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
    transition: box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}
.sac-assoc-card:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.sac-assoc-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px 12px;
    background: var(--sac-bg-light);
    border-bottom: 1px solid var(--sac-border);
}

.sac-assoc-flag {
    width: 48px;
    height: 36px;
    object-fit: contain;
    border-radius: 3px;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.sac-assoc-title h3 {
    margin: 0;
    font-size: 1.05em;
    color: var(--sac-text);
    line-height: 1.3;
}

.sac-assoc-canton-label {
    font-size: 0.82em;
    color: #888;
}

.sac-assoc-body {
    padding: 14px 18px;
    flex: 1;
    font-size: 0.92em;
}
.sac-assoc-body p { margin: 0 0 6px; }

.sac-assoc-label {
    font-weight: 600;
    color: #555;
    margin-right: 4px;
}

.sac-assoc-footer {
    padding: 10px 18px 14px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}


/* ─── Responsive — LOT 4 v1.0.13 : mobile logo à gauche, texte aligné à gauche ─── */
@media (max-width: 767px) {
    .sac-list-header { display: none; }

    .sac-club-row {
        display: flex;
        align-items: flex-start;
        gap: 12px;
        flex-wrap: nowrap;
        padding: 12px;
    }

    /* Logo à gauche, fixe */
    .sac-col-logo {
        flex: 0 0 60px;
        width: 60px;
        margin-right: 0;
        text-align: left;
    }
    .sac-club-logo, .sac-logo-placeholder {
        max-width: 60px;
        max-height: 60px;
        width: auto;
        height: auto;
    }

    /* Toutes les autres colonnes empilées à droite, alignées à gauche */
    .sac-col-name,
    .sac-col-address,
    .sac-col-perf,
    .sac-col-access,
    .sac-col-actions {
        flex: 1 1 auto;
        width: auto;
        padding: 0;
        text-align: left;
        justify-content: flex-start;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }

    /* Mais pour empiler vraiment les colonnes verticalement, on transforme la row :
       logo flex (col 1), puis un wrap pour le reste — on utilise wrap. */
    .sac-club-row { flex-wrap: wrap; }
    .sac-col-logo { flex: 0 0 60px; align-self: flex-start; }
    .sac-col-name,
    .sac-col-address,
    .sac-col-perf,
    .sac-col-access,
    .sac-col-actions {
        flex: 1 1 calc(100% - 80px);
        max-width: calc(100% - 80px);
        margin-left: auto;
    }
    .sac-col-name { font-size: 1em; }
    .sac-col-name strong { text-align: left; display: block; }
    .sac-col-address { font-size: 0.9em; color: #666; }
    .sac-col-address::before {
        content: "Localité : ";
        font-weight: 600;
        color: var(--sac-text);
    }
    .sac-col-perf,
    .sac-col-access {
        flex-direction: row;
        align-items: center;
        flex: 1 1 calc(100% - 80px);
        max-width: calc(100% - 80px);
    }
    .sac-col-perf::before {
        content: "Centre : ";
        font-weight: 600;
        color: var(--sac-text);
        margin-right: 6px;
        font-size: 0.85em;
    }
    .sac-col-access::before {
        content: "Accessible : ";
        font-weight: 600;
        color: var(--sac-text);
        margin-right: 6px;
        font-size: 0.85em;
    }
    .sac-col-actions {
        flex-direction: row;
        gap: 6px;
        flex-wrap: wrap;
        justify-content: flex-start;
    }
}
