/**
 * VM Media Text Block
 *
 * @package club-garrigue
 * @since 1.0.0
 */

/* ─── Block wrapper ─────────────────────────────────────────────── */

.vm-mt-block {
	container-type: inline-size;
	padding: clamp(40px, 10vw, 100px) 30px;
	margin-top: 0 !important;
	width: 100vw !important;
	max-width: unset !important;
	margin-left: calc(50% - 50vw) !important;
	margin-right: calc(50% - 50vw) !important;
	background-color: var(--wp--preset--color--cg-white);

	display: flex;
	justify-content: center;
	
}

/* ─── Inner two-column grid ─────────────────────────────────────── */

.vm-mt-inner {
	display: grid;
	grid-template-columns: 1fr 1fr;
	grid-template-areas: "media content";
	gap: clamp(32px, 5vw, 64px);
	align-items: stretch;
	max-width: var(--max-width);
	padding: 0 clamp(20px, 5vw, 60px);
}

/* ── Orientation: media right ───── */

.vm-mt-block--media-right .vm-mt-inner {
	grid-template-areas: "content media";
}

/* ─── Media column ──────────────────────────────────────────────── */

.vm-mt-media {
	grid-area: media;
	position: relative;
	overflow: hidden;
	border-radius: var(--vm-radius-lg, 0.75rem);
	box-shadow: 0 8px 48px rgba(28, 26, 23, 0.1);
}

.vm-mt-img,
.vm-mt-video {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.vm-mt-img {
	aspect-ratio: 4 / 3;
}

.vm-mt-video {
	aspect-ratio: 16 / 9;
	background: #000;
}

/* ─── Content column ────────────────────────────────────────────── */

.vm-mt-content {
	grid-area: content;
}

.vm-mt-content.vm-para-content p{
	line-height: 1.88 !important;
}

.vm-mt-content > *:first-child {
	margin-top: 0;
}

.vm-mt-content > *:last-child {
	margin-bottom: 0;
}

.vm-mt-content h1,
.vm-mt-content h2,
.vm-mt-content h3,
.vm-mt-content h4 {
	font-family: var(--font-serif);
	font-weight: 400;
	line-height: 1.15;
	margin-bottom: 24px;
}

.vm-mt-content h2 {
	font-weight: 500;
}

.vm-mt-content h2 em{
	font-weight: 400;
}

.vm-mt-content a {
	color: var(--wp--preset--color--accent);
	text-decoration: underline;
	text-underline-offset: 3px;
	transition: color 0.2s ease;
}

.vm-mt-content a:hover {
	color: var(--wp--preset--color--accent-dark);
}

.vm-mt-content ul,
.vm-mt-content ol {
	padding-left: 1.4em;
}

.vm-mt-content li + li {
	margin-top: 0.4em;
}

/* ─── Gutenberg background / text colour support ────────────────── */

/* When a background colour is chosen, pull it edge-to-edge */
.vm-mt-block.has-background {
	padding-left: 30px;
	padding-right: 30px;
	
}

.vm-mt-block.has-background .vm-mt-inner {
	padding-left: 0;
	padding-right: 0;
}

/* Propagate Gutenberg text colour to content prose */
.vm-mt-block.has-text-color .vm-mt-content,
.vm-mt-block.has-text-color .vm-mt-content p,
.vm-mt-block.has-text-color .vm-mt-content h1,
.vm-mt-block.has-text-color .vm-mt-content h2,
.vm-mt-block.has-text-color .vm-mt-content h3,
.vm-mt-block.has-text-color .vm-mt-content h4,
.vm-mt-block.has-text-color .vm-mt-content li {
	color: inherit;
}

/* ─── Editor placeholders ───────────────────────────────────────── */

.vm-mt-media-placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	aspect-ratio: 4 / 3;
	background: #f0ece6;
	border: 2px dashed #ccc3b4;
	border-radius: var(--vm-radius-lg, 0.75rem);
	color: #888;
	font-style: italic;
	font-size: 14px;
	text-align: center;
	padding: 20px;
}

.vm-mt-content-placeholder {
	color: #888;
	font-style: italic;
	border: 1px dashed #ccc;
	padding: 1rem;
	border-radius: 4px;
}

/* ─── Responsive — stack below 720px ───────────────────────────── */

@container (max-width: 720px) {
	.vm-mt-inner {
		grid-template-columns: 1fr;
		grid-template-areas:
			"media"
			"content";
	}

	/* Both orientations stack the same way on mobile (media on top) */
	.vm-mt-block--media-right .vm-mt-inner {
		grid-template-areas:
			"media"
			"content";
	}
}

/* ─── Reduced motion ────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
	.vm-mt-content a {
		transition: none;
	}
}
