/* =========================================================
   IDD Moodboard — Canvas (drag/drop/resize)
   ========================================================= */

.idd-mb__canvas-wrap {
	position: relative;
	border-radius: var(--mb-radius-sm);
	overflow: hidden;
	border: 1px solid var(--mb-line);
	background: linear-gradient(135deg, var(--mb-surface-2) 0%, var(--mb-surface) 100%);
}

.idd-mb__canvas {
	position: relative;
	width: 100%;
	min-height: 540px;
	height: 60vh;
	max-height: 760px;
	overflow: hidden;
	outline: none;
}
.idd-mb__canvas.is-dropping {
	background: var(--mb-brand-soft);
	box-shadow: inset 0 0 0 3px var(--mb-brand-border);
}

.idd-mb__canvas-empty {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	color: var(--mb-muted);
	pointer-events: none;
	text-align: center;
	padding: 20px;
}
.idd-mb__canvas-empty .dashicons {
	font-size: 56px;
	width: 56px;
	height: 56px;
	color: var(--mb-line-strong);
	margin-bottom: 12px;
}
.idd-mb__canvas-empty p {
	font-family: var(--mb-font-serif);
	font-size: 1.3rem;
	color: var(--mb-muted);
	margin: 0;
}
.idd-mb__canvas.has-items .idd-mb__canvas-empty { display: none; }

/* Items du canvas */
.idd-mb__item {
	position: absolute;
	border-radius: var(--radius-xs, 8px);
	overflow: hidden;
	background: #fff;
	box-shadow: var(--mb-shadow-sm);
	cursor: grab;
	user-select: none;
	transition: box-shadow var(--duration, 180ms) var(--ease, ease);
	will-change: transform;
}
.idd-mb__item:hover { box-shadow: var(--mb-shadow); }
.idd-mb__item.is-selected {
	box-shadow: 0 0 0 2px var(--mb-brand), var(--mb-shadow);
}
.idd-mb__item.is-dragging {
	cursor: grabbing;
	z-index: 999;
}
.idd-mb__item img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	pointer-events: none;
}

/* Toolbar item (visible quand selected) */
.idd-mb__item-toolbar {
	position: absolute;
	top: -42px;
	left: 50%;
	transform: translateX(-50%);
	display: none;
	gap: 4px;
	padding: 6px;
	background: var(--mb-surface);
	border-radius: var(--radius-full, 999px);
	box-shadow: var(--mb-shadow);
	border: 1px solid var(--mb-line);
}
.idd-mb__item.is-selected .idd-mb__item-toolbar { display: flex; }
.idd-mb__item-toolbar button {
	background: transparent;
	border: 0;
	cursor: pointer;
	width: 32px; height: 32px;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--mb-soft);
	transition: background var(--duration, 180ms) var(--ease, ease), color var(--duration, 180ms) var(--ease, ease);
}
.idd-mb__item-toolbar button:hover {
	background: var(--mb-brand-soft);
	color: var(--mb-brand);
}
.idd-mb__item-toolbar button[data-action="delete"]:hover {
	background: rgba(156,22,87,.08);
	color: var(--mb-prune);
}
.idd-mb__item-toolbar .dashicons { font-size: 16px; width: 16px; height: 16px; }

/* Resize handles */
.idd-mb__resize {
	position: absolute;
	width: 14px; height: 14px;
	background: var(--mb-surface);
	border: 2px solid var(--mb-brand);
	border-radius: 50%;
	display: none;
	z-index: 2;
}
.idd-mb__item.is-selected .idd-mb__resize { display: block; }
.idd-mb__resize[data-handle="se"] { right: -7px; bottom: -7px; cursor: nwse-resize; }
.idd-mb__resize[data-handle="ne"] { right: -7px; top: -7px; cursor: nesw-resize; }
.idd-mb__resize[data-handle="sw"] { left: -7px; bottom: -7px; cursor: nesw-resize; }
.idd-mb__resize[data-handle="nw"] { left: -7px; top: -7px; cursor: nwse-resize; }
.idd-mb__rotate {
	position: absolute;
	top: -28px;
	right: -10px;
	width: 24px; height: 24px;
	background: var(--mb-surface);
	border: 2px solid var(--mb-brand);
	border-radius: 50%;
	display: none;
	align-items: center;
	justify-content: center;
	cursor: grab;
}
.idd-mb__item.is-selected .idd-mb__rotate { display: flex; }
.idd-mb__rotate::after {
	content: "↻";
	font-size: 14px;
	color: var(--mb-brand);
	font-weight: 700;
}
