/* Empire 1804 — administration */

:root {
	color-scheme: dark;
	--bg: #121110;
	--surface: #1A1816;
	--surface-hover: #1E1C19;
	--row-hover: #171513;
	--line: #2A2724;
	--line-strong: #3A3631;
	--ink: #ECE6DA;
	--ink-bright: #F4EFE6;
	--muted: #A79E8E;
	--muted-2: #8A8274;
	--faint: #6E675C;
	--gold: #C9A55A;
	--gold-hover: #D8B670;
	--danger-border: #6A3A32;
	--danger-text: #E8A396;
	--danger-hover-bg: #2A1A17;
	--danger-alert: #C7695A;
	--overlay: rgba(6, 5, 4, .72);
	--cinzel: 'Cinzel', 'Trajan Pro', Georgia, serif;
	--spectral: 'Spectral', Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font: 400 16px/1.5 var(--spectral);
	-webkit-font-smoothing: antialiased;
}
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
h1, h2 { margin: 0; font-weight: 400; }
input, textarea, select, button { font-family: inherit; color: inherit; }
input::placeholder, textarea::placeholder { color: var(--faint); }

.eyebrow { font: 400 11px var(--cinzel); letter-spacing: .2em; color: var(--gold); white-space: nowrap; }
.eyebrow--muted { font-size: 10px; color: var(--muted-2); }
.brand-name { font: 600 26px/1 var(--cinzel); letter-spacing: .06em; color: var(--ink); }
.hint { font: italic 300 15px/1.45 var(--spectral); color: var(--muted-2); }
.hint--plain { font: 400 14px var(--spectral); }
.inline-form { margin: 0; }
.link { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; text-align: left; }
.link--muted { color: var(--muted); }
.link--muted:hover { color: var(--ink); }

/* ---------- Champs et boutons ---------- */

.field { display: flex; flex-direction: column; gap: 8px; }
.field__label { font: 400 11px var(--cinzel); letter-spacing: .16em; color: var(--muted); }
.field input, .field textarea, .field select, .inline-field input {
	background: var(--surface);
	border: 1px solid var(--line-strong);
	border-radius: 0;
	padding: 10px 12px;
	font-size: 16px;
	outline: none;
	width: 100%;
}
.field input:focus, .field textarea:focus, .field select:focus, .inline-field input:focus { border-color: var(--gold); }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.legend-input { font: italic 300 17px/1.4 var(--spectral) !important; resize: vertical; }

.btn {
	display: inline-block;
	background: transparent;
	border: 1px solid var(--line-strong);
	padding: 11px 18px;
	font: 400 12px var(--cinzel);
	letter-spacing: .12em;
	color: var(--ink);
	cursor: pointer;
	text-align: center;
	border-radius: 0;
}
.btn:hover { text-decoration: none; border-color: var(--gold); }
.btn--primary { background: var(--gold); border-color: var(--gold); color: var(--bg); font-weight: 600; letter-spacing: .14em; padding: 12px 20px; }
.btn--primary:hover { background: var(--gold-hover); border-color: var(--gold-hover); }
.btn--block { width: 100%; padding: 14px; font-size: 13px; }
.btn--outline { font: 400 14px var(--spectral); letter-spacing: 0; padding: 10px; }
.btn--danger { border-color: var(--danger-border); color: var(--danger-text); font: 400 14px var(--spectral); letter-spacing: 0; padding: 11px 18px; }
.btn--danger:hover { border-color: var(--danger-border); background: var(--danger-hover-bg); }
.btn--bottom { margin-top: auto; width: 100%; }

.chevron { color: var(--muted-2); font-size: 18px; }
.chevron:hover { text-decoration: none; color: var(--gold); }

/* ---------- Connexion ---------- */

.login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 16px; }
.login-form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 22px; }
.login-form__brand { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 12px; }
.login-form .field input { padding: 12px 14px; font-size: 17px; }
.login-form__back { text-align: center; font-size: 14px; color: var(--muted-2); }
.alert { border: 1px solid var(--danger-alert); color: var(--danger-text); padding: 10px 14px; font-size: 15px; }

/* ---------- Coque : barre latérale ---------- */

.shell { min-height: 100vh; display: grid; grid-template-columns: clamp(200px, 18vw, 248px) minmax(0, 1fr); }
.shell__side {
	border-right: 1px solid var(--line);
	padding: 32px 26px;
	display: flex;
	flex-direction: column;
	gap: 36px;
	position: sticky;
	top: 0;
	height: 100vh;
	overflow-y: auto;
}
.shell__main { min-width: 0; }
.side-brand { display: flex; flex-direction: column; gap: 10px; }
.side-brand:hover { text-decoration: none; }
.side-brand .brand-name { font-size: 21px; }
.side-brand .eyebrow { font-size: 10px; letter-spacing: .22em; }

.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-nav a {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 10px 12px;
	margin: 0 -12px;
	font: 400 17px var(--spectral);
	color: var(--ink);
}
.side-nav a:hover { background: var(--surface-hover); text-decoration: none; }
.side-nav a.is-active { background: var(--surface-hover); color: var(--gold); }
.side-nav__count { font: 400 12px var(--cinzel); color: var(--muted-2); }

.side-stats { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 20px; font-size: 15px; color: var(--muted); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.side-foot__version { color: var(--faint); font-size: 12px; }

/* ---------- Pages ---------- */

.page { padding: 40px clamp(24px, 4vw, 48px) 80px; display: flex; flex-direction: column; gap: 32px; max-width: 1100px; }
.page--narrow { max-width: 1000px; gap: 28px; }
.page--editor { padding-top: 32px; max-width: 960px; gap: 24px; }
.page__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.page__title { display: flex; flex-direction: column; gap: 6px; }
.page h1 { font: 400 32px var(--cinzel); letter-spacing: .08em; }
.page__title .hint { font-size: 16px; }

.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; font: 400 12px var(--cinzel); letter-spacing: .12em; color: var(--muted); }
.topbar a:first-child { color: var(--muted); }
.topbar a:first-child:hover { color: var(--ink); text-decoration: none; }

/* Liste des albums */
.group { display: flex; flex-direction: column; }
.group__head { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 10px; border-bottom: 1px solid var(--line-strong); }
.group__head h2 { font: 400 17px var(--cinzel); letter-spacing: .14em; color: var(--gold); }
.group__head .hint { font-size: 14px; }

.album-row {
	display: grid;
	grid-template-columns: 72px minmax(0, 1fr) 84px 76px 16px;
	gap: 16px;
	align-items: center;
	padding: 12px 0;
	border-bottom: 1px solid var(--line);
}
.album-row__cover { width: 72px; height: 54px; background: #000; display: block; }
.album-row__cover img { width: 100%; height: 100%; object-fit: cover; }
.album-row__title { display: flex; flex-direction: column; gap: 2px; min-width: 0; color: var(--ink); }
.album-row__title:hover { text-decoration: none; }
.album-row__title:hover .album-row__name { color: var(--gold); }
.album-row__name { font: 400 19px/1.3 var(--spectral); }
.album-row__date { font-size: 14px; color: var(--muted-2); }
.album-row__count { font-size: 15px; color: var(--muted); }

.status {
	justify-self: start;
	cursor: pointer;
	background: transparent;
	font: 400 11px var(--cinzel);
	letter-spacing: .12em;
	padding: 6px 10px;
	border: 1px solid var(--line-strong);
	color: var(--muted-2);
}
.status.is-on { border-color: var(--gold); color: var(--gold); }
.status:hover { border-color: var(--muted); }
.status.is-on:hover { border-color: var(--gold-hover); color: var(--gold-hover); }

/* Modale */
.modal { position: fixed; inset: 0; background: var(--overlay); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal__panel { width: 440px; max-width: 100%; background: var(--surface); border: 1px solid var(--line-strong); padding: 28px; display: flex; flex-direction: column; gap: 18px; }
.modal__panel .field input, .modal__panel .field select { background-color: var(--bg); font-size: 17px; }
.modal__title { font: 400 20px var(--cinzel); letter-spacing: .08em; }
.modal__panel .hint { font-size: 14px; }
.modal__actions { display: flex; justify-content: flex-end; gap: 10px; }
.modal__actions .btn:not(.btn--primary) { font: 400 14px var(--spectral); letter-spacing: 0; }

/* ---------- Album ---------- */

.album-screen { display: grid; grid-template-columns: minmax(0, 1fr) clamp(260px, 26vw, 340px); min-height: 100vh; }
.album-screen__main { padding: 32px clamp(20px, 3vw, 40px) 80px; display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.album-screen__title { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.album-screen__title h1 { font: 400 30px var(--cinzel); letter-spacing: .06em; }
.album-screen__title .hint { font-size: 16px; }

.dropzone {
	border: 1px dashed var(--line-strong);
	padding: 22px;
	display: flex;
	flex-wrap: wrap;
	text-align: center;
	align-items: center;
	justify-content: center;
	gap: 6px 12px;
	cursor: pointer;
	font-size: 16px;
	color: var(--muted);
	outline: none;
	transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--gold); }
.dropzone.is-over { border-color: var(--gold); background: var(--surface-hover); }
.dropzone__cta { font: 600 12px var(--cinzel); letter-spacing: .14em; color: var(--gold); }

.queue { display: flex; flex-direction: column; gap: 6px; }
.queue__row { display: grid; grid-template-columns: minmax(0, 1fr) 80px 120px; gap: 16px; align-items: center; background: var(--surface); padding: 10px 14px; font-size: 14px; }
.queue__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue__size { color: var(--muted-2); }
.queue__bar { height: 3px; background: var(--line); display: block; }
.queue__bar span { display: block; height: 3px; width: 0; background: var(--gold); transition: width .15s; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.tile { position: relative; aspect-ratio: 1; overflow: hidden; background: #000; cursor: grab; outline: none; user-select: none; }
.tile img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.tile.is-selected { outline: 2px solid var(--gold); outline-offset: 2px; }
.tile:focus-visible { outline: 2px solid var(--muted); outline-offset: 2px; }
.tile.is-dragging { opacity: .35; }
.tile__num { position: absolute; left: 6px; top: 6px; font: 400 11px var(--cinzel); background: rgba(12, 11, 10, .75); padding: 3px 6px; }
.tile__cover { position: absolute; right: 6px; top: 6px; font: 400 10px var(--cinzel); letter-spacing: .12em; background: var(--gold); color: var(--bg); padding: 3px 6px; }
.tile:not(:first-child) .tile__cover { display: none; }
.tile__nolegend { position: absolute; left: 6px; bottom: 6px; font-size: 12px; font-style: italic; background: rgba(12, 11, 10, .75); color: var(--muted); padding: 2px 6px; }
.tile:not([data-legend=""]) .tile__nolegend { display: none; }

.album-screen__aside {
	border-left: 1px solid var(--line);
	padding: 32px clamp(18px, 2vw, 28px);
	position: sticky;
	top: 0;
	height: 100vh;
	overflow: auto;
}
.panel { display: flex; flex-direction: column; gap: 22px; min-height: 100%; }
.panel__head { display: flex; justify-content: space-between; align-items: center; }
.panel__head .link { font-size: 14px; color: var(--muted-2); }
.preview { flex-shrink: 0; aspect-ratio: 4 / 3; background: #000; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.preview img { max-width: 100%; max-height: 100%; }
.rotate { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.switch-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	cursor: pointer;
	padding: 12px 0;
	border: 0;
	border-top: 1px solid var(--line);
	border-bottom: 1px solid var(--line);
	background: transparent;
	font-size: 16px;
	text-align: left;
	width: 100%;
}
.switch { width: 40px; height: 22px; border-radius: 11px; background: var(--line-strong); position: relative; display: block; transition: background .2s; flex-shrink: 0; }
.switch__knob { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); transition: left .2s; }
.switch-row[aria-checked=true] .switch { background: var(--gold); }
.switch-row[aria-checked=true] .switch__knob { left: 21px; }
.switch-row:focus-visible { outline: 1px solid var(--gold); outline-offset: 2px; }

/* ---------- Articles ---------- */

.article-rows { display: flex; flex-direction: column; border-top: 1px solid var(--line-strong); }
.article-row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 120px 90px 90px 24px;
	gap: 16px;
	align-items: center;
	padding: 16px 0;
	border-bottom: 1px solid var(--line);
	color: var(--ink);
}
.article-row:hover { background: var(--row-hover); text-decoration: none; }
.article-row__title { font: 400 19px/1.3 var(--spectral); }
.article-row__date { font-size: 14px; color: var(--muted-2); }
.article-row__flag { font: 400 11px var(--cinzel); letter-spacing: .12em; color: var(--muted-2); }
.article-row__flag.is-gold { color: var(--gold); }
.article-row__flag.is-on { color: var(--ink); }
.article-row__flag.is-off { color: var(--faint); }

.article-form { display: flex; flex-direction: column; gap: 24px; }
.title-input {
	background: transparent;
	border: 0;
	border-bottom: 1px solid var(--line-strong);
	padding: 8px 0;
	font: 400 30px var(--cinzel);
	letter-spacing: .04em;
	outline: none;
	width: 100%;
}
.title-input:focus { border-color: var(--gold); }
.article-form__meta { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; font-size: 16px; }
.inline-field { display: flex; gap: 10px; align-items: center; }
.inline-field input { width: 120px; padding: 8px 10px; font-size: 15px; }
.check { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.check input { accent-color: var(--gold); width: 16px; height: 16px; margin: 0; }
.article-form__actions { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.article-form__main-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.article-form__main-actions .btn--primary { padding: 12px 22px; }

.editor { border: 1px solid var(--line-strong); }
.editor > textarea { display: block; width: 100%; background: var(--bg); border: 0; padding: 20px 22px; font: 300 18px/1.6 var(--spectral); resize: vertical; outline: none; }

/* TinyMCE 4 (skin lightgray) recoloré aux couleurs de l'admin */
.editor .mce-tinymce, .editor .mce-panel { background: var(--surface) !important; border: 0 !important; box-shadow: none !important; }
.editor .mce-top-part::before { box-shadow: none !important; }
.editor .mce-toolbar-grp { border-bottom: 1px solid var(--line-strong) !important; padding: 4px !important; }
.editor .mce-edit-area { border: 0 !important; }
.mce-btn, .mce-btn-group .mce-btn { background: transparent !important; border: 0 !important; box-shadow: none !important; border-radius: 0 !important; }
.mce-btn button { min-width: 32px; height: 32px; padding: 0 8px !important; }
.mce-btn:hover, .mce-btn.mce-active, .mce-btn:focus { background: var(--line) !important; }
.mce-btn .mce-ico, .mce-btn .mce-txt, .mce-caret { color: var(--muted) !important; border-top-color: var(--muted) !important; }
.mce-btn:hover .mce-ico, .mce-btn.mce-active .mce-ico, .mce-btn:hover .mce-txt { color: var(--ink) !important; }
.mce-btn .mce-txt { font-family: var(--spectral) !important; font-size: 14px !important; }
.mce-btn-group:not(:first-child) { border-left: 1px solid var(--line-strong) !important; }
.mce-window, .mce-menu, .mce-floatpanel { background: var(--surface) !important; border: 1px solid var(--line-strong) !important; border-radius: 0 !important; box-shadow: 0 8px 30px rgba(0, 0, 0, .4) !important; }
.mce-window-head { background: var(--surface) !important; border-bottom: 1px solid var(--line) !important; }
.mce-window .mce-title, .mce-window .mce-label, .mce-menu-item .mce-text, .mce-window .mce-close { color: var(--ink) !important; font-family: var(--spectral) !important; text-shadow: none !important; }
.mce-window .mce-title { font-family: var(--cinzel) !important; letter-spacing: .08em; }
.mce-window .mce-foot { background: var(--surface) !important; border-top: 1px solid var(--line) !important; }
.mce-window .mce-textbox, .mce-window .mce-listbox, .mce-window .mce-combobox input { background: var(--bg) !important; border: 1px solid var(--line-strong) !important; color: var(--ink) !important; border-radius: 0 !important; box-shadow: none !important; }
.mce-window .mce-listbox .mce-txt { color: var(--ink) !important; }
.mce-window .mce-btn { border: 1px solid var(--line-strong) !important; }
.mce-window .mce-btn.mce-primary { background: var(--gold) !important; border-color: var(--gold) !important; }
.mce-window .mce-btn.mce-primary .mce-txt { color: var(--bg) !important; font-weight: 600; }
.mce-menu-item:hover, .mce-menu-item.mce-selected, .mce-menu-item:focus { background: var(--line) !important; }
.mce-menu-item:hover .mce-text, .mce-menu-item.mce-selected .mce-text { color: var(--gold) !important; }
.mce-container, .mce-container *, .mce-widget, .mce-widget * { color: inherit; }
#mce-modal-block.mce-in { background: var(--overlay) !important; opacity: 1 !important; }

/* ---------- Toast ---------- */

.toast {
	position: fixed;
	bottom: 28px;
	left: 50%;
	transform: translateX(-50%);
	background: var(--ink);
	color: var(--bg);
	padding: 12px 20px;
	font: 15px var(--spectral);
	z-index: 60;
	box-shadow: 0 8px 30px rgba(0, 0, 0, .4);
	max-width: calc(100vw - 32px);
}

/* ---------- Petits écrans ---------- */

@media (max-width: 1000px) {
	.album-screen { grid-template-columns: minmax(0, 1fr); }
	.album-screen__aside { position: static; height: auto; border-left: 0; border-top: 1px solid var(--line); order: -1; }
	.panel { min-height: 0; }
}

@media (max-width: 760px) {
	.shell { grid-template-columns: minmax(0, 1fr); }
	.shell__side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 16px 24px; padding: 16px; border-right: 0; border-bottom: 1px solid var(--line); }
	.side-brand { flex-direction: row; align-items: center; }
	.side-brand img { width: 36px; }
	.side-brand .eyebrow, .side-stats { display: none; }
	.side-nav { flex-direction: row; gap: 8px; }
	.side-nav a { margin: 0; gap: 10px; }
	.side-foot { margin: 0 0 0 auto; flex-direction: row; flex-wrap: wrap; gap: 6px 16px; align-items: center; }
	.side-foot__version { display: none; }
	.page { padding: 24px 16px 60px; }
	.album-row { grid-template-columns: 56px minmax(0, 1fr) auto 12px; gap: 12px; }
	.album-row__cover { width: 56px; height: 42px; }
	.album-row__count { display: none; }
	.article-row { grid-template-columns: minmax(0, 1fr) 70px 20px; }
	.article-row__date, .article-row__flag + .article-row__flag { display: none; }
	.album-screen__main { padding: 24px 16px 60px; }
	.title-input { font-size: 24px; }
}
