/* ============================================================
   Agenda des événements — styles dédiés
   ============================================================ */

/* ------------------------------------------------------------
   Tokens locaux clair/sombre
   Même pattern que emplois-services.css / marches-services.css :
   la palette du fichier est déclarée une fois ici, puis basculée
   sous [data-bs-theme="dark"]. Les valeurs claires sont celles
   déjà en place (aucun pixel changé en thème clair) ; les valeurs
   sombres réutilisent l'échelle --bs-gray-* de Bootstrap 5.3 et
   les tokens de rôle de tokens.css, pour rester alignées sur le
   système de cartes emplois/marchés (.ec-card dans main.css).
   ------------------------------------------------------------ */
:root {
    --agenda-surface:        #ffffff;   /* fond de carte, de select */
    --agenda-elevated:       #ffffff;   /* surface flottante : dropdown calendrier */
    --agenda-surface-soft:   #f1efe8;   /* fonds doux : compteur mois, tags neutres, fallback logo */
    --agenda-surface-hover:  #f5f4f0;   /* survol de bouton, fond de vignette */
    --agenda-surface-hover2: #f8f6f2;   /* survol d'item de dropdown */
    --agenda-border:         #e8e6e0;   /* bordure de carte, séparateurs, vignette */
    --agenda-border-mid:     #d0cec8;   /* bordure de bouton / select */
    --agenda-border-hover:   #b4b2a9;   /* bordure de carte au survol */
    --agenda-line:           #e0ded8;   /* filet du séparateur mensuel, bordure dropdown */
    --agenda-text:           #1a1a18;   /* texte fort : titre, jour, libellé de mois */
    --agenda-text-muted:     #5f5e5a;   /* texte secondaire : méta, description */
    --agenda-text-soft:      #888780;   /* texte tertiaire : mois, organisateur */
    --agenda-danger:         #c0392b;   /* bouton "S'inscrire" (webinaire) */
    --agenda-danger-soft:    #fdf0ef;   /* son survol */
    --agenda-deadline:       #791f1f;   /* échéance proche */
    --agenda-highlight-bd:   #d4d4e2;   /* bordure des cartes mises en avant */
    --agenda-highlight-bd-h: #b9b9d0;   /* idem au survol */
}
[data-bs-theme="dark"] {
    --agenda-surface:        var(--bs-gray-900);
    --agenda-elevated:       var(--bs-gray-800);
    --agenda-surface-soft:   var(--bs-gray-800);
    --agenda-surface-hover:  var(--bs-gray-800);
    --agenda-surface-hover2: var(--bs-gray-800);
    --agenda-border:         var(--bs-gray-800);
    --agenda-border-mid:     var(--bs-gray-700);
    --agenda-border-hover:   var(--bs-gray-600);
    --agenda-line:           var(--bs-gray-700);
    --agenda-text:           var(--bs-white);
    --agenda-text-muted:     #babac0;   /* même gris de texte secondaire que --text-accent-mid */
    --agenda-text-soft:      var(--bs-gray-400);
    --agenda-danger:         #e8776a;
    --agenda-danger-soft:    rgba(192, 57, 43, .18);
    --agenda-deadline:       #f0928c;
    --agenda-highlight-bd:   var(--bs-gray-700);
    --agenda-highlight-bd-h: var(--bs-gray-600);
}

/* Filtres select */
.agenda-filtres select {
    font-size: 13px;
    padding: 6px 10px;
    border: 1px solid var(--agenda-border-mid);
    border-radius: 8px;
    background-color: var(--agenda-surface);
    color: var(--agenda-text);
    cursor: pointer;
}

/* Séparateur mensuel */
.agenda-month-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 24px 0 10px;
}
.agenda-month-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--agenda-text);
    white-space: nowrap;
}
.agenda-month-count {
    font-size: 11px;
    color: var(--agenda-text-soft);
    background: var(--agenda-surface-soft);
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
}
.agenda-month-line {
    flex: 1;
    height: 1px;
    background: var(--agenda-line);
}

/* Carte de base */
.agenda-card {
    background: var(--agenda-surface);
    border: 1px solid var(--agenda-border);
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 8px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    cursor: pointer;
    transition: border-color 0.15s;
    text-decoration: none;
    color: inherit;
}
.agenda-card:hover { border-color: var(--agenda-border-hover); }

/* Variante urgente */
.agenda-card--urgent {
    border-left: 3px solid #e24b4a;
    border-radius: 0 12px 12px 0;
    padding-left: 15px;
}

/* Variante passée */
.agenda-card--past { opacity: 0.55; }

/* Variante payante (mise en avant) */
.agenda-card--payant {
    background: var(--surface-highlight);
    border-color: var(--agenda-highlight-bd);
    border-left: 3px solid var(--accent-border);
    border-radius: 0 12px 12px 0;
    padding-left: 15px;
}
.agenda-card--payant:hover {
    border-left-color: var(--accent-border);
    border-color: var(--agenda-highlight-bd-h);
}

/* Bloc date (colonne gauche) */
.agenda-card__date {
    flex-shrink: 0;
    width: 48px;
    text-align: center;
    padding-top: 2px;
}
.agenda-card__day {
    display: block;
    font-size: 22px;
    font-weight: 500;
    color: var(--agenda-text);
    line-height: 1;
}
.agenda-card__month {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--agenda-text-soft);
    margin-top: 2px;
}
.agenda-card__end {
    display: block;
    font-size: 10px;
    color: var(--agenda-text-soft);
    margin-top: 1px;
}

/* Séparateur vertical */
.agenda-card__sep {
    width: 1px;
    background: var(--agenda-border);
    align-self: stretch;
    flex-shrink: 0;
    margin: 0 2px;
}

/* Colonne de contenu : corps+logo côte à côte, pied en pleine largeur en dessous */
.agenda-card__content {
    flex: 1;
    min-width: 0;
}
.agenda-card__top-row {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

/* Corps de la vignette */
.agenda-card__body { flex: 1; min-width: 0; }

/* Ligne de badges */
.agenda-card__tags {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-bottom: 7px;
}

/* Badge générique */
.agenda-tag {
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
}

/* Badge type d'événement (carte liste) — fond bleuté + bord gauche, comme .ec-card__badge-primary */
.agenda-card__badge-primary {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-services-mid);
    background: var(--color-services-light);
    border-left: 3px solid var(--color-services);
    border-radius: 4px;
    padding: 2px 8px;
    white-space: nowrap;
}

/* Couleurs par type d'événement */
.agenda-tag--salon     { background: #eeedfe; color: #3c3489; }
.agenda-tag--webinaire { background: #e1f5ee; color: #085041; }
.agenda-tag--colloque  { background: #e6f1fb; color: #0c447c; }
.agenda-tag--rencontre { background: #faeeda; color: #633806; }
.agenda-tag--online    { background: #f1efe8; color: #444441; }
.agenda-tag--new       { background: #eaf3de; color: #27500a; }
.agenda-tag--urgent    { background: #fcebeb; color: #791f1f; }
.agenda-tag--past      { background: #f1efe8; color: #5f5e5a; }

/* Titre */
.agenda-card__title {
    font-size: 14px;
    font-weight: 500;
    color: var(--agenda-text);
    margin-bottom: 5px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Métadonnées */
.agenda-card__meta {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 5px;
    font-size: 12px;
    color: var(--agenda-text-muted);
    align-items: center;
}
.agenda-card__meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}
.agenda-card__meta-item svg {
    width: 12px;
    height: 12px;
    opacity: 0.45;
    flex-shrink: 0;
}
/* À 45%, les icônes de méta s'effacent presque complètement sur fond sombre. */
[data-bs-theme="dark"] .agenda-card__meta-item svg { opacity: 0.7; }
.agenda-card__deadline {
    font-size: 11px;
    font-weight: 500;
    color: var(--agenda-deadline);
}

/* Description (2 lignes max) */
.agenda-card__desc {
    font-size: 12px;
    color: var(--agenda-text-muted);
    line-height: 1.5;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Colonne logo (droite de la vignette) : bouton "Ajouter à mon agenda" + image */
.agenda-card__logo-col {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.agenda-card__logo {
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
    padding-top: 2px;
}

/* Image logo */
.agenda-card__logo-img {
    width: 80px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--agenda-border);
    background: var(--agenda-surface-hover);
    display: block;
}

/* Fallback initiales */
.agenda-card__logo-fallback {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--agenda-surface-soft);
    border: 1px solid var(--agenda-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 500;
    color: var(--agenda-text-soft);
    flex-shrink: 0;
    letter-spacing: 0.03em;
}

/* Pied de vignette */
.agenda-card__footer {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.agenda-card__org {
    flex: 1;
    font-size: 11px;
    color: var(--agenda-text-soft);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.agenda-card__equipe {
    font-size: 11px;
    font-weight: 500;
    color: #e24b4a;
}
.agenda-card__btn {
    font-size: 11px;
    padding: 5px 12px;
    border: 1px solid var(--agenda-border-mid);
    border-radius: 8px;
    background: transparent;
    color: var(--agenda-text-muted);
    text-decoration: none;
    white-space: nowrap;
}
.agenda-card__btn:hover { background: var(--agenda-surface-hover); }

/* CTA "Voir l'événement" — toujours calé à droite du pied de carte */
.agenda-card__cta {
    margin-left: auto;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-accent);
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
.agenda-card__inscrit-btn {
    font-size: 11px;
    padding: 5px 12px;
    border: 1px solid var(--agenda-danger);
    border-radius: 8px;
    background: transparent;
    color: var(--agenda-danger);
    white-space: nowrap;
    cursor: pointer;
    line-height: 1;
}
.agenda-card__inscrit-btn:hover { background: var(--agenda-danger-soft); }

/* Bouton "Ajouter à mon agenda" */
.agenda-card__cal-wrap {
    position: relative;
}
.agenda-card__cal-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.agenda-card__cal-drop {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--agenda-elevated);
    border: 1px solid var(--agenda-line);
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,.10);
    min-width: 180px;
    z-index: 100;
    overflow: hidden;
}
.agenda-card__cal-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    font-size: 12px;
    color: var(--agenda-text);
    text-decoration: none;
    white-space: nowrap;
    width: 100%;
    background: none;
    border: none;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
}
.agenda-card__cal-item + .agenda-card__cal-item {
    border-top: 1px solid var(--agenda-border);
}
.agenda-card__cal-item:hover { background: var(--agenda-surface-hover2); }
