/*
 * Agent flip cards (Loop Item "Card – Agent Flip").
 * Layout, text and colors are set in Elementor; this file only does the flip.
 * Elementor classes used: bhg-flip (card), bhg-flip__inner, bhg-flip__front,
 * bhg-flip__back, bhg-flip__toggle (the "Bio & contact" / "Back" buttons).
 */
.bhg-flip {
	perspective: 1600px;
	cursor: pointer;
}
.bhg-flip .bhg-flip__inner {
	position: relative;
	display: grid !important;
	transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
	transform-style: preserve-3d;
	height: 100%;
}
.bhg-flip .bhg-flip__front,
.bhg-flip .bhg-flip__back {
	grid-area: 1 / 1;
	-webkit-backface-visibility: hidden;
	backface-visibility: hidden;
	min-width: 0;
}
.bhg-flip .bhg-flip__back {
	transform: rotateY(180deg);
	overflow: auto;
}
.bhg-flip.is-flipped .bhg-flip__inner {
	transform: rotateY(180deg);
}

/* The hidden face can't be clicked or tabbed to. */
.bhg-flip:not(.is-flipped) .bhg-flip__back,
.bhg-flip.is-flipped .bhg-flip__front {
	pointer-events: none;
	visibility: hidden;
	transition: visibility 0s 0.3s;
}
.bhg-flip .bhg-flip__front,
.bhg-flip .bhg-flip__back {
	visibility: visible;
	transition: visibility 0s 0.3s;
}

/* Links and buttons inside still behave normally. */
.bhg-flip a {
	cursor: pointer;
}
.bhg-flip .bhg-flip__toggle .elementor-button {
	cursor: pointer;
}
.bhg-flip:focus-within {
	outline: none;
}

/* Long bios scroll inside the back of the card instead of stretching it. */
.bhg-flip .bhg-flip__back .elementor-widget-theme-post-excerpt,
.bhg-flip .bhg-flip__back .elementor-widget-text-editor {
	overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
	.bhg-flip .bhg-flip__inner {
		transition: none;
		transform: none !important;
	}
	.bhg-flip .bhg-flip__back {
		transform: none;
	}
}
