/* ==========================================================
   WeddingPart — Moodboard v2 : onglets + planche libre
   Mobile d'abord. Les éléments sont dessinés en unités de
   planche (1080 de large) puis mis à l'échelle.
   ========================================================== */

/* ── Onglets ───────────────────────────────────────────────── */
.idd-mb-tabs {
	display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px;
	padding: 4px; margin: 0 0 12px;
	background: var(--wp-surface-2, #FAF5F3); border: 1px solid var(--wp-line, #EDE0E4); border-radius: 14px;
}
.idd-mb-tab {
	min-height: 44px; padding: 0 8px; border: 0; border-radius: 10px; background: transparent;
	color: var(--wp-muted, #7A6A6F); font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.idd-mb-tab.is-on { background: #fff; color: var(--wp-brand, #9E4D64); box-shadow: 0 4px 14px -8px rgba(29,24,25,.35); }
.idd-mb-panel[hidden] { display: none !important; }
/* L'app-shell plafonne la hauteur de tout élément dont la classe contient « board » / « canvas » / « plan ». */
.idd-mb .mbx-board, .idd-mb .idd-mb__section--board, .idd-mb .mbx-stage { max-height: none !important; }
.idd-mb__section--board { padding: 0 !important; background: transparent !important; border: 0 !important; box-shadow: none !important; }

/* ── Planche ───────────────────────────────────────────────── */
.mbx { position: relative; --mbx-bottom: 0px; }
.mbx * { box-sizing: border-box; }
.mbx-stage {
	position: relative; overflow: hidden; border-radius: 16px;
	background:
		radial-gradient(circle, rgba(0,0,0,.05) 1px, transparent 1px) 0 0 / 18px 18px,
		var(--wp-surface-2, #f3eeec);
	user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
	touch-action: pan-y;
}
.mbx-stage.has-sel { touch-action: none; }
.mbx-board {
	position: absolute; left: 0; top: 0; transform-origin: 0 0;
	box-shadow: 0 18px 44px -22px rgba(29,24,25,.45), 0 1px 3px rgba(29,24,25,.1);
	overflow: hidden; contain: layout paint;
}
.mbx-it { position: absolute; transform-origin: 50% 50%; touch-action: none; cursor: grab; }
.mbx-it:active { cursor: grabbing; }
.mbx-it--img img { display: block; width: 100%; height: 100%; pointer-events: none; }
.mbx-it--img.is-polaroid, .mbx-it--img.is-border { background: #fff; }
.mbx-it--img.is-polaroid { padding: 6% 6% 20%; }
.mbx-it--img.is-border { padding: 3.5%; }
.mbx-it--img.has-shadow { box-shadow: 0 12px 30px rgba(0,0,0,.25); }
.mbx-it--img.has-shadow:not(.is-polaroid):not(.is-border) { background: #fff; }
.mbx-ph {
	width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
	background: repeating-linear-gradient(45deg, rgba(158,77,100,.06) 0 14px, rgba(158,77,100,.1) 14px 28px);
	border: 4px dashed rgba(158,77,100,.45); color: #9E4D64; font: 600 30px/1.2 'Lato', sans-serif; text-align: center; padding: 12px;
}
.mbx-it--txt { white-space: pre-wrap; overflow-wrap: break-word; word-break: normal; }
.mbx-it--ico svg { display: block; width: 100%; height: 100%; }
.mbx-it--sw { display: flex; flex-direction: column; align-items: center; }
.mbx-sw__dot { display: block; width: 100%; aspect-ratio: 1; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(0,0,0,.08); }
.mbx-it--sw.is-square .mbx-sw__dot { border-radius: 8%; }
.mbx-it--sw em { margin-top: 8%; font-style: normal; font-family: 'Lato', Arial, sans-serif; color: #5c5054; white-space: nowrap; text-align: center; }

/* Cadre de sélection, poignées, guides (en pixels d'écran) */
.mbx-overlay { position: absolute; inset: 0; pointer-events: none; }
.mbx-sel { position: absolute; border: 2px solid #4f7cff; border-radius: 2px; transform-origin: 50% 50%; pointer-events: none; }
.mbx-sel.is-locked { border-style: dashed; }
.mbx-h {
	position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%;
	background: #fff; border: 2px solid #4f7cff; box-shadow: 0 1px 4px rgba(0,0,0,.25); pointer-events: auto; touch-action: none;
}
.mbx-h::after { content: ''; position: absolute; inset: -14px; } /* zone tactile plus grande */
.mbx-h--nw { left: 0; top: 0; cursor: nwse-resize; } .mbx-h--se { left: 100%; top: 100%; cursor: nwse-resize; }
.mbx-h--ne { left: 100%; top: 0; cursor: nesw-resize; } .mbx-h--sw { left: 0; top: 100%; cursor: nesw-resize; }
.mbx-h--n { left: 50%; top: 0; cursor: ns-resize; } .mbx-h--s { left: 50%; top: 100%; cursor: ns-resize; }
.mbx-h--e { left: 100%; top: 50%; cursor: ew-resize; } .mbx-h--w { left: 0; top: 50%; cursor: ew-resize; }
.mbx-h--n, .mbx-h--s { width: 22px; height: 10px; margin: -5px 0 0 -11px; border-radius: 5px; }
.mbx-h--e, .mbx-h--w { width: 10px; height: 22px; margin: -11px 0 0 -5px; border-radius: 5px; }
.mbx-rot {
	position: absolute; left: 50%; top: 100%; width: 30px; height: 30px; margin: 14px 0 0 -15px;
	display: flex; align-items: center; justify-content: center; border-radius: 50%;
	background: #fff; color: #1d1819; box-shadow: 0 2px 8px rgba(0,0,0,.25); pointer-events: auto; cursor: grab; touch-action: none;
}
.mbx-rot::after { content: ''; position: absolute; inset: -10px; }
.mbx-guide { position: absolute; background: #e5468f; pointer-events: none; }
.mbx-guide--v { width: 1px; }
.mbx-guide--h { height: 1px; }
.mbx-drop {
	position: absolute; inset: 0; z-index: 3; display: flex; align-items: center; justify-content: center;
	background: rgba(158,77,100,.12); border: 3px dashed #9E4D64; border-radius: 16px; color: #9E4D64; font-weight: 700;
}
.mbx-drop[hidden] { display: none; }
.mbx-drop span { display: flex; flex-direction: column; align-items: center; gap: 8px; }

/* Planche vide : invitation à commencer */
.mbx.is-empty .mbx-board::after {
	content: 'Touche « Ajouter » ou « Modèles » pour commencer ta planche';
	position: absolute; left: 10%; right: 10%; top: 44%; text-align: center;
	font: 400 44px/1.3 'Cormorant Garamond', Georgia, serif; color: rgba(43,34,36,.45);
}

/* ── Barre d'actions de la planche ─────────────────────────── */
.mbx-bar {
	display: flex; align-items: center; gap: 4px; overflow-x: auto; scrollbar-width: none;
	padding: 6px; margin: 0 0 10px; background: #fff; border: 1px solid var(--wp-line, #EDE0E4); border-radius: 14px;
}
.mbx-bar::-webkit-scrollbar { display: none; }
.mbx-bar__sep { flex: 1 0 8px; }
.mbx-btn {
	flex: none; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
	min-width: 58px; min-height: 52px; padding: 4px 8px; border: 0; border-radius: 10px; background: transparent;
	color: var(--wp-ink, #1D1819); font-family: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.mbx-btn:hover { background: var(--wp-surface-2, #FAF5F3); }
.mbx-btn:disabled { opacity: .35; cursor: default; background: transparent; }
.mbx-btn--icon { min-width: 44px; }
.mbx-btn--primary { background: var(--wp-brand, #9E4D64); color: #fff; }
.mbx-btn--primary:hover { background: var(--wp-brand-dark, #853F55); }
.mbx-btn--done { background: #1d1819; color: #fff; }
.mbx-btn--done:hover { background: #000; }
.mbx-btn--danger { color: #b42318; }
.mbx-btn--full { width: 100%; flex-direction: row; gap: 8px; min-height: 48px; margin-top: 12px; font-size: 15px; }

/* ── Panneau (ajout, couleurs, police…) ───────────────────── */
.mbx-sheet {
	position: fixed; left: 0; right: 0; bottom: var(--mbx-bottom, 0px); z-index: 1001;
	max-height: min(62vh, 560px); display: flex; flex-direction: column;
	background: #fff; border-radius: 20px 20px 0 0; box-shadow: 0 -16px 40px -16px rgba(0,0,0,.35);
	animation: mbx-up .18s ease-out;
}
.mbx-sheet[hidden] { display: none; }
@keyframes mbx-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.mbx-sheet__head { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 6px 18px; font-size: 16px; }
.mbx-sheet__body { flex: 1 1 auto; overflow-y: auto; padding: 4px 16px 18px; overscroll-behavior: contain; }
.mbx-icon { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: var(--wp-surface-2, #FAF5F3); color: var(--wp-ink, #1D1819); cursor: pointer; }
.mbx-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 0 12px; }
.mbx-tab { flex: none; min-height: 38px; padding: 0 14px; border: 1px solid var(--wp-line, #EDE0E4); border-radius: 999px; background: #fff; font-family: inherit; font-size: 13.5px; font-weight: 600; color: var(--wp-muted, #7A6A6F); cursor: pointer; }
.mbx-tab.is-on { border-color: var(--wp-brand, #9E4D64); background: var(--wp-brand, #9E4D64); color: #fff; }
.mbx-label { margin: 14px 0 8px; font-size: 12.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--wp-muted, #7A6A6F); }
.mbx-hint { margin: 8px 0; font-size: 13px; line-height: 1.45; color: var(--wp-muted, #7A6A6F); }
.mbx-big {
	display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px; margin: 0 0 10px;
	border: 1px solid var(--wp-line, #EDE0E4); border-radius: 14px; background: #fff; text-align: left; cursor: pointer; font-family: inherit; color: var(--wp-ink, #1D1819);
}
.mbx-big:hover { border-color: var(--wp-brand, #9E4D64); }
.mbx-big svg { flex: none; color: var(--wp-brand, #9E4D64); }
.mbx-big span { display: flex; flex-direction: column; gap: 2px; }
.mbx-big strong { font-size: 15px; }
.mbx-big small { font-size: 12.5px; color: var(--wp-muted, #7A6A6F); }
.mbx-presets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mbx-preset {
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 84px; padding: 8px;
	border: 1px solid var(--wp-line, #EDE0E4); border-radius: 12px; background: #fff; cursor: pointer; overflow: hidden;
}
.mbx-preset span { font-size: 22px; line-height: 1.15; color: #2b2224; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mbx-preset small { font-family: 'DM Sans', system-ui, sans-serif; font-size: 11.5px; font-weight: 600; color: var(--wp-muted, #7A6A6F); }
.mbx-preset:hover, .mbx-ico:hover { border-color: var(--wp-brand, #9E4D64); }
.mbx-icons, .mbx-shapes { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 8px; }
.mbx-ico {
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; aspect-ratio: 1;
	border: 1px solid var(--wp-line, #EDE0E4); border-radius: 12px; background: #fff; color: #5c3a44; cursor: pointer; font-family: inherit;
}
.mbx-shapes .mbx-ico { aspect-ratio: auto; min-height: 72px; }
.mbx-ico small { font-size: 11px; color: var(--wp-muted, #7A6A6F); }
.mbx-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.mbx-chip {
	position: relative; width: 40px; height: 40px; border-radius: 50%; border: 2px solid #fff; background: var(--c, #ccc);
	box-shadow: 0 0 0 1px rgba(0,0,0,.14); cursor: pointer; padding: 0;
}
.mbx-chip.is-on { box-shadow: 0 0 0 2px var(--wp-brand, #9E4D64); }
.mbx-chip--pick { display: inline-flex; align-items: center; justify-content: center; background: conic-gradient(#f87171, #fbbf24, #34d399, #60a5fa, #a78bfa, #f472b6, #f87171); color: #fff; overflow: hidden; }
.mbx-chip--pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.mbx-fonts { display: grid; gap: 8px; }
.mbx-font {
	display: flex; align-items: baseline; justify-content: space-between; gap: 10px; width: 100%; min-height: 54px; padding: 8px 14px;
	border: 1px solid var(--wp-line, #EDE0E4); border-radius: 12px; background: #fff; cursor: pointer; text-align: left;
}
.mbx-font span { font-size: 24px; color: #2b2224; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mbx-font small { flex: none; font-family: 'DM Sans', system-ui, sans-serif; font-size: 12px; color: var(--wp-muted, #7A6A6F); }
.mbx-font.is-on, .mbx-toggle.is-on, .mbx-format.is-on, .mbx-tpl:hover { border-color: var(--wp-brand, #9E4D64); background: rgba(158,77,100,.06); }
.mbx-toggles { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 6px; }
.mbx-toggle { min-height: 42px; padding: 0 14px; border: 1px solid var(--wp-line, #EDE0E4); border-radius: 10px; background: #fff; font-family: inherit; font-size: 14px; cursor: pointer; color: var(--wp-ink, #1D1819); }
.mbx-range { display: flex; flex-direction: column; gap: 4px; margin: 12px 0 0; font-size: 13px; font-weight: 600; color: var(--wp-muted, #7A6A6F); }
.mbx-range input { width: 100%; accent-color: var(--wp-brand, #9E4D64); min-height: 32px; }
.mbx-textarea, .mbx-input {
	width: 100%; padding: 12px 14px; border: 1px solid #DECFD5; border-radius: 12px; font-family: inherit; font-size: 16px; line-height: 1.4; color: #1D1819; background: #fff; resize: vertical;
}
.mbx-formats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.mbx-format { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; min-height: 86px; padding: 8px 4px; border: 1px solid var(--wp-line, #EDE0E4); border-radius: 12px; background: #fff; cursor: pointer; font-family: inherit; font-size: 12.5px; font-weight: 600; }
.mbx-format i { display: block; border: 2px solid currentColor; border-radius: 3px; color: var(--wp-brand, #9E4D64); }
.mbx-tpls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mbx-tpl { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px; border: 1px solid var(--wp-line, #EDE0E4); border-radius: 14px; background: #fff; cursor: pointer; font-family: inherit; text-align: center; }
.mbx-tpl strong { font-size: 14px; color: var(--wp-ink, #1D1819); }
.mbx-tpl small { font-size: 11.5px; color: var(--wp-muted, #7A6A6F); line-height: 1.3; }
.mbx-tpl__prev { position: relative; display: block; overflow: hidden; border-radius: 4px; box-shadow: 0 2px 10px -4px rgba(0,0,0,.3); margin-bottom: 6px; }
.mbx-tpl__prev i { position: absolute; display: block; }
.mbx-tpl__prev i.is-img { background: #d9cfd2; }
.mbx-tpl__prev i.is-img.is-frame { background: #d9cfd2; box-shadow: 0 0 0 2px #fff, 0 2px 4px rgba(0,0,0,.2); }
.mbx-tpl__prev i.is-txt { height: 3px !important; opacity: .6; border-radius: 2px; margin-top: 3px; }

/* ── Téléphone : barre d'actions en bas, au-dessus de la barre d'outils ── */
@media (max-width: 719.98px) {
	.mbx-bar {
		position: fixed; left: 8px; right: 8px; bottom: calc(var(--mbx-bottom, 0px) + 6px); z-index: 1000; margin: 0;
		box-shadow: 0 10px 30px -12px rgba(0,0,0,.35);
	}
	.mbx { padding-bottom: 76px; }
	.mbx-bar [data-mbx-act="add"] { display: none; } /* déjà dans la barre d'outils du bas */
	.mbx.has-sheet .mbx-bar { visibility: hidden; }
	.idd-mb-tabs { position: sticky; top: calc(var(--app-header-h, 60px) + 4px); z-index: 20; }
	.idd-mb-tab { font-size: 13px; }
	.idd-mb .idd-mb__zones { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 12px !important; }
}

/* ── Ordinateur : panneau ancré à gauche de la planche ── */
@media (min-width: 720px) {
	.mbx-sheet {
		position: absolute; left: 12px; right: auto; top: 76px; bottom: auto; width: 340px; max-height: calc(100% - 88px);
		border-radius: 18px; box-shadow: 0 20px 50px -18px rgba(0,0,0,.35);
	}
	.mbx-btn { min-width: 64px; }
}

/* ── Ordinateur, pleine largeur : la page défile sous la planche ──
   La barre d'actions reste en haut de l'écran, le panneau se pose juste dessous,
   « Tout voir » n'apparaît que si la planche dépasse la hauteur de l'écran. */
.mbx:not([data-mbx-view-toggle]) .mbx-bar [data-mbx-act="view"] { display: none; }
@media (min-width: 1024px) {
	.mbx[data-mbx-view="largeur"] .mbx-bar {
		position: sticky; top: calc(var(--app-header-h, 60px) + var(--app-adminbar-h, 0px) + 8px); z-index: 30;
		box-shadow: 0 12px 28px -20px rgba(29,24,25,.5);
	}
	.mbx[data-mbx-view="largeur"] .mbx-sheet {
		position: fixed; top: var(--mbx-sheet-top, 150px); left: var(--mbx-sheet-left, 12px);
		max-height: calc(100vh - var(--mbx-sheet-top, 150px) - var(--mbx-bottom, 0px) - 16px);
	}
}

/* ── Lecture seule (lien public) ───────────────────────────── */
.idd-mbb { position: relative; width: 100%; overflow: hidden; container-type: inline-size; border-radius: 12px; box-shadow: 0 18px 44px -22px rgba(29,24,25,.45); }
.idd-mbb__it { position: absolute; transform-origin: 50% 50%; }
.idd-mbb__it svg { display: block; width: 100%; height: 100%; }
.idd-mbb__img img { display: block; width: 100%; height: 100%; }
.idd-mbb__img.is-polaroid, .idd-mbb__img.is-border { background: #fff; }
.idd-mbb__img.is-polaroid { padding: 6% 6% 20%; }
.idd-mbb__img.is-border { padding: 3.5%; }
.idd-mbb__img.has-shadow { box-shadow: 0 1.1cqw 2.8cqw rgba(0,0,0,.25); }
.idd-mbb__txt { white-space: pre-wrap; overflow-wrap: break-word; }
.idd-mbb__sw { display: flex; flex-direction: column; align-items: center; }
.idd-mbb__sw span { display: block; width: 100%; aspect-ratio: 1; border-radius: 50%; box-shadow: inset 0 0 0 .2cqw rgba(0,0,0,.08); }
.idd-mbb__sw.is-square span { border-radius: 8%; }
.idd-mbb__sw em { margin-top: 8%; font-style: normal; font-family: 'Lato', Arial, sans-serif; color: #5c5054; white-space: nowrap; }

/* ── Zoom de la planche (octobre 2026) : − / 100 % / +, Ctrl + molette, pincer ; glisser le fond pour se déplacer ── */
.mbx-zoom { flex: none; display: inline-flex; align-items: center; gap: 2px; margin-left: 4px; padding: 2px; border-radius: 12px; background: var(--wp-surface-2, #FAF5F3); }
.mbx-zoom .mbx-btn--icon { min-width: 40px; min-height: 44px; }
.mbx-zoom__val { min-width: 58px; min-height: 40px; padding: 0 6px; border: 0; border-radius: 9px; background: #fff; color: var(--wp-ink, #1D1819); font: 700 13px/1 'DM Sans', system-ui, sans-serif; font-variant-numeric: tabular-nums; cursor: pointer; }
.mbx-zoom__val:hover { background: var(--wp-brand-soft, #F7E7EC); }
.mbx.is-zoomed .mbx-stage, .mbx.is-pannable .mbx-stage { touch-action: none; cursor: grab; }
.mbx.is-panning .mbx-stage { cursor: grabbing; }
