/* Administration du site Vincent Jaton — feuille de style unique, sans framework. */

:root {
  --bg: #f4f2ee;
  --surface: #fff;
  --surface-2: #faf8f5;
  --surface-3: #f1ede6;
  --line: #e6e0d6;
  --line-strong: #d4ccbf;
  --ink: #1c1a18;
  --muted: #69635b;
  --faint: #938b80;
  --accent: #bf4a24;
  --accent-strong: #a84220;
  --accent-soft: #fbeee8;
  --ok: #2c7a4b;
  --ok-soft: #e6f3eb;
  --warn: #9a5a06;
  --warn-soft: #fdf3e1;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --sidebar: #161514;
  --sidebar-2: #23201e;
  --sidebar-fg: #ece7df;
  --sidebar-muted: #9f978c;
  --radius: 14px;
  --radius-s: 8px;
  --shadow: 0 1px 2px rgb(20 19 18 / 5%), 0 6px 18px rgb(20 19 18 / 5%);
  --shadow-lg: 0 12px 40px rgb(20 19 18 / 18%);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: var(--font);
  --topbar-h: 72px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html, body { height: 100%; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; max-width: 100%; }
a { color: var(--accent-strong); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid rgb(191 74 36 / 45%); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }

/* ------------------------------------------------------------------ structure */
.app { display: grid; grid-template-columns: 268px minmax(0, 1fr); height: 100vh; height: 100dvh; }
.workspace { display: flex; flex-direction: column; min-width: 0; height: 100vh; height: 100dvh; }
.workspace__body { flex: 1; display: flex; min-height: 0; }
.main { flex: 1; min-width: 0; overflow-y: auto; padding: 28px clamp(16px, 3vw, 40px) 120px; outline: none; }
.main > * { max-width: 920px; margin-inline: auto; }
.main.is-wide > * { max-width: 1180px; }

/* ------------------------------------------------------------------ barre latérale */
.sidebar { background: var(--sidebar); color: var(--sidebar-fg); display: flex; flex-direction: column; overflow-y: auto; }
.sidebar__brand { display: flex; align-items: center; gap: 12px; padding: 22px 20px 18px; color: inherit; text-decoration: none; }
.sidebar__brand strong { display: block; font: 700 17px/1.15 var(--serif); letter-spacing: -0.01em; }
.sidebar__brand small { display: block; color: var(--sidebar-muted); font-size: 12px; margin-top: 2px; }
.sidebar__mark { flex: none; width: 34px; height: 34px; border-radius: 9px; background: var(--accent); -webkit-mask: none; position: relative; }
.sidebar__mark::after { content: ""; position: absolute; inset: 6px; background: #fff; -webkit-mask: url("/assets/img/brand/logo-mark.png") center / contain no-repeat; mask: url("/assets/img/brand/logo-mark.png") center / contain no-repeat; }
.sidebar__nav { padding: 6px 12px 16px; flex: 1; }
.nav-group + .nav-group { margin-top: 18px; }
.nav-group__title { padding: 0 10px 6px; color: var(--sidebar-muted); font-size: 11px; font-weight: 650; letter-spacing: 0.12em; text-transform: uppercase; }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 9px; color: var(--sidebar-fg); text-decoration: none; font-size: 14.5px; position: relative; }
.nav-link svg { width: 18px; height: 18px; flex: none; opacity: 0.75; }
.nav-link:hover { background: var(--sidebar-2); }
.nav-link[aria-current="page"] { background: #2d2926; font-weight: 600; }
.nav-link[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav-link[aria-current="page"] svg { opacity: 1; color: #f0a07f; }
.nav-link__badge { margin-left: auto; min-width: 20px; padding: 1px 7px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 650; text-align: center; }
.sidebar__foot { padding: 14px 22px 20px; border-top: 1px solid #2a2724; font-size: 13px; }
.sidebar__foot a { color: var(--sidebar-muted); text-decoration: none; }
.sidebar__foot a:hover { color: #fff; }

/* ------------------------------------------------------------------ barre supérieure */
.topbar { position: relative; z-index: 5; display: flex; align-items: center; gap: 16px; min-height: var(--topbar-h); padding: 12px clamp(16px, 3vw, 32px); background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar .topbar__menu { display: none; }
.topbar__title { min-width: 0; flex: 1; }
.topbar__title h1 { font: 700 23px/1.15 var(--serif); letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__crumbs { font-size: 12.5px; color: var(--muted); min-height: 18px; }
.topbar__crumbs a { color: var(--muted); text-decoration: none; }
.topbar__crumbs a:hover { color: var(--accent-strong); text-decoration: underline; }
.topbar__actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.lang-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; gap: 2px; }
.lang-toggle__btn { border: 0; background: none; padding: 5px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700; letter-spacing: 0.02em; color: var(--muted); cursor: pointer; }
.lang-toggle__btn:hover { color: var(--ink); }
.lang-toggle__btn[aria-pressed="true"] { background: var(--surface-3); color: var(--ink); }
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.status.is-dirty { color: var(--warn); font-weight: 600; }
.status.is-dirty::before { background: #e08a1e; box-shadow: 0 0 0 3px var(--warn-soft); }
.status.is-busy::before { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); animation: pulse 1s infinite alternate; }

/* ------------------------------------------------------------------ boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 8px 16px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink); font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap; transition: background 0.15s, border-color 0.15s, box-shadow 0.15s; }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn:hover { background: var(--surface-2); border-color: var(--faint); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 1px 2px rgb(168 66 32 / 30%); }
.btn--primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn--primary:disabled { background: #cdbfb6; border-color: #cdbfb6; box-shadow: none; opacity: 1; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn--ghost:hover { background: var(--surface-3); border-color: transparent; color: var(--ink); }
.btn--ghost[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-strong); }
.btn--danger { color: var(--danger); border-color: #efc7c2; }
.btn--danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn--small { min-height: 32px; padding: 5px 12px; font-size: 13px; border-radius: 8px; }
.btn.is-busy { pointer-events: none; }
.btn.is-busy::before { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); flex: none; }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.icon-btn--danger:hover { background: var(--danger-soft); color: var(--danger); }
.icon-btn:disabled { opacity: 0.35; cursor: default; background: transparent; }
.link-btn { border: 0; background: none; padding: 0; color: var(--accent-strong); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ------------------------------------------------------------------ en-têtes de vue */
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.view-head__intro { color: var(--muted); max-width: 62ch; }
.view-head__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; box-shadow: inset 0 -1px 0 var(--line); margin-bottom: 24px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--accent-strong); border-bottom-color: var(--accent); }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600; margin-bottom: 14px; }
.back-link svg { width: 16px; height: 16px; }
.back-link:hover { color: var(--accent-strong); }

/* ------------------------------------------------------------------ cartes / groupes */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card + .group, .group + .card, .group + .group { margin-top: 18px; }
.group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); scroll-margin-top: 16px; transition: border-color 0.2s, box-shadow 0.2s; }
.group.is-focused { border-color: #e3b4a1; box-shadow: 0 0 0 3px rgb(191 74 36 / 9%), var(--shadow); }
.group__head { display: flex; align-items: flex-start; gap: 14px; padding: 18px 22px; border: 0; background: none; width: 100%; text-align: left; }
button.group__head { cursor: pointer; }
.group__icon { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-strong); }
.group__icon svg { width: 19px; height: 19px; }
.group__titles { flex: 1; min-width: 0; }
.group__title { display: block; font: 700 17px/1.3 var(--font); letter-spacing: -0.005em; }
.group__hint { display: block; color: var(--muted); font-size: 13.5px; margin-top: 2px; font-weight: 400; overflow-wrap: anywhere; }
.group__chevron { flex: none; width: 20px; height: 20px; color: var(--faint); margin-top: 8px; transition: transform 0.2s; }
.group.is-collapsed .group__chevron { transform: rotate(-90deg); }
.group__body { padding: 4px 22px 22px 72px; display: grid; gap: 20px; }
.group.is-collapsed .group__body { display: none; }
.group__locate { flex: none; margin-top: 3px; }
.note { display: flex; gap: 10px; padding: 12px 14px; border-radius: 10px; background: var(--surface-3); color: var(--muted); font-size: 13.5px; }
.note svg { flex: none; width: 18px; height: 18px; margin-top: 1px; }
.note--warn { background: var(--warn-soft); color: #6f4204; }
.note--danger { background: var(--danger-soft); color: #7a1a12; }
.note--ok { background: var(--ok-soft); color: #1d5434; }
.note a { color: inherit; font-weight: 600; }
.note .btn { margin-left: 6px; vertical-align: middle; }

/* version de la fiche dans l'autre langue (réalisations) */
.translation-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; padding: 10px 12px 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--muted); font-size: 13.5px; }
.translation-bar > svg { flex: none; width: 18px; height: 18px; }
.translation-bar__text { flex: 1 1 220px; }
.translation-bar .btn { margin-left: auto; }

/* ------------------------------------------------------------------ champs */
.field { display: grid; gap: 6px; min-width: 0; }
.field__top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.field__label { font-weight: 650; font-size: 14px; }
.field__label .req { color: var(--accent-strong); margin-left: 2px; }
.field__optional { color: var(--faint); font-weight: 500; font-size: 12.5px; margin-left: 6px; }
.field__hint { color: var(--muted); font-size: 13px; line-height: 1.45; }
.field__count { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.field__count.is-over { color: var(--warn); font-weight: 650; }
.field__error { color: var(--danger); font-size: 13px; font-weight: 600; }
.field__row { display: flex; gap: 8px; align-items: center; }
.field__row > .input { flex: 1; }
.field-grid { display: grid; gap: 16px 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
.field-grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.input { width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); transition: border-color 0.15s, box-shadow 0.15s; }
.input::placeholder { color: #aaa296; }
.input:hover { border-color: var(--faint); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgb(191 74 36 / 14%); }
.input.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 3px rgb(180 35 24 / 10%); }
textarea.input { min-height: 88px; resize: vertical; line-height: 1.55; }
textarea.input--tall { min-height: 180px; }
select.input { appearance: none; padding-right: 36px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2369635b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 10px center / 18px no-repeat; }
.input--short { max-width: 140px; }
.input--number { max-width: 130px; font-variant-numeric: tabular-nums; }
.rich-preview { font: 600 17px/1.3 var(--serif); color: var(--ink); padding: 2px 2px 0; }
.rich-preview em { color: var(--accent-strong); font-style: normal; }
.rich-preview:empty { display: none; }
.rich-tools { display: flex; gap: 6px; align-items: center; }
.chip-btn { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--line-strong); border-radius: 99px; background: var(--surface); font-size: 12.5px; font-weight: 600; color: var(--muted); }
.chip-btn:hover { border-color: var(--accent); color: var(--accent-strong); }
.chip-btn em { font-family: var(--serif); color: var(--accent-strong); }
.vars { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; color: var(--muted); }
.var-chip { padding: 2px 8px; border-radius: 6px; background: var(--surface-3); border: 1px solid var(--line); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--ink); }
button.var-chip:hover { border-color: var(--accent); }

/* interrupteur */
.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch__track { position: relative; flex: none; width: 42px; height: 24px; border-radius: 99px; background: var(--line-strong); transition: background 0.2s; }
.switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 25%); transition: transform 0.2s; }
.switch input:checked + .switch__track { background: var(--accent); }
.switch input:checked + .switch__track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__track { outline: 3px solid rgb(191 74 36 / 45%); outline-offset: 2px; }
.switch__label { font-weight: 600; font-size: 14px; }

/* listes et répéteurs */
.list { display: grid; gap: 8px; }
.list-row { display: flex; align-items: flex-start; gap: 6px; }
.list-row > .input, .list-row > .grow { flex: 1; min-width: 0; }
.list-row__tools { display: flex; gap: 2px; padding-top: 4px; }
.handle { cursor: grab; color: var(--faint); display: grid; place-items: center; width: 22px; height: 42px; flex: none; }
.handle svg { width: 16px; height: 16px; }
.is-dragging { opacity: 0.45; }
.drop-before { box-shadow: 0 -3px 0 var(--accent); }
.drop-after { box-shadow: 0 3px 0 var(--accent); }
.add-btn { justify-self: start; display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border: 1px dashed var(--line-strong); border-radius: 10px; background: transparent; color: var(--accent-strong); font-weight: 650; font-size: 14px; }
.add-btn svg { width: 16px; height: 16px; }
.add-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.repeater { display: grid; gap: 10px; }
.item { border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.item__head { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 6px; }
.item__summary { flex: 1; min-width: 0; border: 0; background: none; text-align: left; padding: 4px 6px; border-radius: 6px; }
.item__summary strong { display: block; font-weight: 650; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item__summary span { display: block; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item__summary:hover strong { color: var(--accent-strong); }
.item__body { padding: 4px 16px 16px 36px; display: grid; gap: 16px; }
.item.is-collapsed .item__body { display: none; }
.item__num { flex: none; width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); font-size: 12.5px; font-weight: 700; }

/* sélecteur de réalisations */
.picks { display: grid; gap: 8px; }
.pick { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.pick__thumb { width: 54px; height: 40px; border-radius: 7px; object-fit: cover; background: var(--surface-3); flex: none; }
.pick__text { flex: 1; min-width: 0; }
.pick__text strong { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick__text span { display: block; font-size: 12.5px; color: var(--muted); }
.pick-add { display: flex; gap: 8px; align-items: center; }
.pick-add select { max-width: 360px; }

/* ------------------------------------------------------------------ images */
.dropzone { display: grid; place-items: center; gap: 6px; padding: 22px; border: 2px dashed var(--line-strong); border-radius: 14px; background: var(--surface-2); color: var(--muted); text-align: center; transition: border-color 0.15s, background 0.15s; }
.dropzone svg { width: 28px; height: 28px; color: var(--accent); }
.dropzone strong { color: var(--ink); }
.dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); }
.gallery { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.shot { position: relative; display: grid; grid-template-rows: auto 1fr; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.shot.is-cover { border-color: var(--accent); box-shadow: 0 0 0 2px rgb(191 74 36 / 25%); }
.shot.is-invalid { border-color: var(--danger); }
.shot__media { position: relative; aspect-ratio: 4 / 3; background: var(--surface-3); }
.shot__media img { width: 100%; height: 100%; object-fit: cover; }
.shot__badge { position: absolute; left: 8px; top: 8px; padding: 3px 8px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 700; }
.shot__num { position: absolute; right: 8px; top: 8px; min-width: 24px; padding: 2px 6px; border-radius: 7px; background: rgb(20 19 18 / 70%); color: #fff; font-size: 12px; font-weight: 700; text-align: center; }
.shot__busy { position: absolute; inset: 0; display: grid; place-items: center; gap: 8px; background: rgb(255 255 255 / 75%); font-size: 13px; font-weight: 600; color: var(--muted); }
.shot__tools { display: flex; flex-wrap: wrap; gap: 2px; padding: 4px 6px 0; }
.shot__tools .spacer { flex: 1; }
.shot__alt { padding: 4px 10px 10px; }
.shot__alt textarea { min-height: 62px; font-size: 13px; padding: 7px 9px; }
.shot__alt label { display: block; font-size: 12px; font-weight: 650; color: var(--muted); margin-bottom: 3px; }
.shot[draggable="true"] .shot__media { cursor: grab; }
.image-slot { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.image-slot__media { width: 180px; aspect-ratio: 4 / 5; border-radius: 12px; overflow: hidden; background: var(--surface-3); border: 1px solid var(--line); flex: none; position: relative; }
.image-slot__media img { width: 100%; height: 100%; object-fit: cover; }
.image-slot__side { flex: 1; min-width: 220px; display: grid; gap: 10px; }
.thumb-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
.thumb { position: relative; border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: var(--surface-3); padding: 0; aspect-ratio: 4 / 5; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb span { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 6px 5px; background: linear-gradient(transparent, rgb(0 0 0 / 70%)); color: #fff; font-size: 11.5px; font-weight: 600; text-align: left; line-height: 1.2; }
.thumb:hover { border-color: var(--faint); }
.thumb.is-selected { border-color: var(--accent); }
.wall-cols { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.wall-col h4 { font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.wall-list { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); }
.wall-tile { position: relative; aspect-ratio: 4 / 5; border-radius: 9px; overflow: hidden; background: var(--surface-3); border: 1px solid var(--line); }
.wall-tile img { width: 100%; height: 100%; object-fit: cover; }
.wall-tile button { position: absolute; right: 4px; top: 4px; width: 24px; height: 24px; border-radius: 6px; border: 0; background: rgb(20 19 18 / 70%); color: #fff; display: grid; place-items: center; opacity: 0; transition: opacity 0.15s; }
.wall-tile button svg { width: 14px; height: 14px; }
.wall-tile button::before { content: ""; position: absolute; inset: -6px; }
.wall-tile:hover button, .wall-tile button:focus-visible { opacity: 1; }
.wall-add { aspect-ratio: 4 / 5; border: 2px dashed var(--line-strong); border-radius: 9px; background: transparent; color: var(--accent-strong); display: grid; place-items: center; }
.wall-add:hover { border-color: var(--accent); background: var(--accent-soft); }
.wall-add svg { width: 22px; height: 22px; }

/* vidéo */
.video-field { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.video-field__thumb { width: 200px; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: var(--surface-3); flex: none; display: grid; place-items: center; color: var(--faint); }
.video-field__thumb img { width: 100%; height: 100%; object-fit: cover; }
.video-field__side { flex: 1; min-width: 240px; display: grid; gap: 12px; }

/* aperçu Google */
.serp { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-family: Arial, sans-serif; }
.serp__url { color: #4d5156; font-size: 13px; }
.serp__title { color: #1a0dab; font-size: 19px; line-height: 1.3; margin: 3px 0 2px; }
.serp__desc { color: #4d5156; font-size: 14px; line-height: 1.5; }

/* ------------------------------------------------------------------ tableau de bord */
.hello { display: flex; justify-content: space-between; gap: 20px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 24px; }
.hello h2 { font: 700 30px/1.15 var(--serif); letter-spacing: -0.015em; }
.hello p { color: var(--muted); max-width: 60ch; margin-top: 6px; }
.stats { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 18px; }
.stat { padding: 16px 18px; }
.stat__value { font: 700 30px/1 var(--serif); }
.stat__label { color: var(--muted); font-size: 13.5px; margin-top: 6px; }
.shortcuts { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.shortcut { display: flex; gap: 14px; align-items: flex-start; padding: 18px; color: inherit; text-decoration: none; transition: border-color 0.15s, transform 0.15s; }
.shortcut:hover { border-color: var(--accent); transform: translateY(-1px); }
.shortcut__text { min-width: 0; }
.shortcut strong { display: block; font-size: 15px; }
.shortcut__desc { display: block; color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.section-title { font: 700 19px/1.25 var(--serif); margin: 30px 0 12px; }
.checklist { display: grid; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; border-top: 1px solid var(--line); }
.check:first-child { border-top: 0; }
.check svg { flex: none; width: 20px; height: 20px; margin-top: 1px; }
.check--ok svg { color: var(--ok); }
.check--warn svg { color: #d27d0f; }
.check--danger svg { color: var(--danger); }
.check__text { flex: 1; }
.check__text span { display: block; color: var(--muted); font-size: 13px; }
.steps-line { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); counter-reset: step; }
.step { padding: 16px 18px; counter-increment: step; }
.step::before { content: counter(step); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-strong); font-weight: 700; margin-bottom: 10px; }
.step strong { display: block; }
.step span { display: block; color: var(--muted); font-size: 13.5px; margin-top: 2px; }

/* ------------------------------------------------------------------ listes de projets */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.search { position: relative; flex: 1; min-width: 220px; }
.search svg { position: absolute; left: 12px; top: 50%; width: 17px; height: 17px; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search .input { padding-left: 38px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 99px; background: var(--surface); font-size: 13px; font-weight: 600; color: var(--muted); }
.chip:hover { border-color: var(--faint); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.project-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.project-card { display: grid; grid-template-rows: auto 1fr; color: inherit; text-decoration: none; overflow: hidden; transition: border-color 0.15s, transform 0.15s; }
.project-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.project-card__media { position: relative; aspect-ratio: 16 / 10; background: var(--surface-3); }
.project-card__media img { width: 100%; height: 100%; object-fit: cover; }
.project-card__body { padding: 12px 14px 14px; }
.project-card__meta { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--muted); }
.project-card__title { font: 700 17px/1.25 var(--serif); margin-top: 4px; }
.project-card__flags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.flag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; background: var(--surface-3); color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.flag svg { width: 13px; height: 13px; }
.flag--accent { background: var(--accent-soft); color: var(--accent-strong); }
.flag--warn { background: var(--warn-soft); color: var(--warn); }
.flag--ok { background: var(--ok-soft); color: var(--ok); }

/* tableau (archives presse) */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table .cell-projects { min-width: 140px; }
.table th { position: sticky; top: 0; background: var(--surface-2); text-align: left; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); z-index: 1; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tbody tr { cursor: pointer; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr.is-open { background: var(--accent-soft); }
.table .cell-date { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.table .cell-title { min-width: 200px; }
.table .cell-title strong { display: block; font-weight: 650; }
.table .cell-title span { color: var(--muted); }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; color: var(--muted); font-size: 13.5px; }

/* ------------------------------------------------------------------ historique */
.timeline { display: grid; }
.version { display: flex; gap: 16px; align-items: center; padding: 14px 18px; border-top: 1px solid var(--line); }
.version:first-child { border-top: 0; }
.version__dot { flex: none; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface); }
.version.is-current .version__dot { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.version__text { flex: 1; min-width: 0; }
.version__text strong { display: block; font-size: 14.5px; }
.version__text span { color: var(--muted); font-size: 13px; }
.log { max-height: 320px; overflow: auto; padding: 12px 14px; border-radius: 10px; background: #1c1a18; color: #e9e4dc; font: 12.5px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; }

/* ------------------------------------------------------------------ aperçu */
.preview { flex: none; width: min(42vw, 720px); display: flex; flex-direction: column; border-left: 1px solid var(--line); background: #e9e5de; }
.preview__bar { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.preview__label { font-weight: 700; font-size: 13px; white-space: nowrap; }
.preview__label::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); margin-right: 7px; vertical-align: 1px; }
.preview__path { flex: 1; min-width: 0; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.preview__tools { display: flex; align-items: center; gap: 4px; }
.preview__stage { position: relative; flex: 1; overflow: hidden; }
.preview__frame { position: absolute; left: 0; top: 0; border: 0; background: #fff; transform-origin: 0 0; }
.preview__frame.is-back { visibility: hidden; }
.preview__stage.is-mobile { background: #d9d3c9; }
.preview__stage.is-mobile .preview__frame { border-radius: 18px; box-shadow: var(--shadow-lg); }
.preview__loading { position: absolute; right: 12px; bottom: 12px; padding: 6px 12px; border-radius: 99px; background: rgb(20 19 18 / 78%); color: #fff; font-size: 12.5px; display: flex; gap: 8px; align-items: center; }
.segmented { display: inline-flex; padding: 3px; border-radius: 9px; background: var(--surface-3); }
.segmented button { border: 0; background: transparent; padding: 4px 10px; border-radius: 7px; font-size: 12.5px; font-weight: 650; color: var(--muted); }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / 10%); }

/* ------------------------------------------------------------------ fenêtres, notifications */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgb(20 19 18 / 45%); animation: fade 0.15s; }
.modal__box { width: min(560px, 100%); max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); overflow: auto; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); animation: rise 0.2s; }
.modal__box--wide { width: min(980px, 100%); }
.modal__head { display: flex; align-items: center; gap: 12px; padding: 20px 22px 8px; }
.modal__head h2 { flex: 1; font: 700 21px/1.25 var(--serif); }
.modal__body { padding: 8px 22px 18px; display: grid; gap: 14px; }
.modal__body ul { padding-left: 20px; display: grid; gap: 6px; }
.modal__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px 20px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 18px 18px; }
.drawer { position: fixed; inset: 0 0 0 auto; z-index: 40; width: min(520px, 100vw); display: flex; flex-direction: column; background: var(--surface); box-shadow: var(--shadow-lg); animation: slide 0.2s; }
.drawer__head { display: flex; align-items: center; gap: 10px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.drawer__head h2 { flex: 1; font: 700 20px/1.25 var(--serif); }
.drawer__body { flex: 1; overflow-y: auto; padding: 20px; display: grid; gap: 18px; align-content: start; }
.drawer__foot { display: flex; justify-content: space-between; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: grid; gap: 10px; justify-items: end; }
.toast { display: flex; align-items: center; gap: 12px; max-width: 440px; padding: 12px 14px 12px 16px; border-radius: 12px; background: #1f1d1b; color: #f4f1eb; box-shadow: var(--shadow-lg); font-size: 14px; animation: rise 0.2s; }
.toast svg { flex: none; width: 19px; height: 19px; }
.toast--ok svg { color: #7fd3a1; }
.toast--error { background: #5c130d; }
.toast button { border: 0; background: rgb(255 255 255 / 12%); color: #fff; padding: 5px 10px; border-radius: 7px; font-weight: 650; font-size: 13px; }
.toast button:hover { background: rgb(255 255 255 / 22%); }
.loading { display: flex; align-items: center; gap: 12px; padding: 60px 0; color: var(--muted); justify-content: center; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block; }
.empty { padding: 34px 20px; text-align: center; color: var(--muted); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { to { opacity: 0.4; } }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }

/* ------------------------------------------------------------------ petits écrans */
/* Archives presse : quand la place manque (téléphone, ou zone d'édition réduite par l'aperçu), chaque ligne du tableau devient une fiche */
.table-wrap { container: tablewrap / inline-size; }
@container tablewrap (max-width: 680px) {
  .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .table, .table tbody { display: block; }
  .table tbody tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .table tbody td { display: block; padding: 0; border: 0; }
  .table .cell-date { order: 1; flex: 1 1 auto; }
  .table tbody td:nth-child(3) { order: 2; }
  .table tbody td:nth-child(4) { order: 3; }
  .table .cell-title { order: 4; flex: 1 0 100%; min-width: 0; }
  .table .cell-projects { order: 5; flex: 1 0 100%; min-width: 0; }
  .table .cell-projects:empty { display: none; }
  .table tbody td.empty { flex: 1 0 100%; padding: 30px 12px; }
}

@media (max-width: 1100px) {
  .preview { position: fixed; inset: var(--topbar-h) 0 0 auto; z-index: 20; width: min(92vw, 640px); box-shadow: var(--shadow-lg); }
}
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .status { white-space: normal; }

  /* menu latéral : tiroir masqué (donc hors de portée du clavier) tant qu'il n'est pas ouvert, avec fond assombri */
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; width: min(280px, 86vw); transform: translateX(-100%); visibility: hidden; transition: transform 0.2s, visibility 0s 0.2s; }
  .app.menu-open .sidebar { transform: none; visibility: visible; box-shadow: var(--shadow-lg); transition: transform 0.2s; }
  .app.menu-open::after { content: ""; position: fixed; inset: 0; z-index: 25; background: rgb(20 19 18 / 45%); animation: fade 0.15s; }

  /* barre supérieure compacte : titre et « Enregistrer » sur la première ligne, langue, état et aperçu sur la seconde */
  .topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; min-height: 0; padding: 10px 14px; }
  .topbar::after { content: ""; order: 4; flex: 1 0 100%; height: 0; }
  .topbar__actions { display: contents; }
  .topbar .topbar__menu { display: inline-grid; order: 1; }
  .topbar__title { order: 2; flex: 1 1 0; }
  .topbar__title h1 { font-size: 20px; }
  .topbar [data-save] { order: 3; }
  .topbar .lang-toggle { order: 5; }
  .topbar .status { order: 6; flex: 1 1 0; min-width: 0; font-size: 12.5px; line-height: 1.3; }
  .topbar [data-discard] { order: 7; }
  .topbar [data-preview-toggle] { order: 8; }

  .group__body { padding: 4px 16px 18px; }
  .group__head { padding: 16px; }
  .item__body { padding: 4px 12px 14px; }
}
@media (max-width: 640px) {
  .main { padding-top: 20px; }
  .preview { width: 100vw; }
  .btn__extra { display: none; }
  .preview__bar { flex-wrap: wrap; row-gap: 4px; padding-left: 12px; }
  .preview__tools { margin-left: auto; }
  .hello h2 { font-size: 26px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 14px; }
  .stat__value { font-size: 26px; }
  .project-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 10px; }
  .project-card__body { padding: 10px 12px 12px; }
  .project-card__title { font-size: 15px; }
  .shortcut { padding: 14px; }
  .field-grid, .field-grid--2 { gap: 14px; }
  .modal { padding: 12px; align-items: end; }
  .modal__box { max-height: calc(100dvh - 24px); border-radius: 16px; }
  .modal__head, .modal__body { padding-inline: 16px; }
  .modal__foot { flex-wrap: wrap; padding-inline: 16px; }
  .modal__foot .btn { flex: 1 1 auto; }
  .drawer__foot { flex-wrap: wrap; }
  .toasts { left: 12px; right: 12px; bottom: 12px; justify-items: stretch; }
  .toast { max-width: none; }
  .login { padding: 16px; }
  .login__card { padding: 26px 20px 22px; }

  /* listes : la poignée de glisser-déposer ne sert pas au toucher (les flèches montent/descendent) ; les outils passent à la ligne au lieu d'écraser le champ */
  .list-row > .handle, .item__head > .handle, .pick > .handle { display: none; }
  .list-row { flex-wrap: wrap; }
  .list-row > .input, .list-row > .grow, .pick > .grow { min-width: min(100%, 11rem); }
  .list-row__tools { margin-left: auto; padding-top: 0; }
  .pick { flex-wrap: wrap; row-gap: 2px; padding: 8px; }
  .pick .flag { margin-right: auto; }
  .pick__text { min-width: min(100%, 8rem); }
  .item__head { flex-wrap: wrap; padding: 8px; }
  .item__summary { min-width: min(100%, 9rem); }
  .item__head .list-row__tools { margin-left: auto; }
  .field__row { flex-wrap: wrap; }
  .field__row > .input { min-width: min(100%, 11rem); }


  .pager { flex-direction: column; align-items: flex-start; }

  /* onglets : défilement discret, sans barre visible */
  .tabs { scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { padding-inline: 10px; }
}

/* Petit écran ou écran tactile : champs à 16 px (sinon iOS zoome la page à chaque saisie) et zones de toucher d'au moins 44 px */
@media (max-width: 860px), (pointer: coarse) {
  .input, textarea.input, select.input, .shot__alt textarea { font-size: 16px; }
  .input { min-height: 46px; }
  .shot__alt textarea { min-height: 72px; }
  .btn { min-height: 44px; }
  .btn--small { min-height: 40px; }
  .icon-btn { width: 44px; height: 44px; }
  .icon-btn svg { width: 20px; height: 20px; }
  .nav-link { min-height: 44px; }
  .lang-toggle__btn { min-height: 40px; padding-inline: 14px; }
  .chip { min-height: 40px; padding-inline: 14px; }
  .chip-btn { min-height: 40px; }
  .var-chip { min-height: 34px; padding-inline: 10px; }
  .add-btn { min-height: 44px; }
  .back-link { min-height: 44px; }
  .tabs a { padding-block: 13px; }
  .switch { min-height: 44px; }
  .link-btn, .account__btn { padding-block: 10px; }
  .sidebar__foot a { display: inline-block; padding-block: 10px; }
  .handle { height: 44px; }
  .wall-tile button { width: 32px; height: 32px; opacity: 1; }
}
@media (max-height: 520px) {
  .login { padding: 12px; }
  .login__card { padding: 20px 22px 18px; }
  .login__brand { margin-bottom: 14px; }
  .login__lead { margin-bottom: 14px; }
  .login__form { gap: 10px; }
  .login h1 { font-size: 21px; }
}
@media (max-height: 480px) and (max-width: 900px) {
  .topbar__crumbs { display: none; }
  .topbar { padding-block: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Les grilles à une colonne ne doivent jamais s’élargir au-delà de leur conteneur (textes longs, résumés sur une ligne) */
.group__body, .item__body, .field, .list, .repeater, .picks, .modal__body, .drawer__body, .image-slot__side, .video-field__side, .checklist, .timeline { grid-template-columns: minmax(0, 1fr); }

/* ------------------------------------------------------------------ administration en ligne : connexion et compte */
.login { position: fixed; inset: 0; z-index: 200; display: grid; padding: 24px; overflow-y: auto; background: var(--sidebar); animation: fade 0.2s; }
.login__card { width: min(100%, 410px); margin: auto; padding: 32px 30px 30px; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-lg); animation: rise 0.25s; }
.login__brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.login__brand strong { display: block; font: 700 17px/1.15 var(--serif); letter-spacing: -0.01em; }
.login__brand small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.login__mark { flex: none; position: relative; width: 36px; height: 36px; border-radius: 10px; background: var(--accent); }
.login__mark::after { content: ""; position: absolute; inset: 7px; background: #fff; -webkit-mask: url("/assets/img/brand/logo-mark.png") center / contain no-repeat; mask: url("/assets/img/brand/logo-mark.png") center / contain no-repeat; }
.login h1 { font: 700 24px/1.2 var(--serif); letter-spacing: -0.01em; }
.login__lead { margin: 6px 0 22px; color: var(--muted); font-size: 14.5px; }
.login__form { display: grid; gap: 16px; }
.login__form .btn--primary { width: 100%; min-height: 46px; font-size: 15px; }
.login__remember { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13.5px; cursor: pointer; }
.login__remember input { width: 16px; height: 16px; accent-color: var(--accent); }
.login__error { padding: 10px 12px; border-radius: 10px; background: var(--danger-soft); color: #7a1a12; font-size: 13.5px; }
.account { display: grid; gap: 6px; padding: 14px 22px 4px; border-top: 1px solid #2a2724; font-size: 13px; }
.account__mail { color: var(--sidebar-fg); overflow-wrap: anywhere; }
.account__actions { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.account__btn { padding: 2px 0; border: 0; background: none; color: var(--sidebar-muted); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.account__btn:hover { color: #fff; }
.account + .sidebar__foot { border-top: 0; padding-top: 8px; }
.auto-publish { display: grid; gap: 6px; padding: 14px 22px 10px; border-top: 1px solid #2a2724; font-size: 13px; }
.auto-publish .switch { color: var(--sidebar-fg); }
.auto-publish .switch__label { font-size: 13.5px; }
.auto-publish .switch__track { background: #4a453f; }
.auto-publish .switch input:checked + .switch__track { background: var(--accent); }
.auto-publish__hint { color: var(--sidebar-muted); font-size: 12px; line-height: 1.45; }
.auto-publish + .sidebar__foot { border-top: 0; padding-top: 8px; }
