/**
 * Custom Portfolio Manager - Card Styles
 */

.cpm-portfolios-container {
	width: 100%;
	margin: 2rem 0;
	font-family: 'Manrope', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.cpm-portfolios-grid {
	display: grid;
	gap: 2.5rem;
	width: 100%;
}

.cpm-portfolios-grid.cpm-cols-1 {
	grid-template-columns: 1fr;
}

.cpm-portfolios-grid.cpm-cols-2 {
	grid-template-columns: repeat(2, 1fr);
}

.cpm-portfolios-grid.cpm-cols-3 {
	grid-template-columns: repeat(3, 1fr);
}

.cpm-portfolios-grid.cpm-cols-4 {
	grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {
	.cpm-portfolios-grid.cpm-cols-4,
	.cpm-portfolios-grid.cpm-cols-3 {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 640px) {
	.cpm-portfolios-grid.cpm-cols-4,
	.cpm-portfolios-grid.cpm-cols-3,
	.cpm-portfolios-grid.cpm-cols-2 {
		grid-template-columns: 1fr;
	}
}


.cpm-portfolio-card {
	display: flex;
	flex-direction: column;
	background: #ffffff;
	border-radius: 20px;
	overflow: hidden;
	box-shadow: 0 15px 35px rgba(0, 0, 0, 0.05);
	border: 1px solid rgba(0, 0, 0, 0.03);
	transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s ease;
}

.cpm-portfolio-card:hover {
	transform: translateY(-6px);
	box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

.cpm-portfolio-media {
	position: relative;
	width: 100%;
	aspect-ratio: 1.6;
	overflow: hidden;
	background: #f3f4f6;
}

.cpm-portfolio-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.cpm-portfolio-card:hover .cpm-portfolio-media img {
	transform: scale(1.04);
}

.cpm-portfolio-badge {
	display: none !important;
}

.cpm-portfolio-content {
	display: flex;
	flex-direction: column;
	flex-grow: 1;
	padding: 2.2rem 1.8rem;
	align-items: center;
	text-align: center;
}

.cpm-portfolio-title {
	margin: 0 0 1.5rem 0;
	font-size: 1.2rem;
	font-weight: 800;
	color: #0c2317;
	line-height: 1.4;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	transition: color 0.2s ease;
}

.cpm-portfolio-card:hover .cpm-portfolio-title {
	color: #1b3e2b;
}

.cpm-portfolio-excerpt {
	display: none !important;
}

.cpm-portfolio-button {
	align-self: center;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.75rem 2.2rem;
	background: #0c2317;
	color: #ffffff !important;
	border-radius: 99px;
	font-size: 0.85rem;
	font-weight: 700;
	text-decoration: none;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	transition: background 0.3s ease, transform 0.2s ease;
}

.cpm-portfolio-button:hover {
	background: #1b3e2b;
	transform: translateY(-2px);
}

.cpm-no-portfolios {
	padding: 3rem;
	text-align: center;
	background: #f9fafb;
	border-radius: 16px;
	border: 2px dashed #e5e7eb;
	color: #6b7280;
	font-size: 1.1rem;
	font-weight: 500;
}

/* ─────────────────────────────────────────────────────────────────────────────
 * Dark Mode Theme Overrides (e.g. MHD Stitch / Custom Theme backgrounds)
 * ───────────────────────────────────────────────────────────────────────────── */

.mhd-stitch-body .cpm-portfolio-card {
	background: rgba(255, 255, 255, 0.02);
	border: 1px solid rgba(255, 255, 255, 0.08);
	backdrop-filter: blur(24px);
	-webkit-backdrop-filter: blur(24px);
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.mhd-stitch-body .cpm-portfolio-card:hover {
	background: rgba(255, 255, 255, 0.05);
	border-color: rgba(232, 179, 255, 0.3);
}

.mhd-stitch-body .cpm-portfolio-title {
	color: #ffffff;
}

.mhd-stitch-body .cpm-portfolio-card:hover .cpm-portfolio-title {
	color: #e8b3ff;
}

.mhd-stitch-body .cpm-portfolio-excerpt {
	color: #d2c1d6;
}

.mhd-stitch-body .cpm-portfolio-button {
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid rgba(255, 255, 255, 0.1);
	box-shadow: none;
}

.mhd-stitch-body .cpm-portfolio-button:hover {
	background: #e8b3ff;
	color: #500075 !important;
	border-color: #e8b3ff;
	box-shadow: 0 16px 32px rgba(232, 179, 255, 0.2);
}

.mhd-stitch-body .cpm-no-portfolios {
	background: rgba(255, 255, 255, 0.01);
	border-color: rgba(255, 255, 255, 0.1);
	color: #d2c1d6;
}

/* ─────────────────────────────────────────────────────────────────────────────
 * Portfolios Map Grid Split-Pane Layout
 * ───────────────────────────────────────────────────────────────────────────── */

.cpm-portfolios-map-container {
	display: flex;
	width: 100%;
	height: 500px;
	border-radius: 20px;
	overflow: hidden;
	background: #ffffff;
	border: 1px solid rgba(0, 0, 0, 0.08);
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.04);
	margin: 2rem 0;
	font-family: 'Manrope', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.cpm-map-sidebar {
	width: 340px;
	flex-shrink: 0;
	display: flex;
	flex-direction: column;
	background: #ffffff;
	border-right: 1px solid #e5e7eb;
	z-index: 10;
}

.cpm-map-sidebar-header {
	padding: 1.5rem;
	font-size: 1.2rem;
	font-weight: 800;
	color: #0c2317;
	border-bottom: 1px solid #e5e7eb;
	text-transform: capitalize;
	letter-spacing: 0.02em;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease;
}

.cpm-map-sidebar-header:hover {
	background: #f4f6f5;
	color: #1b3e2b;
}

.cpm-map-sidebar-list {
	flex-grow: 1;
	overflow-y: auto;
	padding: 0.5rem 0;
}

/* Premium scrollbar styling for sidebar list */
.cpm-map-sidebar-list::-webkit-scrollbar {
	width: 6px;
}

.cpm-map-sidebar-list::-webkit-scrollbar-track {
	background: transparent;
}

.cpm-map-sidebar-list::-webkit-scrollbar-thumb {
	background: rgba(12, 35, 23, 0.15);
	border-radius: 99px;
}

.cpm-map-sidebar-list::-webkit-scrollbar-thumb:hover {
	background: rgba(12, 35, 23, 0.3);
}

.cpm-map-sidebar-item {
	padding: 1.2rem 1.5rem;
	border-bottom: 1px solid #f3f4f6;
	cursor: pointer;
	transition: background 0.2s ease, border-color 0.2s ease;
	border-left: 4px solid transparent;
}

.cpm-map-sidebar-item:hover {
	background: #f4f6f5;
}

.cpm-map-sidebar-item.active {
	background: #e6eae8;
	border-left-color: #0c2317;
}

.cpm-sidebar-item-title {
	margin: 0 0 0.35rem 0;
	font-size: 0.95rem;
	font-weight: 700;
	color: #1f2937;
	line-height: 1.4;
}

.cpm-sidebar-item-address {
	font-size: 0.8rem;
	color: #6b7280;
	display: block;
}

.cpm-portfolio-map-canvas {
	flex-grow: 1;
	height: 100%;
	width: 100%;
	z-index: 1;
}

.cpm-map-no-coords {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	background: #f9fafb;
	color: #9ca3af;
	font-size: 0.95rem;
}

/* ─────────────────────────────────────────────────────────────────────────────
 * Leaflet Popup Style Overrides
 * ───────────────────────────────────────────────────────────────────────────── */

.cpm-leaflet-popup-override .leaflet-popup-content-wrapper {
	border-radius: 16px;
	padding: 0;
	overflow: hidden;
	box-shadow: 0 15px 45px rgba(0, 0, 0, 0.15);
	border: 1px solid rgba(0, 0, 0, 0.05);
}

.cpm-leaflet-popup-override .leaflet-popup-content {
	margin: 0 !important;
	width: 240px !important;
	font-family: 'Manrope', sans-serif;
}

.cpm-map-popup-card {
	display: flex;
	flex-direction: column;
}

.cpm-popup-img-wrap {
	height: 130px;
	width: 100%;
	overflow: hidden;
	background: #e5e7eb;
}

.cpm-popup-img-wrap img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.cpm-popup-info {
	padding: 1.2rem;
}

.cpm-popup-info h4 {
	margin: 0 0 0.65rem 0;
	font-size: 0.95rem;
	font-weight: 800;
	color: #0c2317;
	line-height: 1.35;
}

.cpm-popup-btn {
	font-size: 0.75rem;
	font-weight: 800;
	color: #0c2317;
	text-decoration: none;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	display: inline-block;
	transition: color 0.2s ease;
}

.cpm-popup-btn:hover {
	color: #1b3e2b;
}

.cpm-leaflet-popup-override .leaflet-popup-close-button {
	color: #ffffff !important;
	padding: 8px !important;
	z-index: 100;
}

.cpm-custom-map-pin {
	filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

/* ─────────────────────────────────────────────────────────────────────────────
 * Responsive Layout for Small Screens
 * ───────────────────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
	.cpm-portfolios-map-container {
		flex-direction: column-reverse !important;
		height: 600px !important;
	}

	.cpm-map-sidebar {
		width: 100% !important;
		height: 250px !important;
		border-right: none !important;
		border-top: 1px solid #e5e7eb !important;
	}

	.cpm-map-sidebar-header {
		padding: 1rem 1.25rem !important;
		font-size: 1rem !important;
	}

	.cpm-map-sidebar-list {
		height: calc(250px - 50px) !important;
	}

	.cpm-map-sidebar-item {
		padding: 0.9rem 1.25rem !important;
	}

	.cpm-portfolio-map-canvas {
		width: 100% !important;
		height: 350px !important;
	}

	/* Prevent horizontal scroll issues for leaflet popups on small mobile viewports */
	.cpm-leaflet-popup-override .leaflet-popup-content {
		width: 210px !important;
	}
	.cpm-popup-img-wrap {
		height: 110px !important;
	}
}


