/* Couleurs : thème sombre par défaut (tons chauds), thème clair au choix dans le menu. */
:root, :root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #15110e;
  --surface: #201a16;
  --surface-2: #2a221c;
  --text: #ece3d8;
  --muted: #a99b8c;
  --accent: #d6a15f;
  --accent-dark: #b9843f;
  --on-accent: #1a130c;
  --heading: #f1c891;
  --border: #3a3029;
  --banner: #0d0a08;
  --banner-text: #f4ebe0;
  --danger: #e07a66;
  --field: #191410;
  --shadow: rgba(0, 0, 0, .45);
  --ok-bg: #1f3320; --ok-fg: #b5dcae;
  --err-bg: #3d1f1a; --err-fg: #f0b4a8;
  --info-bg: #33291c; --info-fg: #e8d2b0;
  --warn-bg: #3b2e14; --warn-fg: #f0d08a;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #faf7f2;
  --surface: #ffffff;
  --surface-2: #f3ece2;
  --text: #2b2723;
  --muted: #6f665c;
  --accent: #7a4b2a;
  --accent-dark: #5c3820;
  --on-accent: #ffffff;
  --heading: #5c3820;
  --border: #e3dbd0;
  --banner: #4a3424;
  --banner-text: #ffffff;
  --danger: #a33a2a;
  --field: #ffffff;
  --shadow: rgba(0, 0, 0, .1);
  --ok-bg: #e7f2e4; --ok-fg: #2f5a27;
  --err-bg: #f8e3df; --err-fg: #7d2a1e;
  --info-bg: #f3ecdf; --info-fg: #5c4630;
  --warn-bg: #fbefd5; --warn-fg: #7a5410;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text);
  font-family: Georgia, "Times New Roman", serif; line-height: 1.6; }
a { color: var(--accent); }
img { max-width: 100%; height: auto; }
h2, h3 { color: var(--heading); font-weight: normal; }

/* Bandeau : menu à gauche, titre au centre, connexion à droite */
.banner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: 1rem; padding: .8rem 1.5rem; background: var(--banner); color: var(--banner-text);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.site-title { grid-column: 2; margin: 0; font-size: 1.6rem; font-weight: normal; text-align: center; color: var(--banner-text); }
.site-title a { color: inherit; text-decoration: none; }
.account { grid-column: 3; justify-self: end; display: flex; align-items: center; gap: .6rem; }
.user-link { color: var(--banner-text); opacity: .8; font-family: system-ui, sans-serif; font-size: .9rem; }

.menu { grid-column: 1; grid-row: 1; justify-self: start; position: relative; }
.menu-toggle { display: flex; flex-direction: column; justify-content: center; gap: 5px;
  width: 42px; height: 38px; padding: 0 10px; background: none; border: 1px solid transparent;
  border-radius: 6px; cursor: pointer; }
.menu-toggle span { display: block; height: 2px; background: var(--banner-text); border-radius: 2px; }
.menu-toggle:hover, .menu-toggle[aria-expanded="true"] { border-color: rgba(255,255,255,.3); }
.menu-panel { position: absolute; top: calc(100% + 10px); left: 0; min-width: 240px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 10px 30px var(--shadow); padding: .4rem 0; font-family: system-ui, sans-serif; font-size: .95rem; }
.menu-panel[hidden] { display: none; }
.menu-section { margin: .6rem 1rem .2rem; font-size: .72rem; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted); }
.menu-item { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .5rem 1rem;
  background: none; border: 0; color: var(--text); text-decoration: none; text-align: left;
  font: inherit; cursor: pointer; }
.menu-item:hover { background: var(--surface-2); color: var(--accent); }
.switch { position: relative; width: 34px; height: 20px; border-radius: 999px; background: var(--border); flex-shrink: 0; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px;
  border-radius: 50%; background: var(--text); transition: transform .15s; }
.theme-switch[aria-checked="true"] .switch { background: var(--accent); }
.theme-switch[aria-checked="true"] .switch::after { transform: translateX(14px); background: var(--on-accent); }

.content { padding: 2rem 2.5rem; }

/* Accueil : photo + texte, puis blocs pleine largeur */
.public-intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2.5rem; align-items: start; }
.public-photo img { width: 100%; border-radius: 8px; display: block; }
.member-intro { margin-top: 2rem; }

.blocks { display: flex; flex-direction: column; gap: 1.75rem; margin-top: 2rem; }
.block { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); align-items: stretch;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
  color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
a.block:hover { border-color: var(--accent); box-shadow: 0 6px 24px var(--shadow); }
.block > img, .block > .placeholder { width: 100%; height: 100%; min-height: 240px; max-height: 420px;
  aspect-ratio: auto; object-fit: cover; display: block; }
.block-body { padding: 1.5rem 2rem; align-self: center; }
.block-body h2 { margin: 0 0 .5rem; font-size: 1.5rem; }
.block-add { display: flex; align-items: center; justify-content: center; min-height: 120px;
  border: 1px dashed var(--border); border-radius: 10px; color: var(--accent);
  font-family: system-ui, sans-serif; text-decoration: none; }
.block-add:hover { border-color: var(--accent); }
.placeholder { aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--muted); font-family: system-ui, sans-serif; font-size: .9rem; }

/* Page de détail */
.detail { max-width: 780px; margin: 0 auto; }
.detail-wide { max-width: 1100px; }
.detail-image { display: block; border-radius: 8px; margin: 1rem 0; }

/* Mise en page libre (affichage et édition partagent ces règles).
   Mesures en centièmes de la largeur de la feuille ; le texte suit la même
   échelle, donc la page garde ses proportions à toutes les largeurs d'écran. */
.sheet-wrap { container-type: inline-size; max-width: 1100px; margin: 1rem auto; }
.sheet { position: relative; width: 100%; aspect-ratio: 100 / var(--sheet-h, 40); }
.sheet-item { position: absolute; z-index: var(--z, 1);
  left: calc(var(--x) * 1%); width: calc(var(--w) * 1%);
  top: calc(var(--y) / var(--sheet-h) * 100%); height: calc(var(--h) / var(--sheet-h) * 100%); }
.sheet-image img { width: 100%; height: 100%; display: block; border-radius: 6px; }
.sheet-image img.fit-cover { object-fit: cover; }
.sheet-image img.fit-contain { object-fit: contain; }
.sheet-text { font-size: 1.4545cqw; }
.sheet-text .rich > :first-child, .sheet-text .ql-editor > :first-child { margin-top: 0; }

/* Téléphone : les éléments s'empilent de haut en bas */
@media (max-width: 700px) {
  .sheet:not(.sheet-edit) { aspect-ratio: auto; display: flex; flex-direction: column; gap: 1rem; }
  .sheet:not(.sheet-edit) .sheet-item { position: static; width: auto; height: auto; }
  .sheet:not(.sheet-edit) .sheet-image { position: relative; aspect-ratio: var(--w) / var(--h); }
  .sheet:not(.sheet-edit) .sheet-text { font-size: 1rem; }
}

/* Éditeur de mise en page */
.page-form { max-width: 1180px; margin: 0 auto; }
.composer { margin: 1rem 0; }
.composer-bar { position: sticky; top: var(--banner-h, 64px); z-index: 40; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
  padding: .6rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; }
.composer-selection { display: inline-flex; gap: .5rem; flex-wrap: wrap; padding-left: .5rem; border-left: 1px solid var(--border); }
.composer-selection[hidden] { display: none; }
.sheet-edit { background-color: var(--field); border: 1px dashed var(--border); border-radius: 6px; margin-top: 3.5rem;
  background-image: linear-gradient(to right, var(--surface-2) 1px, transparent 1px),
                    linear-gradient(to bottom, var(--surface-2) 1px, transparent 1px);
  background-size: 5% 5cqw; touch-action: none; }
.sheet-edit .sheet-item { outline: 1px dashed transparent; touch-action: none; }
.sheet-edit .sheet-item:hover { outline-color: var(--muted); }
.sheet-edit .sheet-item.is-selected { outline: 2px solid var(--accent); }
.sheet-edit .sheet-image img { cursor: move; user-select: none; }
.sheet-edit .sheet-text { background: color-mix(in srgb, var(--field) 70%, transparent); }
:root .sheet-edit .ql-container.ql-snow { border: 0; font-size: inherit; font-family: inherit; height: 100%; }
:root .sheet-edit .ql-editor { padding: 0; overflow: visible; line-height: 1.6; }
.sheet-edit .ql-editor.ql-blank::before { left: 0; color: var(--muted); }
:root .sheet-edit .ql-toolbar.ql-snow { display: none; position: absolute; bottom: calc(100% + 6px); left: 0; z-index: 2000;
  background: var(--surface); border: 1px solid var(--border); border-radius: 6px; white-space: nowrap;
  font-size: 14px; box-shadow: 0 4px 16px var(--shadow); }
:root .sheet-edit .sheet-item.is-selected .ql-toolbar.ql-snow { display: block; }
.handle { position: absolute; display: none; z-index: 5; background: var(--accent); border: 2px solid var(--field); }
.sheet-edit .is-selected .handle, .sheet-edit .sheet-item:hover .handle { display: block; }
.handle-e  { right: -6px; top: 50%; width: 10px; height: 26px; margin-top: -13px; cursor: ew-resize; border-radius: 4px; }
.handle-w  { left: -6px;  top: 50%; width: 10px; height: 26px; margin-top: -13px; cursor: ew-resize; border-radius: 4px; }
.handle-s  { bottom: -6px; left: 50%; width: 26px; height: 10px; margin-left: -13px; cursor: ns-resize; border-radius: 4px; }
.handle-se { right: -7px; bottom: -7px; width: 14px; height: 14px; cursor: nwse-resize; border-radius: 50%; }
.handle-sw { left: -7px; bottom: -7px; width: 14px; height: 14px; cursor: nesw-resize; border-radius: 50%; }
.grip { position: absolute; top: -12px; right: -12px; z-index: 6; display: none; width: 24px; height: 24px;
  align-items: center; justify-content: center; border-radius: 50%; background: var(--accent); color: var(--on-accent);
  font: 14px/1 system-ui, sans-serif; cursor: move; user-select: none; touch-action: none; }
.sheet-edit .sheet-text.is-selected .grip, .sheet-edit .sheet-text:hover .grip { display: flex; }
.sheet-edit .sheet-image .grip { display: none !important; }

/* Contenu riche produit par l'éditeur (Quill 2 note les puces via data-list) */
/* Listes à côté d'une photo du texte : chaque élément se range à côté de la photo
   (display: flow-root), et sa puce ou son numéro reste dans son retrait, au lieu de
   passer sous la photo. Les puces sont dessinées comme dans l'éditeur (Quill). */
.rich li[data-list] { display: flow-root; list-style: none; padding-left: 1.5em; }
/* Photo posée DANS un élément de liste : sur la page, static/listes.js la sort de l'élément
   (juste avant lui, dans la liste), et tout se range comme ci-dessus. Dans l'éditeur, elle reste
   dedans : cet élément et les suivants de la même liste ne sont pas en flow-root (sinon l'élément
   garderait la photo pour lui seul et les suivants passeraient dessous) ; leurs puces se logent
   alors dans la distance entre la photo et le texte. */
.rich li[data-list]:has(.fig), .rich li[data-list]:has(.fig) ~ li[data-list] { display: block; }
.rich:not(.ql-editor) :is(ol, ul) { padding-left: 0; }
.rich:not(.ql-editor) ol { counter-reset: rich-list; }
.rich:not(.ql-editor) li[data-list="ordered"] { counter-increment: rich-list; }
.rich:not(.ql-editor) li[data-list]::before { display: inline-block; width: 1.2em; margin-left: -1.5em; margin-right: .3em;
  text-align: right; white-space: nowrap; }
.rich:not(.ql-editor) li[data-list="bullet"]::before { content: "\2022"; }
.rich:not(.ql-editor) li[data-list="ordered"]::before { content: counter(rich-list) "."; }
.rich:not(.ql-editor) .ql-ui { display: none; }  /* dans l'éditeur, Quill y dessine les puces */
.rich .ql-align-center { text-align: center; }
.rich .ql-align-right { text-align: right; }
.rich .ql-align-justify { text-align: justify; }
.rich .ql-size-small { font-size: .75em; }
.rich .ql-size-large { font-size: 1.5em; }
.rich .ql-size-huge { font-size: 2.5em; }
.rich blockquote { border-left: 3px solid var(--accent); margin-left: 0; padding-left: 1rem; color: var(--muted); }
.rich h1, .rich h2, .rich h3 { color: var(--heading); font-weight: normal; line-height: 1.25; }

/* Formulaires et administration */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 1.5rem; margin-bottom: 1.5rem; }
.narrow-card { max-width: 460px; margin-left: auto; margin-right: auto; }
.field { display: block; margin: .8rem 0; font-family: system-ui, sans-serif; font-size: .9rem; color: var(--muted); }
.field input[type=text], .field input[type=email], .field input[type=password], .field input[type=number] {
  display: block; width: 100%; margin-top: .25rem; padding: .5rem .6rem; font-size: 1rem;
  border: 1px solid var(--border); border-radius: 6px; background: var(--field); color: var(--text); }
.field.narrow input { max-width: 120px; }
.check { display: block; margin: .35rem 0; font-family: system-ui, sans-serif; font-size: .92rem; }
fieldset { border: 1px solid var(--border); border-radius: 8px; margin: 1.2rem 0; padding: .6rem 1rem 1rem; }
legend { font-family: system-ui, sans-serif; font-weight: 600; padding: 0 .4rem; }
.hint { color: var(--muted); font-family: system-ui, sans-serif; font-size: .88rem; }
.row { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.thumb { max-width: 220px; border-radius: 6px; display: block; margin: .5rem 0; }
.form-actions { margin-top: 1.25rem; display: flex; gap: .6rem; }
.btn { display: inline-block; padding: .5rem 1rem; border: 1px solid var(--accent); border-radius: 6px;
  background: var(--accent); color: var(--on-accent); text-decoration: none; cursor: pointer; white-space: nowrap;
  font-family: system-ui, sans-serif; font-size: .9rem; line-height: 1.2; }
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-light { background: transparent; color: var(--accent); }
.btn-light:hover { background: var(--surface-2); color: var(--accent); }
.btn-ghost { background: transparent; color: var(--banner-text); border-color: rgba(255,255,255,.35); }
.btn-ghost:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.6); }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-sm { padding: .3rem .6rem; font-size: .8rem; }
form.inline { display: inline; margin: 0; }
.flash { padding: .7rem 1rem; border-radius: 6px; margin-bottom: 1rem; font-family: system-ui, sans-serif; font-size: .92rem; }
.flash-success { background: var(--ok-bg); color: var(--ok-fg); }
.flash-error { background: var(--err-bg); color: var(--err-fg); }
.flash-info, .flash-message { background: var(--info-bg); color: var(--info-fg); }
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.admin-hint { margin-top: 0; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; background: var(--surface); font-family: system-ui, sans-serif; font-size: .9rem; margin-bottom: 1.5rem; }
.table th, .table td { text-align: left; padding: .6rem .7rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { color: var(--muted); font-weight: 600; }
.actions { white-space: nowrap; }
.actions .btn, .actions form { margin: .1rem 0; }
.badge { display: inline-block; padding: .05rem .45rem; border-radius: 999px; background: var(--surface-2);
  color: var(--muted); font-family: system-ui, sans-serif; font-size: .75rem; }
.badge-warn { background: var(--warn-bg); color: var(--warn-fg); }
.badge-off { background: var(--err-bg); color: var(--err-fg); }

/* Textes : états, onglets, renvoi à l'auteur */
.status-draft, .status-retired { background: var(--surface-2); }
.status-submitted { background: var(--info-bg); color: var(--info-fg); }
.status-review, .status-changes { background: var(--warn-bg); color: var(--warn-fg); }
.status-published { background: var(--ok-bg); color: var(--ok-fg); }
.tabs { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-family: system-ui, sans-serif; font-size: .92rem; }
.tabs a[aria-current="page"] { font-weight: 600; text-decoration: none; border-bottom: 2px solid var(--accent); }
.tabs-small { font-size: .85rem; color: var(--muted); }
.inline-details { display: inline-block; vertical-align: top; }
.inline-details > summary { list-style: none; cursor: pointer; }
.inline-details > summary::-webkit-details-marker { display: none; }
.inline-details[open] form { margin-top: .4rem; min-width: 16rem; }
.send-back[open] { display: block; flex-basis: 100%; padding: .6rem; border: 1px solid var(--border); border-radius: 6px; }
.send-back[open] > .field, .send-back[open] > .btn { margin-top: .5rem; }
.send-back[open] { order: 10; }
.send-back .field { display: flex; flex-direction: column; gap: .3rem; }
.send-back textarea { width: 100%; box-sizing: border-box; }
.form-actions:has(.send-back) { align-items: flex-start; flex-wrap: wrap; }
.status-note .badge { margin-right: .4rem; }
.diff { line-height: 1.7; white-space: normal; }
.diff del { color: var(--err-fg); background: var(--err-bg); }
.diff ins { color: var(--ok-fg); background: var(--ok-bg); text-decoration: underline; }
.action-row { display: flex; flex-wrap: wrap; gap: .4rem; align-items: flex-start; }
.menu-toggle { position: relative; }
.menu-dot { position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); }
.credentials { font-size: 1.05rem; background: var(--surface-2); padding: .8rem 1rem; border-radius: 6px; }

/* Mode édition de l'accueil */
.edit-bar { position: sticky; top: var(--banner-h, 64px); z-index: 40; display: flex; align-items: center; gap: .6rem;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: .6rem 1rem; margin-bottom: 1rem;
  font-family: system-ui, sans-serif; }
.spacer { flex: 1; }
.edit-section { margin: 2rem 0; }
.edit-section h2 small { color: var(--muted); font-size: .8rem; font-weight: normal; font-family: system-ui, sans-serif; }
.wysiwyg { background: var(--field); min-height: 160px; }
.wysiwyg.ql-container { height: auto; }
.wysiwyg-small { min-height: 90px; }
.block-title-input { width: 100%; font-size: 1.15rem; padding: .35rem .5rem; margin: .5rem 0;
  border: 1px solid var(--border); border-radius: 6px; font-family: Georgia, serif; color: var(--heading); background: var(--field); }
.block-edit .block-body { font-size: .92rem; align-self: start; }

/* Quill (thème « snow ») adapté aux deux thèmes */
:root .ql-toolbar.ql-snow, :root .ql-container.ql-snow { border-color: var(--border); }
:root .ql-toolbar.ql-snow { background: var(--surface-2); }
:root .ql-snow .ql-stroke { stroke: var(--text); }
:root .ql-snow .ql-fill { fill: var(--text); }
:root .ql-snow .ql-picker { color: var(--text); }
:root .ql-snow .ql-picker-options { background: var(--surface); border-color: var(--border); }
:root .ql-snow.ql-toolbar button:hover .ql-stroke, :root .ql-snow .ql-active .ql-stroke, :root .ql-snow .ql-picker-label:hover .ql-stroke { stroke: var(--accent); }
:root .ql-snow.ql-toolbar button:hover .ql-fill, :root .ql-snow .ql-active .ql-fill { fill: var(--accent); }
:root .ql-snow.ql-toolbar button.ql-active, :root .ql-snow .ql-picker-label.ql-active, :root .ql-snow .ql-picker-item.ql-selected { color: var(--accent); }
:root .ql-editor.ql-blank::before { color: var(--muted); }
:root .ql-snow .ql-tooltip { background: var(--surface); color: var(--text); border-color: var(--border); box-shadow: 0 2px 8px var(--shadow); }
:root .ql-snow .ql-tooltip input[type=text] { background: var(--field); color: var(--text); border-color: var(--border); }

/* Téléphone */
@media (max-width: 760px) {
  .banner { padding: .6rem 16px; gap: .5rem; }
  .site-title { font-size: 1.05rem; }
  .user-link { display: none; }
  .content { padding: 1.25rem 16px; }
  .public-intro { grid-template-columns: 1fr; gap: 1.25rem; }
  .block { grid-template-columns: 1fr; }
  .block > img, .block > .placeholder { min-height: 0; max-height: none; aspect-ratio: 4 / 3; }
  .block-body { padding: 1rem 1.1rem; }
  .edit-bar, .composer-bar { top: 56px; }
  .menu-panel { position: fixed; top: 56px; left: 8px; right: 8px; min-width: 0; }
}

/* Mêmes marges que dans l'éditeur, pour que l'affichage corresponde à la saisie */
.sheet-text .rich :is(p, ol, ul, h1, h2, h3, pre, blockquote) { margin: 0; }
:root .sheet-text .rich :is(ol, ul) { padding-left: 0; }  /* le retrait est sur chaque élément (li) */
.sheet-text .rich h1 { font-size: 2em; }
.sheet-text .rich h2 { font-size: 1.5em; }
.sheet-text .rich h3 { font-size: 1.17em; }

/* Blocs de pages posés sur la feuille de l'accueil */
.sheet-block .block { height: 100%; }
.sheet-block .block > img, .sheet-block .block > .placeholder { min-height: 0; max-height: none; height: 100%; aspect-ratio: auto; }
.sheet-block .block-body { font-size: 1.4545cqw; padding: 1.5em 2em; overflow: hidden; }
.sheet-block .block-body h2 { font-size: 1.5em; }
.sheet-edit .sheet-block .block { cursor: move; user-select: none; }
.sheet-edit .sheet-block .block img { pointer-events: none; }
.sheet-block .badge { margin-bottom: .4em; }
.badge-public { background: var(--accent); color: var(--on-accent); }
.vis-badge { position: absolute; top: -10px; left: 6px; z-index: 6; display: none; }
.sheet-edit .is-public .vis-badge { display: inline-block; }
.composer-page { padding: .3rem .4rem; border: 1px solid var(--accent); border-radius: 6px; background: var(--field);
  color: var(--accent); font: .8rem system-ui, sans-serif; }

/* L'accueil occupe toute la largeur de l'écran (jusqu'à 1600 px) */
.home-sheet .sheet-wrap { max-width: 1600px; }
.home-edit { max-width: 1600px; }

@media (max-width: 700px) {
  .sheet:not(.sheet-edit) .sheet-block .block { height: auto; grid-template-columns: 1fr; }
  .sheet:not(.sheet-edit) .sheet-block .block > img,
  .sheet:not(.sheet-edit) .sheet-block .block > .placeholder { height: auto; aspect-ratio: 4 / 3; }
  .sheet:not(.sheet-edit) .sheet-block .block-body { font-size: 1rem; padding: 1rem 1.1rem; }
}
/* Feuille plus large : texte ramené à 16 px pour 1400 px de large */
.home-sheet .sheet-text, .home-sheet .sheet-block .block-body { font-size: 1.143cqw; }
@media (max-width: 700px) {
  .home-sheet .sheet:not(.sheet-edit) .sheet-text,
  .home-sheet .sheet:not(.sheet-edit) .sheet-block .block-body { font-size: 1rem; }
}
.home-edit .edit-bar { position: static; }

/* Photo : le cadre coupe ce qui dépasse quand on l'agrandit (« Régler la taille ») */
.sheet-image img { border-radius: 0; }
/* Fenêtre de la photo : tout le cadre (--zw = 1) ou plus petite et centrée en dézoom */
.img-win { position: absolute; overflow: hidden; border-radius: 6px;
  left: calc((1 - var(--zw, 1)) * 50%); top: calc((1 - var(--zw, 1)) * 50%);
  width: calc(var(--zw, 1) * 100%); height: calc(var(--zw, 1) * 100%); }

/* Menu du clic droit dans l'éditeur */
.ctx-menu { position: fixed; z-index: 3000; min-width: 220px; padding: .35rem 0; background: var(--surface);
  color: var(--text); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 10px 30px var(--shadow);
  font-family: system-ui, sans-serif; font-size: .92rem; }
.ctx-zoom { display: flex; align-items: center; gap: .5rem; padding: .5rem 1rem; white-space: nowrap; }
.ctx-zoom input { width: 160px; vertical-align: middle; accent-color: var(--accent); }
.ctx-zoom output { min-width: 3.5em; text-align: right; color: var(--muted); }
.block-photo { display: flex; gap: 1rem; align-items: flex-start; margin: .8rem 0; }
.block-photo .thumb { width: 180px; margin: 0; aspect-ratio: 4 / 3; object-fit: cover; }
.block-photo .placeholder { font-size: .8rem; }
.file-btn { cursor: pointer; }

/* Photo d'un bloc : même cadrage et même taille réglables que les photos libres */
.block > .photo-frame { position: relative; overflow: hidden; min-height: 240px; max-height: 420px; }
.photo-frame .img-win { border-radius: 0; }
.photo-frame .img-win img { width: 100%; height: 100%; display: block; object-fit: cover; }
.sheet-block .block > .photo-frame { min-height: 0; max-height: none; height: 100%; }
@media (max-width: 700px) {
  .block > .photo-frame { min-height: 0; max-height: none; aspect-ratio: 4 / 3; }
  .sheet:not(.sheet-edit) .sheet-block .block > .photo-frame { height: auto; aspect-ratio: 4 / 3; }
}

/* Photos insérées dans un texte : le texte s'enroule autour */
.rich img { max-width: 100%; height: auto; border-radius: 6px; }
.rich :is(img, .fig).img-l { float: left; margin: var(--mt, var(--gap-v, .25em)) var(--mr, var(--gap, 1.2em)) var(--mb, var(--gap-v, .6em)) var(--ml, 0); }
.rich :is(img, .fig).img-r { float: right; margin: var(--mt, var(--gap-v, .25em)) var(--mr, 0) var(--mb, var(--gap-v, .6em)) var(--ml, var(--gap, 1.2em)); }
.rich :is(img, .fig).img-c { display: block; margin: var(--mt, var(--gap-v, .6em)) auto var(--mb, var(--gap-v, .6em)); }
.rich::after { content: ""; display: block; clear: both; }
.rich :is(img, .fig).w-10 { width: 10%; } .rich :is(img, .fig).w-15 { width: 15%; } .rich :is(img, .fig).w-20 { width: 20%; }
.rich :is(img, .fig).w-25 { width: 25%; } .rich :is(img, .fig).w-30 { width: 30%; } .rich :is(img, .fig).w-35 { width: 35%; }
.rich :is(img, .fig).w-40 { width: 40%; } .rich :is(img, .fig).w-45 { width: 45%; } .rich :is(img, .fig).w-50 { width: 50%; }
.rich :is(img, .fig).w-55 { width: 55%; } .rich :is(img, .fig).w-60 { width: 60%; } .rich :is(img, .fig).w-65 { width: 65%; }
.rich :is(img, .fig).w-70 { width: 70%; } .rich :is(img, .fig).w-75 { width: 75%; } .rich :is(img, .fig).w-80 { width: 80%; }
.rich :is(img, .fig).w-85 { width: 85%; } .rich :is(img, .fig).w-90 { width: 90%; } .rich :is(img, .fig).w-95 { width: 95%; }
.rich :is(img, .fig).w-100 { width: 100%; }
.sheet-edit .rich :is(img, .fig) { cursor: grab; touch-action: none; }
.sheet-edit .rich :is(img, .fig).is-moving { opacity: .4; cursor: grabbing; }
/* Photo du texte seule sur sa ligne : le texte suivant passe dessous (avant les décalages, qui la poussent du bord) */
.rich :is(img, .video-thumb, .fig).solo:is(.img-l, .img-r, .img-c) { float: none; display: block; clear: both; margin: var(--mt, var(--gap-v, .6em)) var(--mr, 0) var(--mb, var(--gap-v, .6em)) var(--ml, 0); }
.rich :is(img, .video-thumb, .fig).solo.solo.img-c { margin: var(--mt, var(--gap-v, .6em)) auto var(--mb, var(--gap-v, .6em)); }
.rich :is(img, .video-thumb, .fig).solo.img-r { margin-left: auto; }
.ctx-flow { display: flex; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin: .2rem 0; }
.ctx-flow .menu-item { flex: 1; }
/* Décalage d'une photo du texte depuis son bord (o-5 … o-90, en % de la largeur du texte) */
.rich :is(img, .video-thumb, .fig).img-l.o-5 { margin-left: 5%; } .rich :is(img, .video-thumb, .fig).img-r.o-5 { margin-right: 5%; } .rich :is(img, .video-thumb, .fig).img-l.o-10 { margin-left: 10%; } .rich :is(img, .video-thumb, .fig).img-r.o-10 { margin-right: 10%; } .rich :is(img, .video-thumb, .fig).img-l.o-15 { margin-left: 15%; } .rich :is(img, .video-thumb, .fig).img-r.o-15 { margin-right: 15%; } .rich :is(img, .video-thumb, .fig).img-l.o-20 { margin-left: 20%; } .rich :is(img, .video-thumb, .fig).img-r.o-20 { margin-right: 20%; } .rich :is(img, .video-thumb, .fig).img-l.o-25 { margin-left: 25%; } .rich :is(img, .video-thumb, .fig).img-r.o-25 { margin-right: 25%; } .rich :is(img, .video-thumb, .fig).img-l.o-30 { margin-left: 30%; } .rich :is(img, .video-thumb, .fig).img-r.o-30 { margin-right: 30%; } .rich :is(img, .video-thumb, .fig).img-l.o-35 { margin-left: 35%; } .rich :is(img, .video-thumb, .fig).img-r.o-35 { margin-right: 35%; } .rich :is(img, .video-thumb, .fig).img-l.o-40 { margin-left: 40%; } .rich :is(img, .video-thumb, .fig).img-r.o-40 { margin-right: 40%; } .rich :is(img, .video-thumb, .fig).img-l.o-45 { margin-left: 45%; } .rich :is(img, .video-thumb, .fig).img-r.o-45 { margin-right: 45%; } .rich :is(img, .video-thumb, .fig).img-l.o-50 { margin-left: 50%; } .rich :is(img, .video-thumb, .fig).img-r.o-50 { margin-right: 50%; } .rich :is(img, .video-thumb, .fig).img-l.o-55 { margin-left: 55%; } .rich :is(img, .video-thumb, .fig).img-r.o-55 { margin-right: 55%; } .rich :is(img, .video-thumb, .fig).img-l.o-60 { margin-left: 60%; } .rich :is(img, .video-thumb, .fig).img-r.o-60 { margin-right: 60%; } .rich :is(img, .video-thumb, .fig).img-l.o-65 { margin-left: 65%; } .rich :is(img, .video-thumb, .fig).img-r.o-65 { margin-right: 65%; } .rich :is(img, .video-thumb, .fig).img-l.o-70 { margin-left: 70%; } .rich :is(img, .video-thumb, .fig).img-r.o-70 { margin-right: 70%; } .rich :is(img, .video-thumb, .fig).img-l.o-75 { margin-left: 75%; } .rich :is(img, .video-thumb, .fig).img-r.o-75 { margin-right: 75%; } .rich :is(img, .video-thumb, .fig).img-l.o-80 { margin-left: 80%; } .rich :is(img, .video-thumb, .fig).img-r.o-80 { margin-right: 80%; } .rich :is(img, .video-thumb, .fig).img-l.o-85 { margin-left: 85%; } .rich :is(img, .video-thumb, .fig).img-r.o-85 { margin-right: 85%; } .rich :is(img, .video-thumb, .fig).img-l.o-90 { margin-left: 90%; } .rich :is(img, .video-thumb, .fig).img-r.o-90 { margin-right: 90%; }
/* Cadre d'une photo du texte (composer.js, TextPhoto) : la photo, puis sa légende sur sa largeur */
.rich .fig { max-width: 100%; }
.rich .fig > img { display: block; width: 100%; margin: 0; }
.rich .fig-cap { display: block; margin-top: .35em; font-size: calc(var(--cs, .95) * 1em); line-height: 1.4; color: var(--muted); overflow-wrap: anywhere; cursor: inherit; }
.rich .fig-cap .cap-line { display: block; }
/* Taille de la légende réglée dans le menu de la photo (composer.js) : 95 % du texte sans classe,
   cs-50 … cs-200 en % du texte, par pas de 5 */
.rich .fig.cs-50 { --cs: 0.5; } .rich .fig.cs-55 { --cs: 0.55; } .rich .fig.cs-60 { --cs: 0.6; } .rich .fig.cs-65 { --cs: 0.65; } .rich .fig.cs-70 { --cs: 0.7; } .rich .fig.cs-75 { --cs: 0.75; } .rich .fig.cs-80 { --cs: 0.8; } .rich .fig.cs-85 { --cs: 0.85; } .rich .fig.cs-90 { --cs: 0.9; } .rich .fig.cs-100 { --cs: 1; } .rich .fig.cs-105 { --cs: 1.05; } .rich .fig.cs-110 { --cs: 1.1; } .rich .fig.cs-115 { --cs: 1.15; } .rich .fig.cs-120 { --cs: 1.2; } .rich .fig.cs-125 { --cs: 1.25; } .rich .fig.cs-130 { --cs: 1.3; } .rich .fig.cs-135 { --cs: 1.35; } .rich .fig.cs-140 { --cs: 1.4; } .rich .fig.cs-145 { --cs: 1.45; } .rich .fig.cs-150 { --cs: 1.5; } .rich .fig.cs-155 { --cs: 1.55; } .rich .fig.cs-160 { --cs: 1.6; } .rich .fig.cs-165 { --cs: 1.65; } .rich .fig.cs-170 { --cs: 1.7; } .rich .fig.cs-175 { --cs: 1.75; } .rich .fig.cs-180 { --cs: 1.8; } .rich .fig.cs-185 { --cs: 1.85; } .rich .fig.cs-190 { --cs: 1.9; } .rich .fig.cs-195 { --cs: 1.95; } .rich .fig.cs-200 { --cs: 2; }
.rich .fig > .video-thumb { float: none; width: 100%; margin: 0; }
/* Distance entre la photo et le texte qui l'entoure, en pixels, réglée séparément en haut
   (mt-0 … mt-60), en bas (mb-…), à gauche (ml-…) et à droite (mr-…). g-… (côtés vers le texte)
   et v-… (haut et bas) : anciens réglages, encore lus. */
.rich .fig.g-0 { --gap: 0px; } .rich .fig.g-2 { --gap: 2px; } .rich .fig.g-4 { --gap: 4px; } .rich .fig.g-6 { --gap: 6px; } .rich .fig.g-8 { --gap: 8px; } .rich .fig.g-10 { --gap: 10px; } .rich .fig.g-12 { --gap: 12px; } .rich .fig.g-14 { --gap: 14px; } .rich .fig.g-16 { --gap: 16px; } .rich .fig.g-18 { --gap: 18px; } .rich .fig.g-20 { --gap: 20px; } .rich .fig.g-22 { --gap: 22px; } .rich .fig.g-24 { --gap: 24px; } .rich .fig.g-26 { --gap: 26px; } .rich .fig.g-28 { --gap: 28px; } .rich .fig.g-30 { --gap: 30px; } .rich .fig.g-32 { --gap: 32px; } .rich .fig.g-34 { --gap: 34px; } .rich .fig.g-36 { --gap: 36px; } .rich .fig.g-38 { --gap: 38px; } .rich .fig.g-40 { --gap: 40px; } .rich .fig.g-42 { --gap: 42px; } .rich .fig.g-44 { --gap: 44px; } .rich .fig.g-46 { --gap: 46px; } .rich .fig.g-48 { --gap: 48px; } .rich .fig.g-50 { --gap: 50px; } .rich .fig.g-52 { --gap: 52px; } .rich .fig.g-54 { --gap: 54px; } .rich .fig.g-56 { --gap: 56px; } .rich .fig.g-58 { --gap: 58px; } .rich .fig.g-60 { --gap: 60px; }
.rich .fig.v-0 { --gap-v: 0px; } .rich .fig.v-2 { --gap-v: 2px; } .rich .fig.v-4 { --gap-v: 4px; } .rich .fig.v-6 { --gap-v: 6px; } .rich .fig.v-8 { --gap-v: 8px; } .rich .fig.v-10 { --gap-v: 10px; } .rich .fig.v-12 { --gap-v: 12px; } .rich .fig.v-14 { --gap-v: 14px; } .rich .fig.v-16 { --gap-v: 16px; } .rich .fig.v-18 { --gap-v: 18px; } .rich .fig.v-20 { --gap-v: 20px; } .rich .fig.v-22 { --gap-v: 22px; } .rich .fig.v-24 { --gap-v: 24px; } .rich .fig.v-26 { --gap-v: 26px; } .rich .fig.v-28 { --gap-v: 28px; } .rich .fig.v-30 { --gap-v: 30px; } .rich .fig.v-32 { --gap-v: 32px; } .rich .fig.v-34 { --gap-v: 34px; } .rich .fig.v-36 { --gap-v: 36px; } .rich .fig.v-38 { --gap-v: 38px; } .rich .fig.v-40 { --gap-v: 40px; } .rich .fig.v-42 { --gap-v: 42px; } .rich .fig.v-44 { --gap-v: 44px; } .rich .fig.v-46 { --gap-v: 46px; } .rich .fig.v-48 { --gap-v: 48px; } .rich .fig.v-50 { --gap-v: 50px; } .rich .fig.v-52 { --gap-v: 52px; } .rich .fig.v-54 { --gap-v: 54px; } .rich .fig.v-56 { --gap-v: 56px; } .rich .fig.v-58 { --gap-v: 58px; } .rich .fig.v-60 { --gap-v: 60px; }
.rich .fig.mt-0 { --mt: 0px; } .rich .fig.mt-2 { --mt: 2px; } .rich .fig.mt-4 { --mt: 4px; } .rich .fig.mt-6 { --mt: 6px; } .rich .fig.mt-8 { --mt: 8px; } .rich .fig.mt-10 { --mt: 10px; } .rich .fig.mt-12 { --mt: 12px; } .rich .fig.mt-14 { --mt: 14px; } .rich .fig.mt-16 { --mt: 16px; } .rich .fig.mt-18 { --mt: 18px; } .rich .fig.mt-20 { --mt: 20px; } .rich .fig.mt-22 { --mt: 22px; } .rich .fig.mt-24 { --mt: 24px; } .rich .fig.mt-26 { --mt: 26px; } .rich .fig.mt-28 { --mt: 28px; } .rich .fig.mt-30 { --mt: 30px; } .rich .fig.mt-32 { --mt: 32px; } .rich .fig.mt-34 { --mt: 34px; } .rich .fig.mt-36 { --mt: 36px; } .rich .fig.mt-38 { --mt: 38px; } .rich .fig.mt-40 { --mt: 40px; } .rich .fig.mt-42 { --mt: 42px; } .rich .fig.mt-44 { --mt: 44px; } .rich .fig.mt-46 { --mt: 46px; } .rich .fig.mt-48 { --mt: 48px; } .rich .fig.mt-50 { --mt: 50px; } .rich .fig.mt-52 { --mt: 52px; } .rich .fig.mt-54 { --mt: 54px; } .rich .fig.mt-56 { --mt: 56px; } .rich .fig.mt-58 { --mt: 58px; } .rich .fig.mt-60 { --mt: 60px; }
.rich .fig.mb-0 { --mb: 0px; } .rich .fig.mb-2 { --mb: 2px; } .rich .fig.mb-4 { --mb: 4px; } .rich .fig.mb-6 { --mb: 6px; } .rich .fig.mb-8 { --mb: 8px; } .rich .fig.mb-10 { --mb: 10px; } .rich .fig.mb-12 { --mb: 12px; } .rich .fig.mb-14 { --mb: 14px; } .rich .fig.mb-16 { --mb: 16px; } .rich .fig.mb-18 { --mb: 18px; } .rich .fig.mb-20 { --mb: 20px; } .rich .fig.mb-22 { --mb: 22px; } .rich .fig.mb-24 { --mb: 24px; } .rich .fig.mb-26 { --mb: 26px; } .rich .fig.mb-28 { --mb: 28px; } .rich .fig.mb-30 { --mb: 30px; } .rich .fig.mb-32 { --mb: 32px; } .rich .fig.mb-34 { --mb: 34px; } .rich .fig.mb-36 { --mb: 36px; } .rich .fig.mb-38 { --mb: 38px; } .rich .fig.mb-40 { --mb: 40px; } .rich .fig.mb-42 { --mb: 42px; } .rich .fig.mb-44 { --mb: 44px; } .rich .fig.mb-46 { --mb: 46px; } .rich .fig.mb-48 { --mb: 48px; } .rich .fig.mb-50 { --mb: 50px; } .rich .fig.mb-52 { --mb: 52px; } .rich .fig.mb-54 { --mb: 54px; } .rich .fig.mb-56 { --mb: 56px; } .rich .fig.mb-58 { --mb: 58px; } .rich .fig.mb-60 { --mb: 60px; }
.rich .fig.ml-0 { --ml: 0px; } .rich .fig.ml-2 { --ml: 2px; } .rich .fig.ml-4 { --ml: 4px; } .rich .fig.ml-6 { --ml: 6px; } .rich .fig.ml-8 { --ml: 8px; } .rich .fig.ml-10 { --ml: 10px; } .rich .fig.ml-12 { --ml: 12px; } .rich .fig.ml-14 { --ml: 14px; } .rich .fig.ml-16 { --ml: 16px; } .rich .fig.ml-18 { --ml: 18px; } .rich .fig.ml-20 { --ml: 20px; } .rich .fig.ml-22 { --ml: 22px; } .rich .fig.ml-24 { --ml: 24px; } .rich .fig.ml-26 { --ml: 26px; } .rich .fig.ml-28 { --ml: 28px; } .rich .fig.ml-30 { --ml: 30px; } .rich .fig.ml-32 { --ml: 32px; } .rich .fig.ml-34 { --ml: 34px; } .rich .fig.ml-36 { --ml: 36px; } .rich .fig.ml-38 { --ml: 38px; } .rich .fig.ml-40 { --ml: 40px; } .rich .fig.ml-42 { --ml: 42px; } .rich .fig.ml-44 { --ml: 44px; } .rich .fig.ml-46 { --ml: 46px; } .rich .fig.ml-48 { --ml: 48px; } .rich .fig.ml-50 { --ml: 50px; } .rich .fig.ml-52 { --ml: 52px; } .rich .fig.ml-54 { --ml: 54px; } .rich .fig.ml-56 { --ml: 56px; } .rich .fig.ml-58 { --ml: 58px; } .rich .fig.ml-60 { --ml: 60px; }
.rich .fig.mr-0 { --mr: 0px; } .rich .fig.mr-2 { --mr: 2px; } .rich .fig.mr-4 { --mr: 4px; } .rich .fig.mr-6 { --mr: 6px; } .rich .fig.mr-8 { --mr: 8px; } .rich .fig.mr-10 { --mr: 10px; } .rich .fig.mr-12 { --mr: 12px; } .rich .fig.mr-14 { --mr: 14px; } .rich .fig.mr-16 { --mr: 16px; } .rich .fig.mr-18 { --mr: 18px; } .rich .fig.mr-20 { --mr: 20px; } .rich .fig.mr-22 { --mr: 22px; } .rich .fig.mr-24 { --mr: 24px; } .rich .fig.mr-26 { --mr: 26px; } .rich .fig.mr-28 { --mr: 28px; } .rich .fig.mr-30 { --mr: 30px; } .rich .fig.mr-32 { --mr: 32px; } .rich .fig.mr-34 { --mr: 34px; } .rich .fig.mr-36 { --mr: 36px; } .rich .fig.mr-38 { --mr: 38px; } .rich .fig.mr-40 { --mr: 40px; } .rich .fig.mr-42 { --mr: 42px; } .rich .fig.mr-44 { --mr: 44px; } .rich .fig.mr-46 { --mr: 46px; } .rich .fig.mr-48 { --mr: 48px; } .rich .fig.mr-50 { --mr: 50px; } .rich .fig.mr-52 { --mr: 52px; } .rich .fig.mr-54 { --mr: 54px; } .rich .fig.mr-56 { --mr: 56px; } .rich .fig.mr-58 { --mr: 58px; } .rich .fig.mr-60 { --mr: 60px; }
.ctx-menu .menu-item.is-current { color: var(--accent); font-weight: 600; }
@media (max-width: 700px) {
  /* sur téléphone, une photo large passe seule sur sa ligne */
  .rich :is(img, .fig):is(.w-55, .w-60, .w-65, .w-70, .w-75, .w-80, .w-85, .w-90, .w-95, .w-100) { float: none; display: block; width: 100%; margin: var(--mt, var(--gap-v, .6em)) 0 var(--mb, var(--gap-v, .6em)); }
  .rich :is(img, .video-thumb, .fig):is(.w-55, .w-60, .w-65, .w-70, .w-75, .w-80, .w-85, .w-90, .w-95, .w-100):is(.img-l, .img-r) { margin-left: 0; margin-right: 0; }
}

/* Titre du bandeau mis en forme (taille, gras…) comme les autres textes */
.site-title .rich { display: block; color: inherit; text-decoration: none; }
.site-title .rich :is(p, h1, h2, h3) { margin: 0; font-weight: inherit; color: inherit; line-height: 1.25; }
.site-title .rich h1 { font-size: 1.6em; } .site-title .rich h2 { font-size: 1.3em; } .site-title .rich h3 { font-size: 1.1em; }
.site-title .rich :is(strong, b) { font-weight: bold; }
/* Dans l'éditeur, le titre est saisi sur le fond du bandeau */
:root .wysiwyg-title .ql-editor { background: var(--banner); color: var(--banner-text); text-align: center;
  font-family: Georgia, "Times New Roman", serif; line-height: 1.25;
  font-size: 1.6rem; min-height: 0; padding: .8rem 1rem; }
:root .wysiwyg-title .ql-editor :is(p, h1, h2, h3) { margin: 0; color: inherit; font-weight: normal; }
.wysiwyg-title .ql-editor h1 { font-size: 1.6em; } .wysiwyg-title .ql-editor h2 { font-size: 1.3em; } .wysiwyg-title .ql-editor h3 { font-size: 1.1em; }
.wysiwyg-title .ql-editor .ql-size-small { font-size: .75em; }
.wysiwyg-title .ql-editor .ql-size-large { font-size: 1.5em; }
.wysiwyg-title .ql-editor .ql-size-huge { font-size: 2.5em; }
.wysiwyg-title { min-height: 0; }

/* Bouton « Insérer une photo au curseur » de la barre d'outils des textes */
:root .ql-toolbar.ql-snow button.photo-button { width: auto; display: inline-flex; align-items: center; gap: .35em;
  padding: 2px 6px; font: .8rem system-ui, sans-serif; color: inherit; white-space: nowrap; }
:root .ql-toolbar.ql-snow button.photo-button svg { width: 18px; height: 18px; flex: none; }

/* Bouton Enregistrer dans la barre de l'éditeur, toujours visible */
.composer-save { margin-left: auto; }
/* Barre d'outils du texte sélectionné fixée sous la barre de l'éditeur pendant le défilement */
:root .ql-toolbar.ql-snow.is-docked { position: fixed; z-index: 2000; display: block; margin: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 6px; white-space: nowrap;
  font-size: 14px; box-shadow: 0 4px 16px var(--shadow); }
/* Photo d'un texte recadrée : le cadre garde sa forme, la photo le remplit */
.rich img[style] { object-fit: cover; }

/* Vidéo d'un texte : sa vignette, à la place d'une photo, avec un triangle ▶ (static/video.js) */
.rich .video-thumb { position: relative; display: block; max-width: 100%; cursor: pointer; border-radius: 6px; overflow: hidden; }
.rich .video-thumb.img-l { float: left; margin: .25em 1.2em .6em 0; }
.rich .video-thumb.img-r { float: right; margin: .25em 0 .6em 1.2em; }
.rich .video-thumb.img-c { margin: .6em auto; }
.rich .video-thumb.w-10 { width: 10%; } .rich .video-thumb.w-15 { width: 15%; } .rich .video-thumb.w-20 { width: 20%; } .rich .video-thumb.w-25 { width: 25%; } .rich .video-thumb.w-30 { width: 30%; } .rich .video-thumb.w-35 { width: 35%; } .rich .video-thumb.w-40 { width: 40%; } .rich .video-thumb.w-45 { width: 45%; } .rich .video-thumb.w-50 { width: 50%; } .rich .video-thumb.w-55 { width: 55%; } .rich .video-thumb.w-60 { width: 60%; } .rich .video-thumb.w-65 { width: 65%; } .rich .video-thumb.w-70 { width: 70%; } .rich .video-thumb.w-75 { width: 75%; } .rich .video-thumb.w-80 { width: 80%; } .rich .video-thumb.w-85 { width: 85%; } .rich .video-thumb.w-90 { width: 90%; } .rich .video-thumb.w-95 { width: 95%; } .rich .video-thumb.w-100 { width: 100%; }
.rich .video-thumb img { display: block; width: 100%; margin: 0; }
.video-play { position: absolute; left: 50%; top: 50%; width: 64px; max-width: 40%; aspect-ratio: 1;
  transform: translate(-50%, -50%); border-radius: 50%; background: rgba(0, 0, 0, .55);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .4); transition: background .15s; }
.video-play::after { content: ""; position: absolute; inset: 28% 24% 28% 36%; background: #fff;
  clip-path: polygon(0 0, 100% 50%, 0 100%); }
.sheet-item.video-thumb { cursor: pointer; }
.sheet-edit .sheet-item.video-thumb { cursor: auto; }
.sheet-item .video-play { pointer-events: none; z-index: 1; }
.video-thumb:hover .video-play, .video-thumb:focus-visible .video-play { background: var(--accent); }
.video-thumb:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.video-box { cursor: default; }
.video-box video { width: min(100%, 960px); max-width: 100%; max-height: calc(100vh - 6rem); border-radius: 4px; background: #000; }
.video-box .lightbox-caption a { color: #fff; }
/* dans l'éditeur, une vidéo se reconnaît à son cadre pointillé */
.ql-editor img[data-video] { outline: 3px dashed var(--accent); outline-offset: -3px; }
@media (max-width: 700px) {
  .rich .video-thumb:is(.w-55, .w-60, .w-65, .w-70, .w-75, .w-80, .w-85, .w-90, .w-95, .w-100) { float: none; width: 100%; margin: .6em 0; }
}
/* Légende d'une photo : saisie dans le menu de la photo */
.ctx-caption { width: 320px; max-width: calc(100vw - 2rem); padding: .3rem 1rem .5rem; }
.ctx-caption .ctx-title { margin: 0 0 .4rem; font-weight: 600; }
:root .ctx-caption .ql-toolbar.ql-snow { padding: 4px; border-radius: 6px 6px 0 0; }
:root .ctx-caption .ql-container.ql-snow { border-radius: 0 0 6px 6px; font-size: .95rem; }
:root .ctx-caption .ql-editor { min-height: 4.5em; max-height: none; overflow: visible; padding: .5rem .6rem; }
.ctx-menu { max-height: calc(100vh - 16px); overflow-y: auto; }
.ctx-tip { margin: .3rem 1rem .5rem; max-width: 280px; font-size: .8rem; color: var(--muted); white-space: normal; }

/* Accueil sans connexion : contenu factice flouté, seul le bandeau reste net */
.veil { filter: blur(8px); pointer-events: none; user-select: none; }
.veil-photo { position: absolute; inset: 0; border-radius: 6px;
  background: linear-gradient(135deg, #7a6450, #3b4a55 60%, #2a2622); }
.sheet-image .veil-photo { position: absolute; }
.veil-photo-block { background: linear-gradient(135deg, #7a6450, #3b4a55 60%, #2a2622); }
.veil-note { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 60;
  padding: 1.5rem 2rem; text-align: center; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px var(--shadow); }
.veil-note p { margin: 0 0 1rem; font-size: 1.15rem; }

/* Menu : un groupe (qui se déplie) se distingue d'un lien par plusieurs indices à la fois,
   jamais par la seule couleur (WCAG 1.4.1) : bandeau teinté séparé par un trait, intitulé en
   petites majuscules espacées, chevron ⌄ (signe le mieux compris selon NN/g, P. Laubheimer et
   R. Budiu, 23/08/2020), couleur d'accent une fois ouvert. Les liens restent sur le fond, en
   graisse normale ; ceux d'un sous-groupe sont un peu plus discrets. */
.menu-item { font-weight: 400; }
.menu-group > summary { list-style: none; justify-content: space-between; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; color: var(--heading);
  background: var(--surface-2); border-top: 1px solid var(--border); }
.menu-group > summary::-webkit-details-marker { display: none; }
.menu-group > summary::after { content: ""; flex: none; width: .5em; height: .5em; margin: 0 .2rem .2em;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg); transition: transform .15s; }
.menu-group[open] > summary::after { transform: rotate(-135deg); margin-bottom: -.15em; }
.menu-group[open] > summary { color: var(--accent); }
.menu-subgroup > summary { font-weight: 600; font-size: .74rem;
  background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.menu-sub { padding-left: 2rem; font-size: .92rem; }
.menu-sub2 { padding-left: 3rem; font-size: .88rem; color: var(--muted); }
.menu-sub2:hover { color: var(--accent); }

/* Arbre généalogique : visionneuse zoomable */
.tree-head { display: flex; align-items: center; justify-content: space-between; gap: .4rem 1rem; flex-wrap: wrap; margin-bottom: .5rem; }
.tree-head h2 { margin: 0; font-size: 1.2rem; display: flex; align-items: center; gap: .5rem; }
.tree-tools { display: flex; flex-wrap: wrap; gap: .3rem; }
.tree-tools .btn { min-width: 2.2rem; }
.tree-help { color: var(--muted); font-size: .85rem; margin: 0 0 .5rem; }
.tree-view { position: relative; overflow: hidden; height: calc(100vh - 9rem); min-height: 320px;
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  cursor: grab; touch-action: none; user-select: none; }
.tree-view.dragging { cursor: grabbing; }
[data-theme="dark"] .tree-view { background: #000; }
.tree-view:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tree-img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; }

/* Roue de descendance (GEDCOM) */
.tree-wrap { position: relative; }
.wheel-target { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.wheel { display: block; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.wheel-cell { fill: var(--fl); stroke: #4a4038; stroke-width: .7; cursor: pointer; }
.wheel-cell:hover { stroke: var(--accent); stroke-width: 2.5; }
.wheel-text { fill: #2b2723; pointer-events: none; }
[data-theme="dark"] .wheel-cell { fill: var(--fd); stroke: #6b5d50; }
[data-theme="dark"] .wheel-text { fill: #f0e6da; }
.wheel-btn { cursor: pointer; }
.wheel-btn-bg { fill: #5c3820; }
.wheel-btn-fg { fill: #fff; }
.wheel-btn:hover .wheel-btn-bg { fill: #a8672e; }
[data-theme="dark"] .wheel-btn-bg { fill: #d6a15f; }
[data-theme="dark"] .wheel-btn-fg { fill: #15110e; }
.wheel-icon-sample { font-style: normal; }
.wheel-crumbs { position: absolute; z-index: 4; top: .6rem; left: .6rem; max-width: calc(100% - 1.2rem);
  display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .35rem; padding: .3rem .55rem; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: 0 2px 8px var(--shadow);
  font-family: system-ui, sans-serif; font-size: .85rem; }
.wheel-crumbs[hidden] { display: none; }
.wheel-crumb { border: 0; background: none; padding: .1rem .3rem; border-radius: 4px; color: var(--accent); font: inherit; cursor: pointer;
  display: inline-flex; align-items: center; gap: .3rem; }
.wheel-crumb:hover, .wheel-crumb:focus-visible { background: var(--surface-2); text-decoration: underline; }
.wheel-crumb-root { font-weight: 600; }
.wheel-crumb svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.wheel-crumb-sep { color: var(--muted); }
.wheel-crumb-here { font-weight: 600; color: var(--text); padding: 0 .3rem; }
.tree-folded .wheel-crumbs { left: 3.2rem; }
.wheel-tip { position: absolute; z-index: 5; max-width: 320px; padding: .5rem .7rem; border-radius: 6px; pointer-events: none;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: 0 4px 14px var(--shadow);
  font-family: system-ui, sans-serif; font-size: .85rem; line-height: 1.35; }
.wheel-tip-more { color: var(--muted); font-style: italic; margin-top: .2rem; }
.wheel-card { position: absolute; z-index: 6; top: .8rem; right: .8rem; width: min(360px, calc(100% - 1.6rem)); max-height: calc(100% - 1.6rem);
  overflow: auto; padding: 1rem 1.1rem; border-radius: 8px; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); box-shadow: 0 8px 28px var(--shadow); font-family: system-ui, sans-serif; font-size: .9rem; }
.wheel-card h3 { margin: 0 1.6rem .5rem 0; color: var(--heading); }
.wheel-line { margin: .2rem 0; }
.wheel-sub { color: var(--muted); }
.wheel-text-block { white-space: pre-wrap; margin: .7rem 0; padding: .6rem .7rem; border-left: 3px solid var(--accent); background: var(--bg); }
.wheel-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .8rem; }
.wheel-close { position: absolute; top: .4rem; right: .5rem; border: 0; background: none; color: var(--muted); font-size: 1.4rem; cursor: pointer; line-height: 1; }
.wheel-edit select, .wheel-edit input, .wheel-edit textarea { display: block; width: 100%; box-sizing: border-box; margin-top: .25rem;
  padding: .4rem; border: 1px solid var(--border); border-radius: 4px; background: var(--field); color: var(--text); font: inherit; }
.wheel-error { color: var(--danger); min-height: 1em; margin: .3rem 0 0; }
[data-theme="dark"] .wheel-view { background: #0d0a08; }
.wheel-view { background: var(--surface); }
.person-card { max-width: 760px; margin-left: auto; margin-right: auto; position: relative; }
.person-close { position: absolute; top: .8rem; right: .8rem; width: 2.2rem; height: 2.2rem; display: flex; align-items: center;
  justify-content: center; border-radius: 50%; color: var(--muted); }
.person-close:hover, .person-close:focus-visible { background: var(--surface-2); color: var(--accent); }
.person-close svg { width: 1.3rem; height: 1.3rem; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; }
.person-card > h2 { padding-right: 2.6rem; }
.person-line { margin: .25rem 0; }
.person-text { white-space: pre-wrap; }
/* Notes : paragraphes justifiés, avec coupure des mots en fin de ligne (français) */
.person-notes p { margin: 0 0 .6rem; text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.person-notes p:last-child { margin-bottom: 0; }
.person-text { margin: 1rem 0; padding: .7rem .9rem; border-left: 3px solid var(--accent); background: var(--bg); }
.person-links { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.person-foot { justify-content: space-between; }
.orphan { padding: .6rem 0; border-top: 1px solid var(--border); }
.orphan form { margin-top: .4rem; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
@media (max-width: 640px) {
  .wheel-card { top: auto; bottom: .5rem; right: .5rem; left: .5rem; width: auto; max-height: 60%; }
}
/* Photos de l'arbre : vignettes, agrandies au clic */
.photos { display: flex; flex-wrap: wrap; gap: .6rem; margin: .7rem 0; }
.photo { margin: 0; width: 150px; }
.photo-link { display: block; border-radius: 6px; overflow: hidden; border: 1px solid var(--border); background: var(--bg); }
.photo img { display: block; width: 100%; height: 120px; object-fit: cover; transition: transform .15s; }
.photo-link:hover img { transform: scale(1.04); }
.doc-link { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; height: 120px;
  padding: .5rem; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); color: var(--text);
  text-decoration: none; text-align: center; font-size: .8rem; line-height: 1.25; overflow: hidden; }
.doc-link:hover { border-color: var(--accent); }
.doc-icon { padding: .25rem .5rem; border-radius: 4px; background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: .75rem; }
.doc-title { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.photo figcaption { font-size: .78rem; color: var(--muted); margin-top: .25rem; line-height: 1.3; }
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .88); display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 1rem; cursor: zoom-out; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 6rem); object-fit: contain; border-radius: 4px; cursor: default; }
.lightbox-caption { color: #f0e6da; margin: .7rem 0 0; text-align: center; max-width: 60rem; }
/* Photo d'un article agrandie au clic (static/photo-viewer.js) */
img.zoomable { cursor: zoom-in; }
img.zoomable:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.photo-box .lightbox-caption .cap-line { display: block; }
.photo-box { overflow: hidden; }
.photo-box { touch-action: none; }
/* la photo occupe la place disponible, même si le fichier est petit (proportions gardées) */
.photo-box img { width: 100%; height: calc(100vh - 6rem); max-width: 100%; max-height: calc(100vh - 6rem);
  cursor: zoom-in; user-select: none; }
.photo-box:has(.lightbox-caption:not([hidden])) img { height: calc(100vh - 9rem); max-height: calc(100vh - 9rem); }
.photo-box img.is-zoomed { cursor: grab; }
.photo-box img.is-zoomed:active { cursor: grabbing; }
.photo-box .lightbox-caption { position: relative; z-index: 1; }
.photo-box .lightbox-close { z-index: 2; }
.zoom-bar { position: absolute; z-index: 2; top: .7rem; left: 50%; transform: translateX(-50%); display: flex; gap: .3rem;
  font-family: Inter, system-ui, sans-serif; }
.zoom-bar button { min-width: 2.4rem; padding: .3rem .6rem; border: 1px solid rgba(255, 255, 255, .4); border-radius: 6px;
  background: rgba(0, 0, 0, .55); color: #fff; font: inherit; font-size: 1rem; cursor: pointer; }
.zoom-bar button:hover, .zoom-bar button:focus-visible { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.zoom-bar .zoom-level { min-width: 4.2rem; font-size: .85rem; }
.lightbox-close { position: absolute; top: .6rem; right: .9rem; border: 0; background: none; color: #fff; font-size: 2rem; cursor: pointer; }
.wheel-photo { float: right; width: 84px; height: 84px; object-fit: cover; border-radius: 6px; margin: 0 0 .4rem .6rem; border: 1px solid var(--border); }
.story { list-style: none; padding: 0; margin: .5rem 0 0; border-left: 2px solid var(--border); }
.story li { position: relative; padding: 0 0 1rem 1.1rem; }
.story li::before { content: ""; position: absolute; left: -6px; top: .45rem; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.story-head { margin-bottom: .2rem; }

/* Bandeau replié : bandeau du site et barre de l'arbre masqués, la roue prend
   toute la hauteur ; seule la flèche → reste, en haut à gauche */
[data-tree=fold], .tree-unfold { display: inline-flex; align-items: center; justify-content: center; padding: .25rem .45rem; }
.tree-arrow { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.tree-unfold { display: none; }
.tree-folded .banner, .tree-folded .tree-head, .tree-folded .tree-help { display: none; }
.tree-folded .tree-unfold { display: inline-flex; position: fixed; top: .9rem; left: .9rem; z-index: 20; min-width: 2.2rem; }
.tree-folded .content { padding-top: .5rem; padding-bottom: .5rem; }
.tree-folded .tree-view { height: calc(100vh - 1rem); }

/* Impression (ou PDF) : seulement l'arbre affiché, sur une page */
@media print {
  .person-close, .person-foot { display: none !important; }
  /* toujours les couleurs du thème clair, sinon l'arbre sombre ne se lit pas sur papier */
  :root, :root[data-theme] {
    color-scheme: light;
    --bg: #faf7f2;
    --surface: #ffffff;
    --surface-2: #f3ece2;
    --text: #2b2723;
    --muted: #6f665c;
    --accent: #7a4b2a;
    --accent-dark: #5c3820;
    --on-accent: #ffffff;
    --heading: #5c3820;
    --border: #e3dbd0;
    --banner: #4a3424;
    --banner-text: #ffffff;
    --danger: #a33a2a;
    --field: #ffffff;
    --shadow: rgba(0, 0, 0, .1);
    --ok-bg: #e7f2e4; --ok-fg: #2f5a27;
    --err-bg: #f8e3df; --err-fg: #7d2a1e;
    --info-bg: #f3ecdf; --info-fg: #5c4630;
    --warn-bg: #fbefd5; --warn-fg: #7a5410;
  }
  [data-theme] .wheel-cell { fill: var(--fl); stroke: #4a4038; }
  [data-theme] .wheel-text { fill: #2b2723; }
  [data-theme] .wheel-btn-bg { fill: #5c3820; }
  [data-theme] .wheel-btn-fg { fill: #fff; }
  @page { margin: 1cm; }
  .banner, .tree-head, .tree-help, .tree-unfold, .flash, .lightbox, .wheel-crumbs, .wheel-tip, .wheel-card, .wheel-btn { display: none !important; }
  .content { padding: 0; }
  body { background: #fff; }
  .tree-view { height: auto; min-height: 0; overflow: visible; border: 0; background: #fff !important;
    display: flex; justify-content: center; }
  .tree-img, .wheel-target { position: static; transform: none !important; width: 100% !important; height: auto !important; }
  .wheel { width: 100%; height: auto; max-height: 26cm; }
}

/* Envoi de fichiers (admin) */
.upload-progress { display: flex; align-items: center; gap: .6rem; margin-top: .7rem; flex-wrap: wrap; }
.upload-progress[hidden] { display: none; }
.upload-progress progress { width: min(22rem, 100%); height: .7rem; accent-color: var(--accent); }
.upload-text { color: var(--muted); font-size: .9rem; }
.btn:disabled { opacity: .55; cursor: progress; }
.invite-text { width: 100%; box-sizing: border-box; font: inherit; font-size: .95rem; line-height: 1.45;
  padding: .7rem .8rem; border-radius: 6px; border: 1px solid var(--border);
  background: var(--surface-2); color: inherit; resize: vertical; margin: .3rem 0 .6rem; }

/* Filigrane « Contenu provisoire » (case du même nom dans les réglages d'une page) :
   en travers du bloc ou de la page, de bas à gauche vers haut à droite, à l'angle
   et à la taille de la diagonale du cadre. */
.block, .detail-body { position: relative; }
.detail-body > .demo-mark { z-index: 1001; }  /* au-dessus des éléments de la feuille */
.demo-mark { position: absolute; inset: 0; z-index: 5; overflow: hidden; pointer-events: none;
  container-type: size; display: flex; align-items: center; justify-content: center; border-radius: inherit; }
.demo-mark span { white-space: nowrap; font: 800 2rem/1 system-ui, sans-serif; text-transform: uppercase;
  letter-spacing: .15em; color: var(--accent); opacity: .35; border: .09em solid currentColor;
  border-radius: .2em; padding: .25em .6em; transform: rotate(-25deg); user-select: none; }
@supports (width: hypot(1px, 1px)) and (rotate: atan2(1px, 1px)) {
  .demo-mark span { font-size: clamp(.8rem, calc(hypot(100cqw, 100cqh) / 26), 4.6rem);
    transform: rotate(atan2(-100cqh, 100cqw)); }
}

/* Chapitres : bloc titre de l'accueil qui déplie ses sous-blocs (static/chapters.js),
   sous-blocs décalés vers la droite et sur un fond distinct, navigation dans les pages */
.block-chapter { cursor: pointer; }
.block-chapter:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.block-chapter:hover, .block-chapter[aria-expanded="true"] { border-color: var(--accent); box-shadow: 0 6px 24px var(--shadow); }
.sheet .sheet-subs { height: auto; display: flex; flex-direction: column; gap: 1.2cqw; }
.sheet .sheet-subs[hidden] { display: none; }
.sub-block { background: var(--surface-2); border-left: 5px solid var(--accent); }
.sheet-subs .sub-block { height: calc(var(--bh) * 1cqw); }
.sheet-subs .sub-block > .photo-frame, .sheet-subs .sub-block > .placeholder { min-height: 0; max-height: none; height: 100%; aspect-ratio: auto; }
.sheet-subs .sub-block .block-body { font-size: 1.05cqw; padding: 1.2em 1.8em; overflow: hidden; }
.sub-block .block-body h3 { margin: 0 0 .4rem; font-size: 1.35em; }
@media (max-width: 700px) {
  .sheet:not(.sheet-edit) .sheet-subs { margin-left: 1.5rem; gap: 1rem; }
  .sheet-subs .sub-block { height: auto; grid-template-columns: 1fr; }
  .sheet-subs .sub-block > .photo-frame, .sheet-subs .sub-block > .placeholder { height: auto; aspect-ratio: 4 / 3; }
  .sheet-subs .sub-block .block-body { font-size: 1rem; padding: 1rem 1.1rem; }
  /* bloc sans photo : sur téléphone, pas de place vide au-dessus du titre */
  .sheet:not(.sheet-edit) .block > .placeholder:not(.veil-photo-block), .sub-blocks .block > .placeholder { display: none; }
}
.crumbs { font-family: system-ui, sans-serif; font-size: .9rem; color: var(--muted); margin: 0 0 .8rem; }
.crumbs a { color: inherit; }
.crumbs span { color: var(--text); }
.sub-blocks { display: flex; flex-direction: column; gap: 1.25rem; margin: 2rem 0 2rem 1.5rem; }
.sub-blocks .block > .photo-frame, .sub-blocks .block > .placeholder { min-height: 180px; max-height: 300px; }
.chapter-nav { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin: 2rem 0 1rem; font-family: system-ui, sans-serif; }
.chapter-nav .spacer { flex: 1; }
.chapter-nav .is-disabled { opacity: .4; pointer-events: none; border-style: dashed; }
.field-short input { max-width: 8rem; }
.order-input { width: 5.5rem; }
/* Chapitres et articles : sous-chapitre (se déplie sur place), bouton Réglages des blocs
   dans l'éditeur de l'accueil, plan du site sous l'éditeur */
.sub-panel { display: flex; flex-direction: column; gap: 1.2cqw; margin-left: 5%; }
.sub-panel[hidden] { display: none; }
.sub-empty { margin: 0; font-style: italic; }
.chapter-intro { margin-bottom: 1rem; }
.block-settings { position: absolute; top: 8px; right: 8px; z-index: 7; display: flex; gap: .35rem; }
.block-settings .btn { box-shadow: 0 2px 8px var(--shadow); }
.site-plan { margin-top: 2rem; }
.plan-list { list-style: none; margin: 0; padding: 0; }
.plan-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .45rem .5rem;
  padding-left: calc(.5rem + var(--depth, 0) * 1.6rem); border-bottom: 1px solid var(--border, rgba(127, 127, 127, .25)); }
.plan-list .spacer { flex: 1; }
.plan-chapter > a:not(.btn) { font-weight: 600; }
@media (max-width: 700px) {
  .sheet:not(.sheet-edit) .sub-panel { margin-left: 1rem; gap: 1rem; }
}

/* Chapitre = un titre sur lequel on clique : bandeau photo pleine largeur assombri,
   grand titre clair en petites capitales, rond à chevron qui tourne à l'ouverture.
   Un article garde la carte photo + texte. */
.block.block-chapter { display: block; position: relative; border: 0; border-radius: 14px; color: #fff;
  background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 80%, #000), color-mix(in srgb, var(--accent) 30%, #000)); }
.block-chapter > .photo-frame, .block-chapter > .placeholder { position: absolute; inset: 0; width: 100%; height: 100%;
  min-height: 0; max-height: none; aspect-ratio: auto; }
.block-chapter > .placeholder { display: none; }
.block-chapter > .photo-frame::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, .78) 0%, rgba(0, 0, 0, .45) 55%, rgba(0, 0, 0, .15) 100%); }
.block-chapter .block-body > :not(.chapter-toggle) { position: relative; z-index: 1; }
.block-chapter .block-body, .sheet-block .block-chapter .block-body { position: static; height: 100%;
  display: flex; flex-direction: column; justify-content: center; padding: 1.5em 6em 1.5em 2.2em; max-width: 75%; }
.block-chapter .block-body :is(h2, h3) { color: #fff; font-variant: small-caps; letter-spacing: .06em; line-height: 1.05;
  font-size: 2.6em; margin: 0 0 .35em; text-shadow: 0 2px 12px rgba(0, 0, 0, .5); }
.block-chapter .block-body h3 { font-size: 2em; }
.block-chapter .rich { color: rgba(255, 255, 255, .88); text-shadow: 0 1px 6px rgba(0, 0, 0, .5); }
.block-chapter .badge { align-self: flex-start; }
.chapter-toggle { position: absolute; z-index: 2; right: 1.6em; top: 50%; width: 3.2em; height: 3.2em; margin-top: -1.6em;
  border: 2px solid rgba(255, 255, 255, .85); border-radius: 50%; background: rgba(0, 0, 0, .25);
  display: grid; place-items: center; transition: transform .25s, background .15s; }
.chapter-toggle::before { content: ""; width: .8em; height: .8em; margin-top: -.35em;
  border-right: 3px solid #fff; border-bottom: 3px solid #fff; transform: rotate(45deg); }
.block-chapter[aria-expanded="true"] .chapter-toggle { transform: rotate(180deg); }
.block-chapter:hover .chapter-toggle, .block-chapter:focus-visible .chapter-toggle { background: var(--accent); border-color: var(--accent); }
.block-chapter:hover, .block-chapter[aria-expanded="true"] { box-shadow: 0 8px 28px var(--shadow); }
.sub-block.block-chapter { border-left: 0; }
.sheet-subs .sub-block.block-chapter .block-body { padding: 1.2em 6em 1.2em 2em; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 700px) {
  .block.block-chapter { min-height: 9rem; }
  .block-chapter .block-body, .sheet-block .block-chapter .block-body { max-width: none; padding: 1.2rem 4.5rem 1.2rem 1.2rem; font-size: 1rem; }
  .block-chapter .block-body :is(h2, h3) { font-size: 1.7rem; }
  .sheet-subs .sub-block.block-chapter { height: auto; }
  /* la photo d'un chapitre couvre tout le bandeau, même si le texte le rend plus haut que 4/3 */
  .sheet:not(.sheet-edit) .sheet-block .block-chapter > .photo-frame,
  .sheet-subs .sub-block.block-chapter > .photo-frame { height: 100%; aspect-ratio: auto; }
}

/* Boutons de la page (modifier, réglages…) dans le bandeau fixe */
.banner-actions { grid-column: 1; grid-row: 1; justify-self: start; display: flex; flex-wrap: wrap; align-items: center;
  gap: .4rem; margin-left: 54px; }  /* à gauche, juste après le menu ☰ */
.banner-actions:not(:has(*)) { display: none; }
.banner-actions .action-row { margin: 0; }
/* boutons pleins, couleurs du texte du bandeau inversées : lisibles en mode clair comme sombre */
.banner-actions .btn, .banner-actions .btn-light { padding: .3rem .75rem; font-size: .85rem; font-weight: 600;
  background: var(--banner-text); color: var(--banner); border-color: var(--banner-text); }
.banner-actions .btn:hover { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
@media (max-width: 700px) {
  .banner-actions { grid-column: 1 / -1; grid-row: 2; margin-left: 0; }
}
.banner-actions .send-back[open] { position: absolute; left: 1rem; top: 100%; z-index: 60; min-width: 20rem;
  background: var(--surface); color: var(--text); box-shadow: 0 10px 30px var(--shadow); }
/* Formulaire d'un texte : Publier / Enregistrer / Annuler dans le bandeau ; l'action principale en couleur */
.banner-actions .form-bar .btn:not(.btn-light) { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.banner-actions .form-bar .btn:not(.btn-light):hover { background: var(--accent-dark); border-color: var(--accent-dark); }
/* Formulaire d'un chapitre : aperçu du bandeau où l'on cadre la photo */
.block-preview-wrap { container-type: inline-size; margin: .5rem 0 1rem; }
.block-preview { width: 100%; cursor: grab; user-select: none; touch-action: none; }
.block-preview.is-dragging { cursor: grabbing; }
.block-chapter.block-preview .block-body { font-size: 1.4545cqw; }
.block-preview img { pointer-events: none; }
.pv-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; margin-top: .6rem; font-family: system-ui, sans-serif; font-size: .9rem; }
.pv-tools input[type=range] { vertical-align: middle; width: 12rem; }
.block-preview-wrap ~ .block-photo .thumb { display: none; }
.article-preview { height: auto; }
.article-preview > .photo-frame, .article-preview > .placeholder { min-height: 0; max-height: none; height: 100%; aspect-ratio: auto; }
.article-preview > [hidden] { display: none; }
.article-preview .block-body { font-size: var(--pv-font); padding: 1.2em 1.8em; overflow: hidden; align-self: center; }
.article-preview:not(.sub-block) .block-body { padding: 1.5em 2em; }
.article-preview:not(.sub-block) .block-body h2 { font-size: 1.5em; }
.block-chapter { scroll-margin-top: 110px; }
/* ===== Habillage « Style & Design » (choix de Salagamor, 22/10/2026) =====
   Base « Sobre et soigné », lettrine, fond de bloc qui déborde autour de la photo,
   bandeau translucide. Uniquement cosmétique ; le menu ☰ n'est pas modifié. */
:root { --radius: 12px; }
body { font-family: Charter, "Bitstream Charter", Georgia, "Times New Roman", serif; }
.user-link, .btn, .hint, .field, .flash, .badge, .table { font-family: Inter, system-ui, sans-serif; }

/* Bandeau translucide : le contenu passe flouté dessous ; titre en capitales fines espacées */
.banner { padding: .9rem 2rem; background: color-mix(in srgb, var(--banner) 72%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.site-title { font-family: "Inter Display", Inter, system-ui, sans-serif; font-weight: 300; font-size: 1.35rem;
  letter-spacing: .3em; text-transform: uppercase; }
.user-link { text-decoration: none; padding: .35rem .7rem; border-radius: 999px; background: rgba(255,255,255,.08); opacity: 1; }

/* Photos de l'accueil : coins arrondis et ombre douce */
.sheet-image .img-win { border-radius: var(--radius); box-shadow: 0 12px 30px var(--shadow); }
.sheet-image img { border-radius: 0; }

/* Blocs : le fond du bloc déborde un peu autour de la photo et du texte */
.block { padding: 14px; border-radius: var(--radius); box-shadow: 0 6px 18px var(--shadow);
  transition: border-color .15s, box-shadow .2s, transform .2s; }
.block > .photo-frame { border-radius: calc(var(--radius) - 4px); }
.block-body h2 { font-size: 1.7em; }
a.block:hover { transform: translateY(-2px); box-shadow: 0 14px 34px var(--shadow); border-color: var(--accent); }
/* au survol, le titre se souligne en plus du changement de couleur (WCAG 1.4.1) */
a.block:hover .block-body h2 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }

/* Lettrine : première lettre du premier paragraphe de chaque texte qui commence par une lettre */
/* (le paragraphe est choisi par lettrine.js : le premier qui commence par une lettre) */
.sheet-text .rich > p.lettrine::first-letter,
.detail-body > .rich > p.lettrine::first-letter { float: left; font-size: 3.3em; line-height: .82;
  padding: .06em .12em 0 0; color: var(--accent); font-weight: 600; }
.sheet-text .rich h2 { font-size: 1.9em; margin-bottom: .3em; }

/* Boutons, cartes, champs, messages */
.btn { border-radius: 8px; font-weight: 500; padding: .55rem 1.1rem; }
.btn-sm { padding: .3rem .6rem; }
.btn:focus-visible, .content a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.card { border-radius: var(--radius); box-shadow: 0 16px 40px var(--shadow); padding: 2rem; }
.card h2 { margin-top: 0; }
.field input[type=text], .field input[type=email], .field input[type=password], .field input[type=number] {
  border-radius: 8px; padding: .65rem .75rem; }
.field input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.flash { border-radius: 10px; border-left: 4px solid currentColor; }
@media (max-width: 760px) {
  .banner { padding: .6rem 16px; }
  .site-title { font-size: 1rem; letter-spacing: .18em; }
  .block { padding: 10px; }
}
