/* GMS Boxen-Layout: Kachel-Raster und Bearbeitungsmodus */

/* Breite im Raster (gms-boxes.js begrenzt auf die Spaltenzahl) */
.boxContainer > [data-box-identifier] {
	grid-column: span var(--gms-span, 1);
}

/* Kacheln gleich hoch: Box fuellt ihre Zelle */
.boxesTop > .boxContainer > .box,
.boxesContentTop > .boxContainer > .box,
.boxesContentBottom > .boxContainer > .box,
.boxesBottom > .boxContainer > .box,
.boxesFooterBoxes .boxContainer > .box {
	display: flex;
	flex-direction: column;
}

.boxesTop > .boxContainer > .box > .boxContent,
.boxesContentTop > .boxContainer > .box > .boxContent,
.boxesContentBottom > .boxContainer > .box > .boxContent,
.boxesBottom > .boxContainer > .box > .boxContent,
.boxesFooterBoxes .boxContainer > .box > .boxContent {
	flex: 1 1 auto;
}

/* ---- Bearbeitungsmodus ---- */
.gmsBoxDrop {
	display: none;
}

.gmsBoxEditing .gmsBoxDrop {
	display: flex;
	grid-column: 1 / -1;
	align-items: center;
	justify-content: center;
	min-height: 56px;
	border: 2px dashed var(--wcfContentBorderInner);
	border-radius: 8px;
	color: var(--wcfContentDimmedText);
	font-size: var(--wcfFontSizeSmall);
}

.gmsBoxEditing .gmsBoxDrop::before {
	content: attr(data-gms-label);
}

.gmsBoxEditing .boxContainer {
	min-height: 60px;
	outline: 1px dashed rgba(127, 127, 127, .35);
	outline-offset: 4px;
}

.gmsBoxEditing .boxContainer.gmsBoxTarget {
	outline: 2px solid var(--wcfContentLink);
}

.gmsBoxEditable {
	position: relative;
	outline: 2px solid transparent;
	transition: outline-color .15s;
}

.gmsBoxEditable:hover {
	outline-color: var(--wcfContentLink);
}

.gmsBoxEditable.gmsBoxIsHidden {
	opacity: .4;
}

.gmsBoxEditable.gmsBoxIsHidden::after {
	content: attr(data-gms-hidden-label);
	position: absolute;
	top: 8px;
	left: 8px;
	padding: 2px 8px;
	border-radius: 4px;
	background: #b3261e;
	color: #fff;
	font-size: 12px;
	font-weight: 600;
}

.gmsBoxTools {
	position: absolute;
	z-index: 20;
	top: 6px;
	right: 6px;
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 4px;
	border-radius: 6px;
	background: rgba(15, 15, 20, .88);
	color: #fff;
	box-shadow: 0 2px 10px rgba(0, 0, 0, .35);
	font-size: 12px;
}

.gmsBoxTools button,
.gmsBoxTools select {
	min-width: 32px;
	height: 32px;
	padding: 0 8px;
	border: 1px solid rgba(255, 255, 255, .25);
	border-radius: 4px;
	background: transparent;
	color: inherit;
	font: inherit;
	cursor: pointer;
}

.gmsBoxTools select option {
	color: #000;
}

.gmsBoxTools button:hover,
.gmsBoxTools button:focus-visible,
.gmsBoxTools button[aria-pressed="true"] {
	border-color: #fff;
	background: rgba(255, 255, 255, .15);
}

.gmsBoxTools .gmsBoxHandle {
	cursor: grab;
	touch-action: none;
}

.gmsBoxTools .gmsBoxLockInfo {
	padding: 0 6px;
}

.gmsBoxPlaceholder {
	min-height: 60px;
	border: 2px dashed var(--wcfContentLink);
	border-radius: 8px;
	background: rgba(127, 127, 127, .08);
}

.gmsBoxGhost {
	position: fixed;
	z-index: 1000;
	max-width: 360px;
	max-height: 240px;
	overflow: hidden;
	opacity: .85;
	pointer-events: none;
	box-shadow: 0 8px 30px rgba(0, 0, 0, .45);
	transform: rotate(1.5deg);
}

body.gmsBoxDragging,
body.gmsBoxDragging * {
	cursor: grabbing !important;
	user-select: none;
}

/* Leiste unten */
.gmsBoxBar {
	position: fixed;
	z-index: 900;
	right: 16px;
	bottom: 16px;
	left: 16px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	max-width: 1100px;
	margin: 0 auto;
	padding: 12px 16px;
	border-radius: 10px;
	background: rgba(15, 15, 20, .94);
	color: #fff;
	box-shadow: 0 6px 30px rgba(0, 0, 0, .5);
}

.gmsBoxBar p {
	flex: 1 1 280px;
	margin: 0;
	font-size: 13px;
}

.gmsBoxBar .button {
	min-height: 40px;
}

.gmsBoxEditing {
	padding-bottom: 110px;
}

/* Knopf "Boxen anordnen" */
.gmsBoxLauncher {
	position: fixed;
	z-index: 800;
	bottom: 16px;
	left: 16px;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
}

.gmsBoxLauncher button {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 40px;
	padding: 0 14px;
	border: 1px solid rgba(255, 255, 255, .2);
	border-radius: 20px;
	background: rgba(15, 15, 20, .85);
	color: #fff;
	box-shadow: 0 3px 12px rgba(0, 0, 0, .35);
	font-size: 13px;
	cursor: pointer;
	opacity: .75;
}

.gmsBoxLauncher button:hover,
.gmsBoxLauncher button:focus-visible {
	opacity: 1;
}

.gmsBoxLauncherMenu {
	display: none;
	flex-direction: column;
	gap: 6px;
}

.gmsBoxLauncher.open .gmsBoxLauncherMenu {
	display: flex;
}

@media print {
	.gmsBoxLauncher,
	.gmsBoxBar {
		display: none !important;
	}
}
