/* Bibliothèque de fonctions */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.bb-page { --bb: var(--accent); --bb-fn: var(--accent2); --bb-proc: var(--accent4); }
.bb-page code .fn { color: var(--fn, var(--accent5)); }
.bb-page code .op { color: var(--accent4); }
.bb-page code .kw { color: var(--keyword); }
.bb-page code .num { color: var(--number); }

/* en-tête */
.bb-entete {
    display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px;
    padding: 44px 0 24px; border-bottom: 1px solid var(--border); margin-bottom: 20px;
    background: var(--bg) url('/assets/image/pattern-bg.svg') repeat;
}
:root[data-theme="dark"] .bb-entete { background-image: url('/assets/image/pattern-bg-dark.svg'); }
.bb-entete-texte { flex: 1 1 460px; }
.bb-eyebrow {
    display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px; padding: 4px 12px;
    border: 1px solid color-mix(in srgb, var(--bb) 30%, transparent); border-radius: 999px; background: color-mix(in srgb, var(--bb) 8%, transparent);
    color: var(--bb); font-size: 10.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
}
.bb-entete h1 { margin: 0 0 10px; padding: 0; border: 0; font-family: 'Unbounded', sans-serif; font-size: 30px; font-weight: 900; letter-spacing: -1.5px; line-height: 1.2; }
.bb-entete h1::before { display: none; }
.bb-entete h1 em { font-style: italic; color: var(--bb); }
.bb-entete-texte p { max-width: 720px; margin: 0; font-size: 13px; line-height: 1.75; color: var(--text-dim); }
.bb-entete-cote { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.bb-mes { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-dim); text-decoration: none; }
.bb-mes:hover { color: var(--bb); }
.bb-mes .mdi-timer-sand { color: var(--accent4); }
.bb-total { font-size: 12px; color: var(--text-dimmer); }
.bb-total strong { color: var(--text); }

/* recherche et filtres */
.bb-recherche { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; border: 1px solid var(--border2); border-radius: 14px; background: var(--surface); margin-bottom: 14px; }
.bb-recherche:focus-within { border-color: var(--bb); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bb) 15%, transparent); }
.bb-recherche > .mdi { font-size: 20px; color: var(--text-dimmer); }
.bb-recherche input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 13.5px; padding: 6px 0; }
.bb-cats { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 6px; margin-bottom: 10px; }
.bb-cats a { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--border); border-radius: 99px; background: var(--surface); color: var(--text-dim); font-size: 12.5px; text-decoration: none; white-space: nowrap; }
.bb-cats a:hover { border-color: var(--bb); color: var(--text); }
.bb-cats a span { padding: 0 7px; border-radius: 99px; background: var(--surface3); font-size: 11px; }
.bb-cats a.is-active { border-color: var(--bb); background: color-mix(in srgb, var(--bb) 9%, var(--surface)); color: var(--bb); font-weight: 600; }
.bb-cats a.is-active span { background: var(--bb); color: #fff; }
.bb-barre { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.bb-onglets { display: flex; flex-wrap: wrap; gap: 4px; padding: 3px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.bb-onglets a { display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; border-radius: 9px; color: var(--text-dim); font-size: 12.5px; text-decoration: none; }
.bb-onglets a:hover { color: var(--text); background: var(--hover); }
.bb-onglets a.is-active { background: color-mix(in srgb, var(--bb) 11%, var(--surface)); color: var(--bb); font-weight: 600; }
.bb-resultat { margin: -4px 0 14px; font-size: 12.5px; color: var(--text-dim); }
.bb-resultat a { color: var(--bb); }

/* cartes */
.bb-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.bb-carte { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); transition: border-color .15s, transform .15s, box-shadow .15s; }
.bb-carte:hover { border-color: color-mix(in srgb, var(--bb) 45%, var(--border)); transform: translateY(-2px); box-shadow: 0 8px 22px rgba(15, 20, 25, .06); }
.bb-carte-lien { flex: 1; display: block; padding: 16px 18px 12px; color: inherit; text-decoration: none; }
.bb-genre { display: inline-block; margin-bottom: 8px; padding: 2px 8px; border-radius: 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; }
.bb-genre.is-fonction { background: color-mix(in srgb, var(--bb-fn) 13%, transparent); color: var(--bb-fn); }
.bb-genre.is-procedure { background: color-mix(in srgb, var(--bb-proc) 14%, transparent); color: var(--bb-proc); }
.bb-sig { display: block; font-family: var(--font-mono); font-size: 13px; font-weight: 600; color: var(--text); background: none; padding: 0; overflow-wrap: anywhere; }
.bb-resume { margin: 8px 0 0; font-size: 12px; line-height: 1.65; color: var(--text-dim); }
.bb-carte-pied { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 18px 12px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-dim); }
.bb-auteur { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.bb-auteur small { color: var(--text-dimmer); }
.bb-auteur small::before { content: '· '; }
.bb-chiffres { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.bb-chiffres > span { display: inline-flex; align-items: center; gap: 3px; }
.bb-chiffres .mdi-heart { color: var(--accent3); }
.bb-cat { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; background: var(--surface3); color: var(--text-dim); font-size: 11.5px; text-decoration: none; }
a.bb-cat:hover { color: var(--bb); }
.bb-vide { margin: 30px 0; }
.bb-vide a { color: var(--bb); }
.bb-pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 22px 0 10px; }
.bb-pagination a { min-width: 34px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; text-align: center; font-size: 12.5px; color: var(--text-dim); text-decoration: none; }
.bb-pagination a.is-active { border-color: var(--bb); color: var(--bb); font-weight: 700; }

.bb-comment { margin: 34px 0 10px; padding: 18px 20px; border: 1px dashed var(--border2); border-radius: 16px; font-size: 13px; line-height: 1.75; color: var(--text-dim); }
.bb-comment h2 { margin: 0 0 8px; padding: 0; border: 0; font-size: 15px; color: var(--text); }
.bb-comment h2::before { display: none; }
.bb-comment h2 .mdi { color: var(--accent4); }
.bb-comment ol { margin: 0 0 8px; padding-left: 20px; }
.bb-comment p { margin: 0; }
.bb-comment a { color: var(--bb); }

/* fiche */
.bb-fil { display: flex; align-items: center; gap: 8px; margin: 22px 0 14px; font-size: 12.5px; color: var(--text-dimmer); }
.bb-fil a { color: var(--text-dim); text-decoration: none; }
.bb-fil a:hover { color: var(--bb); }
.bb-etat { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 14px; padding: 10px 14px; border-radius: 12px; font-size: 13px; line-height: 1.6; }
.bb-etat .mdi { font-size: 18px; }
.bb-etat a { font-weight: 600; color: inherit; }
.bb-etat.is-attente { background: color-mix(in srgb, var(--accent4) 10%, var(--surface)); color: color-mix(in srgb, var(--accent4) 75%, var(--text)); }
.bb-etat.is-refusee { background: color-mix(in srgb, var(--err) 9%, var(--surface)); color: color-mix(in srgb, var(--err) 75%, var(--text)); }
.bb-fiche { border: 1px solid var(--border); border-radius: 18px; background: var(--surface); overflow: hidden; }
.bb-fiche-tete { padding: 22px 24px 18px; border-bottom: 1px solid var(--border); }
.bb-fiche-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bb-fiche-badges .bb-genre { margin: 0; }
.bb-fiche h1 { margin: 10px 0 6px; padding: 0; border: 0; font-size: inherit; line-height: 1.3; }
.bb-fiche h1::before { display: none; }
.bb-fiche h1 .bb-sig { font-size: 14px; font-weight: 700; letter-spacing: -.2px; }
.bb-fiche-resume { margin: 0 0 16px; font-size: 13px; line-height: 1.65; color: var(--text-dim); }
.bb-fiche-auteur { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 13px; }
.bb-fiche-auteur > span:not(.bb-fiche-gestion) { display: flex; flex-direction: column; gap: 2px; }
.bb-fiche-auteur small { color: var(--text-dimmer); font-size: 11.5px; }
.bb-fiche-gestion { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; }
.bb-bloc { padding: 18px 24px; border-bottom: 1px solid var(--border); }
.bb-bloc h2 { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; padding: 0; border: 0; font-size: 13px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; color: var(--text-dim); }
.bb-bloc h2::before { display: none; }
.bb-bloc-tete { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.bb-bloc-tete h2 { margin: 0; }
.bb-code { margin: 0; max-height: 560px; overflow: auto; white-space: pre; font-size: 13px; }
.bb-texte { font-size: 12.5px; line-height: 1.75; color: var(--text); overflow-wrap: anywhere; }
.bb-texte p { margin: 0 0 10px; }
.bb-texte p:last-child { margin-bottom: 0; }
.bb-texte code { padding: 1px 5px; border-radius: 5px; background: var(--code-bg); font-size: .92em; }
.bb-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px 24px; background: var(--surface2); }
.bb-aimer, .bb-stat { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: 1px solid var(--border); border-radius: 99px; background: var(--surface); color: var(--text-dim); font: inherit; font-size: 12.5px; text-decoration: none; cursor: pointer; }
.bb-stat:hover, .bb-aimer:hover { border-color: var(--border2); color: var(--text); }
span.bb-stat, .bb-aimer.is-lecture { cursor: default; }
.bb-aimer .mdi { font-size: 16px; }
.bb-aimer.is-aime { border-color: color-mix(in srgb, var(--accent3) 40%, transparent); background: color-mix(in srgb, var(--accent3) 8%, var(--surface)); color: var(--accent3); }
.bb-aimer.pop .mdi { animation: bb-pop .35s ease; }
@keyframes bb-pop { 40% { transform: scale(1.35); } }
.bb-stat b, .bb-aimer b { color: var(--text); }

/* commentaires */
.bb-commentaires { margin-top: 26px; }
.bb-commentaires h2, .bb-autres h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 0; border: 0; font-size: 16px; }
.bb-commentaires h2::before, .bb-autres h2::before { display: none; }
.bb-com-vide { margin: 0 0 14px; font-size: 13px; color: var(--text-dim); }
.bb-com { display: flex; gap: 10px; margin-bottom: 12px; scroll-margin-top: calc(var(--header-h) + 16px); }
.bb-com-corps { flex: 1; min-width: 0; padding: 10px 14px; border: 1px solid var(--border); border-radius: 4px 14px 14px 14px; background: var(--surface); }
.bb-com.is-auteur .bb-com-corps { border-color: color-mix(in srgb, var(--bb) 30%, var(--border)); background: color-mix(in srgb, var(--bb) 4%, var(--surface)); }
.bb-com:target .bb-com-corps { box-shadow: 0 0 0 3px color-mix(in srgb, var(--bb) 22%, transparent); }
.bb-com-tete { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 12.5px; }
.bb-com-tete small { color: var(--text-dimmer); font-size: 11.5px; }
.bb-com-badge { padding: 1px 7px; border-radius: 99px; background: var(--bb); color: #fff; font-size: 10.5px; font-weight: 700; }
.bb-com-tete .inline-form { margin-left: auto; }
.bb-com-suppr { border: 0; background: none; color: var(--text-dimmer); cursor: pointer; padding: 2px; }
.bb-com-suppr:hover { color: var(--err); }
.bb-com .bb-texte { font-size: 13px; }
.bb-com-form { display: flex; gap: 10px; margin-top: 16px; }
.bb-com-champ { flex: 1; min-width: 0; }
.bb-com-champ textarea { resize: vertical; min-height: 84px; }
.bb-com-pied { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.bb-com-pied .form-help { margin: 0; }
.bb-com-connexion { padding: 14px; border: 1px dashed var(--border2); border-radius: 12px; text-align: center; font-size: 13px; color: var(--text-dim); }
.bb-com-connexion a { color: var(--bb); font-weight: 600; }

.bb-autres { margin: 30px 0 10px; }
.bb-autres-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.bb-autres-liste a { display: block; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: inherit; text-decoration: none; }
.bb-autres-liste a:hover { border-color: var(--bb); }
.bb-autres-liste .bb-sig { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bb-autres-liste .bb-sig span { display: inline; margin: 0; font-size: inherit; line-height: inherit; }
.bb-autres-liste .bb-sig .fn { color: var(--fn, var(--accent5)); }
.bb-autres-liste .bb-sig .op { color: var(--accent4); }
.bb-autres-liste a > span { display: block; margin-top: 4px; font-size: 12px; line-height: 1.55; color: var(--text-dim); }

/* formulaire */
.bb-form .code-textarea.bb-exemple { min-height: 130px; height: 130px; }
.bb-admin-titre { margin: 16px 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; color: var(--text-dim); }
.bb-form .bb-piege { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.bb-detecte { margin: 8px 0 0; font-size: 12.5px; line-height: 1.6; color: var(--text-dim); }
.bb-detecte:empty { display: none; }
.bb-detecte .mdi { font-size: 15px; vertical-align: -2px; }
.bb-detecte .bb-sig { display: inline; font-size: 12.5px; }
.bb-detecte.is-ok .mdi { color: var(--accent2); }
.bb-detecte.is-erreur { color: color-mix(in srgb, var(--accent4) 80%, var(--text)); }
.bb-form .form-help code { padding: 0 4px; border-radius: 4px; background: var(--code-bg); }
.bb-form .form-check.has-error span { color: var(--err); }
.bb-quota { margin: 0 0 0 auto; }
.bb-badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.bb-badge.is-publiee { background: color-mix(in srgb, var(--accent2) 14%, transparent); color: var(--accent2); }
.bb-badge.is-attente { background: color-mix(in srgb, var(--accent4) 14%, transparent); color: var(--accent4); }
.bb-badge.is-refusee { background: color-mix(in srgb, var(--err) 12%, transparent); color: var(--err); }
.acc-table .bb-sig { font-size: 13px; }

@media (max-width: 720px) {
    .bb-entete { padding-top: 28px; }
    .bb-entete h1 { font-size: 24px; letter-spacing: -1px; }
    .bb-entete-cote { align-items: flex-start; }
    .bb-grille { grid-template-columns: 1fr; }
    .bb-barre { flex-direction: column; align-items: stretch; }
    .bb-onglets { overflow-x: auto; flex-wrap: nowrap; }
    .bb-onglets a { flex: 0 0 auto; }
    .bb-cats { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
    .bb-fiche-tete, .bb-bloc { padding-left: 16px; padding-right: 16px; }
    .bb-actions { padding: 12px 16px; }
    .bb-fiche h1 .bb-sig { font-size: 16px; }
    .bb-fiche-gestion { margin-left: 0; }
    .bb-recherche .btn { padding-left: 10px; padding-right: 10px; }
}
