/**
 * WOW Masonry Grid — frontend & editor styles.
 *
 * Most sizing values (columns, row height, gap, spans, radius, etc.) are
 * generated per-widget by Elementor from the control selectors. The rules
 * below are sensible defaults + behaviour that controls don't cover.
 */

.wow-mg-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	grid-auto-rows: 200px;
	grid-auto-flow: row dense;
	gap: 16px;
	width: 100%;
}

.wow-mg-item {
	position: relative;
	overflow: hidden;
	grid-column: span 1;
	grid-row: span 1;
	min-width: 0;
	min-height: 0;
}

/* Media (image) items */
.wow-mg-item__media,
.wow-mg-item__link,
.wow-mg-item__template {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
}

.wow-mg-item__media {
	position: relative;
}

.wow-mg-item__link--lightbox {
	cursor: zoom-in;
}

.wow-mg-item img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center center;
	transition: transform 0.5s ease, opacity 0.4s ease;
	will-change: transform;
}

/* Template items: let their own content size itself but keep it clipped to the cell. */
.wow-mg-item__template {
	height: 100%;
	overflow: hidden;
}

.wow-mg-item__template > * {
	height: 100%;
}

/* Caption overlay */
.wow-mg-item__caption {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	text-align: left;
	color: #fff;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.55) 0%, transparent 100%);
	padding: 24px 16px 12px;
	pointer-events: none;
}

.wow-mg-item__caption span {
	display: block;
}

/* Hover effects (driven by prefix_class on the widget wrapper) */
.wow-mg-hover--zoom .wow-mg-item:hover img {
	transform: scale(1.06);
}

.wow-mg-hover--fade .wow-mg-item img {
	opacity: 1;
}

.wow-mg-hover--fade .wow-mg-item:hover img {
	opacity: 0.8;
}

/* Editor helpers */
.wow-mg-empty,
.wow-mg-item__placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	min-height: 80px;
	padding: 16px;
	text-align: center;
	color: #777;
	background: rgba(0, 0, 0, 0.03);
	border: 1px dashed rgba(0, 0, 0, 0.15);
	box-sizing: border-box;
}
