/* ============================================================
   Facmed Chercheurs — front.css  v2.1
   Charte UdeM : Figtree + Lora, bleu #0057ac, bleu foncé #0b113a
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Lora&family=Figtree:wght@400;600&display=swap');

.fchr-repertoire {
    --fchr-bleu:        #0057ac;
    --fchr-bleu-fonce:  #0b113a;
    --fchr-bleu-pale:   #e5f0f8;
    --fchr-jaune:       #ffca40;
    --fchr-rouge:       #f04e24;
    --fchr-texte-muted: #4a6080;
    --fchr-texte-hint:  #6b7a99;
    font-family: 'Figtree', sans-serif;
    max-width: 1200px;
    margin-inline: auto;
}

/* Filtres */
.fchr-filtres { display:flex; flex-wrap:wrap; gap:.6rem; justify-content:center; align-items:center; margin-bottom:.75rem; }
.fchr-pill-btn { display:inline-flex; align-items:center; gap:.5rem; border:1.5px solid #c8d4e0; border-radius:999px; padding:.45rem 1rem; font-size:1rem; font-weight:500; font-family:inherit; line-height:1.4; color:#0b113a; background:#fff; cursor:pointer; user-select:none; white-space:nowrap; transition:border-color .15s,background .15s; }
.fchr-pill-btn:hover { border-color:#0b113a; }
.fchr-pill-btn.active { background:#0b113a; border-color:#0b113a; color:#fff; }
.fchr-pill-btn.open { border-color:#0b113a; background:#e5f0f8; color:#0b113a; }
.fchr-pill-btn.active.open { background:#0b113a; color:#fff; }
.fchr-pill-badge { display:inline-flex; align-items:center; justify-content:center; width:18px; height:18px; border-radius:50%; background:rgba(255,255,255,.25); font-size:.7rem; font-weight:600; }
.fchr-pill-arrow { width:8px; height:8px; border-right:2px solid currentColor; border-bottom:2px solid currentColor; transform:rotate(45deg); margin-top:-3px; transition:transform .15s,margin-top .15s; flex-shrink:0; display:inline-block; }
.fchr-pill-btn.open .fchr-pill-arrow { transform:rotate(-135deg); margin-top:3px; }

.fchr-dropdown-wrap { position:relative; }
.fchr-dropdown-panel { display:none; position:absolute; top:calc(100% + 6px); left:0; background:#fff; border:1px solid #d0d8e4; border-radius:12px; box-shadow:0 4px 16px rgba(11,17,58,.12); min-width:300px; padding:.5rem 0; z-index:100; }
.fchr-dropdown-panel.open { display:block; }
.fchr-dd-item { display:flex; align-items:center; gap:.75rem; padding:.55rem 1rem; cursor:pointer; font-size:1rem; color:#0b113a; transition:background .1s; user-select:none; background:transparent; }
.fchr-dd-item:hover { background:#e5f0f8; }
.fchr-dd-item:has(input:checked) { background:#e5f0f8; }
.fchr-dd-item label { background:transparent !important; }
.fchr-dd-item label { display:flex; align-items:flex-start; gap:8px; cursor:pointer; flex:1; line-height:1.4; }
.fchr-dd-item input[type="checkbox"] { width:15px; height:15px; margin-top:2px; accent-color:var(--fchr-bleu); cursor:pointer; flex-shrink:0; }
.fchr-dd-count { font-size:.8rem; color:#8a9ab0; font-weight:500; margin-left:auto; }

.fchr-btn-reset { display:none; align-items:center; gap:.3rem; border:1.5px solid #e0e0e0; border-radius:999px; padding:.45rem .875rem; font-size:.8rem; font-weight:600; font-family:inherit; color:#8a9ab0; background:transparent; cursor:pointer; transition:border-color .15s,color .15s; }
.fchr-btn-reset:hover { border-color:#f04e24; color:#f04e24; }
.fchr-btn-reset.visible { display:inline-flex; }

/* Compteur */
.fchr-compteur { text-align:center; font-size:.85rem; color:var(--fchr-texte-hint); margin:.75rem 0 1.5rem; }
.fchr-compteur strong { color:var(--fchr-bleu-fonce); }

/* Grille */
.fchr-grille { display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:1.25rem; }

/* Animation fade-in-up */
@keyframes fchr-fade-in-up {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Carte */
.fchr-carte { background:var(--fchr-bleu-pale); border:none; border-radius:12px; transition:background .2s; cursor:pointer; text-decoration:none; display:block; color:inherit; position:relative;
    animation: fchr-fade-in-up .45s ease both;
    animation-delay: var(--fchr-delay, 0s);
}
.fchr-carte a, .fchr-carte a:hover, .fchr-carte a:visited { text-decoration:none; color:inherit; }
.fchr-carte-lien { display:block; overflow:hidden; border-radius:12px; text-decoration:none !important; }
.fchr-carte:hover { background:var(--fchr-bleu); }
.fchr-carte--no-link { cursor:default; }
.fchr-carte--no-link:hover { background:var(--fchr-bleu-pale) !important; }
.fchr-carte--no-link:hover .fchr-nom { color:var(--fchr-bleu-fonce) !important; }
.fchr-carte--no-link:hover .fchr-discipline { color:var(--fchr-bleu) !important; }
.fchr-carte--no-link:hover .fchr-titre { color:var(--fchr-texte-muted) !important; }
.fchr-carte--no-link:hover .fchr-theme { color:var(--fchr-texte-muted) !important; }
.fchr-carte--no-link:hover .fchr-theme::before { background:var(--fchr-bleu) !important; }
.fchr-repertoire .fchr-carte--no-link:hover .fchr-expertise { background:transparent !important; border-color:#b8cfe8 !important; color:var(--fchr-texte-muted) !important; }
.fchr-carte--no-link:hover .fchr-expertise-label { color:var(--fchr-texte-hint) !important; }
.fchr-carte--no-link:hover .fchr-badge-type { background:var(--fchr-bleu) !important; color:#fff !important; }
.fchr-carte--no-link:hover .fchr-badge-type--clinique { background:var(--fchr-jaune) !important; color:var(--fchr-bleu-fonce) !important; }
.fchr-carte--no-link:hover .fchr-photo-bg { background:var(--fchr-bleu) !important; }
.fchr-carte--no-link:hover .fchr-photo { filter:grayscale(100%) !important; }
.fchr-carte-top { display:flex; align-items:flex-start; justify-content:space-between; }

/* Photo collée top-right */
/* Colonne droite : badge + photo */
.fchr-photo-col { flex-shrink:0; display:flex; flex-direction:column; align-items:flex-end; gap:0; margin:0; }
.fchr-photo-wrap { flex-shrink:0; position:relative; width:88px; height:88px; margin:0; overflow:visible; }
.fchr-photo-bg { position:absolute; bottom:-7px; left:-7px; width:88px; height:88px; background:var(--fchr-bleu); transition:background .2s; z-index:0; }
.fchr-carte:hover .fchr-photo-bg { background:var(--fchr-bleu-fonce); }
.fchr-photo { position:relative; z-index:1; width:88px; height:88px; object-fit:cover; object-position:center top; display:block; filter:grayscale(100%); transition:filter .2s; }
.fchr-carte:hover .fchr-photo { filter:grayscale(0%); }

/* Corps */
.fchr-corps { flex:1; min-width:0; padding:1.1rem 0 1.1rem 1.25rem; align-self:center; }
.fchr-meta-top { display:flex; align-items:center; justify-content:space-between; margin-bottom:.35rem; min-height:22px; padding-right:1.1rem; }
.fchr-badge-type { display:inline-block; font-size:.68rem; font-weight:500; letter-spacing:.04em; text-transform:uppercase; padding:3px 9px; border-radius:999px; background:var(--fchr-bleu); color:#fff; transition:background .2s,color .2s; flex-shrink:0; }
.fchr-badge-type--clinique { background:var(--fchr-jaune); color:var(--fchr-bleu-fonce); }
.fchr-carte:hover .fchr-badge-type,
.fchr-carte:hover .fchr-badge-type--clinique { background:rgba(255,255,255,.25); color:#fff; }
.fchr-nom { font-family:'Lora',serif; font-weight:500; color:var(--fchr-bleu-fonce); margin:0 0 .2rem; line-height:1.25; transition:color .2s; }
.fchr-carte:hover .fchr-nom { color:#fff; }
.fchr-discipline { font-size:.72rem; font-weight:600; text-transform:uppercase; letter-spacing:.05em; color:var(--fchr-bleu); transition:color .2s; }
.fchr-carte:hover .fchr-discipline { color:rgba(255,255,255,.85); }
.fchr-titre { font-size:1rem; color:var(--fchr-texte-muted); margin:0; line-height:1.4; transition:color .2s; }
.fchr-carte:hover .fchr-titre { color:rgba(255,255,255,.8); }

/* Bas de carte */
.fchr-carte-sep { height:1px; background:rgba(11,17,58,.12); margin:0 1.25rem; transition:background .2s; }
.fchr-carte:hover .fchr-carte-sep { background:rgba(255,255,255,.25); }
.fchr-carte--no-link:hover .fchr-carte-sep { background:rgba(11,17,58,.12) !important; }
.fchr-carte-bottom { padding:.75rem 1.25rem 1.1rem; }
.fchr-thematiques { display:flex; flex-direction:column; gap:.3rem; margin-bottom:.55rem; }
.fchr-theme-wrap { position:relative; }
.fchr-theme { font-size:1rem; color:var(--fchr-texte-muted); line-height:1.45; padding-left:.8rem; position:relative; transition:color .2s; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:block; cursor:default; }
.fchr-theme::before { content:''; position:absolute; left:0; top:.55em; width:4px; height:4px; border-radius:50%; background:var(--fchr-bleu); transition:background .2s; }
.fchr-theme-wrap .fchr-tooltip { display:none; position:absolute; bottom:calc(100% + 5px); left:0; background:#0b113a; color:#fff; font-size:.8rem; padding:7px 11px; border-radius:8px; z-index:20; white-space:normal; max-width:320px; line-height:1.45; pointer-events:none; }
.fchr-theme-wrap:hover .fchr-tooltip { display:block; }
.fchr-carte:hover .fchr-theme         { color:rgba(255,255,255,.85); }
.fchr-carte:hover .fchr-theme::before { background:rgba(255,255,255,.6); }

.fchr-expertises { display:flex; flex-wrap:wrap; gap:.3rem; margin-top:.2rem; }
.fchr-expertise { font-size:.85rem; padding:2px 8px; border-radius:4px; background:transparent; border:1px solid #b8cfe8; color:var(--fchr-texte-muted); transition:background .2s,color .2s,border-color .2s; }
.fchr-expertise-label { font-size:.7rem; font-weight:600; text-transform:uppercase; letter-spacing:.05em; color:var(--fchr-texte-hint); margin-top:.4rem; display:block; transition:color .2s; }
.fchr-carte:hover .fchr-expertise-label { color:rgba(255,255,255,.6); }
.fchr-carte:hover .fchr-expertise { background:rgba(255,255,255,.15); border-color:rgba(255,255,255,.35); color:rgba(255,255,255,.9); }

/* Vide */
.fchr-vide, .fchr-empty { text-align:center; padding:3rem; color:var(--fchr-texte-hint); font-style:italic; }

/* Responsive */
@media (max-width:640px) {
    .fchr-grille { grid-template-columns:1fr; }
    .fchr-filtres { flex-direction:column; align-items:stretch; }
    .fchr-dropdown-panel { min-width:unset; width:100%; }
}
