/* ============================================================
   Page builder — rendu des blocs sur un site public.

   Feuille livrée par le bundle qcdgone/builder et partagée par tous les
   fronts : elle habille les blocs `faq`, `callout`, `toc`, `quote`, `gmap`,
   `ranking`, `stats`, `steps` et `proscons`, ainsi que le conteneur de
   débordement des tableaux.

   Les couleurs passent par quatre variables, redéfinissables par le thème
   qui inclut cette feuille :

     :root {
         --pb-accent:  var(--ma-couleur-principale);
         --pb-border:  var(--ma-couleur-de-liseret);
         --pb-surface: var(--mon-fond-alterne);
         --pb-text:    var(--ma-couleur-de-texte);
     }

   Sans redéfinition, les valeurs de repli ci-dessous s'appliquent.
   ============================================================ */

:root {
    --pb-accent: #4f46e5;
    --pb-border: #e5e7eb;
    --pb-surface: #f8fafc;
    --pb-text: #1f2937;
}

/* ── Blocs page builder : FAQ / encadré / sommaire ─────────── */
.pb-faq { margin: 1.5rem 0; }
.pb-faq-item { border: 1px solid var(--pb-border, #e5e7eb); border-radius: 10px; margin-bottom: .6rem; overflow: hidden; }
.pb-faq-q { width: 100%; text-align: left; background: var(--pb-surface, #f8fafc); border: 0; cursor: pointer;
    padding: .9rem 1.1rem; font-weight: 700; font-size: 1rem; display: flex; justify-content: space-between; gap: 1rem; }
.pb-faq-q::after { content: "+"; color: var(--pb-accent, #4f46e5); font-weight: 800; }
.pb-faq-item.open .pb-faq-q::after { content: "−"; }
.pb-faq-a { padding: 0 1.1rem; max-height: 0; overflow: hidden; transition: max-height .2s, padding .2s; }
.pb-faq-item.open .pb-faq-a { padding: .9rem 1.1rem; max-height: 1000px; }

.pb-callout { display: flex; gap: .9rem; margin: 1.5rem 0; padding: 1.1rem 1.2rem; border-radius: 12px;
    border-left: 5px solid var(--pb-accent, #4f46e5); background: var(--pb-surface, #f8fafc); }
.pb-callout--warning { border-left-color: #f59e0b; }
.pb-callout--tip { border-left-color: #10b981; }
.pb-callout-icon { font-size: 1.5rem; line-height: 1; }
.pb-callout-title { font-weight: 800; margin: 0 0 .3rem; }
.pb-callout-body { margin: 0; }

.pb-toc { margin: 1.5rem 0; padding: 1rem 1.2rem; border: 1px solid var(--pb-border, #e5e7eb);
    border-radius: 12px; background: var(--pb-surface, #f8fafc); }
.pb-toc-title { font-weight: 800; margin: 0 0 .5rem; }
.pb-toc ul { margin: 0; padding-left: 1.1rem; }
.pb-toc a { text-decoration: none; }
.pb-toc .pb-toc-h3 { padding-left: 1rem; font-size: .92rem; }

/* ── Citation ──────────────────────────────────────────────── */
.pb-quote { margin: 1.8rem 0; padding: 1rem 1.4rem; border-left: 4px solid var(--pb-accent, #4f46e5);
    background: var(--pb-surface, #f8fafc); border-radius: 0 12px 12px 0; }
.pb-quote-text { margin: 0; font-size: 1.15rem; font-style: italic; color: var(--pb-text, #1f2937); }
.pb-quote-author { margin-top: .5rem; font-weight: 700; color: var(--pb-accent, #4f46e5); }
.pb-quote-author::before { content: "— "; }

/* ── Carte Google Maps (fluide : largeur du conteneur, hauteur au ratio) ── */
.pb-map { position: relative; width: 100%; margin: 1.8rem 0; border-radius: 14px; overflow: hidden;
    border: 1px solid var(--pb-border, #e5e7eb); aspect-ratio: 4 / 3; }
.pb-map--16x9 { aspect-ratio: 16 / 9; }
.pb-map--1x1 { aspect-ratio: 1 / 1; }
.pb-map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
@supports not (aspect-ratio: 1 / 1) {
    .pb-map { height: 0; padding-bottom: 75%; }
    .pb-map--16x9 { padding-bottom: 56.25%; }
    .pb-map--1x1 { padding-bottom: 100%; }
}
/* Carte accolée au texte : la marge verticale du bloc décalerait la colonne. */
.row > [class*="col-"] > .pb-map { margin: 0; }

/* ── Citation ──────────────────────────────────────────────── */
.pb-quote { margin: 1.8rem 0; padding: 1rem 1.4rem; border-left: 4px solid var(--pb-accent, #4f46e5);
    background: var(--pb-surface, #f8fafc); border-radius: 0 12px 12px 0; }
.pb-quote-text { margin: 0; font-size: 1.15rem; font-style: italic; color: var(--pb-text, #1f2937); }
.pb-quote-author { margin-top: .5rem; font-weight: 700; color: var(--pb-accent, #4f46e5); }
.pb-quote-author::before { content: "— "; }

/* ── Classement (top N) ────────────────────────────────────── */
.pb-ranking { margin: 1.8rem 0; }
.pb-ranking-title { font-weight: 800; font-size: 1.2rem; margin: 0 0 .8rem; }
.pb-ranking-list { list-style: none; margin: 0; padding: 0; counter-reset: none; }
.pb-ranking-item { display: flex; gap: 1rem; align-items: flex-start; padding: 1rem 1.1rem;
    border: 1px solid var(--pb-border, #e5e7eb); border-radius: 14px; background: #fff;
    margin-bottom: .8rem; }
.pb-ranking-rank { flex: 0 0 auto; width: 2.2rem; height: 2.2rem; display: flex;
    align-items: center; justify-content: center; border-radius: 50%; font-weight: 800;
    background: var(--pb-accent, #4f46e5); color: #fff; }
.pb-ranking-body { flex: 1 1 auto; min-width: 0; }
.pb-ranking-name { margin: 0; font-weight: 700; font-size: 1.05rem; }
.pb-ranking-rating { margin: .2rem 0 0; font-size: .9rem; color: #64748b; }
.pb-ranking-stars { color: #f59e0b; letter-spacing: .05em; }
.pb-ranking-desc { margin: .4rem 0 0; }

/* ── Chiffres-clés ─────────────────────────────────────────── */
.pb-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1rem; margin: 1.8rem 0; }
.pb-stat { text-align: center; padding: 1.2rem 1rem; border: 1px solid var(--pb-border, #e5e7eb);
    border-radius: 14px; background: #fff; }
.pb-stat-value { font-size: 2rem; font-weight: 800; line-height: 1.1; color: var(--pb-accent, #4f46e5); }
.pb-stat-label { margin-top: .4rem; font-size: .9rem; color: #64748b; }

/* ── Étapes ────────────────────────────────────────────────── */
.pb-steps { margin: 1.8rem 0; }
.pb-steps-title { font-weight: 800; margin: 0 0 .6rem; }
.pb-steps-list { list-style: none; counter-reset: pb-step; margin: 0; padding: 0; }
.pb-steps-list li { counter-increment: pb-step; position: relative; padding: .6rem 0 .6rem 3rem; }
.pb-steps-list li::before { content: counter(pb-step); position: absolute; left: 0; top: .5rem;
    width: 2rem; height: 2rem; display: flex; align-items: center; justify-content: center;
    background: var(--pb-accent, #4f46e5); color: #fff; border-radius: 50%; font-weight: 800; }

/* ── Avantages / inconvénients ─────────────────────────────── */
.pb-proscons { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1.8rem 0; }
.pb-proscons .pb-pros, .pb-proscons .pb-cons { padding: 1.1rem 1.2rem; border-radius: 12px; border: 1px solid var(--pb-border, #e5e7eb); }
.pb-proscons .pb-pros { background: #f0fdf4; border-color: #bbf7d0; }
.pb-proscons .pb-cons { background: #fef2f2; border-color: #fecaca; }
.pb-proscons-title { font-weight: 800; margin: 0 0 .5rem; }
.pb-proscons .pb-pros .pb-proscons-title { color: #16a34a; }
.pb-proscons .pb-cons .pb-proscons-title { color: #dc2626; }
.pb-proscons ul { margin: 0; padding-left: 1.1rem; }
.pb-proscons li { margin-bottom: .3rem; }
@media (max-width: 860px) { .pb-proscons { grid-template-columns: 1fr; } }

/* ── Tableaux du contenu ───────────────────────────────────────
   Seul le conteneur de débordement est générique ; l'habillage des
   cellules relève de la charte de chaque thème. */
.pb-table-wrap { overflow-x: auto; margin: 1.5rem 0; }
.pb-table-wrap table { margin: 0; }
