/* Parcours B : la démo d'un thème dans le site des licences (gabarit demo.php). Préfixe b-. Base : /vitrine.css.
   Feuille chargée sur la seule page de démo : elle règle aussi main, le bandeau et le pied de cette page. */
.b-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bandeau__liens a[aria-current] { text-decoration: underline; text-decoration-color: var(--yellow); text-decoration-thickness: 2px; text-underline-offset: 6px; }
main { max-width: 1400px; padding: 30px 24px 72px; }

/* ---------- en-tête : le thème, son secteur, ses styles ---------- */
.b-tete { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 48px; align-items: end; }
.b-retour { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; color: var(--ink-2); text-decoration: none; margin-bottom: 18px; }
.b-retour::before { content: "←"; font-family: var(--sans); transition: transform .15s; }
.b-retour:hover { color: var(--ink); text-decoration: underline; }
.b-retour:hover::before { transform: translateX(-3px); }
.b-tete h1 { font-size: 38px; line-height: 1.15; margin: 8px 0 8px; }
.b-tete .lead { max-width: 70ch; }

.b-styles { min-width: 0; }
.b-styles .eyebrow { margin: 0 0 10px; }
.b-styles__liste { display: flex; flex-wrap: wrap; gap: 8px; }
.b-style { position: relative; display: inline-flex; align-items: center; gap: 9px; margin: 0; padding: 7px 14px 7px 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 13.5px; color: var(--ink); text-decoration: none; cursor: pointer; transition: border-color .15s, background .15s; }
.b-style:hover { border-color: var(--line-strong); }
.b-style[aria-current] { border-color: var(--yellow); background: var(--yellow-soft); box-shadow: inset 0 0 0 1px var(--yellow); }
.b-style:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.b-style__pastille { display: inline-flex; }
.b-style__pastille i { width: 14px; height: 14px; border-radius: 50%; box-shadow: 0 0 0 2px var(--surface), inset 0 0 0 1px rgba(0, 0, 0, .15); }
.b-style__pastille i + i { margin-left: -4px; }
.b-style[aria-current] .b-style__pastille i { box-shadow: 0 0 0 2px var(--yellow-soft), inset 0 0 0 1px rgba(0, 0, 0, .15); }

/* ---------- barre de la démo (collante) ---------- */
.b-barre { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; margin-top: 26px; padding: 12px 0; background: var(--bg); border-block: 1px solid var(--line); }
.b-barre__theme { display: flex; align-items: center; gap: 6px; margin-right: 6px; }
.b-fleche { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); font: 400 20px/1 var(--serif); color: var(--ink-2); text-decoration: none; padding-bottom: 3px; transition: border-color .15s; }
.b-fleche:hover { border-color: var(--ink); color: var(--ink); }
.b-barre__nom { display: flex; align-items: baseline; gap: 8px; min-width: 0; margin: 0; padding: 0 4px; }
.b-barre__nom strong { font: 700 17px/1.2 var(--serif); }
.b-barre__nom span { font: 500 12px/1 var(--mono); color: var(--yellow-ink); }
.b-barre .segments { flex-wrap: nowrap; }
.b-barre .segments a { position: relative; text-decoration: none; }
.b-barre .segments span { padding: 7px 14px; font-size: 13.5px; }
.b-barre .segments a:hover span { color: var(--ink); }
.b-barre .segments a[aria-current] span { background: var(--ink); color: var(--bg); }
.b-barre .segments a:focus-visible { outline: 0; }
.b-barre .segments a:focus-visible span { outline: 2px solid var(--focus); outline-offset: 2px; }
.b-vues { padding-left: 16px; border-left: 1px solid var(--line); }
.b-complete { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; margin: 0 0 0 auto; }
.b-complete a { font-weight: 600; font-size: 13.5px; color: var(--ink-2); white-space: nowrap; }
.b-complete a::after { content: " ↗"; }
.b-complete a:hover { color: var(--ink); }
.b-complete small, .b-collant__complete small { font: 500 11px/1.2 var(--mono); color: var(--muted); white-space: nowrap; }
.b-complete small[hidden], .b-collant__complete small[hidden] { display: none; }
.b-reserver { white-space: nowrap; }

/* ---------- la scène : le cadre et le panneau ---------- */
.b-scene { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 48px; margin-top: 28px; align-items: start; }
.b-scene__cadre { min-width: 0; padding-bottom: 64px; }

.b-cadre { position: relative; margin: 0; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.b-cadre__barre { display: flex; align-items: center; gap: 14px; height: 40px; padding: 0 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); border-radius: 13px 13px 0 0; }
.b-cadre__pts { display: inline-flex; gap: 6px; }
.b-cadre__pts i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); }
.b-cadre__adresse { flex: 0 1 520px; margin: 0 auto; transform: translateX(-30px); padding: 5px 12px; border-radius: 7px; background: var(--bg); font: 400 12px/1.4 var(--mono); color: var(--ink-2); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.b-cadre__corps { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 24px; height: clamp(440px, calc(100vh - 220px), 780px); }
.b-ecran { overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: none; border-radius: 0 0 0 13px; background: var(--surface-2); }
.b-ecran::-webkit-scrollbar { display: none; }
.b-ecran:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.b-ecran picture { display: block; }
.b-ecran img { display: block; width: 100%; height: auto; transition: opacity .2s; }
.b-cadre--charge .b-ecran img { opacity: .3; }

/* le rail : une étoile qui suit le défilement, et qu'on attrape */
.b-rail { position: relative; border-left: 1px solid var(--line); cursor: ns-resize; touch-action: none; }
.b-rail::before { content: ""; position: absolute; left: 50%; top: 14px; bottom: 14px; width: 1px; background: repeating-linear-gradient(var(--line-strong) 0 3px, transparent 3px 7px); }
.b-rail__etoile { position: absolute; left: 2px; top: 0; width: 20px; height: 20px; overflow: visible; filter: var(--star-filter); will-change: transform; }
.b-rail__etoile path { fill: var(--star); stroke: var(--star-edge); stroke-width: .05; }

/* l'étoile qui accompagne : posée sur le coin du cadre, la clé de la licence au bout du bras */
.b-compagne { position: absolute; right: -26px; bottom: -58px; display: flex; align-items: center; gap: 10px; flex-direction: row-reverse; z-index: 2; pointer-events: none; }
.b-compagne__etoile { width: 92px; height: 92px; flex: none; }
.b-bulle { max-width: 300px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 14px 14px 3px 14px; background: var(--surface); font: italic 400 14px/1.45 var(--serif); color: var(--ink-2); margin: 26px 0 0; }
.b-bulle--fin { border-color: var(--yellow); background: var(--yellow-soft); color: var(--ink); }

/* le téléphone */
.b-cadre--mobile { width: 414px; margin: 0 auto; border: 12px solid #1d1c1a; border-radius: 46px; background: #1d1c1a; }
.b-cadre--mobile .b-cadre__barre { display: none; }
.b-cadre--mobile .b-cadre__corps { position: static; grid-template-columns: minmax(0, 1fr); height: clamp(440px, calc(100vh - 210px), 760px); }
.b-cadre--mobile .b-ecran { border-radius: 34px; }
.b-cadre--mobile .b-rail { position: absolute; top: 48px; bottom: 48px; right: -48px; width: 24px; border-left: 0; }
.b-cadre--mobile .b-compagne { right: auto; left: calc(100% + 60px); bottom: 30px; flex-direction: row; align-items: flex-end; }
.b-cadre--mobile .b-compagne .b-bulle { border-radius: 14px 14px 14px 3px; margin: 0 0 30px; }
.b-cadre--mobile .b-bulle { max-width: 230px; }
:root[data-theme="dark"] .b-cadre--mobile { box-shadow: var(--shadow), 0 0 0 1px var(--line-strong); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .b-cadre--mobile { box-shadow: var(--shadow), 0 0 0 1px var(--line-strong); } }

/* le panneau : ce qui est inclus */
.b-panneau { position: sticky; top: 90px; padding-left: 28px; border-left: 1px solid var(--line); }
.b-panneau p { margin: 0; }
.b-panneau__rub + .b-panneau__rub { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }
.b-panneau .eyebrow { margin-bottom: 10px; }
.b-panneau__fort { font: 400 16px/1.5 var(--serif); }
.b-panneau .b-panneau__note { margin-top: 10px; font-size: 13px; color: var(--muted); }
.b-versions { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.b-versions li { font: 500 12.5px/1 var(--mono); padding: 7px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.b-formules { list-style: none; margin: 0; padding: 0; }
.b-formules li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--ink-2); }
.b-formules li:first-child { border-top: 0; padding-top: 0; }
.b-formules b { font: 700 15px/1.2 var(--serif); color: var(--ink); white-space: nowrap; }

/* ---------- d'un thème à l'autre ---------- */
.b-suite { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin-top: 40px; background: var(--line); border-block: 1px solid var(--line); }
.b-suite__lien { display: grid; grid-template-columns: 168px minmax(0, 1fr); grid-template-rows: auto auto 1fr; column-gap: 22px; align-content: center; padding: 22px 26px; background: var(--bg); color: var(--ink); text-decoration: none; transition: background .15s; }
.b-suite__lien:only-child { grid-column: 1 / -1; }
.b-suite__lien:hover { background: var(--surface); }
.b-suite__lien img { grid-row: 1 / 4; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); }
.b-suite__lien .eyebrow { align-self: end; margin: 0; }
.b-suite__lien--prec .eyebrow::before { content: "← "; }
.b-suite__lien--suiv .eyebrow::after { content: " →"; }
.b-suite__nom { font: 700 20px/1.3 var(--serif); margin-top: 4px; }
.b-suite__secteur { color: var(--muted); font-size: 13.5px; }
.b-suite__lien:hover .b-suite__nom { text-decoration: underline; text-decoration-color: var(--yellow); text-decoration-thickness: 2px; text-underline-offset: 4px; }

.b-collant { display: none; }

/* sous 1400 px, la marge de main ne suffit plus à la clé de l'étoile : elle rentre un peu sur le cadre */
@media (max-width: 1400px) { .b-cadre--ordi .b-compagne { right: -6px; } }
@media (max-width: 1180px) {
  .b-scene { grid-template-columns: minmax(0, 1fr) 230px; gap: 36px; }
  .b-barre__nom { display: none; }
  .b-cadre--mobile .b-compagne { flex-direction: column; align-items: flex-start; left: calc(100% + 50px); }
  .b-cadre--mobile .b-compagne .b-bulle { max-width: 150px; margin: 0; border-radius: 3px 14px 14px 14px; }
}
@media (max-width: 960px) {
  .b-tete { grid-template-columns: minmax(0, 1fr); }
  .b-scene { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .b-panneau { position: static; padding: 28px 0 0; border-left: 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
  .b-panneau__rub + .b-panneau__rub { margin: 0; padding: 0; border: 0; }
}
/* Écran étroit : toujours le téléphone (la capture mobile vient du <source> du <picture>, même sans JS). */
@media (max-width: 760px) {
  main { padding: 22px 16px 40px; }
  body { padding-bottom: 70px; }
  .b-retour { margin-bottom: 12px; }
  .b-tete h1 { font-size: 29px; }
  .b-style { padding: 6px 12px 6px 8px; font-size: 13px; }
  .b-barre { position: static; margin-top: 22px; padding: 10px 0; }
  .b-barre__theme, .b-vues, .b-complete, .b-reserver { display: none; }
  .b-barre .b-pages { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .b-barre .b-pages span { text-align: center; padding: 8px 6px; }
  .b-scene { margin-top: 20px; }
  .b-scene__cadre { padding-bottom: 72px; }
  .b-cadre { width: calc(100% - 36px); max-width: 340px; margin: 0; border: 9px solid #1d1c1a; border-radius: 38px; background: #1d1c1a; }
  .b-cadre .b-cadre__barre { display: none; }
  .b-cadre .b-cadre__corps { position: static; grid-template-columns: minmax(0, 1fr); height: min(560px, calc(100vh - 230px)); min-height: 420px; }
  .b-cadre .b-ecran { border-radius: 29px; }
  .b-cadre .b-rail { position: absolute; right: -36px; top: 40px; bottom: 120px; width: 24px; border-left: 0; }
  .b-cadre .b-compagne { left: auto; right: -42px; bottom: -66px; flex-direction: row-reverse; align-items: center; }
  .b-cadre .b-compagne .b-bulle { max-width: 220px; font-size: 13.5px; border-radius: 14px 14px 3px 14px; margin: 26px 0 0; }
  .b-compagne__etoile { width: 76px; height: 76px; }
  .b-panneau { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .b-panneau__rub + .b-panneau__rub { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
  .b-suite { grid-template-columns: minmax(0, 1fr); margin-top: 32px; }
  .b-suite__lien { grid-template-columns: 112px minmax(0, 1fr); column-gap: 14px; padding: 16px 0; }
  .b-collant { display: flex; align-items: center; gap: 16px; position: fixed; z-index: 10; left: 0; right: 0; bottom: 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line); }
  .b-collant .btn { flex: 1; }
  .b-collant__complete { display: flex; flex-direction: column; gap: 2px; margin: 0; }
  .b-collant__complete a { font-weight: 600; font-size: 13.5px; color: var(--ink-2); white-space: nowrap; }
  .b-collant__complete a::after { content: " ↗"; }
}
@media (prefers-reduced-motion: reduce) {
  .b-retour::before, .b-ecran img { transition: none; }
  .b-retour:hover::before { transform: none; }
}

/* le bandeau et le pied s'alignent sur la largeur de la visionneuse */
.bandeau, .pied { padding-inline: max(24px, calc((100% - 1352px) / 2)); }
@media (max-width: 560px) { .bandeau, .pied { padding-inline: 16px; } }
