/* ============================================================
   Fiche — styles partagés agenda + emploi
   ============================================================ */

/* Tokens — aliasés sur les tokens globaux services (tokens.css) */
:root {
    --fiche-accent:        var(--color-services);
    --fiche-accent-hover:  var(--color-services-hover);
    --fiche-accent-light:  var(--color-services-light);
    --fiche-accent-text:   var(--color-services-text);
    --fiche-aside-bg:      #f5f5f2;
    --fiche-section-label: #1a1a2e;
}

/* ------------------------------------------------------------
   Palette clair/sombre du fichier
   Même pattern que agenda.css / emplois-services.css : 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 (.ec-card dans main.css).
   Ce fichier est partagé par les fiches agenda, emploi, marché,
   publication, article, portrait et entreprise : toute valeur
   ci-dessous se propage à ces 7 pages.
   ------------------------------------------------------------ */
:root {
    --fiche-surface:       #ffffff;   /* fond des cartes : en-tête, sections, CTA, boutons */
    --fiche-surface-soft:  #f5f4f0;   /* fonds doux : pills, survols, vignettes */
    --fiche-surface-soft2: #f1efe8;   /* fonds doux n°2 : fallbacks d'initiales */
    --fiche-surface-tint:  #faf9f6;   /* fond des badges auteurs cliquables */
    --fiche-border:        #e8e6e0;   /* bordure des cartes et des vignettes */
    --fiche-border-soft:   #e0deda;   /* bordure des boutons outils */
    --fiche-border-mid:    #d8d6d0;   /* bordure des boutons secondaires */
    --fiche-border-hover:  #c0beba;   /* idem au survol */
    --fiche-line:          #f1efe8;   /* filets : sous-titre de section, lignes de synthèse */
    --fiche-text:          #1a1a18;   /* texte fort : titres, valeurs */
    --fiche-text-muted:    #5f5e5a;   /* texte secondaire : descriptifs, libellés */
    --fiche-text-soft:     #888780;   /* texte tertiaire : organisateur, notes */
    --fiche-alert:         #991b1b;   /* valeur en alerte (synth-row) */
}
[data-bs-theme="dark"] {
    --fiche-surface:       var(--bs-gray-900);
    --fiche-surface-soft:  var(--bs-gray-800);
    --fiche-surface-soft2: var(--bs-gray-800);
    --fiche-surface-tint:  var(--bs-gray-800);
    --fiche-border:        var(--bs-gray-800);
    --fiche-border-soft:   var(--bs-gray-700);
    --fiche-border-mid:    var(--bs-gray-700);
    --fiche-border-hover:  var(--bs-gray-600);
    --fiche-line:          var(--bs-gray-700);
    --fiche-text:          var(--bs-white);
    --fiche-text-muted:    #babac0;   /* même gris de texte secondaire que --text-accent-mid */
    --fiche-text-soft:     var(--bs-gray-400);
    --fiche-alert:         #f0928c;
    /* Libellé de section : le bleu nuit #1a1a2e disparaît sur fond sombre. */
    --fiche-section-label: var(--bs-gray-100);
    --fiche-aside-bg:      var(--bs-gray-800);
}

/* En-tête */
.fiche-header {
    background: var(--fiche-surface);
    border: 1px solid var(--fiche-border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px; 
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.fiche-header__logo { flex-shrink: 0; }
.fiche-header__logo-img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border-radius: 10px;
    border: 1px solid var(--fiche-border);
    background: var(--fiche-surface-soft);
    display: block;
}
.fiche-header__logo-fallback {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    background: var(--fiche-surface-soft2);
    border: 1px solid var(--fiche-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    color: var(--fiche-text-soft);
    letter-spacing: 0.03em;
}
.fiche-header__tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.fiche-header__info { flex: 1; min-width: 0; }

/* Titres */
.fiche-title {
    font-size: 20px;
    font-weight: 500;
    color: var(--fiche-text);
    line-height: 1.3;
    margin: 0 0 6px;
}
.fiche-subtitle {
    font-size: 14px;
    color: var(--fiche-text-muted);
    margin: 0 0 6px;
    line-height: 1.4;
}
.fiche-org {
    font-size: 13px;
    color: var(--fiche-text-soft);
    margin: 0 0 12px;
}

/* Pills de métadonnées */
.fiche-meta-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.fiche-meta-pill {
    font-size: 12px;
    color: var(--fiche-text-muted);
    background: var(--fiche-surface-soft);
    padding: 4px 10px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.fiche-meta-pill svg { width: 12px; height: 12px; opacity: 0.45; }
/* À 45%, les icônes des pills s'effacent presque complètement sur fond sombre. */
[data-bs-theme="dark"] .fiche-meta-pill svg { opacity: 0.7; }

/* Highlight box (accroche) */
.fiche-highlight {
    border-left: 3px solid var(--accent-border);
    background: var(--surface-highlight);
    padding: 14px 16px;
    border-radius: 0 8px 8px 0;
    margin-bottom: 14px;
    font-size: 14px;
    color: var(--text-strong);
    line-height: 1.65;
}
.fiche-highlight p { margin: 0 0 8px; }
.fiche-highlight p:last-child { margin-bottom: 0; }

/* Layout 2 colonnes */
.fiche-layout {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.fiche-col-main { flex: 1; min-width: 0; }
.fiche-col-side {
    width: 260px;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
}

/* Section card */
.fiche-section {
    background: var(--fiche-surface);
    border: 1px solid var(--fiche-border);
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 12px;
}
.fiche-section__title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--fiche-section-label);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--fiche-line);
}

/* Contenu HTML éditeur */
.fiche-descriptif {
    font-size: 13px;
    color: var(--fiche-text-muted);
    line-height: 1.7;
}
.fiche-descriptif p { margin: 0 0 10px; }
.fiche-descriptif p:last-child { margin-bottom: 0; }
.fiche-descriptif ul,
.fiche-descriptif ol { padding-left: 18px; margin: 0 0 10px; }

/* Document PDF */
.fiche-doc-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--fiche-border);
    border-radius: 8px;
    text-decoration: none;
    color: var(--fiche-text);
    font-size: 13px;
    transition: background 0.15s;
}
.fiche-doc-link:hover { background: var(--fiche-surface-soft); }
.fiche-doc-icon {
    width: 28px;
    height: 28px;
    background: var(--fiche-accent-light);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* CTA sidebar */
.fiche-cta {
    background: var(--fiche-surface);
    border: 1px solid var(--fiche-border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
}
.fiche-cta__btn-primary {
    display: block;
    width: 100%;
    padding: 11px;
    background: var(--fiche-accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    margin-bottom: 8px;
    box-sizing: border-box;
    transition: background 0.15s;
}
.fiche-cta__btn-primary:hover { background: var(--fiche-accent-hover); color: #fff; }
/* Le bleu nuit du bouton principal se confond avec le fond de carte en thème
   sombre : même correctif que .claudine-day-band dans main.css, un liseré
   interne clair plutôt qu'un changement de couleur. */
[data-bs-theme="dark"] .fiche-cta__btn-primary {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
}
.fiche-cta__btn-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 9px 14px;
    background: var(--fiche-surface);
    color: var(--fiche-text);
    border: 1px solid var(--fiche-border-mid);
    border-radius: 8px;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
    margin-bottom: 8px;
    box-sizing: border-box;
    transition: background 0.15s, border-color 0.15s;
}
.fiche-cta__btn-secondary:hover { background: var(--fiche-surface-soft); border-color: var(--fiche-border-hover); color: var(--fiche-text); }
.fiche-cta__btn-secondary:last-child { margin-bottom: 0; }
.fiche-cta__note {
    font-size: 11px;
    color: var(--fiche-text-soft);
    text-align: center;
    line-height: 1.5;
    margin: 8px 0 0;
}

/* Infos pratiques sidebar */
.fiche-info-list { display: flex; flex-direction: column; gap: 10px; }
.fiche-info-item { display: flex; flex-direction: column; gap: 2px; }
.fiche-info-lbl { font-size: 11px; color: var(--fiche-text-soft); }
.fiche-info-val { font-size: 13px; font-weight: 500; color: var(--fiche-text); }
.fiche-info-val--link {
    font-weight: 400;
    color: var(--text-accent);
    text-decoration: none;
    word-break: break-all;
}
.fiche-info-val--link:hover { text-decoration: underline; }

/* Synth rows (aside key-value) */
.synth-list { display: flex; flex-direction: column; }
.synth-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 0;
    border-bottom: 1px solid var(--fiche-line);
}
.synth-row:last-child { border-bottom: none; }
.synth-row__label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--fiche-text-soft);
    font-weight: 600;
}
.synth-row__value {
    font-size: 13px;
    color: var(--fiche-text);
    font-weight: 500;
}
.synth-row__value a {
    color: var(--text-accent);
    text-decoration: none;
}
.synth-row__value a:hover { text-decoration: underline; }
.synth-row__value--alert {
    color: var(--fiche-alert);
    font-size: 12px;
}

/* Org badge (logo + nom recruteur) */
.org-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.org-badge__img {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    border: 1px solid var(--fiche-border);
    object-fit: contain;
    background: var(--fiche-surface-soft);
    flex-shrink: 0;
}
.org-badge__initials {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: var(--fiche-surface-soft2);
    border: 1px solid var(--fiche-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    color: var(--fiche-text-soft);
    flex-shrink: 0;
}
.org-badge__info { min-width: 0; }
.org-badge__name {
    font-size: 13px;
    font-weight: 500;
    color: var(--fiche-text);
    line-height: 1.3;
}
.org-badge__meta {
    font-size: 11px;
    color: var(--fiche-text-soft);
    line-height: 1.4;
    margin-top: 2px;
}

/* Auteurs en ligne (fiche publication) */
.fiche-auteurs-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.org-badge--clickable {
    border: 1px solid var(--fiche-border);
    border-radius: 10px;
    padding: 8px 12px;
    background: var(--fiche-surface-tint);
    cursor: pointer;
    text-align: left;
    transition: border-color .15s, background .15s, box-shadow .15s;
}
.org-badge--clickable:hover {
    border-color: #c8a96e;
    background: var(--fiche-surface);
    box-shadow: 0 2px 6px rgba(0,0,0,.07);
}
.org-badge--clickable.is-active {
    border-color: var(--color-accent, #c0392b);
    background: var(--fiche-surface);
    box-shadow: 0 2px 8px rgba(192,57,43,.12);
}

/* Tool buttons */
.fiche-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}
.fiche-tool-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    background: var(--fiche-surface);
    color: var(--fiche-text-muted);
    border: 1px solid var(--fiche-border-soft);
    border-radius: 6px;
    font-size: 12px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s;
    line-height: 1;
}
.fiche-tool-btn:hover { background: var(--fiche-surface-soft); color: var(--fiche-text); }
.fiche-tool-btn--active {
    background: #fff0f0;
    color: #991B1B;
    border-color: #fca5a5;
}
.fiche-tool-btn--active:hover { background: #fee2e2; }

/* Bloc Claudine sidebar (fiches emploi, marché et agenda) */
.fiche-claudine {
    background: #fffaed;
    border-color: #ffd75e;
}
.fiche-claudine .fiche-section__title {
    color: #7a5200;
    border-bottom-color: #ffd75e;
}

/* Responsive */
@media (max-width: 640px) {
    .fiche-layout { flex-direction: column; }
    .fiche-col-side { width: 100%; position: static; }
    .fiche-header { flex-wrap: wrap; }
}
