/*
 * Facmed — Services Clinique
 * Chargé uniquement sur les pages contenant [services_clinique]
 *
 * Charte UdeM : Figtree + bleu #0057ac, bleu nuit #0b113a, fond card #e5f0f8
 * Pattern identique à facmed-programmes-udem
 */


/* ══════════════════════════════════════════════════
   BARRE DE FILTRES
══════════════════════════════════════════════════ */

.services-clinique .svc__filtres {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    align-items: center;
    justify-content: center;
}

/* ── Bouton trigger dropdown ──────────────────────── */

.services-clinique .svc__filtre-trigger {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 1rem;
    border-radius: 999px;
    border: 1.5px solid #c8d4e0;
    background: #ffffff;
    color: #0b113a;
    font-size: 1rem;
    font-weight: 500;
    font-family: inherit;
    line-height: 1.4;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.15s ease, background 0.15s ease;
    box-shadow: none;
    text-shadow: none;
}

.services-clinique .svc__filtre-trigger:hover {
    border-color: #0b113a;
}

.services-clinique .svc__filtre-trigger.is-open {
    border-color: #0b113a;
    background: #e5f0f8;
}

.services-clinique .svc__filtre-trigger.has-value {
    border-color: #0b113a;
    background: #0b113a;
    color: #ffffff;
}

/* Badge compteur dans le bouton */
.services-clinique .svc__filtre-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
}

/* Flèche chevron */
.services-clinique .svc__filtre-arrow {
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    margin-top: -3px;
    transition: transform 0.15s ease, margin-top 0.15s ease;
    flex-shrink: 0;
}

.services-clinique .svc__filtre-trigger.is-open .svc__filtre-arrow {
    transform: rotate(-135deg);
    margin-top: 3px;
}

/* ── Wrapper dropdown ─────────────────────────────── */

.services-clinique .svc__filtre-drop {
    position: relative;
    display: inline-block;
}

/* ── Panel dropdown ───────────────────────────────── */

.services-clinique .svc__filtre-panel {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: #ffffff;
    border: 1px solid #dde3ef;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    min-width: 240px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 999;
    padding: 0.5rem 0;
}

.services-clinique .svc__filtre-panel.is-open {
    display: block;
}

/* ── Items checkbox ───────────────────────────────── */

.services-clinique .svc__filtre-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 1rem;
    cursor: pointer;
    font-size: 1rem;
    color: #0b113a;
    transition: background 0.1s ease;
    user-select: none;
}

.services-clinique .svc__filtre-item:hover {
    background: #e5f0f8;
}

.services-clinique .svc__filtre-item:has(input:checked) {
    background: #e5f0f8;
}

.services-clinique .svc__filtre-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #0b113a;
    cursor: pointer;
    flex-shrink: 0;
    margin: 0;
}

.services-clinique .svc__filtre-item-label {
    flex: 1;
    line-height: 1.4;
}

.services-clinique .svc__filtre-item-count {
    font-size: 0.8rem;
    color: #8a9ab0;
    font-weight: 500;
    margin-left: auto;
}

/* ── Bouton réinitialiser ─────────────────────────── */

.services-clinique .svc__filtre-reset {
    appearance: none;
    -webkit-appearance: none;
    display: none;
    align-items: center;
    gap: 0.3rem;
    padding: 0.45rem 0.875rem;
    border-radius: 999px;
    border: 1.5px solid #e0e0e0;
    background: transparent;
    color: #8a9ab0;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
    box-shadow: none;
}

.services-clinique .svc__filtre-reset.is-visible {
    display: inline-flex;
}

.services-clinique .svc__filtre-reset:hover {
    border-color: #f04e24;
    color: #f04e24;
}

/* ── Compteur de résultats ────────────────────────── */

.services-clinique .svc__filtre-count {
    font-size: 0.875rem;
    color: #5a6e84;
    margin-bottom: 1rem;
    text-align: center;
}

.services-clinique .svc__filtre-count strong {
    color: #0b113a;
}


/* ══════════════════════════════════════════════════
   LAYOUT GÉNÉRAL
══════════════════════════════════════════════════ */

.services-clinique {
    margin-block: 2rem;
}

.svc__section-titre {
    margin-bottom: 1.75rem;
}

/* ── Liste & colonnes ─────────────────────────────── */

.services-clinique .svc__liste {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 1rem;
}

.services-clinique .svc__item {
    display: flex;
    width: 100%;
}

/* 1 colonne */
.svc--1-col .svc__liste {
    grid-template-columns: 1fr;
}

/* 2 colonnes */
.svc--2-col .svc__liste {
    grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 600px) {
    .svc--2-col .svc__liste {
        grid-template-columns: 1fr;
    }
}

/* 3 colonnes */
.svc--3-col .svc__liste {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 780px) {
    .svc--3-col .svc__liste {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .svc--3-col .svc__liste {
        grid-template-columns: 1fr;
    }
}

/* Auto — min 260px par card */
.svc--auto-col .svc__liste {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}


/* ══════════════════════════════════════════════════
   CARD SERVICE
══════════════════════════════════════════════════ */

@keyframes svc-fade-in-up {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.services-clinique .svc__card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    height: 100%;
    width: 100%;
    background-color: var(--wp--preset--color--main-accent, #e5f0f8);
    border-radius: 16px;
    padding: var(--wp--preset--spacing--medium, 1.5rem);
    text-decoration: none;
    position: relative;
    transition: background-color 0.2s ease;
    animation: svc-fade-in-up 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: var(--svc-delay, 0s);
}

.services-clinique .svc__card:hover {
    background-color: var(--wp--preset--color--custom-bleu-principal, #0057ac);
}

/* ── Label discipline ─────────────────────────────── */

.services-clinique .svc__label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    line-height: 1;
    color: var(--wp--preset--color--primary-alt, #0057ac);
    transition: color 0.2s ease;
    padding-bottom: 0.15rem;
}

.services-clinique .svc__card:hover .svc__label {
    color: rgba(255, 255, 255, 0.8);
}

/* ── Titre avec lien étiré ────────────────────────── */

.services-clinique .svc__titre {
    font-family: var(--wp--preset--font-family--figtree, inherit);
    font-size: var(--wp--preset--font-size--medium, 1.1rem);
    font-weight: 500;
    line-height: 1.2;
    margin-block: 0;
}

.services-clinique .svc__card-link {
    color: var(--wp--preset--color--primary, #0b113a);
    text-decoration: none;
}

/* Lien étiré — couvre toute la card */
.services-clinique .svc__card-link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
}

.services-clinique .svc__card:hover .svc__card-link {
    color: #ffffff;
}

/* ── Extrait ──────────────────────────────────────── */

.services-clinique .svc__extrait {
    font-size: 1rem;
    color: var(--wp--preset--color--primary, #0b113a);
    opacity: 0.65;
    margin-block: 0;
    line-height: 1.55;
    flex: 1;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.services-clinique .svc__card:hover .svc__extrait {
    color: #ffffff;
    opacity: 0.8;
}

/* ── Badge statut ACF ─────────────────────────────── */

.services-clinique .svc__badge {
    display: inline-block;
    align-self: flex-start;
    margin-top: auto;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    z-index: 2;
    position: relative;
}

.services-clinique .svc__badge--ouvert {
    background: #d1fae5;
    color: #065f46;
}

.services-clinique .svc__badge--attente {
    background: #fef3c7;
    color: #92400e;
}

.services-clinique .svc__badge--attente-fermee {
    background: #fee2e2;
    color: #991b1b;
}

.services-clinique .svc__badge--non-offert {
    background: #f1f5f9;
    color: #475569;
}

/* ── Message aucun résultat ───────────────────────── */

.services-clinique .svc__no-result {
    font-size: 0.9rem;
    font-style: italic;
    color: #5a6e84;
    padding: 0.75rem 0;
    text-align: center;
}

.svc-vide {
    font-size: 0.9rem;
    font-style: italic;
    padding: 0.75rem 0;
    color: #5a6e84;
}


/* ══════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════ */

@media (max-width: 640px) {
    .services-clinique .svc__filtres {
        flex-direction: column;
        align-items: stretch;
    }

    .services-clinique .svc__filtre-drop {
        display: block;
    }

    .services-clinique .svc__filtre-trigger {
        width: 100%;
        justify-content: space-between;
    }

    .services-clinique .svc__filtre-panel {
        min-width: unset;
        width: 100%;
        left: 0;
    }
}
