/* Facility List Widget CSS */

.facility-list-container {
	display: flex;
	width: 100%;
	height: 500px; /* Default height, controlled by Elementor dynamic CSS */
	overflow: visible;
	position: relative;
	box-sizing: border-box;
	background-color: transparent;
}

/* Left Column: Titles */
.facility-list-left {
	width: 25%;
	height: 100% !important;
	display: flex;
	flex-direction: column;
	justify-content: stretch;
	align-items: stretch;
	box-sizing: border-box;
	border-right: 1px solid #e2e8f0;
	overflow: hidden;
}

.facility-list-title-row {
	flex: 1;
	display: flex;
	align-items: center;
	padding: 24px;
	cursor: pointer;
	position: relative;
	box-sizing: border-box;
	background-color: #ffffff;
	color: #1e293b;
	border-bottom: 1px solid #f1f5f9;
	transition: all 0.35s cubic-bezier(0.25, 1, 0.5, 1);
	user-select: none;
}

.facility-list-title-row:last-child {
	border-bottom: none;
}

/* Accent indicator for active row */
.facility-list-title-row::before {
	content: '';
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 4px;
	background-color: transparent;
	transition: background-color 0.3s ease;
}

.facility-list-title-row.active::before {
	background-color: #3b82f6; /* Elementor control overrides this if set */
}

.facility-list-title-text {
	font-weight: 600;
	font-size: 16px;
	line-height: 1.4;
	transition: transform 0.3s ease;
}

.facility-list-title-row:hover .facility-list-title-text {
	transform: translateX(4px);
}

/* Right Column: Panels (Image + Overlay) */
.facility-list-right {
	width: 75%;
	height: 100% !important;
	position: relative;
	display: grid;
	grid-template-columns: 1fr;
	grid-template-rows: 1fr;
	overflow: hidden;
	box-sizing: border-box;
}

.facility-list-panel {
	grid-area: 1 / 1 / 2 / 2;
	width: 100%;
	height: 100% !important;
	display: flex;
	position: relative;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.5s cubic-bezier(0.25, 1, 0.5, 1), visibility 0.5s cubic-bezier(0.25, 1, 0.5, 1);
	box-sizing: border-box;
	overflow: hidden !important; /* Clips the sliding overlay within panel boundaries */
}

.facility-list-panel.active {
	opacity: 1;
	visibility: visible;
	z-index: 5;
}

/* Image Wrapper and Image */
.facility-list-image-wrapper {
	width: 100% !important; /* Fills right side completely */
	height: 100% !important;
	max-height: 100% !important;
	position: relative;
	overflow: hidden;
	box-sizing: border-box;
}

.facility-list-image {
	width: 100% !important;
	height: 100% !important;
	max-height: 100% !important;
	object-fit: cover !important;
	display: block;
	transform: scale(1.05);
	transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.facility-list-panel.active .facility-list-image {
	transform: scale(1);
}

/* Description Overlay */
.facility-list-overlay {
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
	bottom: 0;
	width: 100% !important;
	height: 100% !important;
	transform: translateY(100%); /* Start shifted below the container */
	background-color: rgba(15, 23, 42, 0.85);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	border-radius: inherit !important; /* Inherits rounded corners from parent container */
	opacity: 0;
	z-index: 10;
	transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.5s cubic-bezier(0.25, 1, 0.5, 1);
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
}

.facility-list-panel.active .facility-list-overlay {
	transform: translateY(0); /* Slide up to fully cover the image */
	opacity: 1;
}

.facility-list-overlay-content {
	padding: 40px;
	color: #ffffff;
	font-size: 16px;
	line-height: 1.6;
	box-sizing: border-box;
	text-align: center;
	width: 100%;
	max-height: 100%;
	overflow-y: auto; /* Allow scrolling if content is too long for the image height */
}

.facility-list-overlay-content h1,
.facility-list-overlay-content h2,
.facility-list-overlay-content h3,
.facility-list-overlay-content h4,
.facility-list-overlay-content h5,
.facility-list-overlay-content h6 {
	color: #ffffff;
	margin-top: 0;
	margin-bottom: 16px;
	font-weight: 700;
}

.facility-list-overlay-content p {
	margin: 0 0 16px 0;
}

.facility-list-overlay-content p:last-child {
	margin-bottom: 0;
}

/* Responsive Rules for Tablets and Mobile Devices */
@media (max-width: 991px) {
	.facility-list-title-row {
		padding: 16px;
	}
	.facility-list-overlay-content {
		padding: 30px;
	}
}

@media (max-width: 767px) {
	.facility-list-container {
		display: flex;
		flex-direction: column;
		height: auto !important;
		overflow: visible;
	}

	.facility-list-left {
		width: 100%;
		height: auto;
		flex-direction: row;
		flex-wrap: wrap;
		border-right: none;
		border-bottom: 1px solid #e2e8f0;
	}

	.facility-list-title-row {
		flex: 1 1 auto;
		padding: 12px 16px;
		justify-content: center;
		border-bottom: none;
		border-right: 1px solid #f1f5f9;
	}

	.facility-list-title-row:last-child {
		border-right: none;
	}

	.facility-list-title-row::before {
		left: 0;
		right: 0;
		bottom: 0;
		top: auto;
		height: 3px;
		width: auto;
	}

	.facility-list-title-row:hover .facility-list-title-text {
		transform: none;
	}

	.facility-list-right {
		width: 100%;
		height: 400px;
		margin-top: 16px;
	}

	.facility-list-image-wrapper {
		width: 100% !important;
		border-radius: 8px !important;
	}

	.facility-list-image {
		border-radius: 8px !important;
	}

	.facility-list-overlay {
		width: 100% !important;
		left: 0 !important;
		right: 0 !important;
		bottom: 0 !important;
		top: 0 !important;
		transform: translateY(100%);
		border-radius: 8px !important;
	}

	.facility-list-panel.active .facility-list-overlay {
		transform: translateY(0);
	}

	.facility-list-overlay-content {
		padding: 24px;
	}
}
