/**
* Derrière le Miroir — Helpline page: "Qui vous répond ?" section and call buttons
* Load after dlm-components.css and helpline-demo.css (which holds .db-listen__cta).
* Relies on the site's --db-* variables.
*/

.db-therapists,
.db-therapists__actions {
    font-family: "Libre Franklin", system-ui, sans-serif;
    color: var(--db-charcoal);
}

.db-therapists *,
.db-therapists__actions * {
    box-sizing: border-box;
}

#db-therapists-list-container {
    scroll-margin-top: 80px; /* "Préférez-vous appeler ?" anchor lands below the header */
}

/* ---------- Cards ---------- */

.db-therapists {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.db-therapist {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px 24px 10px;
    background: #FFFFFF;
    border: 1px solid #EADFDA;
    border-radius: 16px;
}

.db-therapist__head {
    display: flex;
    align-items: center;
    gap: 16px;
}

.db-therapist__avatar {
    flex-shrink: 0;
    display: block;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
}

.db-therapist__name {
    margin: 0;
    font-family: "Source Serif Pro", Georgia, serif;
    font-weight: 600;
    font-size: 22px;
    line-height: 28px;
    color: var(--db-accent-blue);
}

.db-therapist__bio,
.db-therapist__details {
    margin: 0;
    font-size: 16px;
    line-height: 26px;
    color: #3E3F42;
}

.db-therapist__details em {
    font-weight: 600;
}

.db-therapist__quote {
    margin: 0;
    padding: 16px 18px;
    border: none;
    border-radius: 12px;
    background: var(--db-background-cream);
    font-family: "Source Serif Pro", Georgia, serif;
    font-style: italic;
    font-size: 17px;
    line-height: 26px;
    color: var(--db-accent-blue);
}

/* Links row, pushed to the bottom so both cards align */
.db-therapist__links {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 28px;
    margin-top: auto;
    padding-top: 4px;
    border-top: 1px solid #F0E4DF;
}

.db-therapist__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    color: var(--db-pink-link);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
}

.db-therapist__link:hover {
    color: #833F31;
}

.db-therapist__link i {
    font-size: 18px;
}

/* ---------- Call button (legacy structure kept for helpline.js) ---------- */

/* Hidden until the therapist opens the line (db-active) */
.db-helpline-button {
    display: none;
}

.db-helpline-button.db-active {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    align-self: flex-start;
    min-height: 48px;
    margin: 0;
    padding: 0 20px;
    border: 2px solid var(--db-pink-link);
    border-radius: 999px;
    background: #FFFFFF;
    color: var(--db-pink-link);
    font-family: inherit;
    font-size: 15px;
    line-height: 20px;
    font-weight: 600;
    cursor: pointer;
}

.db-helpline-button.db-active:hover {
    background: #F7E9E4;
}

.db-helpline-button:focus-visible {
    outline: 2px solid var(--db-pink-link);
    outline-offset: 2px;
}

.db-button-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.db-service-status-container {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 400;
    color: #5E5F62;
    letter-spacing: 0;
    text-transform: none;
}

/* Status dot drawn in CSS: no dependency on an icon font */
.db-status-led {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #B7B2AF;
}

.db-status-led i {
    display: none;
}

.db-status-led[data-service-status="online"] { background: #3A8F5C; }
.db-status-led[data-service-status="busy"] { background: #C77D2B; }
.db-status-led[data-service-status="away"] { background: #C77D2B; }
.db-status-led[data-service-status="offline"] { background: #B7B2AF; }

/* Dialing / in call */
.db-helpline-button.db-blink {
    animation: db-call-pulse 1.4s ease-in-out infinite;
}

@keyframes db-call-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(156, 82, 66, 0.35); }
    50% { box-shadow: 0 0 0 8px rgba(156, 82, 66, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .db-helpline-button.db-blink {
        animation: none;
        background: #F7E9E4;
    }
}

/* ---------- Actions under the cards ---------- */

.db-therapists__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px 24px;
    margin-top: 28px;
}

.db-therapists__more {
    white-space: nowrap;
    margin: 0;
    font-size: 15px;
    line-height: 22px;
    color: #5E5F62;
}

.db-therapists__more a {
    color: var(--db-pink-link);
    font-weight: 600;
}

/* ---------- Smartphone ---------- */

@media (max-width: 600px) {
    .db-therapists {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .db-therapist {
        gap: 14px;
        padding: 18px 16px 8px;
    }
    
    .db-therapist__avatar {
        width: 56px;
        height: 56px;
    }
    
    .db-therapist__name {
        font-size: 19px;
        line-height: 24px;
    }
    
    .db-therapist__bio,
    .db-therapist__details {
        font-size: 15px;
        line-height: 24px;
    }
    
    .db-therapist__quote {
        padding: 14px 16px;
        font-size: 16px;
        line-height: 24px;
    }
    
    .db-therapist__links {
        justify-content: space-between;
        gap: 4px;
    }
    
    .db-therapist__link {
        font-size: 14px;
    }
    
    .db-helpline-button.db-active {
        align-self: stretch;
    }
    
    .db-therapists__actions {
        flex-direction: column;
        align-items: stretch;
        margin-top: 20px;
    }
    
    .db-therapists__more {
        text-align: center;
    }

    .db-therapists__more a {
        display: block;
        margin-top: 2px;
    }
}

/* ---------- Emergency numbers ---------- */

.db-emergency {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-family: "Libre Franklin", system-ui, sans-serif;
    color: #4F5154;
}

.db-emergency__title {
    margin: 0;
    font-size: 15px;
    line-height: 22px;
    font-weight: 600;
    color: var(--db-charcoal);
}

.db-emergency__text {
    margin: 0;
    font-size: 15px;
    line-height: 23px;
}

.db-emergency__list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 4px 0 0;
    padding: 0;
    list-style: none;
    font-size: 15px;
    line-height: 23px;
}

.db-emergency__country {
    display: inline-block;
    min-width: 80px;
    font-weight: 600;
    color: var(--db-charcoal);
}

.db-emergency__list a {
    color: var(--db-pink-link);
    font-weight: 600;
    text-decoration: none;
}

@media (max-width: 600px) {
    .db-emergency__title,
    .db-emergency__text,
    .db-emergency__list {
        font-size: 14px;
        line-height: 21px;
    }
    
    .db-emergency__list li {
        display: flex;
        flex-wrap: wrap;
        gap: 2px 8px;
    }
    
    .db-emergency__country {
        flex-basis: 100%;
    }
}
