/* ==========================================================
   OPDS Team Flip Box — CSS
   Flip direction: flip to the LEFT (rotateY)
   Mobile < 768px: Front card is visible, Back becomes popup
   ========================================================== */

/* ── Root defaults ── */
.opds-flip-wrapper {
	position: relative;
	width: 100%;
}

/* ==========================================================
   DESKTOP: Flip Card
   ========================================================== */

/* Container that holds perspective */
.opds-flip-card {
	perspective: 1200px;
	width: 100%;
	height: 480px; /* overridden by Elementor control */
	cursor: pointer;
	outline: none;
}

.opds-flip-card:focus-visible .opds-flip-inner {
	outline: 3px solid #1a8080;
	outline-offset: 4px;
	border-radius: 16px;
}

/* The rotating inner wrapper */
.opds-flip-inner {
	position: relative;
	width: 100%;
	height: 100%;
	transform-style: preserve-3d;
	transition: transform 0.65s cubic-bezier(0.45, 0.05, 0.55, 0.95);
	border-radius: 16px;
}

/* Flip to left: rotate Y to positive 180deg */
.opds-flip-card:hover .opds-flip-inner,
.opds-flip-card.is-flipped .opds-flip-inner {
	transform: rotateY(180deg);
}

/* ── Front face ── */
.opds-flip-front,
.opds-flip-back {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	backface-visibility: hidden;
	-webkit-backface-visibility: hidden;
	border-radius: 16px;
	overflow: hidden;
}

/* Front: photo + gradient overlay + name/position */
.opds-flip-front {
	background: #c8c8c8;
}

.opds-flip-front__img {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center top;
	background-repeat: no-repeat;
	width: 100%;
	height: 100%;
}

.opds-flip-front__img--placeholder {
	background: linear-gradient(135deg, #d0d0d0 0%, #a0a0a0 100%);
}

/* Dark gradient overlay at bottom for text legibility */
.opds-flip-front__overlay {
	display: none;
	position: absolute;
	inset: 0;
	background: linear-gradient(
		to top,
		rgba(0, 0, 0, 0.55) 0%,
		rgba(0, 0, 0, 0.15) 40%,
		transparent 70%
	);
}

.opds-flip-front__info {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	padding: 20px 22px 22px;
	z-index: 2;
}

.opds-flip-front__name {
	margin: 0 0 4px;
	font-size: 1.55rem;
	font-weight: 700;
	color: #ffffff;
	line-height: 1.2;
}

.opds-flip-front__position {
	margin: 0;
	font-size: 0.9rem;
	font-weight: 700;
	color: #ffffff;
}

/* ── Back face ── */
.opds-flip-back {
	background-color: #1a8080;
	transform: rotateY(-180deg); /* pre-rotated so flipping reveals it */
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

/* Decorative concentric-circle swirl (top-right) */
.opds-flip-back__content {
	position: relative;
	z-index: 2;
	padding: 32px 26px 26px;
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow-y: auto;
	background: url(/wp-content/uploads/sites/8/2026/06/Circles_White_Faded-23.png) top right/contain no-repeat;
}

.opds-flip-back__title {
	margin: 0 0 20px;
	font-size: 1.6rem;
	font-weight: 700;
	color: #ffffff;
	line-height: 1.2;
}

.opds-flip-back__desc {
	margin-top: auto;
	font-size: 0.88rem;
	line-height: 1.2;
	color: rgba(255, 255, 255, 0.92);
}

.opds-flip-back__desc p {
	margin: 0 0 1em;
	color: inherit;
}

.opds-flip-back__desc p:last-child {
	margin-bottom: 0;
}

/* ==========================================================
   MOBILE: Popup
   Hide the flip card, show mobile-trigger instead
   ========================================================== */

/* Mobile trigger card (looks like the front face) */
.opds-mobile-trigger {
	display: none; /* shown via media query */
	width: 100%;
	height: 480px; /* match card height default */
	border-radius: 16px;
	overflow: hidden;
	cursor: pointer;
	position: relative;
}

.opds-mobile-front {
	position: relative;
	width: 100%;
	height: 100%;
}

.opds-mobile-front__img {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center top;
	background-repeat: no-repeat;
}

.opds-mobile-front__img--placeholder {
	background: linear-gradient(135deg, #d0d0d0 0%, #a0a0a0 100%);
}

/* Popup Overlay */
.opds-popup-overlay {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 99999;
	background: rgba(0, 0, 0, 0.6);
	align-items: flex-end;
	justify-content: center;
	padding: 0;

	/* Animation */
	opacity: 0;
	transition: opacity 0.28s ease;
}

.opds-popup-overlay.is-open {
	display: flex;
	opacity: 0; /* will animate to 1 via JS class */
}

.opds-popup-overlay.is-visible {
	opacity: 1;
}

/* Popup panel (slides up from bottom) */
.opds-popup-back {
	position: relative;
	background-color: #1a8080;
	border-radius: 12px 12px 0 0;
	width: 100%;
	max-height: 85vh;
	overflow: hidden;
	transform: translateY(100%);
	transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}

.opds-popup-overlay.is-visible .opds-popup-back {
	transform: translateY(0);
}

/* Close button */
.opds-popup-close {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 10;
	width: 36px;
	height: 36px;
	border: none;
	background: none !important;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #ffffff;
	cursor: pointer;
	padding: 0 !important;
	transition: background 0.2s ease;
}

.opds-popup-close:hover,
.opds-popup-close:focus-visible {
	background: rgba(255, 255, 255, 0.3);
	outline: none;
}

.opds-popup-close svg {
	display: block;
}

/* Swirl decoration inside popup */
.opds-popup-back__swirl {
	position: absolute;
	top: -80px;
	right: -80px;
	width: 280px;
	height: 280px;
	pointer-events: none;
	opacity: 0.6;
}

.opds-popup-back__swirl svg {
	width: 100%;
	height: 100%;
}

/* Popup content */
.opds-popup-back__content {
	position: relative;
	z-index: 2;
	padding: 28px 22px 36px;
	overflow-y: auto;
	min-height: 40vh;
	max-height: 85vh;
	background: url(/wp-content/uploads/sites/8/2026/06/Circles_White_Faded-23-Top.png) top right/80% auto no-repeat;
}

.opds-popup-back__title {
	margin: 0 0 18px;
	font-size: 1.5rem;
	font-weight: 800;
	color: #ffffff;
	line-height: 1.2;
	padding-right: 40px; /* space for close btn */
}

.opds-popup-back__desc {
	font-size: 0.9rem;
	line-height: 1.7;
	color: rgba(255, 255, 255, 0.92);
}

.opds-popup-back__desc p {
	margin: 0 0 1em;
	color: inherit;
}

.opds-popup-back__desc p:last-child {
	margin-bottom: 0;
}

/* Body scroll lock when popup open */
body.opds-popup-active {
	overflow: hidden;
}

/* ==========================================================
   RESPONSIVE BREAKPOINT
   ========================================================== */

@media (max-width: 767px) {
	/* Hide desktop flip card */
	.opds-flip-card {
		display: none;
	}

	/* Show mobile trigger card */
	.opds-mobile-trigger {
		display: block;
	}

	/* Adjust mobile trigger height to match */
	.opds-mobile-trigger {
		height: 420px;
	}
	
	
	.opds-flip-front__info {
		padding: 14px;
	}
}

/* ==========================================================
   Elementor Editor: show flip card, hide mobile
   ========================================================== */
.elementor-editor-active .opds-mobile-trigger,
.elementor-editor-active .opds-popup-overlay {
	display: none !important;
}

.elementor-editor-active .opds-flip-card {
	display: block !important;
}
