/* ═══════════════════════════════════════════════════════════════════════════
   Contact
   ───────────────────────────────────────────────────────────────────────────
   Le formulaire tient la largeur principale ; à côté, une photo et les
   réseaux. En dessous, les questions qui reviennent. Le formulaire envoie
   vers /api/contact (lib/contact.js), pièces jointes comprises.
   ═══════════════════════════════════════════════════════════════════════════ */

.contact-main { padding-bottom: var(--e-9); }

.contact-grille {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
    gap: clamp(24px, 3.5vw, 48px);
    align-items: start;
    margin-bottom: var(--e-9);
}

.contact-titre {
    font-size: 1.3rem;
    font-weight: 500;
    margin-bottom: var(--e-4);
}

/* ═══════════════════════════════ Formulaire ═════════════════════════════ */

.contact-formulaire {
    padding: clamp(22px, 3vw, 36px);
    background: var(--blanc);
    border: 1px solid var(--filet);
    border-radius: var(--r-lg);
    box-shadow: var(--ombre-2);
}

.form-ligne {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 var(--e-4);
}

.contact-formulaire .champ { margin-bottom: var(--e-4); }
/* background-color et non background : le raccourci effaçait aussi l'image de
   fond, c'est-à-dire la flèche dessinée des listes déroulantes. */
.contact-formulaire .saisie { background-color: var(--papier); }
.contact-formulaire .saisie:focus { background-color: var(--blanc); }

.facultatif {
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    color: var(--encre-500);
}

/* Piège à robots : hors écran plutôt que `display: none`, que certains
   robots savent repérer. Jamais atteignable au clavier (tabindex -1). */
.piege {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ── Zone de dépôt ── */

.depot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--e-2);
    padding: var(--e-6) var(--e-4);
    border: 1.5px dashed var(--filet);
    border-radius: var(--r-md);
    background: var(--papier-2);
    text-align: center;
    cursor: pointer;
    transition: border-color var(--transition), background-color var(--transition);
}
.depot:hover,
.depot.survol { border-color: var(--prune); background: var(--prune-100); }
.depot:focus-within { outline: var(--focus); outline-offset: var(--focus-decalage); }
.depot svg { width: 26px; height: 26px; color: var(--prune); }
.depot-titre { font-size: var(--t-petit); font-weight: 700; color: var(--encre-900); }
.depot-aide { font-size: var(--t-mini); color: var(--encre-500); line-height: 1.5; }

/* ── Liste des pièces ── */

.pieces-liste {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: var(--e-2);
    margin-top: var(--e-3);
    max-height: 360px;
    overflow-y: auto;
}
.pieces-liste:empty { display: none; }

.piece {
    display: flex;
    align-items: center;
    gap: var(--e-3);
    padding: var(--e-2);
    background: var(--papier);
    border: 1px solid var(--filet);
    border-radius: var(--r-sm);
    animation: piece-arrive 260ms var(--courbe-douce);
}
@keyframes piece-arrive { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.piece-vignette {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: var(--r-xs);
    overflow: hidden;
    background: var(--prune-100);
    color: var(--prune);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
}
.piece-vignette img { width: 100%; height: 100%; object-fit: cover; }

.piece-infos { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.piece-nom {
    font-size: var(--t-mini);
    font-weight: 600;
    color: var(--encre-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.piece-taille { font-size: 12px; color: var(--encre-500); }

.piece-retirer {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--encre-500);
    transition: background-color var(--transition), color var(--transition);
}
.piece-retirer:hover { background: var(--erreur-bg); color: var(--erreur); }

#pieces-resume { margin-top: var(--e-2); }
#pieces-resume.trop { color: var(--erreur); font-weight: 600; }

/* ── Progression de l'envoi ── */

.progression { margin-top: var(--e-4); }
.progression-barre {
    height: 6px;
    border-radius: var(--r-rond);
    background: var(--papier-2);
    overflow: hidden;
}
.progression-barre span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--prune);
    transition: width 200ms linear;
}

.form-rgpd { margin-top: var(--e-4); }

/* ── Confirmation ── */

.form-merci {
    text-align: center;
    padding: var(--e-6) var(--e-4);
    animation: piece-arrive 400ms var(--courbe-douce);
}
.form-merci:focus { outline: none; }
.form-merci h3 { font-size: var(--t-h3); margin-bottom: var(--e-3); }
.form-merci p { color: var(--encre-500); max-width: 42ch; margin: 0 auto var(--e-5); }
.form-merci-icone {
    display: grid;
    place-items: center;
    width: 60px;
    height: 60px;
    margin: 0 auto var(--e-4);
    border-radius: 50%;
    background: var(--succes-bg);
    color: var(--succes);
}
.form-merci-icone svg { width: 28px; height: 28px; }

/* ═════════════════════════════ Colonne voisine ══════════════════════════ */

.contact-cote {
    position: sticky;
    top: calc(var(--header-h) + var(--e-5));
    display: flex;
    flex-direction: column;
    gap: var(--e-5);
}

.contact-photo {
    margin: 0;
    border-radius: var(--r-md);
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: var(--papier-2);
}
.contact-photo img { width: 100%; height: 100%; object-fit: cover; }

.contact-bloc {
    padding: var(--e-5);
    background: var(--papier-2);
    border: 1px solid var(--filet);
    border-radius: var(--r-md);
}

.contact-detail {
    font-size: var(--t-petit);
    color: var(--encre-500);
    margin-bottom: var(--e-3);
}

.contact-reseaux { list-style: none; display: flex; flex-direction: column; }
.contact-reseaux a {
    display: flex;
    align-items: center;
    min-height: 46px;
    font-size: var(--t-petit);
    font-weight: 600;
    color: var(--encre-900);
    border-bottom: 1px solid var(--filet);
    transition: color var(--transition), padding-left var(--transition);
}
.contact-reseaux li:last-child a { border-bottom: 0; }
.contact-reseaux a:hover,
.contact-reseaux a:focus-visible { color: var(--prune); padding-left: var(--e-2); }

.contact-adresse {
    font-size: var(--t-mini);
    color: var(--encre-500);
    margin: var(--e-3) 0 0;
    word-break: break-word;
}
.contact-adresse a { color: var(--prune); border-bottom: 1px solid currentColor; }

/* ═══════════════════════════════════ FAQ ════════════════════════════════ */

.faq-liste { max-width: var(--largeur-texte); }

.faq-liste details {
    border-top: 1px solid var(--filet);
    padding-block: var(--e-2);
}
.faq-liste details:last-child { border-bottom: 1px solid var(--filet); }

.faq-liste summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--e-4);
    min-height: 60px;
    cursor: pointer;
    list-style: none;
    font-family: var(--police-titre);
    font-size: 1.1rem;
    color: var(--encre-900);
}
.faq-liste summary::-webkit-details-marker { display: none; }

/* Plus qui devient moins à l'ouverture, dessiné en CSS. */
.faq-liste summary::after {
    content: "";
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    background:
        linear-gradient(var(--prune), var(--prune)) center / 14px 1.5px no-repeat,
        linear-gradient(var(--prune), var(--prune)) center / 1.5px 14px no-repeat;
    transition: transform var(--transition);
}
.faq-liste details[open] summary::after {
    background: linear-gradient(var(--prune), var(--prune)) center / 14px 1.5px no-repeat;
    transform: rotate(180deg);
}

.faq-liste details p {
    font-size: var(--t-petit);
    color: var(--encre-500);
    padding-bottom: var(--e-5);
    margin: 0;
    max-width: 62ch;
}

/* ═══════════════════════════ Points de rupture ═══════════════════════════ */

@media (max-width: 900px) {
    .contact-grille { grid-template-columns: 1fr; }
    .contact-cote { position: static; }
    .contact-photo { display: none; }   /* le formulaire passe en premier, la photo n'ajoute rien */
}

@media (max-width: 560px) {
    .form-ligne { grid-template-columns: 1fr; }
    .pieces-liste { grid-template-columns: 1fr; }
}
