/* Feuille de style commune des témoignages vidéo TopAssist (voir topassist-testimonial.js).
   Fonctionne sur la page de présentation comme sur les pages article. */

.testimonial {
    --testimonial-blue: var(--primary-blue, #3D6B8E);
    --testimonial-dark: var(--dark-blue, #2C5070);
    --testimonial-text: var(--text-dark, #333333);
    --testimonial-gray: var(--text-gray, #666666);
    --testimonial-surface: var(--white, #FFFFFF);
    text-align: left;
}

/* ===== Vignette cliquable et lecteur ===== */
.testimonial-frame,
.testimonial-thumb {
    position: relative;
    aspect-ratio: 9 / 16;
    border-radius: 14px;
    overflow: hidden;
    background: #000;
}
.testimonial-facade {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    cursor: pointer;
    background: #000;
    position: relative;
}
.testimonial-poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s, opacity 0.3s;
    opacity: 0.92;
}
.testimonial-facade:hover .testimonial-poster { transform: scale(1.03); opacity: 1; }
.testimonial-play {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 64px;
    height: 64px;
    margin: -32px 0 0 -32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s;
}
.testimonial-play::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 54%;
    transform: translate(-50%, -50%);
    border-style: solid;
    border-width: 12px 0 12px 20px;
    border-color: transparent transparent transparent var(--testimonial-blue);
}
.testimonial-facade:hover .testimonial-play,
.testimonial-facade:focus-visible .testimonial-play { transform: scale(1.1); }
.testimonial-facade:focus-visible { outline: 3px solid var(--accent-orange, #E8913A); outline-offset: 3px; }
.testimonial-iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ===== Chiffre clé ===== */
.testimonial-keyfigure {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    margin: 0 0 0.8rem;
    color: var(--testimonial-dark);
    line-height: 1;
}
.testimonial-keyfigure-value {
    font-size: 4.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--accent-orange, #E8913A);    white-space: nowrap;
    flex-shrink: 0;
}
.testimonial-keyfigure-caption { font-size: 1.35rem; font-weight: 700; }

/* ===== Citation ===== */
.testimonial-quote {
    margin: 0 0 0.6rem;
    padding: 0;
    border: 0;
}
.testimonial-quote p {
    font-size: 1.3rem;
    font-style: italic;
    line-height: 1.45;
    color: var(--testimonial-text);
    margin: 0;
}

/* ===== Textes ===== */
.testimonial-lead { color: var(--testimonial-text); margin: 1.2rem 0 0.4rem; line-height: 1.6; }
.testimonial-summary { color: var(--testimonial-gray); margin: 0; line-height: 1.6; }
.testimonial-attribution { color: var(--testimonial-gray); font-size: 0.95rem; margin: 0; }
.testimonial-attribution strong { color: var(--testimonial-text); }
.testimonial-attribution a { color: var(--testimonial-blue); font-weight: 600; }
.testimonial-logo-link { display: inline-block; margin-bottom: 1.2rem; }
.testimonial-logo { width: 240px; max-width: 100%; height: auto; display: block; }

/* ===== Format complet ===== */
.testimonial--full {
    display: grid;
    grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
    gap: 2.5rem;
    align-items: center;
    max-width: 900px;
    margin: 0 auto;
    background: var(--testimonial-surface);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
}
@media (max-width: 720px) {
    .testimonial--full { grid-template-columns: 1fr; gap: 1.5rem; padding: 1.25rem; }
    .testimonial--full .testimonial-frame { width: 100%; max-width: 240px; margin: 0 auto; }
    .testimonial-keyfigure-value { font-size: 3.4rem; }
    .testimonial-keyfigure-caption { font-size: 1.15rem; }
    .testimonial-quote p { font-size: 1.15rem; }
}

/* ===== Format compact ===== */
.testimonial--compact {
    display: flex;
    gap: 1.25rem;
    align-items: center;
    background: var(--testimonial-surface);
    border-left: 4px solid var(--accent-orange, #E8913A);
    border-radius: 8px;
    padding: 1.1rem 1.3rem;
    margin: 1.8rem 0;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
}
.testimonial--compact .testimonial-thumb { flex: 0 0 96px; border-radius: 10px; }
.testimonial--compact .testimonial-play { width: 40px; height: 40px; margin: -20px 0 0 -20px; }
.testimonial--compact .testimonial-play::after { border-width: 8px 0 8px 13px; }
.testimonial--compact .testimonial-keyfigure { margin-bottom: 0.4rem; }
.testimonial--compact .testimonial-keyfigure-value { font-size: 2.4rem; }
.testimonial--compact .testimonial-keyfigure-caption { font-size: 1.05rem; }
.testimonial--compact .testimonial-quote p { font-size: 1.05rem; }
.testimonial--compact .testimonial-lead { font-size: 0.9rem; color: var(--testimonial-gray); margin: 0.5rem 0 0; }
.testimonial-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-orange, #E8913A);
    margin: 0 0 0.2rem;
}
.testimonial-play-link {
    margin-top: 0.6rem;
    background: none;
    border: 1.5px solid var(--testimonial-blue);
    color: var(--testimonial-blue);
    border-radius: 50px;
    padding: 0.3rem 0.9rem;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}
.testimonial-play-link:hover { background: var(--testimonial-blue); color: #fff; }
@media (max-width: 480px) {
    .testimonial--compact { padding: 1rem; gap: 1rem; align-items: flex-start; }
    .testimonial--compact .testimonial-thumb { flex-basis: 76px; }
}

/* ===== Fenêtre de lecture (format compact) ===== */
.testimonial-dialog {
    border: 0;
    padding: 0;
    background: transparent;
    overflow: visible;
    margin: auto;
}
.testimonial-dialog::backdrop { background: rgba(10, 20, 30, 0.8); }
.testimonial-dialog-frame { height: min(85vh, 720px); width: auto; }
.testimonial-dialog-close {
    position: absolute;
    top: -44px;
    right: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 0;
    background: #fff;
    color: #222;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}
@media (max-width: 480px) {
    .testimonial-dialog-frame { height: auto; width: 88vw; }
}

/* Repli avant chargement du script */
[data-testimonial] > a.testimonial-fallback { font-weight: 600; }
