/* ============================================================
   PUBLICATIONS — l'appli du portail client (HUB), préfixe .pb-            24/11/2026
   Pensée d'abord pour un téléphone (360 à 430 px, une main, le pouce) : une colonne, des cibles de 44 px au moins,
   un bouton plein en bas de chaque carte. Sur grand écran la colonne reste étroite et centrée.
   Couleurs : celles de la charte (css/charte.css) par leurs variables. Prusse = textes et boutons pleins ; menthe = fond ou repère,
   jamais un texte sur fond clair ; ardoise = secondaire. Seules les pastilles des réseaux portent leur couleur de marque (donnée).
   ============================================================ */

.pb { width: 100%; max-width: 580px; margin: 0 auto; min-width: 0; color: var(--prusse); font-size: 16px; line-height: 1.5; }
.pb *, .pb *::before, .pb *::after { box-sizing: border-box; }
.pb [hidden] { display: none !important; }
.pb p, .pb h2, .pb h3, .pb ul, .pb ol { margin: 0; padding: 0; }
.pb ul, .pb ol { list-style: none; }
.pb button { font-family: inherit; }
.pb-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.pb-ic { flex: none; display: block; }
.pb-attente { color: var(--ardoise-fonce); padding: 40px 8px; text-align: center; }

/* Le focus se voit toujours (Prusse sur blanc : 15:1) */
.pb :is(button, a, textarea, input, [tabindex]):focus-visible { outline: 3px solid var(--prusse); outline-offset: 2px; }

/* ── Onglets ───────────────────────────────────────────── */
.pb-onglets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; margin-bottom: 20px; background: var(--ardoise-pale); border-radius: 16px; }
.pb-onglet { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 0 6px; border: 0; border-radius: 12px; background: transparent; color: var(--ardoise-fonce); font-size: 15px; font-weight: 600; cursor: pointer; transition: background .15s, color .15s; }
.pb-onglet[aria-selected="true"] { background: #fff; color: var(--prusse); box-shadow: 0 1px 3px rgba(var(--prusse-rgb), .12); }
.pb-nb { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--prusse); color: #fff; font-size: 12px; font-weight: 700; }

/* ── Liste et cartes ───────────────────────────────────── */
.pb-liste { display: flex; flex-direction: column; gap: 20px; }
.pb-regle { margin-bottom: 16px; color: var(--ardoise-fonce); font-size: 14px; }
.pb-carte { position: relative; background: #fff; border: 1px solid var(--ardoise-ligne); border-radius: 20px; overflow: hidden; box-shadow: 0 1px 2px rgba(var(--prusse-rgb), .04), 0 12px 30px -16px rgba(var(--prusse-rgb), .18); }
.pb-carte:focus { outline: none; }
.pb-carte:focus-visible { outline: 3px solid var(--prusse); outline-offset: 2px; }
.pb-carte-tete { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 16px 16px 12px; }
.pb-corps { display: flex; flex-direction: column; gap: 14px; padding: 14px 16px 18px; }
.pb-corps-haut { padding-top: 0; padding-bottom: 14px; }
.pb-date { color: var(--ardoise-fonce); font-size: 14px; }
.pb-meta { color: var(--ardoise-fonce); font-size: 13px; }
.pb-note { margin: 0 16px 12px; padding: 12px 14px; border-radius: 12px; background: var(--ardoise-brume); border: 1px solid var(--ardoise-ligne-2); font-size: 15px; }
.pb-note:empty, .pb-erreur:empty, .pb-progres:empty { display: none; }
.pb-surbrillance { animation: pb-flash 2.4s ease-out; }
@keyframes pb-flash { 0% { box-shadow: 0 0 0 4px var(--menthe); } 100% { box-shadow: 0 0 0 4px rgba(var(--menthe-rgb), 0); } }

/* La pastille d'état : la menthe n'y est qu'un repère (le point), le texte reste en Prusse */
.pb-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 30px; padding: 3px 12px; border-radius: 15px; background: var(--ardoise-pale); color: var(--prusse); font-size: 14px; font-weight: 700; line-height: 1.3; }
.pb-chip::before { content: ''; flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--ardoise); }
.pb-chip-valider { background: var(--menthe-pale); }
.pb-chip-valider::before, .pb-chip-publiee::before { background: var(--menthe); box-shadow: 0 0 0 1px rgba(var(--prusse-rgb), .35); }
.pb-chip-publiee { background: var(--menthe-brume); }
.pb-chip-completer::before { background: var(--amber, #d97706); }
.pb-chip-petit { min-height: 24px; padding: 1px 10px; font-size: 12.5px; }

/* ── Images : toute l'image se voit (le client valide ce qui part), jamais rognée ── */
.pb-media { position: relative; background: var(--ardoise-brume); }
.pb-piste { display: flex; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; aspect-ratio: 1 / 1; max-height: 78vh; }
.pb-piste::-webkit-scrollbar { display: none; }
.pb-slide { flex: 0 0 100%; margin: 0; display: flex; align-items: center; justify-content: center; scroll-snap-align: center; scroll-snap-stop: always; min-width: 0; }
.pb-slide img { display: block; width: 100%; height: 100%; object-fit: contain; }
.pb-slide { position: relative; }
.pb-slide.pb-casse img { visibility: hidden; }
.pb-slide.pb-casse::after { content: 'Image indisponible pour le moment'; position: absolute; color: var(--ardoise-fonce); font-size: 14px; padding: 0 16px; text-align: center; }
.pb-compteur { position: absolute; right: 12px; bottom: 12px; padding: 2px 10px; border-radius: 12px; background: rgba(var(--prusse-rgb), .78); color: #fff; font-size: 13px; font-weight: 600; pointer-events: none; }
.pb-fleche { display: none; position: absolute; top: 50%; width: 44px; height: 44px; margin-top: -22px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .92); color: var(--prusse); box-shadow: 0 1px 4px rgba(var(--prusse-rgb), .25); cursor: pointer; align-items: center; justify-content: center; }
.pb-fleche-g { left: 10px; } .pb-fleche-d { right: 10px; }
@media (hover: hover) and (pointer: fine) { .pb-fleche { display: inline-flex; } }
.pb-video video { display: block; width: 100%; max-height: 78vh; background: var(--prusse); }

/* ── Texte, réseaux ────────────────────────────────────── */
.pb-texte { white-space: pre-line; overflow-wrap: anywhere; font-size: 16px; line-height: 1.55; }
.pb-replie { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; overflow: hidden; }
.pb-texte-zone { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.pb-lire { min-height: 44px; padding: 0; border: 0; background: none; color: var(--prusse); font-size: 15px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.pb-versions { display: flex; flex-direction: column; gap: 12px; padding-top: 6px; width: 100%; }
.pb-version { padding-left: 12px; border-left: 3px solid var(--ardoise-ligne-2); }
.pb-etiquette { color: var(--ardoise-fonce); font-size: 13px; font-weight: 600; }
.pb-etiquette-champ { font-size: 15px; font-weight: 600; }
.pb-aide { color: var(--ardoise-fonce); font-size: 14px; overflow-wrap: anywhere; }
.pb-lien-ligne { font-size: 14px; overflow-wrap: anywhere; }
.pb-lien { color: var(--prusse); text-underline-offset: 3px; }
.pb-reseaux { display: flex; flex-wrap: wrap; gap: 8px; }
.pb-reseaux li { display: inline-flex; align-items: center; gap: 8px; min-height: 30px; padding: 3px 12px; border: 1px solid var(--ardoise-ligne-2); border-radius: 15px; font-size: 14px; }
.pb-pt { flex: none; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--ardoise)); }
.pb-pt-grand { width: 14px; height: 14px; }

/* ── Actions : une principale par carte, pleine largeur, sous le pouce ── */
.pb-actions { display: flex; flex-direction: column; gap: 12px; padding-top: 4px; }
.pb-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 52px; padding: 0 20px; border: 2px solid transparent; border-radius: 14px; font-size: 16px; font-weight: 700; line-height: 1.2; text-align: center; cursor: pointer; transition: background .15s, border-color .15s; }
.pb-btn-plein { background: var(--prusse); color: #fff; }
.pb-btn-plein:hover:not(:disabled) { background: var(--prusse-2); }
.pb-btn-sec { background: #fff; color: var(--prusse); border-color: var(--ardoise-ligne-2); }
.pb-btn-sec:hover:not(:disabled) { background: var(--ardoise-brume); border-color: var(--ardoise); }
.pb-btn-texte { width: auto; min-height: 44px; padding: 0 8px; border: 0; background: none; color: var(--prusse); font-size: 15px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.pb-btn-petit { width: auto; min-height: 44px; padding: 0 16px; font-size: 15px; }
.pb-btn:disabled { opacity: .45; cursor: not-allowed; }
.pb-duo { display: grid; grid-template-columns: 1fr; gap: 10px; }
.pb-erreur { padding: 12px 14px; border-radius: 12px; background: var(--red-bg, #fef2f2); border: 1px solid #f3b4b4; color: #7f1d1d; font-size: 15px; overflow-wrap: anywhere; }
.pb-progres { color: var(--ardoise-fonce); font-size: 14px; text-align: center; }

/* ── Champs ────────────────────────────────────────────── */
.pb .pb-champ { display: block; width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid var(--ardoise-ligne-2); border-radius: 12px; background: #fff; color: var(--prusse); font: inherit; font-size: 16px; line-height: 1.45; }
.pb textarea.pb-champ { min-height: 112px; resize: vertical; }
.pb .pb-champ:focus { border-color: var(--prusse); box-shadow: none; background: #fff; }
.pb .pb-champ[aria-invalid="true"] { border-color: #b91c1c; }
.pb-modif, .pb-nom-saisie { display: flex; flex-direction: column; gap: 8px; }
.pb-modif label, .pb-nom-saisie label { font-size: 15px; font-weight: 600; }
.pb-nom-connu { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--ardoise-fonce); font-size: 14px; }
.pb-nom-connu b { color: var(--prusse); font-weight: 600; overflow-wrap: anywhere; }

/* ── À compléter ───────────────────────────────────────── */
.pb-question { padding: 14px 16px; border-radius: 14px; background: var(--menthe-brume); border: 1px solid var(--ardoise-ligne); border-left: 5px solid var(--prusse); }
.pb-q-texte { margin-top: 2px; font-size: 18px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; white-space: pre-line; }
.pb-vignettes { display: flex; flex-wrap: wrap; gap: 14px; padding: 6px 6px 2px 0; }
.pb-vignette { position: relative; width: 76px; height: 76px; border-radius: 12px; background: var(--ardoise-pale); }
.pb-vignette img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }
.pb-v-retirer { position: absolute; top: -12px; right: -12px; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; background: none; color: #fff; cursor: pointer; }
.pb-v-retirer span { display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--prusse); border: 2px solid #fff; }
.pb-v-retirer .pb-ic { width: 14px; height: 14px; }

/* ── Carte repliée après un geste ──────────────────────── */
.pb-carte-fait .pb-corps { padding-top: 0; }
.pb-fait { display: flex; gap: 14px; align-items: flex-start; padding: 18px 16px; }
.pb-fait-ic { flex: none; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--menthe); color: var(--prusse); }
.pb-fait-titre { font-size: 18px; font-weight: 700; }
.pb-fait-texte { margin-top: 2px; color: var(--prusse); font-size: 16px; overflow-wrap: anywhere; }
.pb-extrait { margin-top: 8px; color: var(--ardoise-fonce); font-size: 14px; overflow-wrap: anywhere; }

/* ── États vides et erreurs de chargement ──────────────── */
.pb-vide { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 40px 12px; text-align: center; }
.pb-vide .pb-btn { max-width: 320px; }
.pb-vide-ic { display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 50%; background: var(--menthe-pale); color: var(--prusse); }
.pb-vide-ic .pb-ic { width: 28px; height: 28px; }
.pb-titre-vide { font-size: 20px; font-weight: 700; line-height: 1.3; }
.pb-vide-etat { border: 1px solid var(--ardoise-ligne); border-radius: 20px; background: #fff; padding: 32px 20px; }

/* ── Calendrier ────────────────────────────────────────── */
.pb-cal-section + .pb-cal-section { margin-top: 32px; }
.pb-cal-titre { margin-bottom: 4px; font-size: 20px; font-weight: 700; }
.pb-jour { margin: 20px 0 8px; color: var(--ardoise-fonce); font-size: 14px; font-weight: 700; text-transform: capitalize; }
.pb-cal-liste { display: flex; flex-direction: column; gap: 10px; }
.pb-cal-ligne { background: #fff; border: 1px solid var(--ardoise-ligne); border-radius: 16px; overflow: hidden; }
.pb-cal-bouton { display: flex; align-items: flex-start; gap: 12px; width: 100%; min-height: 56px; padding: 12px 14px; border: 0; background: none; color: var(--prusse); text-align: left; cursor: pointer; }
.pb-cal-bouton:hover { background: var(--ardoise-brume); }
.pb-cal-heure { flex: none; min-width: 48px; padding-top: 2px; font-size: 15px; font-weight: 700; }
.pb-cal-corps { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.pb-cal-extrait { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: 15px; overflow-wrap: anywhere; }
.pb-cal-reseaux { display: flex; gap: 6px; }
.pb-cal-chev { flex: none; align-self: center; color: var(--ardoise-fonce); transition: transform .15s; }
.pb-cal-bouton[aria-expanded="true"] .pb-cal-chev { transform: rotate(180deg); }
.pb-detail { display: flex; flex-direction: column; gap: 12px; padding: 4px 14px 16px; border-top: 1px solid var(--ardoise-ligne); padding-top: 14px; }
.pb-cal-img { display: block; width: 100%; max-height: 320px; object-fit: contain; border-radius: 12px; background: var(--ardoise-brume); }
.pb-envois { display: flex; flex-direction: column; gap: 10px; }
.pb-envois li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 15px; }
.pb-envois .pb-btn-petit { gap: 6px; }
.pb-histo { display: flex; flex-direction: column; gap: 4px; color: var(--ardoise-fonce); font-size: 14px; }
.pb-histo-date { white-space: nowrap; }

/* ── Comptes ───────────────────────────────────────────── */
.pb-compte-nom { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 700; }
.pb-compte-phrase { font-size: 16px; }
.pb-etapes { display: flex; flex-direction: column; gap: 10px; counter-reset: pb-etape; }
.pb-etapes li { position: relative; padding-left: 40px; min-height: 28px; counter-increment: pb-etape; font-size: 16px; overflow-wrap: anywhere; }
.pb-etapes li::before { content: counter(pb-etape); position: absolute; left: 0; top: -1px; display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--ardoise-pale); color: var(--prusse); font-size: 14px; font-weight: 700; }

/* ── Petits écrans ─────────────────────────────────────── */
@media (max-width: 400px) {
  .pb-carte-tete, .pb-corps, .pb-fait { padding-left: 14px; padding-right: 14px; }
  .pb-note { margin-left: 14px; margin-right: 14px; }
  .pb-onglet { font-size: 14px; }
}
/* Un peu plus d'air dès qu'on a la place, sans élargir la colonne */
@media (min-width: 600px) {
  .pb-duo { grid-template-columns: 1fr 1fr; }
  .pb-corps { padding: 16px 20px 22px; }
  .pb-carte-tete { padding: 18px 20px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .pb *, .pb *::before, .pb *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
