/* ONEIRO — panneau images (pages projets + partagé) */
:root {
  --oneiro-ink: #181614;
  --oneiro-ink-soft: #4a4540;
  --oneiro-paper: #f7f2eb;
  --oneiro-tea: #8a8278;
  --oneiro-vermilion: #b73a1f;
  --oneiro-rule: rgba(24, 22, 20, 0.14);
  --oneiro-rule-soft: rgba(24, 22, 20, 0.08);
  --oneiro-font-text: "Source Serif 4", Georgia, serif;
  --oneiro-font-mono: ui-monospace, "SF Mono", Menlo, monospace;
}

.image-editor-toggle {
  position: fixed;
  top: 12px;
  right: 12px;
  left: auto;
  bottom: auto;
  z-index: 2147483000;
  font: 11px var(--oneiro-font-mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #fff;
  background: var(--oneiro-vermilion);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(183, 58, 31, 0.35);
}
.image-editor-toggle:hover {
  color: #fff;
  background: #9a3119;
  border-color: rgba(255, 255, 255, 0.5);
}

.image-editor-panel {
  position: fixed;
  top: 12px;
  right: 12px;
  left: auto;
  bottom: auto;
  z-index: 2147482000;
  width: min(380px, calc(100vw - 24px));
  max-height: min(88vh, 720px);
  overflow: auto;
  padding: 14px 16px 16px;
  font-family: var(--oneiro-font-text);
  font-size: 13px;
  line-height: 1.4;
  color: var(--oneiro-ink);
  background: rgba(255, 252, 246, 0.97);
  border: 1px solid var(--oneiro-rule);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}
.image-editor-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.image-editor-close {
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--oneiro-ink-soft);
  padding: 0 4px;
}
.image-editor-hint {
  font-size: 11px;
  color: var(--oneiro-tea);
  margin: 0 0 12px;
}
.image-editor-section {
  font-family: var(--oneiro-font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--oneiro-vermilion);
  margin: 18px 0 10px;
  padding-top: 14px;
  border-top: 1px solid var(--oneiro-rule-soft);
}
.image-editor-section:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.image-editor-slot {
  border-top: 1px solid var(--oneiro-rule-soft);
  padding: 12px 0 10px;
}
.image-editor-slot:first-of-type {
  border-top: 0;
  padding-top: 0;
}
.image-editor-slot__label {
  font-family: var(--oneiro-font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--oneiro-tea);
  margin-bottom: 8px;
}
.image-editor-slot__row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.image-editor-slot__thumb {
  width: 52px;
  height: 52px;
  border-radius: 6px;
  background: var(--oneiro-ink-soft) center/cover no-repeat;
  border: 1px solid var(--oneiro-rule-soft);
  flex-shrink: 0;
}
.image-editor-slot__thumb.is-empty {
  opacity: 0.35;
}
.image-editor-slot input[type="file"] {
  font-size: 11px;
  max-width: 100%;
}
.image-editor-slot button {
  font: 11px var(--oneiro-font-text);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid rgba(24, 22, 20, 0.2);
  background: var(--oneiro-paper);
}
.image-editor-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.image-editor-actions button {
  font: 12px var(--oneiro-font-text);
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid rgba(24, 22, 20, 0.2);
  background: var(--oneiro-paper);
}

/* —— Remplissage images (évite bandes grises --img-bg) —— */
:is(.fig, .triptych figure, .seasonal__hero, .seasonal__duo figure, .surreal__hero, .plate-duo figure, .pcard__media) {
  position: relative;
  overflow: hidden;
  line-height: 0;
}

.ph:has(> img[data-slot]) {
  position: relative;
  overflow: hidden;
  line-height: 0;
}

:is(.fig, .triptych figure, .seasonal__hero, .seasonal__duo figure, .surreal__hero, .plate-duo figure, .pcard__media, .ph) > img[data-slot] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.opening__img > img[data-slot] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.fig--compass > img[data-slot],
.fig--depth > img[data-slot] {
  object-fit: contain;
  object-position: center;
}

.hero__frame > img[data-slot] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: none;
}

/* Cadres cinéma — image entière visible (ex. Age V transition) */
.ph.ph--fit-contain > img[data-slot] {
  object-fit: contain;
  object-position: center center;
}

.ph.ph--relationship > img[data-slot] {
  object-fit: contain;
  object-position: center center;
}

/* Planches & cartes — contain dans le cadre (priorité sur .ph > img[data-slot] cover) */
.ph.hero__map > img[data-slot],
.ph.hero__plate-vertical > img[data-slot],
.ph.hero__plate-cell__img > img[data-slot],
#age-i .ph > img[data-slot] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  transform: none;
}

/* Calces — bandes strip (fragments) : marge visible autour de l'image */
.strip .ph > img[data-slot] {
  inset: clamp(14px, 8%, 24px);
  object-fit: contain;
  object-position: center center;
  transform: none;
}
