@import url("fonts-F5J8RU0.css");

/* ——— Jetons ——————————————————————————————————————————— */

:root {
  --ink: #111111;
  --ink-soft: #3a3a3a;
  --paper: #f6f6f5;
  --card: #ffffff;
  --rule: #e4e4e2;
  --rule-light: #f2f2f0;
  --rule-mid: #eeeeec;
  --muted: #8a8a8a;
  --muted-light: #a5a5a5;
  --text-soft: #555555;
  --text-mid: #666666;
  --sidebar-dim: #c9c9c9;
  --sidebar-faint: #7a7a7a;
  --sidebar-hover: #242424;
  --sidebar-rule: #2a2a2a;
  --danger: #a03232;
  --danger-rule: #d9b2b2;
  --danger-bg: #faf2f2;
  --warn: #c9a13a;

  --sans: 'Instrument Sans', system-ui, -apple-system, sans-serif;
  --serif: 'Instrument Serif', Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; background: var(--paper); }

body {
  font-family: var(--sans);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
}

img { display: block; max-width: 100%; }
a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--text-mid); }
input, button, select, textarea { font-family: inherit; }
[hidden] { display: none !important; }

/* ——— Ossature ————————————————————————————————————————— */

.shell {
  display: flex;
  align-items: stretch;
  min-height: 100vh;
  width: 100%;
}

.sidebar {
  flex: 0 0 auto;
  width: clamp(200px, 19vw, 268px);
  background: var(--ink);
  color: #ffffff;
  padding: clamp(18px, 2vw, 28px) clamp(12px, 1.4vw, 22px);
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 3vh, 36px);
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  overflow-y: auto;
}

.sidebar__brand { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.sidebar__brand-mark {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #ffffff;
}
.sidebar__brand-serif { font-family: var(--serif); font-style: italic; font-size: 14px; color: var(--sidebar-dim); }
.sidebar__kicker {
  margin-top: 8px;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--sidebar-faint);
}

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav__group-label {
  margin: 14px 0 4px;
  padding: 0 12px;
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #5c5c5c;
}
.nav__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  font-size: 13px;
  color: var(--sidebar-dim);
  background: transparent;
  transition: background 120ms ease, color 120ms ease;
}
.nav__item:hover { background: var(--sidebar-hover); color: #ffffff; }
.nav__item--active { background: var(--sidebar-hover); color: #ffffff; }
.nav__count { font-size: 11px; color: var(--sidebar-faint); }

.sidebar__foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 1px solid var(--sidebar-rule);
  padding-top: 18px;
}
.sidebar__user { font-size: 12px; color: var(--sidebar-dim); }
.sidebar__role { font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--sidebar-faint); }
.sidebar__logout { font-size: 11px; color: var(--sidebar-faint); background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
.sidebar__logout:hover { color: #ffffff; }

.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: clamp(16px, 2vw, 26px) clamp(16px, 3vw, 44px);
  background: var(--card);
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar__crumb { font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.topbar__title {
  margin: 6px 0 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(24px, 2.6vw, 36px);
  line-height: 1.1;
}
.topbar__actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.topbar__meta { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

.screen {
  padding: clamp(20px, 3vw, 40px) clamp(16px, 3vw, 44px);
  display: flex;
  flex-direction: column;
  gap: clamp(18px, 2.4vw, 32px);
}

/* ——— Boutons ——————————————————————————————————————————— */

.btn {
  display: inline-block;
  padding: 11px 22px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid transparent;
  background: none;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
  white-space: nowrap;
}
.btn--solid { background: var(--ink); color: #ffffff; border-color: var(--ink); }
.btn--solid:hover { background: var(--ink-soft); border-color: var(--ink-soft); color: #ffffff; }
.btn--ghost { border-color: var(--ink); color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: #ffffff; }
.btn--quiet { color: var(--muted); }
.btn--quiet:hover { color: var(--ink); }
.btn--danger { border-color: var(--danger-rule); color: var(--danger); }
.btn--danger:hover { background: var(--danger-bg); color: var(--danger); }
.btn--sm { padding: 9px 16px; letter-spacing: 0.14em; }

/* ——— Cartes ———————————————————————————————————————————— */

.card { background: var(--card); border: 1px solid var(--rule); }
.card__head {
  padding: 18px clamp(18px, 2vw, 26px);
  border-bottom: 1px solid var(--rule-mid);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.card__title { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; }
.card__note { font-size: 11px; color: var(--muted); }
.card__body { padding: clamp(18px, 2vw, 28px); display: flex; flex-direction: column; gap: 18px; }

.grid { display: grid; gap: clamp(12px, 1.6vw, 20px); }
.grid--stats { grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); }
.grid--halves { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); align-items: start; }
.grid--thirds { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); align-items: start; }
.stack { display: flex; flex-direction: column; gap: clamp(14px, 1.8vw, 22px); }

.stat__label { font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.stat__value { margin-top: 12px; font-family: var(--serif); font-size: clamp(32px, 3.4vw, 48px); line-height: 1; }
.stat__hint { margin-top: 8px; font-size: 12px; color: var(--muted); }

/* ——— Listes et tableaux ———————————————————————————————— */

.rows { display: flex; flex-direction: column; }
.row {
  display: grid;
  gap: 14px;
  align-items: center;
  padding: 14px clamp(16px, 2vw, 24px);
  border-bottom: 1px solid var(--rule-light);
}
.row:last-child { border-bottom: 0; }
.row--link { cursor: pointer; }
.row--link:hover { background: #fafafa; }
.row--head {
  padding: 12px clamp(16px, 2vw, 24px);
  border-bottom: 1px solid var(--rule);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.row__cell { min-width: 0; }
.row__title { font-size: 14.5px; line-height: 1.35; }
.row__sub { margin-top: 3px; font-size: 12px; color: var(--muted); }
.row__meta { font-size: 13px; color: var(--text-soft); }
.row__when { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-light); }

.thumb { object-fit: cover; background: #f0f0ef; }
.thumb--45 { width: 56px; aspect-ratio: 4 / 5; }
.thumb--square { width: 48px; height: 48px; }

/* ——— Étiquettes ———————————————————————————————————————— */

.tag {
  display: inline-block;
  padding: 4px 9px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--muted);
  white-space: nowrap;
}
.tag--solid { background: var(--ink); color: #ffffff; border-color: var(--ink); }
.tag--outline { background: var(--card); color: var(--ink); border-color: var(--ink); }
.tag--alert { background: var(--danger-bg); color: var(--danger); border-color: #e6cccc; }

/* ——— Filtres ————————————————————————————————————————— */

.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.filters__set { display: flex; gap: 8px; flex-wrap: wrap; }
.filters__tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.chip {
  display: inline-block;
  padding: 9px 16px;
  border: 1px solid var(--rule);
  background: var(--card);
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}
.chip:hover { color: var(--ink); border-color: var(--ink); }
.chip--on { background: var(--ink); color: #ffffff; border-color: var(--ink); }
.chip--on:hover { color: #ffffff; }

/* ——— Formulaires ——————————————————————————————————————— */

.field { display: flex; flex-direction: column; gap: 7px; }
.field__label { font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.field__help { font-size: 11px; line-height: 1.6; color: var(--muted-light); }
.field__error { font-size: 12px; color: var(--danger); }

.input, .select, .textarea {
  border: 1px solid var(--rule);
  background: var(--card);
  padding: 11px 13px;
  font-size: 15px;
  color: var(--ink);
  outline: none;
  width: 100%;
  border-radius: 0;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--ink); }
.textarea { line-height: 1.6; resize: vertical; }
.input--search { font-size: 13px; padding: 10px 14px; width: clamp(160px, 22vw, 260px); }

.checkline { display: flex; gap: 9px; align-items: center; font-size: 13.5px; cursor: pointer; }
.checkline input { accent-color: var(--ink); }
.checkrow { display: flex; gap: 22px; flex-wrap: wrap; }

.field-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 16px; }

.toggle-set { display: flex; gap: 8px; flex-wrap: wrap; }
.toggle-set input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-set label {
  display: inline-block;
  padding: 9px 16px;
  border: 1px solid var(--rule);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
}
.toggle-set label:hover { border-color: var(--ink); color: var(--ink); }
.toggle-set input:checked + label { background: var(--ink); color: #ffffff; border-color: var(--ink); }
.toggle-set input:focus-visible + label { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ——— Médias ————————————————————————————————————————— */

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(120px, 100%), 1fr)); gap: 10px; }
.tile { position: relative; }
.tile img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: #f0f0ef; }
.tile__num { position: absolute; top: 6px; left: 6px; background: #ffffff; font-size: 10px; letter-spacing: 0.12em; padding: 3px 6px; }
.tile__remove { position: absolute; top: 6px; right: 6px; background: #ffffff; border: 0; font-size: 11px; padding: 3px 7px; cursor: pointer; line-height: 1; }
.tile__remove:hover, .tile__remove:focus-visible { color: var(--danger); }

/* Barre d'actions du bandeau d'accueil, au pied de chaque vignette. */
.tile__bar { position: absolute; left: 6px; right: 6px; bottom: 6px; display: flex; gap: 4px; }
.tile__bar form { flex: 0 0 auto; }
.tile__bar form:nth-child(2) { flex: 1 1 auto; }
.tile__step {
  width: 100%; background: rgba(255, 255, 255, 0.94); border: 0; cursor: pointer;
  font-family: inherit; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 4px 6px; line-height: 1.4; color: var(--ink);
}
.tile__step:hover:not(:disabled) { background: #ffffff; }
.tile__step:disabled { opacity: 0.35; cursor: default; }
.tile__fmt {
  position: absolute; bottom: 6px; left: 6px; right: 6px;
  background: rgba(255, 255, 255, 0.92);
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 3px 6px; text-align: center; color: var(--muted);
}
.tile--add {
  border: 1px dashed #cfcfcd;
  aspect-ratio: 1 / 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; color: var(--muted);
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
}
.tile--add:hover { border-color: var(--ink); color: var(--ink); }

/* ——— Champ image et sélecteur de médiathèque ——————————— */

.media-field__empty {
  aspect-ratio: 4 / 5;
  display: flex; align-items: center; justify-content: center;
  background: #f0f0ef; border: 1px dashed #cfcfcd;
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}
.media-field__actions { display: flex; gap: 8px; flex-wrap: wrap; }

.picker {
  width: min(880px, 92vw);
  max-height: 84vh;
  margin: auto;
  padding: 20px;
  border: 1px solid var(--rule);
  background: var(--card);
  color: var(--ink);
  font-family: var(--sans);
}
.picker::backdrop { background: rgba(17, 17, 17, 0.4); }
.picker[open] { display: flex; flex-direction: column; gap: 14px; }

.picker__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.picker__title { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.picker__close { background: none; border: 0; font-size: 20px; line-height: 1; cursor: pointer; color: var(--muted); }
.picker__close:hover { color: var(--ink); }

.picker__grid {
  flex: 1; min-height: 0; overflow-y: auto;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(130px, 100%), 1fr)); gap: 10px;
  align-content: start;
}
.picker__grid[aria-busy='true'] { opacity: 0.5; }

.picker__item { padding: 0; background: none; border: 1px solid transparent; cursor: pointer; text-align: left; }
.picker__item:hover, .picker__item:focus-visible { border-color: var(--ink); outline: none; }
.picker__item img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: #f0f0ef; display: block; }
.picker__name {
  display: block; padding: 6px 4px 0;
  font-size: 10.5px; color: var(--text-mid);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Sélection multiple : la vignette retenue est cochée dans la fenêtre. */
.picker__item--on { border-color: var(--ink); }
.picker__item--on img { outline: 3px solid var(--ink); outline-offset: -3px; }
.picker__item--on .picker__name::before { content: '✓ '; }

.picker__foot { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }

/* Images retenues, sous le bouton de choix. */
.chosen-set { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.chosen-set:empty { display: none; }
.chosen { position: relative; width: 72px; }
.chosen img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; background: #f0f0ef; display: block; }
.chosen__drop {
  position: absolute; top: 2px; right: 2px;
  background: #ffffff; border: 0; cursor: pointer;
  font-size: 11px; line-height: 1; padding: 2px 5px;
}
.chosen__drop:hover { color: var(--danger); }

.dropzone {
  border: 1px dashed #cfcfcd;
  background: var(--card);
  padding: clamp(24px, 4vw, 44px);
  text-align: center;
  display: flex; flex-direction: column; gap: 8px; align-items: center;
}

/* ——— Divers ————————————————————————————————————————— */

.backlink { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.backlink:hover { color: var(--ink); }

.note { margin: 0; font-size: 12px; line-height: 1.7; color: var(--muted); max-width: 70ch; text-wrap: pretty; }

.flash { padding: 14px 18px; border: 1px solid var(--ink); background: var(--card); font-size: 13.5px; }
.flash--error { border-color: var(--danger-rule); background: var(--danger-bg); color: var(--danger); }

.danger-zone__title { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--danger); }

.empty { padding: clamp(28px, 4vw, 48px); text-align: center; color: var(--muted); font-size: 13.5px; }

/* ——— Import d'expositions ——————————————————————————————— */

.import__bar { position: sticky; top: 0; z-index: 4; }

.import__head {
  display: flex;
  gap: 14px;
  align-items: baseline;
  flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}
.import__num { font-family: var(--serif); font-size: 22px; line-height: 1; color: var(--muted-light); }
.import__title { flex: 1 1 220px; min-width: 0; font-size: 15px; }

.import__flags { display: flex; flex-direction: column; gap: 6px; }
.import__flag {
  margin: 0;
  padding: 9px 13px;
  border: 1px solid var(--rule);
  border-left-width: 3px;
  background: #fafafa;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-soft);
}
.import__flag--error { border-color: var(--danger-rule); background: var(--danger-bg); color: var(--danger); }

.import__more { border-top: 1px solid var(--rule-light); padding-top: 14px; }
.import__more > summary {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
}
.import__more > summary:hover { color: var(--ink); }

.import-events { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.import-event {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--rule);
  border-left-width: 3px;
  background: #fbfbfa;
}
.import-event--error { border-color: var(--danger-rule); background: var(--danger-bg); }
.import-event__head {
  display: flex;
  gap: 14px;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
}
.import-event__label { flex: 1 1 200px; min-width: 0; font-size: 13.5px; }
.import-event .input, .import-event .select, .import-event .textarea { background: var(--card); }

.deflist { margin: 0; font-size: 12.5px; line-height: 1.7; }
.deflist dt { letter-spacing: 0.04em; font-weight: 600; }
.deflist dd { margin: 0 0 10px; color: var(--text-soft); }
.deflist code, .note code { font-size: 11.5px; background: var(--rule-light); padding: 1px 5px; }

.code {
  margin: 12px 0 0;
  padding: 14px 16px;
  background: var(--rule-light);
  font-size: 11.5px;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
}

/* ——— Connexion ————————————————————————————————————————— */

.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--ink); }
.login__panel { width: min(420px, 100%); background: var(--card); padding: clamp(28px, 5vw, 48px); display: flex; flex-direction: column; gap: 22px; }
.login__brand { display: flex; align-items: baseline; gap: 8px; }
.login__title { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 32px; line-height: 1.1; }

@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav__group-label { width: 100%; }
}
