/* ===========================================================
   Portfolio Dev by M.Salman — Frontend styles
   Colors are overridden per-widget via inline CSS variables
   =========================================================== */

/*
 * IMPORTANT: this list uses margin-bottom (not flex "gap") between items and
 * establishes a fresh block formatting context (display:flow-root) on the
 * wrapper. This avoids the classic bug where a theme/page-builder's own CSS
 * (negative margins, floated ancestors, transform on a parent, etc.) causes
 * the next card to visually climb up and overlap the previous one when
 * scrolling. Each card also gets its own stacking context (position:relative
 * + z-index) so nothing from outside can render on top of it either.
 */
.pdms-main-list {
	--pdms-accent: #02e3a7;
	--pdms-dark: #13144d;
	display: flow-root;
	width: 100%;
	font-family: inherit;
}

.pdms-main-item {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: stretch;
	width: 100%;
	background: #ffffff;
	border-radius: 22px;
	overflow: hidden;
	box-shadow: 0 14px 44px rgba(19, 20, 77, 0.10);
	min-height: 340px;
	margin: 0 0 36px 0;
	transition: box-shadow .3s ease;
}

.pdms-main-item:last-child {
	margin-bottom: 0;
}

.pdms-main-item:hover {
	box-shadow: 0 22px 60px rgba(19, 20, 77, 0.16);
}

/* ===================== Stack scroll effect =====================
   Each card is `position: sticky` with its own `top` (set inline per
   item, increasing slightly) and its own `z-index` (also inline,
   increasing). Because later cards sit at a lower sticky offset AND
   a higher z-index, scrolling makes each next card slide up and land
   on top of the previous one — a classic pure-CSS stacked-deck effect.
   No JavaScript needed, so it can never desync or jump. */
.pdms-stack-enabled {
	padding-bottom: 60px;
}

.pdms-stack-enabled .pdms-main-item {
	position: sticky;
	margin-bottom: 0;
}

.pdms-main-item.pdms-reverse {
	flex-direction: row-reverse;
}

.pdms-main-content {
	flex: 1 1 50%;
	padding: 50px 52px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-width: 280px;
}

.pdms-category-tag {
	display: inline-block;
	width: fit-content;
	text-transform: uppercase;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 1.2px;
	color: var(--pdms-accent);
	background: rgba(2,227,167,0.10);
	padding: 6px 14px;
	border-radius: 30px;
	margin-bottom: 16px;
}

.pdms-main-title {
	font-size: 30px;
	font-weight: 800;
	color: var(--pdms-dark);
	margin: 0 0 16px 0;
	line-height: 1.25;
}

.pdms-main-desc {
	font-size: 15px;
	line-height: 1.75;
	color: #5b5f76;
	margin: 0 0 24px 0;
	max-width: 520px;
}

.pdms-meta-row {
	display: flex;
	flex-wrap: wrap;
	gap: 32px;
	margin-bottom: 22px;
}

.pdms-meta-item {
	font-size: 14px;
	color: #3c3f57;
}

.pdms-meta-item strong {
	color: var(--pdms-dark);
	font-weight: 700;
	margin-right: 4px;
}

.pdms-tech-row {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 30px;
}

.pdms-tech-label {
	font-size: 14px;
	color: #3c3f57;
	font-weight: 600;
	margin-right: 6px;
}

.pdms-tech-icon {
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: #fff;
	border: 1px solid #eef0f6;
	box-shadow: 0 3px 10px rgba(0,0,0,0.08);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	flex-shrink: 0;
}

.pdms-tech-icon img {
	width: 60%;
	height: 60%;
	object-fit: contain;
}

.pdms-read-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: var(--pdms-dark);
	color: #fff !important;
	font-weight: 700;
	font-size: 13px;
	letter-spacing: 0.5px;
	padding: 16px 28px;
	border-radius: 50px;
	text-decoration: none !important;
	width: fit-content;
	transition: background .25s ease, transform .25s ease;
}

.pdms-read-btn:hover {
	background: var(--pdms-accent);
	color: var(--pdms-dark) !important;
	transform: translateY(-2px);
}

.pdms-main-image {
	flex: 1 1 50%;
	position: relative;
	background: var(--pdms-accent);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 34px;
	overflow: hidden;
	min-width: 260px;
}

.pdms-main-image::before {
	content: "";
	position: absolute;
	inset: 0;
	background-image: radial-gradient(rgba(255,255,255,0.18) 1.5px, transparent 1.5px);
	background-size: 18px 18px;
	opacity: .5;
}

.pdms-main-image img {
	position: relative;
	z-index: 1;
	max-width: 100%;
	max-height: 320px;
	width: auto;
	border-radius: 14px;
	box-shadow: 0 20px 45px rgba(0,0,0,0.25);
	object-fit: cover;
	transition: transform .4s ease;
}

.pdms-main-item:hover .pdms-main-image img {
	transform: scale(1.03);
}

/* ===================== Responsive — Main widget ===================== */
@media (max-width: 900px) {
	.pdms-main-item,
	.pdms-main-item.pdms-reverse {
		flex-direction: column;
	}
	.pdms-main-content {
		padding: 36px 28px;
	}
	.pdms-main-title {
		font-size: 24px;
	}
	.pdms-main-image {
		min-height: 240px;
	}
	.pdms-main-item {
		margin-bottom: 26px;
	}
	/* Stacking-deck effect is disabled on smaller screens — cards get tall
	   there and a normal scroll list reads much better than a card stack. */
	.pdms-stack-enabled .pdms-main-item {
		position: relative !important;
		top: auto !important;
		margin-bottom: 26px !important;
	}
	.pdms-stack-enabled {
		padding-bottom: 0;
	}
}


/* ===========================================================
   SINGLE PORTFOLIO WIDGET
   =========================================================== */
.pdms-single-wrap {
	--pdms-accent: #02e3a7;
	--pdms-dark: #13144d;
	font-family: inherit;
}

.pdms-single-hero {
	position: relative;
	border-radius: 24px;
	overflow: hidden;
	background: var(--pdms-dark);
	color: #fff;
	padding: 60px 50px;
	margin-bottom: 40px;
}

.pdms-single-hero::after {
	content: "";
	position: absolute;
	inset: 0;
	background: radial-gradient(circle at 85% 20%, rgba(2,227,167,0.35), transparent 55%);
	pointer-events: none;
}

.pdms-single-category {
	position: relative;
	display: inline-block;
	text-transform: uppercase;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 1.2px;
	color: var(--pdms-accent);
	background: rgba(2,227,167,0.12);
	padding: 6px 16px;
	border-radius: 30px;
	margin-bottom: 18px;
}

.pdms-single-title {
	position: relative;
	font-size: 38px;
	font-weight: 800;
	margin: 0 0 22px 0;
	line-height: 1.2;
	max-width: 720px;
}

.pdms-single-meta-row {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	gap: 34px;
}

.pdms-single-meta-item {
	font-size: 14px;
	color: rgba(255,255,255,0.85);
}

.pdms-single-meta-item strong {
	display: block;
	color: #fff;
	font-weight: 700;
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: .5px;
	margin-bottom: 4px;
	opacity: .7;
}

.pdms-single-featured {
	width: 100%;
	border-radius: 20px;
	overflow: hidden;
	margin-bottom: 40px;
	box-shadow: 0 20px 50px rgba(19,20,77,0.15);
}

.pdms-single-featured img {
	width: 100%;
	height: auto;
	display: block;
	max-height: 520px;
	object-fit: cover;
}

.pdms-single-body {
	display: grid;
	grid-template-columns: 2fr 1fr;
	gap: 50px;
	margin-bottom: 50px;
}

.pdms-single-description {
	font-size: 16px;
	line-height: 1.85;
	color: #3c3f57;
}

.pdms-single-description p {
	margin: 0 0 18px 0;
}

.pdms-single-sidebar {
	background: #f7f8fc;
	border-radius: 18px;
	padding: 30px;
	height: fit-content;
}

.pdms-sidebar-block {
	margin-bottom: 26px;
}

.pdms-sidebar-block:last-child {
	margin-bottom: 0;
}

.pdms-sidebar-label {
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 1px;
	font-weight: 700;
	color: #8a8fa3;
	margin-bottom: 8px;
}

.pdms-sidebar-value {
	font-size: 16px;
	font-weight: 700;
	color: var(--pdms-dark);
}

.pdms-sidebar-tech {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
}

.pdms-single-gallery {
	margin-bottom: 55px;
}

.pdms-single-gallery-heading {
	font-size: 22px;
	font-weight: 800;
	color: var(--pdms-dark);
	margin-bottom: 20px;
}

.pdms-gallery-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 18px;
}

.pdms-gallery-grid img {
	width: 100%;
	height: 180px;
	object-fit: cover;
	border-radius: 14px;
	box-shadow: 0 8px 24px rgba(19,20,77,0.1);
	transition: transform .3s ease;
	cursor: zoom-in;
}

.pdms-gallery-grid img:hover {
	transform: translateY(-4px);
}

.pdms-related-heading {
	font-size: 22px;
	font-weight: 800;
	color: var(--pdms-dark);
	margin-bottom: 22px;
}

.pdms-related-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 24px;
}

.pdms-related-card {
	display: block;
	text-decoration: none !important;
	background: #fff;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 8px 26px rgba(19,20,77,0.08);
	transition: transform .25s ease;
}

.pdms-related-card:hover {
	transform: translateY(-4px);
}

.pdms-related-card img {
	width: 100%;
	height: 160px;
	object-fit: cover;
	display: block;
}

.pdms-related-card-body {
	padding: 18px 20px;
}

.pdms-related-category {
	text-transform: uppercase;
	font-size: 11px;
	font-weight: 700;
	color: var(--pdms-accent);
	margin-bottom: 6px;
	letter-spacing: .5px;
}

.pdms-related-title {
	font-size: 16px;
	font-weight: 700;
	color: var(--pdms-dark);
	margin: 0;
	line-height: 1.4;
}

/* Lightbox for gallery */
.pdms-lightbox {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(10,10,20,0.9);
	z-index: 99999;
	align-items: center;
	justify-content: center;
	padding: 30px;
}

.pdms-lightbox.active {
	display: flex;
}

.pdms-lightbox img {
	max-width: 90%;
	max-height: 85vh;
	border-radius: 10px;
}

.pdms-lightbox-close {
	position: absolute;
	top: 24px;
	right: 34px;
	color: #fff;
	font-size: 36px;
	cursor: pointer;
	line-height: 1;
}

/* ===================== Responsive — Single widget ===================== */
@media (max-width: 900px) {
	.pdms-single-body {
		grid-template-columns: 1fr;
	}
	.pdms-single-hero {
		padding: 40px 26px;
	}
	.pdms-single-title {
		font-size: 28px;
	}
}

@media (max-width: 480px) {
	.pdms-single-meta-row {
		gap: 20px;
	}
	.pdms-single-title {
		font-size: 24px;
	}
}
