﻿/* === Container Styles === */
.webpageditor {
}

.wpe-grid h4 {
	margin-top: 0px;
	margin-bottom: 2px;
	font-weight: 400;
	font-size: 0.9em;
}

/* === Row Styles === */
.wpe-row {
	width: calc(100% - 20px);
	min-height: 60px;
	background-color: #fff;
	border: 2px solid transparent;
	margin-bottom: 8px;
	padding: 4px;
	display: flex;
	filter: brightness(1);
	flex-direction: column;
	border-bottom: solid 1px #ddd;
	transition: filter 0.3s ease, border-color 0.3s ease;
}

	.wpe-row.light-grey {
		background-color: #f8f8f8;
	}

	.wpe-row.medium-grey {
		background-color: #d8d8d8;
	}

	.wpe-row.dark-grey {
		background-color: #444;
		color: #fff;
	}

	.wpe-row.light-blue {
		background-color: #E8EFF6;
	}

	.wpe-row.medium-blue {
		background-color: #BACFE6;
	}

	.wpe-row.dark-blue {
		background-color: #8CAFD6;
		color: #fff;
	}

	.wpe-row:hover {
		filter: brightness(0.97);
		cursor: pointer;
	}

.wpe-row-inner {
	width: 100%;
	margin: 0 auto;
	box-sizing: border-box;
}

/* Selected outline */
.wpe-row.selected {
	border: solid 2px #ccc;
	border-radius: 8px;
}

/* Row being dragged */
.wpe-row.dragging {
	border-color: #ff5722 !important;
	background-color: #ffe0b2;
	opacity: 1; /* Keep full opacity for visibility */
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
	transform: scale(1);
	z-index: 1000;
	position: relative;
}

/* Drag over target */
.wpe-row.drag-over {
	border-color: #28a745;
	background-color: #d4edda;
}

/* === Columns Container === */
.wpe-columns {
	display: flex;
	flex-wrap: nowrap;
	gap: 5px;
}

.wpe-column {
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
	min-width: 200px;
	padding: 5px;
}

	/* Flow-mode column: horizontal packing */
	.wpe-column.wpe-column--flow {
		flex-direction: row;
		flex-wrap: wrap;
		align-items: flex-start;
		gap: 12px;
	}

	/* Stack-mode column */
	.wpe-column.wpe-column--stack {
		flex-direction: column;
	}

	/* In flow mode, full-width items take a whole row */
	.wpe-column.wpe-column--flow > .wpe-item--full {
		flex: 0 0 100%;
		max-width: 100%;
	}

	/* In flow mode, fixed/auto items keep intrinsic size */
	.wpe-column.wpe-column--flow > .wpe-item--fixed,
	.wpe-column.wpe-column--flow > .wpe-item--auto {
		flex: 0 0 auto;
		max-width: 100%;
	}

	.wpe-column.column-card {
		border: 1px solid rgba(0, 0, 0, 0.08);
	}

	.wpe-column.column-rounded {
		border-radius: 8px;
		overflow: hidden;
	}

	.wpe-column.column-shadow {
		box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
	}

/* default stack */
.wpe-col-items.stack .wpe-item {
	display: block;
	width: 100%;
}

/* flow mode */
.wpe-col-items.flow {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 20px;
}

	.wpe-col-items.flow .flip-card {
		margin-right: 0;
	}

	.wpe-col-items.flow .wpe-item {
		width: auto; /* important if you currently force 100% */
		flex: 0 0 auto; /* allow wrapping */
	}


	/* Column color helpers */
	.wpe-column.light-grey {
		background-color: #f8f8f8;
	}

	.wpe-column.medium-grey {
		background-color: #d8d8d8;
	}

	.wpe-column.dark-grey {
		background-color: #444;
		color: #fff;
	}

	.wpe-column.light-blue {
		background-color: #E8EFF6;
	}

	.wpe-column.medium-blue {
		background-color: #1675DE;
		color: #fff;
	}

	.wpe-column.dark-blue {
		background-color: #155CAC;
		color: #fff;
	}

	.wpe-column:hover {
		filter: brightness(0.97);
		cursor: pointer;
	}

	/* Selected outline */
	.wpe-column.selected {
		border: solid 2px #ccc;
		border-radius: 8px;
	}

	/* Column being dragged */
	.wpe-column.dragging {
		border-color: #ff5722 !important;
		background-color: #ffe0b2;
		opacity: 1;
		box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
		transform: scale(1);
		z-index: 1000;
		position: relative;
	}

	/* Drag over target */
	.wpe-column.drag-over {
		border-color: #28a745;
		background-color: #e8f5e9;
	}

/* === Clickable overlays === */
.wpe-row-click,
.wpe-col-click {
	display: block;
	width: 100%;
	height: 100%;
	text-decoration: none;
	cursor: pointer;
}

/* === Draggable cursor === */
.wpe-row[draggable="true"],
.wpe-column[draggable="true"] {
	cursor: move;
}

/* === Placeholder While Dragging === */
.wpe-row.drag-placeholder,
.wpe-column.drag-placeholder {
	border: 2px dashed #aaa;
	background-color: #f0f0f0;
}

/* === Item Styles === */
.wpe-item {
	/* IMPORTANT: do NOT force 100% width here, or fixed-width items can’t flow */
	/* width: calc(100% - 4px);  <-- removed */
	min-height: 25px;
	border: 2px solid transparent;
	padding: 0px;
	transition: filter 0.3s ease, border-color 0.3s ease;
	font-size: 0.9em;
	line-height: 1.3em;
	background-color: rgba(255,255,255,0);
	position: relative;
	box-sizing: border-box;
}

/* Default full items */
.wpe-item--full {
	width: calc(100% - 4px);
}

/* Fixed/auto should size to content/inline width */
.wpe-item--fixed,
.wpe-item--auto {
	width: auto;
}

/* Optional: in flow columns, make sure fixed/auto aren't overridden elsewhere */
.wpe-column.wpe-column--flow > .wpe-item--fixed,
.wpe-column.wpe-column--flow > .wpe-item--auto {
	width: auto;
}

/* Item label */
.wpe-item-label {
	position: absolute;
	top: 0;
	right: 0;
	background: rgba(25,25,25, 50);
	color: #fff;
	font-size: 1.0em;
	font-weight: 300;
	padding: 5px 10px;
	z-index: 50;
	border-radius: 4px;
	pointer-events: none;
}

.wpe-item-text {
	padding: 8px;
}

.wpe-item:hover {
	filter: brightness(0.9);
	cursor: pointer;
}

.wpe-item p, .wpe-item h1, .wpe-item h2, .wpe-item h3 {
	margin-top: 0px;
	line-height: 1.4em;
}

.wpe-item h1 {
	font-size: 1.7em;
	margin-bottom: 5px;
	font-weight: 400;
}

.wpe-item h2 {
	font-size: 1.5em;
	margin-bottom: 5px;
}

.wpe-item h3 {
	font-size: 1.3em;
	margin-bottom: 5px;
}

.wpe-item .af-caption-text h3 {
	font-size: 2.4rem;
}

/* Selected outline */
.wpe-item.selected {
	border-color: #00dd00 !important;
	border-radius: 8px;
	margin-left: -2px;
	margin-top: -2px;
	padding: 2px;
}

	.wpe-item.selected::before {
		content: "";
		position: absolute;
		inset: 0;
		background: rgba(0, 221, 0, 0.08);
		border-radius: 8px;
		pointer-events: none;
	}

.wpe-item.copy {
	border-color: #ff0000 !important;
}

.wpe-item img {
}

/* === Properties Table === */
.wpe-properties {
	border-collapse: separate;
	border-spacing: 0 6px;
}

.wpe-prop-label {
	min-width: 130px;
	text-align: left;
	padding: 12px 12px 6px 0px;
	font-weight: 400;
	vertical-align: top;
	white-space: nowrap;
}

.wpe-properties input {
	font-family: Jost;
}

.wpe-prop-input {
	padding: 6px 12px;
	vertical-align: middle;
	font-family: Jost;
}

.wpe-prop-text {
	width: 100%;
	box-sizing: border-box;
	padding: 4px;
}

.wpe-prop-select {
	padding: 4px 6px;
	font-size: 1.0em;
	border: 1px solid #ccc;
	border-radius: 4px;
	font-family: Jost;
}

.wpe-prop-multiselect {
	width: 100%;
	min-width: 200px;
	height: 122px;
	border: 1px solid #ccc;
	padding: 6px;
	box-sizing: border-box;
	font-size: 1.0em;
	overflow-y: scroll;
	background-color: #fff;
	font-family: Jost;
}

/* Editors */
.wpe-editor-background {
	position: fixed;
	z-index: 10000;
	top: 0px;
	left: 0px;
	background: url(/images/base/editor.png);
	width: 100%;
	height: 100%;
}

.wpe-editor {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	padding: 20px;
	padding-bottom:10px;
	width: 760px;
	max-width: calc(100% - 40px);
	max-height: calc(100vh - 80px); /* key change */
	overflow-y: auto; /* enable scrolling */
	overflow-x:hidden;
	background: #fff;
	border-radius: 10px;
}

	.wpe-editor .wpe-editor-column {
		display: inline-block;
		max-width: calc(50% - 25px);
		min-width: 100px;
		width: auto;
		margin-right: 20px;
		vertical-align: top;
		margin-bottom: 15px;
	}

	.wpe-editor h5 {
		margin-top: 0px;
		margin-bottom: 2px;
		font-weight: 400;
		font-size: 1.0em;
	}

	.wpe-editor h2 {
		background: #444;
		padding: 10px 20px;
		text-align: center;
		color: #fff;
		font-size: 1.4em;
		margin-left: -20px;
		margin-top: -20px;
		margin-bottom: 20px;
		width: 100%;
		border-top-left-radius: 10px;
		border-top-right-radius: 10px;
	}

.wpe-editor-buttons {
	padding: 15px 0px;
	text-align: right;
	background: #fff;
	margin-top:20px;
	flex-shrink: 0;
}

.wpe-button {
	margin-left: 10px;
	font-family: Jost;
	padding: 8px 20px;
	border: solid 1px #ccc;
	background: #f8f8f8;
	transition: 0.25s;
	font-size: 1.0em;
	border-radius: 4px;
}

	.wpe-button.close {
		opacity: 0.75;
	}

	.wpe-button:hover {
		background: #444;
		border: solid 1px #444;
		color: #fff;
		cursor: pointer;
	}

.wpe-photo {
	display: block;
	text-align: center;
	margin-bottom: 10px;
}

	.wpe-photo img {
		max-height: 200px;
		width: auto;
		height: auto;
	}

/* Dropzone */
.wpe-dropzone {
	border: 2px dashed #b5c6e0;
	background: #f7faff;
	padding: 24px;
	text-align: center;
	transition: border-color .15s, background-color .15s;
	margin-bottom: 20px;
	max-width: 1000px;
}

	.wpe-dropzone.drag-over {
		border-color: #3a86ff;
		background: #eef6ff;
	}

	.wpe-dropzone.uploading {
		opacity: .6;
		pointer-events: none;
	}

.wpe-dropzone-text {
	font-size: 1.0em;
	color: #444;
}

.wpe-dropzone-sub {
	font-size: 12px;
	color: #667;
	margin-top: 4px;
}

.wpe-upload-row {
	display: flex;
	gap: 10px;
	align-items: center;
}

.wpe-input {
	padding: 4px 10px;
	border: solid 1px #ccc;
	border-radius: 4px;
	font-family: Jost;
	font-size: 1.0em;
	max-width: calc(100% - 20px);
}

.box .wpe-input[type="text"] {
	padding: 5px 10px;
}

.wpe-title-row {
	margin-bottom: 20px;
}

.wpe-title-row-item {
	display: inline-block;
	vertical-align: top;
	margin-right: 0px;
}

	.wpe-title-row-item h4 {
		font-size: 0.9em;
		margin-top: 0px;
		margin-bottom: 2px;
	}

.wpe-input.title {
	max-width: 900px;
	width: auto;
}

.wpe-input.alert {
	border: solid 1px #ffa500;
	background: #FFF0D8;
}

.wpe-clear {
	clear: both;
	height: 20px;
}

.wpe-map-canvas {
	width: 100%;
	height: 420px;
	border: 1px solid #e1e6ef;
	background: #f7f9fc;
}

/* Grid */
.wpe-grid {
	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	gap: 10px;
	align-items: start;
}

@media (max-width: 800px) {
	.wpe-grid {
		grid-template-columns: 1fr;
	}
}

/* === Smooth transition === */
.wpe-row, .wpe-column, .wpe-item {
	transition: all 0.3s ease;
	position: relative;
}

	/* Links inside dark rows/columns/items */
	.wpe-row.dark a, .wpe-column.dark a {
		color: #fff;
		text-decoration: none;
		transition: color 0.2s ease;
	}

		.wpe-row.dark a:hover, .wpe-column.dark a:hover {
			color: #eee;
		}

	.wpe-row.dark h3, .wpe-column.dark h3 {
		color: #fff;
	}

.wpe-row-title {
	position: absolute;
	top: 0px;
	left: 0px;
	background: #444;
	color: #fff;
	padding: 4px 10px;
}

/* Fade the rest when dragging a row */
.webpageditor.dim-rows .wpe-row:not(.dragging) {
	opacity: 0.4;
	filter: blur(0.5px);
}

/* Fade the rest of the columns in a row when dragging a column */
.wpe-row.dim-cols .wpe-column:not(.dragging) {
	opacity: 0.4;
	filter: blur(0.5px);
}

/* Grid (alt / repeated in your original; kept for compatibility) */
.wpe-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 1rem;
	align-items: start;
}

	.wpe-grid > .span-2 {
		grid-column: span 2;
	}

@media (max-width: 800px) {
	.wpe-grid {
		grid-template-columns: 1fr;
	}
}

/* Slides */
.wpe-slides {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

	.wpe-slides .slide {
		display: flex;
		align-items: flex-start;
		gap: 10px;
		border: 1px solid #e1e6ef;
		background: #fff;
		padding: 8px;
		width: 320px;
		box-sizing: border-box;
		position: relative;
	}

		.wpe-slides .slide.dragging {
			opacity: .8;
			border-color: #3a86ff;
			background: #eef6ff;
		}

		.wpe-slides .slide .thumb img {
			max-width: 120px;
			max-height: 80px;
			display: block;
		}

		.wpe-slides .slide .meta {
			flex: 1 1 auto;
		}

			.wpe-slides .slide .meta .row-actions {
				margin-top: 6px;
				display: flex;
				gap: 6px;
			}

		.wpe-slides .slide .handle {
			cursor: move;
			font-size: 18px;
			user-select: none;
			position: absolute;
			right: 8px;
			top: 8px;
		}

/* Buttons */
.wpe-button.mini {
	padding: 4px 8px;
	font-size: 12px;
}

.wpe-button.danger {
	background: #d9534f;
	color: #fff;
	border-color: #d9534f;
}

.input.small {
	width: 100%;
}

.wpe-instructions {
	padding: 20px;
	background: #eee;
	border-radius: 5px;
	margin-bottom: 20px;
}

.wpe-file-input {
	font: inherit;
	color: #334;
	background: #fff;
	border: 1px solid #cfd8e3;
	padding: 4px;
	border-radius: 6px;
	background: #f8f8f8;
}

	.wpe-file-input::file-selector-button {
		margin-right: 10px;
		padding: 5px 14px;
		border: 0;
		border-radius: 6px;
		background: #3a86ff;
		color: #fff;
		cursor: pointer;
		transition: opacity .15s ease;
	}

		.wpe-file-input::file-selector-button:hover {
			opacity: .9;
		}

	.wpe-file-input::-webkit-file-upload-button {
		margin-right: 10px;
		padding: 7px 14px;
		border: 0;
		border-radius: 6px;
		background: #3a86ff;
		color: #fff;
		cursor: pointer;
	}

/* Wrapper for preview + dropzone */
.wpe-photo-block {
	margin-bottom: 20px;
}

/* Preview image */
.wpe-photo img {
	max-height: 250px;
	max-width: 100%;
	display: block;
	margin: 0 auto 10px;
}

/* Dropzone repeat (kept) */
.wpe-dropzone {
	border: 2px dashed #b5c6e0;
	background: #f7faff;
	padding: 24px;
	text-align: center;
	transition: border-color .15s, background-color .15s;
}
