/* =================================================================
   Alternated Content Block
   Layouts: contained | edge (full-bleed)
   ================================================================= */

.alternated-content {
	position: relative;
	margin-block-start: 0 !important;
}

/* Grid (mobile: single column) */
.alternated-content__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2rem;
}

/* Content */
.alternated-content__content {
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.alternated-content__tagline {
	font-size: 1rem;
	font-weight: 500;
	letter-spacing: 0.02rem;
	color: var(--wp--preset--color--text-muted);
	margin: 0 0 0.5rem;
}

/* Tagline below title: different spacing and style */
.alternated-content__title + .alternated-content__tagline {
	margin: -0.5rem 0 1rem;
	font-size: 1rem;
	font-weight: 500;
	letter-spacing: 0.02rem;
	text-transform: none;
	line-height: 1.5;
}

.alternated-content__title {
	font-family: var(--wp--preset--font-family--primary);
	font-size: 1.5rem;
	font-weight: 500;
	line-height: 1.4;
	letter-spacing: 0.03rem;
	text-transform: uppercase;
	text-wrap: pretty;
	color: var(--wp--preset--color--text-heading);
	margin: 0 0 1rem;
}

.alternated-content__text {
	font-size: 1rem;
	line-height: 1.6;
	color: var(--wp--preset--color--text-body);
	margin-bottom: 1.5rem;
}

.alternated-content__text p {
	margin-bottom: 1rem;
}

.alternated-content__text p:last-child,
.alternated-content__text ul:last-child,
.alternated-content__text ol:last-child,
.alternated-content__text blockquote:last-child {
	margin-bottom: 0;
}

.alternated-content__text ul,
.alternated-content__text ol {
	margin: 0 0 1rem;
	padding-left: 1.25rem;
}

.alternated-content__text li {
	margin-bottom: 0.375rem;
}

.alternated-content__text li:last-child {
	margin-bottom: 0;
}

.alternated-content__text blockquote {
	margin: 0 0 1rem;
	padding-left: 1rem;
	border-left: 3px solid var(--wp--preset--color--accent);
	color: var(--wp--preset--color--text-muted);
	font-style: italic;
	font-weight: 500;
}

.alternated-content__text strong {
	font-weight: 600;
	color: var(--wp--preset--color--text);
}

/* Actions */
.alternated-content__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-top: 0.5rem;
}

/* Link style button */
.alternated-content__link {
	font-size: 0.9375rem;
	font-weight: 500;
	color: var(--wp--preset--color--text-muted);
	letter-spacing: 0.01875rem;
	text-decoration: underline;
	text-underline-offset: 0.25rem;
	transition: color 0.2s ease;
}

.alternated-content__link:hover {
	color: var(--wp--preset--color--primary);
}

/* Media */
.alternated-content__image {
	width: 100%;
	height: auto;
	display: block;
}

.alternated-content--fit-cover .alternated-content__image {
	object-fit: cover;
}

.alternated-content--fit-contain .alternated-content__image {
	object-fit: contain;
}

/* Padding variants */
.alternated-content--py-sm {
	padding-block: 2rem;
}

.alternated-content--py-md {
	padding-block: 3rem;
}

.alternated-content--py-lg {
	padding-block: 4rem;
}

/* Background colors */
.alternated-content--bg-default {
	background-color: var(--wp--preset--color--bg);
}

.alternated-content--bg-light {
	background-color: var(--wp--preset--color--bg-secondary);
}

.alternated-content--bg-dark {
	background-color: var(--wp--preset--color--bg-dark);
}

/* Text on dark background */
.alternated-content--text-light .alternated-content__title {
	color: var(--wp--preset--color--bg-secondary);
}

.alternated-content--text-light .alternated-content__tagline {
	color: var(--wp--preset--color--bg-secondary);
	opacity: 0.7;
}

.alternated-content--text-light .alternated-content__text,
.alternated-content--text-light .alternated-content__text p {
	color: var(--wp--preset--color--bg-secondary);
	opacity: 0.85;
}

.alternated-content--text-light .alternated-content__link {
	color: var(--wp--preset--color--bg-secondary);
}

.alternated-content--text-light .alternated-content__link:hover {
	color: var(--wp--preset--color--accent);
}

/* Vertical alignment */
.alternated-content--valign-top .alternated-content__grid {
	align-items: start;
}

.alternated-content--valign-center .alternated-content__grid {
	align-items: center;
}

.alternated-content--valign-bottom .alternated-content__grid {
	align-items: end;
}

/* Image width custom property (used by grid) */
.alternated-content--imgw-narrow {
	--ac-img-width: 33.333%;
}

.alternated-content--imgw-medium {
	--ac-img-width: 41.666%;
}

.alternated-content--imgw-half {
	--ac-img-width: 50%;
}

/* Placeholder (editor) */
.alternated-content__media--placeholder {
	min-height: 15rem;
	background-color: var(--wp--preset--color--bg-secondary);
	border: 2px dashed var(--wp--preset--color--border);
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--wp--preset--color--text-muted);
	font-size: 0.875rem;
}

/* Block style: rounded image */
.alternated-content.is-style-rounded .alternated-content__image {
	border-radius: var(--wp--custom--radius--8);
}

/* At tablet+ the image is absolute, so border-radius must go on the container */
.alternated-content.is-style-rounded .alternated-content__media {
	border-radius: var(--wp--custom--radius--8);
}

/* Block style: shadow */
/* Shadow on the container, not the image — box-shadow on a child gets clipped
   by overflow: hidden on the parent. The container's own shadow is never clipped. */
.alternated-content.is-style-shadow .alternated-content__media {
	box-shadow: var(--wp--preset--shadow--200);
}

/* =================================================================
   Responsive
   ================================================================= */

/* Mobile only: cap image height so portrait photos don't dominate */
@media (max-width: 47.9375rem) {
	.alternated-content__image {
		max-height: 24rem;
		object-fit: cover;
	}
}

/* Tablet (48rem / 768px) */
@media (min-width: 48rem) {
	.alternated-content--py-sm {
		padding-block: 3rem;
	}
	.alternated-content--py-md {
		padding-block: 4.5rem;
	}
	.alternated-content--py-lg {
		padding-block: 6rem;
	}

	/* Contained layout: 2 columns */
	.alternated-content--layout-contained .alternated-content__grid {
		grid-template-columns: 1fr var(--ac-img-width, 41.666%);
		gap: 3rem;
	}

	.alternated-content--layout-contained.alternated-content--img-left
		.alternated-content__grid {
		grid-template-columns: var(--ac-img-width, 41.666%) 1fr;
	}

	.alternated-content--layout-contained .alternated-content__content {
		order: unset;
	}

	/* Image: absolute so it never drives the grid row height.
	   Row height is determined solely by the content column.
	   The media container stretches to match via align-self: stretch. */
	.alternated-content--layout-contained .alternated-content__media {
		order: unset;
		position: relative;
		overflow: hidden;
		align-self: stretch;
		min-height: 15rem;
	}

	.alternated-content--layout-contained.alternated-content--img-left
		.alternated-content__media {
		order: -1;
	}

	.alternated-content--layout-contained .alternated-content__image {
		position: absolute;
		inset: 0;
		width: 100%;
		height: 100%;
		border-radius: 4px;
		/* object-fit inherited from .alternated-content--fit-* base rules */
	}

	/* Edge layout: 2 columns full width */
	.alternated-content--layout-edge .alternated-content__grid {
		grid-template-columns: 1fr var(--ac-img-width, 41.666%);
	}

	.alternated-content--layout-edge.alternated-content--img-left
		.alternated-content__grid {
		grid-template-columns: var(--ac-img-width, 41.666%) 1fr;
	}

	.alternated-content--layout-edge .alternated-content__content {
		order: unset;
	}

	.alternated-content--layout-edge .alternated-content__media {
		order: unset;
	}

	.alternated-content--layout-edge.alternated-content--img-left
		.alternated-content__media {
		order: -1;
	}

	/* Edge: content padding to align with global container */
	.alternated-content--layout-edge .alternated-content__inner {
		max-width: 40rem;
	}

	.alternated-content--layout-edge.alternated-content--img-right
		.alternated-content__content {
		padding-left: max(
			var(--container-spacing, 1rem),
			calc(
				(
						100vw -
							var(
								--wp--custom--layout--content-max-width-wide,
								1200px
							)
					) /
					2
			)
		);
		padding-right: clamp(2rem, 4vw, 4rem);
	}

	.alternated-content--layout-edge.alternated-content--img-left
		.alternated-content__content {
		padding-right: max(
			var(--container-spacing, 1rem),
			calc(
				(
						100vw -
							var(
								--wp--custom--layout--content-max-width-wide,
								1200px
							)
					) /
					2
			)
		);
		padding-left: clamp(2rem, 4vw, 4rem);
	}

	/* Edge: image fills height */
	.alternated-content--layout-edge .alternated-content__media {
		height: 100%;
		min-height: 24rem;
		overflow: hidden;
	}

	.alternated-content--layout-edge .alternated-content__image {
		width: 100%;
		height: 100%;
		object-fit: cover;
	}

	/* Edge + contain: center image */
	.alternated-content--layout-edge.alternated-content--fit-contain
		.alternated-content__image {
		object-fit: contain;
	}
}

/* Desktop (64rem / 1024px) */
@media (min-width: 64rem) {
	.alternated-content--layout-contained .alternated-content__grid {
		gap: 4rem;
	}
}

/* Large desktop (80rem / 1280px) */
@media (min-width: 80rem) {
	.alternated-content--layout-contained .alternated-content__grid {
		gap: 5rem;
	}
}

/* Content margin (only desktop, when side-by-side) */
@media (min-width: 48rem) {
	.alternated-content--cmargin-sm .alternated-content__content {
		padding-block: 1.5rem;
	}

	.alternated-content--cmargin-md .alternated-content__content {
		padding-block: 3rem;
	}
}

/* single-team_member */
.single-team_member .entry-content > .alternated-content:first-child {
	max-width: 64rem;
	margin-inline: auto;
}

.single-team_member
	.entry-content
	> .alternated-content:first-child
	.alternated-content__text {
	line-height: 1.7;
}
