/**
 * Adam Editorial Galleries — frontend styles v1.0.0
 *
 * All spacing hangs off custom properties so the JS engine and the
 * gutter/air presets can tune it without touching layout rules.
 * Breathing space uses real margins (not empty grid rows), so it is
 * always visible.
 */

.aeg-editorial-grid,
.aeg-editorial-mobile {
	--aeg-col-gap: clamp(16px, 1.4vw, 26px);
	--aeg-row-gap-base: clamp(36px, 3vw, 60px);
	--aeg-air-mult: 1;
	--aeg-space-half: clamp(140px, 18vw, 320px);
	--aeg-space-full: clamp(260px, 34vw, 620px);
	--aeg-m-gap: clamp(20px, 5vw, 36px);
}

/* Gutter presets */
[data-aeg-gutter='tight'] {
	--aeg-col-gap: clamp(8px, 0.7vw, 14px);
	--aeg-row-gap-base: clamp(22px, 1.8vw, 38px);
	--aeg-m-gap: clamp(12px, 3vw, 22px);
}

[data-aeg-gutter='airy'] {
	--aeg-col-gap: clamp(26px, 2.4vw, 44px);
	--aeg-row-gap-base: clamp(54px, 4.5vw, 92px);
	--aeg-m-gap: clamp(30px, 7vw, 52px);
}

/* Breathing-space multiplier for the base row gap */
[data-aeg-air='none'] {
	--aeg-air-mult: 0.55;
}

[data-aeg-air='light'] {
	--aeg-air-mult: 0.8;
}

[data-aeg-air='generous'] {
	--aeg-air-mult: 1.3;
}

[data-aeg-air='maximum'] {
	--aeg-air-mult: 1.65;
}

/* ------------------------------------------------------------------ */
/* Desktop editorial grid                                              */
/* ------------------------------------------------------------------ */

@media (min-width: 1025px) {
	.aeg-editorial-grid {
		align-items: start !important;
		column-gap: var(--aeg-col-gap) !important;
		display: grid !important;
		grid-auto-flow: row !important;
		grid-auto-rows: auto !important;
		grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
		height: auto !important;
		margin: 0 !important;
		position: relative !important;
		row-gap: calc(var(--aeg-row-gap-base) * var(--aeg-air-mult)) !important;
		width: 100% !important;
	}

	.aeg-editorial-grid > .aeg-item {
		box-sizing: border-box !important;
		float: none !important;
		height: auto !important;
		left: auto !important;
		margin: 0 !important;
		min-width: 0 !important;
		padding: 0 !important;
		position: relative !important;
		top: auto !important;
		transform: none !important;
		width: auto !important;
	}

	.aeg-editorial-grid > .aeg-item::before {
		content: none !important;
		display: none !important;
	}

	.aeg-editorial-grid .isotope_item-wrapper,
	.aeg-editorial-grid .gt3pg-lightbox,
	.aeg-editorial-grid .img-wrapper {
		height: auto !important;
		width: 100% !important;
	}

	/* Never crop: natural aspect ratio at every size */
	.aeg-editorial-grid > .aeg-item img {
		display: block !important;
		height: auto !important;
		max-height: none !important;
		object-fit: unset !important;
		width: 100% !important;
	}

	/* Real vertical breathing space (half pause / full page turn) */
	.aeg-editorial-grid > .aeg-item.aeg-turn-half {
		margin-top: calc(var(--aeg-space-half) * var(--aeg-air-mult)) !important;
	}

	.aeg-editorial-grid > .aeg-item.aeg-turn-full {
		margin-top: calc(var(--aeg-space-full) * var(--aeg-air-mult)) !important;
	}

	/* Baseline stagger for asymmetric pairings (padding avoids
	   colliding with the margin-based pauses above) */
	.aeg-editorial-grid > .aeg-item.aeg-drop-a {
		padding-top: calc(var(--aeg-space-half) * 0.28) !important;
	}

	.aeg-editorial-grid > .aeg-item.aeg-drop-b {
		padding-top: calc(var(--aeg-space-half) * 0.5) !important;
	}
}

/* ------------------------------------------------------------------ */
/* Mobile editorial stack                                              */
/* ------------------------------------------------------------------ */

@media (max-width: 1024.98px) {
	.aeg-editorial-mobile {
		display: block !important;
		height: auto !important;
		margin: 0 !important;
		position: relative !important;
		width: 100% !important;
	}

	.aeg-editorial-mobile > .aeg-item {
		box-sizing: border-box !important;
		clear: both !important;
		float: none !important;
		height: auto !important;
		left: auto !important;
		margin: 0 0 var(--aeg-m-gap) 0 !important;
		min-width: 0 !important;
		padding: 0 !important;
		position: relative !important;
		top: auto !important;
		transform: none !important;
	}

	.aeg-editorial-mobile > .aeg-item::before {
		content: none !important;
		display: none !important;
	}

	.aeg-editorial-mobile .isotope_item-wrapper,
	.aeg-editorial-mobile .gt3pg-lightbox,
	.aeg-editorial-mobile .img-wrapper {
		height: auto !important;
		width: 100% !important;
	}

	.aeg-editorial-mobile > .aeg-item img {
		display: block !important;
		height: auto !important;
		max-height: none !important;
		object-fit: unset !important;
		width: 100% !important;
	}

	/* Size scale */
	.aeg-editorial-mobile > .aeg-item.aeg-m-full {
		width: 100% !important;
	}

	.aeg-editorial-mobile > .aeg-item.aeg-m-large {
		width: 100% !important;
	}

	.aeg-editorial-mobile > .aeg-item.aeg-m-medium {
		width: 84% !important;
	}

	.aeg-editorial-mobile > .aeg-item.aeg-m-small {
		width: 70% !important;
	}

	/* Alignment rhythm */
	.aeg-editorial-mobile > .aeg-item.aeg-m-start {
		margin-left: 0 !important;
		margin-right: auto !important;
	}

	.aeg-editorial-mobile > .aeg-item.aeg-m-end {
		margin-left: auto !important;
		margin-right: 0 !important;
	}

	.aeg-editorial-mobile > .aeg-item.aeg-m-center {
		margin-left: auto !important;
		margin-right: auto !important;
	}

	/* Breathing space between sequences */
	.aeg-editorial-mobile > .aeg-item.aeg-m-turn-half {
		margin-top: calc(var(--aeg-space-half) * 0.45 * var(--aeg-air-mult)) !important;
	}

	.aeg-editorial-mobile > .aeg-item.aeg-m-turn-full {
		margin-top: calc(var(--aeg-space-half) * 0.85 * var(--aeg-air-mult)) !important;
	}
}

/* ------------------------------------------------------------------ */
/* Frontend preview tool (visible to editors only)                     */
/* ------------------------------------------------------------------ */

.aeg-preview-tool {
	align-items: center;
	background: rgba(20, 20, 20, 0.92);
	border-radius: 999px;
	bottom: 18px;
	box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
	color: #fff;
	display: flex;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-size: 13px;
	gap: 10px;
	left: 18px;
	padding: 8px 14px;
	position: fixed;
	z-index: 99999;
}

.aeg-preview-seed {
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.02em;
	opacity: 0.85;
}

.aeg-preview-tool button {
	background: rgba(255, 255, 255, 0.14);
	border: 0;
	border-radius: 999px;
	color: #fff;
	cursor: pointer;
	font-size: 12px;
	line-height: 1;
	padding: 6px 12px;
	transition: background 0.15s ease;
}

.aeg-preview-tool button:hover {
	background: rgba(255, 255, 255, 0.28);
}
