/* ============================================================
   association.css — v2
   Carte overlay identique à v1 (photo, nom, ville, badges,
   favori, site web) — carousel désormais VERTICAL (colonne
   droite de l'accueil), même logique que evenements-semaine.css.
   ============================================================ */


/* ── Tokens ───────────────────────────────────────────────── */
:root {
  /* Palette – light */
  --bg:           #f5f6fa;
  --bg-card:      #ffffff;
  --bg-input:     #f0f1f7;
  --border:       #e2e4ef;
  --accent:       #4f6ef7;
  --accent-hover: #3a57d8;
  --accent-muted: #eef0fd;
  --danger:       #e5534b;
  --danger-muted: #fdf0ef;
  --success:      #2ea043;
  --success-muted:#edfaf1;
  --text-primary: #1a1d2e;
  --text-secondary:#6b7280;
  --text-muted:   #9ca3af;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:  0 4px 16px rgba(0,0,0,.08);
  --shadow-focus: 0 0 0 3px rgba(79,110,247,.25);

  /* Spacing */
  --radius:    10px;
  --radius-lg: 16px;
  --gap:       24px;

  /* Typography */
  --font-ui:   'Inter', system-ui, sans-serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
}

/* ── Dark mode tokens ─────────────────────────────────────────
   Piloté par la classe .dark-mode posée sur <body> par darkmod.js
   (source de vérité unique pour le dark mode sur le site).
   ────────────────────────────────────────────────────────────── */
body.dark-mode {
  --bg:           #0f1117;
  --bg-card:      #1a1d2a;
  --bg-input:     #252836;
  --border:       #2e3247;
  --accent:       #6c8aff;
  --accent-hover: #8aa0ff;
  --accent-muted: #1e2240;
  --danger:       #f47067;
  --danger-muted: #2a1a1a;
  --success:      #3fb950;
  --success-muted:#0d2117;
  --text-primary: #e8eaf6;
  --text-secondary:#9aa0c0;
  --text-muted:   #5c627a;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.3);
  --shadow-md:  0 4px 16px rgba(0,0,0,.4);
}



.association-wrapper {
    width: 100%;
    position: relative;
}

.association-wrapper .titre-association {
    margin: 0 0 10px;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
}

/* ── Conteneur carousel ──
   Largeur = 1 carte, hauteur = N cartes visibles (ici 4 cartes
   de 150px + marges, comme evenements-semaine-carousel). */
#association-carousel {
    width: 160px;
    height: 624px;
    overflow: hidden;
    position: relative;
    margin: 0 auto;
}

#association-carousel .slick-list,
#association-carousel .slick-track {
    height: 100% !important;
}

#association-carousel .slick-slide {
    height: 154px;
}

/* ── Carte individuelle ── */
#association-carousel .association {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin: 0px;
    position: relative;
    overflow: hidden;
    width: 160px;
    height: 150px;
    text-align: center;
    cursor: pointer;
    box-sizing: border-box;
}

#association-carousel .association:hover {
    border-color: #c8960a;
    box-shadow: 0 3px 10px rgba(180, 130, 0, 0.28);
}

/* ── Image (photo, ou logo si pas de photo) ── */
#association-carousel .association img {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease-in-out;
    z-index: 0;
}

#association-carousel .association:hover img {
    transform: scale(1.08);
}

#association-carousel .association.logo-fallback img {
    object-fit: contain;
    background-color: #f7f5ef;
    padding: 4px;
    box-sizing: border-box;
}

#association-carousel .association.logo-fallback:hover img {
    transform: scale(1.04);
}

/* ── Nom — haut gauche ── */
#association-carousel .association h4 {
    font-size: 11px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.75);
    padding: 2px 5px;
    margin: 0;
    position: absolute;
    top: 0; left: 0;
    max-width: 75%;
    box-sizing: border-box;
    background-color: rgba(0, 0, 0, 0.35);
    border-radius: 5px 0 4px 0;
    z-index: 2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: none;
    letter-spacing: 0;
    border-left: none;
    padding-left: 5px;
}

#association-carousel .association.logo-fallback h4 {
    color: #222;
    text-shadow: none;
    background-color: rgba(255, 255, 255, 0.75);
}

/* ── Ville — bas droite ── */
#association-carousel .association p {
    font-size: 10px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.75);
    padding: 1px 3px;
    margin: 0;
    position: absolute;
    bottom: 0; right: 0;
    max-width: 75%;
    box-sizing: border-box;
    background-color: rgba(0, 0, 0, 0.35);
    border-radius: 4px 0 5px 0;
    z-index: 2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#association-carousel .association.logo-fallback p {
    color: #222;
    text-shadow: none;
    background-color: rgba(255, 255, 255, 0.75);
}

/* ── Bouton favori — haut droite, apparaît au survol ── */
#association-carousel .association .favori-button {
    position: absolute;
    top: 2px; right: 2px;
    z-index: 5;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0;
    overflow: visible;
    transition: opacity 0.3s ease;
    padding: 0;
    line-height: 1;
}

#association-carousel .association:hover .favori-button {
    opacity: 1;
}

#association-carousel .association .favori-button i {
    font-size: 15px;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
    transition: color 0.2s ease;
}

#association-carousel .association.logo-fallback .favori-button i {
    color: #333;
    text-shadow: none;
}

#association-carousel .association .favori-button i.fas {
    color: #ff4500;
}

#association-carousel .association .favori-button:hover i {
    color: #dc143c;
}

#association-carousel .association .favori-button.active i {
    color: red;
    animation: popHeartAsso .3s ease;
}

@keyframes popHeartAsso {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.5); }
    100% { transform: scale(1); }
}

#association-carousel .association .mini-coeur {
    position: absolute;
    color: red;
    font-size: 14px;
    pointer-events: none;
    animation: envolCoeurAsso .8s ease-out forwards;
}

@keyframes envolCoeurAsso {
    from {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    to {
        transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(0.2);
        opacity: 0;
    }
}

/* ── Bouton site web — bas gauche, apparaît au survol ── */
#association-carousel .association .site-web-button {
    position: absolute;
    bottom: 3px; left: 3px;
    font-size: 10px;
    background-color: rgba(0, 51, 204, 0.85);
    color: #fff;
    padding: 2px 6px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0;
    z-index: 3;
    transition: opacity 0.3s ease, background-color 0.2s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
}

#association-carousel .association:hover .site-web-button {
    opacity: 1;
}

#association-carousel .association .site-web-button:hover {
    background-color: rgba(140, 90, 0, 0.95);
}

/* ── Badge secteur — centre bas, apparaît au survol ── */
#association-carousel .association .badge-secteur {
    position: absolute;
    bottom: 18px; left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    background-color: rgba(180, 120, 0, 0.82);
    color: #fff;
    font-size: 9px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 10px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    max-width: 90%;
    overflow: hidden;
    text-overflow: ellipsis;
}

#association-carousel .association:hover .badge-secteur {
    opacity: 1;
}

/* ── Badge "Depuis AAAA" — haut gauche, permanent ── */
#association-carousel .association .badge-depuis {
    position: absolute;
    top: 18px; left: 3px;
    z-index: 5;
    background-color: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.3px;
    padding: 2px 5px;
    border-radius: 10px;
    pointer-events: none;
    line-height: 1.4;
}

#association-carousel .association.logo-fallback .badge-depuis {
    background-color: rgba(0, 0, 0, 0.12);
    color: #333;
}

/* ── Tooltip nom complet — si tronqué ── */
#association-carousel .association .tooltip-nom {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 6;
    background-color: rgba(0, 0, 0, 0.78);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 5px;
    text-align: center;
    white-space: normal;
    max-width: 120px;
    line-height: 1.3;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

#association-carousel .association.nom-tronque:hover .tooltip-nom {
    opacity: 1;
}

/* ── Flèches de navigation — haut / bas ── */
#association-carousel .slick-association-prev,
#association-carousel .slick-association-next {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.45);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    opacity: 0.6;
    transition: opacity 0.2s ease, background 0.2s ease;
    padding: 0;
}

#association-carousel .slick-association-prev { top: 4px; }
#association-carousel .slick-association-next { bottom: 4px; }

#association-carousel .slick-association-prev:hover,
#association-carousel .slick-association-next:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.72);
}

#association-carousel .slick-association-prev i,
#association-carousel .slick-association-next i {
    font-size: 12px;
    color: #fff;
}

/* ── Message vide ── */
#association-carousel p.message-vide {
    font-size: 13px;
    color: #888;
    padding: 20px;
    text-align: center;
    position: static;
    background: none;
}


/* ============================================================
    Mobile
   ============================================================ */
   
   @media (max-width: 500px) {
#evenements-semaine-carousel  {
    width: 176px;
    height: 165px;
}
#evenements-semaine-carousel .evenement-carte {
    width: 175px;
    height: 55px;
}
   }
