/* CMS editor chrome — mode hybride */
.fm-admin { background: #0e0d0a; color: #fff; min-height: 100vh; font-family: 'Instrument Sans', sans-serif; margin: 0; }
.fm-login { display: grid; position: fixed; inset: 0; background: rgba(0,0,0,.85); z-index: 100; place-items: center; }
.fm-login[hidden], .fm-editor[hidden], .fm-editor__drawer[hidden] { display: none !important; }
.fm-editor { display: flex; flex-direction: column; min-height: 100vh; }
.fm-login__box { background: #15130e; border: 1px solid rgba(255,255,255,.2); padding: 2rem; min-width: 320px; text-align: center; }
.fm-login__box h1 { font-family: 'Cormorant Garamond', serif; font-weight: 300; font-size: 2rem; margin-bottom: .25rem; }
.fm-login__box input { width: 100%; margin: 1rem 0; padding: .75rem; background: #0e0d0a; border: 1px solid rgba(255,255,255,.25); color: #fff; }
.fm-login__err { color: #e88; margin-top: .75rem; }

.fm-editor__top {
  display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center;
  padding: .6rem 1rem; border-bottom: 1px solid rgba(255,255,255,.15);
  position: sticky; top: 0; background: #15130e; z-index: 20;
}
.fm-editor__top select { background: #0e0d0a; color: #fff; border: 1px solid rgba(255,255,255,.2); padding: .4rem .6rem; max-width: 220px; }
.fm-editor__top-actions { display: flex; flex-wrap: wrap; gap: .35rem; margin-left: auto; }
.fm-editor__hint { font-size: .72rem; color: rgba(255,255,255,.55); letter-spacing: .06em; flex: 1; min-width: 180px; }

.fm-btn { background: transparent; border: 1px solid rgba(255,255,255,.25); color: #fff; padding: .45rem .75rem; cursor: pointer; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; }
.fm-btn:hover { border-color: #d4aa5a; color: #d4aa5a; }
.fm-btn--gold { background: #b88c3e; border-color: #b88c3e; color: #0e0d0a; }
.fm-btn--gold:hover { background: #d4aa5a; border-color: #d4aa5a; color: #0e0d0a; }

.fm-editor__canvas { flex: 1; min-height: 0; display: flex; background: #1a1814; }
.fm-editor--hybrid .fm-editor__preview {
  flex: 1; width: 100%; min-height: calc(100vh - 96px); border: 0; background: #fff;
}

.fm-editor__drawer {
  position: fixed; top: 52px; right: 0; bottom: 32px; width: min(360px, 92vw);
  background: #15130e; border-left: 1px solid rgba(255,255,255,.15); z-index: 30;
  box-shadow: -8px 0 24px rgba(0,0,0,.35);
}
.fm-editor__drawer--wide { width: min(480px, 94vw); }
.fm-editor__drawer-inner { height: 100%; overflow: auto; padding: 1rem; }
.fm-editor__drawer header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.fm-editor__drawer h2 { font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: #d4aa5a; margin: 0; }

.fm-editor__drawer li { list-style: none; margin-bottom: .35rem; display: flex; gap: .25rem; align-items: center; }
.fm-editor__drawer li.is-active button.fm-sec-label { border-color: #d4aa5a; color: #d4aa5a; }
.fm-sec-label { flex: 1; text-align: left; background: transparent; border: 1px solid rgba(255,255,255,.15); color: #fff; padding: .4rem .5rem; cursor: pointer; font-size: .75rem; }
.fm-sec-actions button { width: 28px; height: 28px; border: 1px solid rgba(255,255,255,.15); background: transparent; color: #fff; cursor: pointer; }
.fm-add-section { margin-top: 1rem; display: flex; flex-direction: column; gap: .5rem; }
.fm-add-section select { background: #0e0d0a; color: #fff; border: 1px solid rgba(255,255,255,.2); padding: .4rem; }

#propsForm label { display: block; font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.65); margin: .75rem 0 .25rem; }
#propsForm input[type=text], #propsForm textarea, #propsForm select { width: 100%; background: #0e0d0a; border: 1px solid rgba(255,255,255,.2); color: #fff; padding: .5rem; font-family: inherit; box-sizing: border-box; }
#propsForm textarea { min-height: 80px; resize: vertical; }

.fm-editor__status { padding: .5rem 1rem; font-size: .8rem; color: rgba(255,255,255,.7); border-top: 1px solid rgba(255,255,255,.1); margin: 0; }
.fm-field-row { display: flex; gap: .5rem; align-items: center; }
.fm-field-row input { flex: 1; }
.fm-field-row button { flex-shrink: 0; }

/* Gestionnaire diaporama */
.fm-slides-manager { display: flex; flex-direction: column; gap: .75rem; }
.fm-slides-list { display: flex; flex-direction: column; gap: .5rem; max-height: 340px; overflow: auto; }
.fm-slide-row {
  display: grid; grid-template-columns: 28px 100px 1fr auto; gap: .5rem; align-items: start;
  padding: .5rem; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.12);
}
.fm-slide-num { font-size: .7rem; color: #d4aa5a; letter-spacing: .08em; text-align: center; padding-top: .35rem; }
.fm-slide-preview { display: flex; flex-direction: column; gap: .35rem; }
.fm-slide-preview img {
  width: 100px; height: 64px; object-fit: cover; display: block;
  border: 1px solid rgba(255,255,255,.2); background: #0e0d0a;
}
.fm-slide-replace { font-size: .58rem !important; padding: .35rem .4rem !important; width: 100%; }
.fm-slide-thumb {
  width: 72px; height: 48px; border: 1px solid rgba(255,255,255,.2); padding: 0; cursor: pointer;
  background-size: cover; background-position: center; background-color: #0e0d0a;
}
.fm-slide-thumb:hover { border-color: #d4aa5a; }
.fm-slide-meta { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.fm-slide-label {
  width: 100%; background: #0e0d0a; border: 1px solid rgba(255,255,255,.2); color: #fff;
  padding: .35rem .5rem; font-size: .78rem; box-sizing: border-box;
}
.fm-slide-path { font-size: .62rem; color: rgba(255,255,255,.45); word-break: break-all; display: none; }
.fm-slide-acts { display: flex; flex-direction: column; gap: 2px; }
.fm-slide-acts button {
  width: 26px; height: 22px; border: 1px solid rgba(255,255,255,.15); background: transparent;
  color: #fff; cursor: pointer; font-size: .72rem; line-height: 1;
}
.fm-slides-drop {
  border: 2px dashed rgba(212,170,90,.45); padding: 1rem; text-align: center; cursor: default;
  background: rgba(212,170,90,.06); transition: border-color .15s, background .15s;
}
.fm-slides-drop.is-over { border-color: #d4aa5a; background: rgba(212,170,90,.14); }
.fm-slides-drop strong { display: block; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: #d4aa5a; margin-bottom: .25rem; }
.fm-slides-drop span { font-size: .68rem; color: rgba(255,255,255,.55); }
.fm-slides-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

.fm-buttons-manager { display: flex; flex-direction: column; gap: .5rem; }
.fm-button-row { display: grid; grid-template-columns: 28px 1fr auto; gap: .5rem; align-items: start; padding: .5rem; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.12); }
.fm-button-meta { display: flex; flex-direction: column; gap: .35rem; }
.fm-button-meta select { background: #0e0d0a; color: #fff; border: 1px solid rgba(255,255,255,.2); padding: .35rem; }

.fm-hint { font-size: .72rem; color: rgba(255,255,255,.55); margin: 0 0 1rem; line-height: 1.4; }
.fm-site-nav h3 { font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: #d4aa5a; margin: 1rem 0 .35rem; }
.fm-history-row { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .4rem 0; border-bottom: 1px solid rgba(255,255,255,.08); font-size: .75rem; }

@media (max-width: 720px) {
  .fm-editor__hint { display: none; }
  .fm-editor--hybrid .fm-editor__preview { min-height: calc(100vh - 120px); }
}

/* Médiathèque (img-panel) */
.fm-imgpanel { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.8); z-index: 200; }
.fm-imgpanel.is-open { display: grid; place-items: center; }
.fm-imgpanel__box { width: min(960px, 96vw); height: min(640px, 90vh); background: #15130e; border: 1px solid rgba(255,255,255,.2); display: flex; flex-direction: column; }
.fm-imgpanel__box header { display: flex; justify-content: space-between; align-items: center; padding: .75rem 1rem; border-bottom: 1px solid rgba(255,255,255,.15); }
.fm-imgpanel__box header button { background: transparent; border: 0; color: #fff; font-size: 1.4rem; cursor: pointer; }
.fm-imgpanel__body { display: grid; grid-template-columns: 200px 1fr; flex: 1; min-height: 0; }
.fm-imgpanel__body aside { overflow: auto; border-right: 1px solid rgba(255,255,255,.12); padding: .5rem; }
.fm-imgpanel__body main { overflow: auto; padding: .75rem; transition: background .15s; }
.fm-imgpanel__body main.is-drop-over { background: rgba(212,170,90,.08); outline: 2px dashed rgba(212,170,90,.5); outline-offset: -4px; }
.fm-imgpanel__drop-hint { font-size: .68rem; color: rgba(255,255,255,.5); margin-left: .5rem; }
.fm-imgpanel__count { font-size: .68rem; color: #d4aa5a; margin-left: .35rem; }
.fm-imgpanel__err { color: #e88; font-size: .78rem; }
.fm-imgtree__item { display: block; width: 100%; text-align: left; background: transparent; border: 0; color: rgba(255,255,255,.8); padding: .35rem .5rem; cursor: pointer; font-size: .78rem; }
.fm-imgtree__item:hover { color: #d4aa5a; }
.fm-imgpanel #fmImgGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .5rem; }
.fm-imgcard { position: relative; cursor: pointer; border: 1px solid rgba(255,255,255,.15); }
.fm-imgcard img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.fm-imgcard__meta { font-size: .65rem; padding: .25rem; word-break: break-all; color: rgba(255,255,255,.7); }
.fm-imgcard__del { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border: 0; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; }
