/* ==========================================================================
   Wellness Partners Gallery — Elementor Widget
   Structural CSS only. Colors/sizes are controlled live from the
   Elementor Style tab (those rules override these defaults automatically).
   ========================================================================== */

.wpg-wrap {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.wpg-heading {
	text-align: center;
	margin: 0 0 24px;
	font-size: 32px;
	font-weight: 700;
}

/* ---------- Gallery row ---------- */
.wpg-gallery {
	display: flex;
	align-items: stretch;
	gap: 16px;
	height: 380px;
}

.wpg-card {
	position: relative;
	flex: 1;
	min-width: 50px;
	border-radius: 18px;
	overflow: hidden;
	cursor: pointer;
	background: #d9d9d9;
	transition-property: flex-grow;
	transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
	transition-duration: 0.5s;
}

.wpg-card img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.5s ease;
}

.wpg-card.wpg-active {
	flex-grow: 3.4;
}

/* Hover: whichever card is hovered becomes wide, siblings shrink */
.wpg-gallery:hover .wpg-card {
	flex-grow: 1;
}

.wpg-gallery .wpg-card:hover {
	flex-grow: 3.4;
}

.wpg-gallery .wpg-card:hover img {
	transform: scale(1.04);
}

.wpg-gallery:not(:hover) .wpg-card.wpg-active {
	flex-grow: 3.4;
}

/* ---------- Overlay text card ---------- */
.wpg-overlay {
	position: absolute;
	left: 20px;
	bottom: 20px;
	background: #ffffff;
	padding: 14px 20px;
	border-radius: 12px;
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
	max-width: calc(100% - 40px);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease;
}

.wpg-overlay h4 {
	margin: 0;
	font-size: 15px;
	font-weight: 700;
}

.wpg-overlay p {
	margin: 4px 0 0;
	font-size: 13px;
}

/* Default (nothing hovered): only the "active" card shows its overlay */
.wpg-gallery:not(:hover) .wpg-card.wpg-active .wpg-overlay {
	opacity: 1;
	pointer-events: auto;
	transition-delay: 0.15s;
}

/* While hovering the gallery: hide every overlay first... */
.wpg-gallery:hover .wpg-card .wpg-overlay {
	opacity: 0;
	pointer-events: none;
}

/* ...then show it only on the exact card being hovered */
.wpg-gallery:hover .wpg-card:hover .wpg-overlay {
	opacity: 1;
	pointer-events: auto;
	transition-delay: 0.15s;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
	.wpg-gallery {
		flex-direction: column;
		height: auto !important;
	}

	.wpg-card {
		flex: none !important;
		height: 220px;
	}

	/* No real hover on touch — tapping a card (via JS) adds .wpg-active,
	   and the existing ":not(:hover) .wpg-active .wpg-overlay" rule shows it. */
}
