/* ===========================================================
   Portfolio Grid widget — Portfolio Dev by M.Salman
   =========================================================== */
.pdmsg {
	--pdms-accent: #02e3a7;
	--pdms-dark: #13144d;
	--pdms-card: #ffffff;
	width: 100%;
	font-family: inherit;
}

.pdmsg *,
.pdmsg *::before,
.pdmsg *::after {
	box-sizing: border-box;
}

/* ---------- Filter tabs ---------- */
.pdmsg-filters {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
	margin: 0 0 40px;
}

.pdmsg-filter {
	appearance: none;
	cursor: pointer;
	padding: 11px 22px;
	border-radius: 50px;
	border: 1px solid rgba(19, 20, 77, 0.14);
	background: #fff;
	color: var(--pdms-dark);
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	transition: all .25s ease;
}

.pdmsg-filter:hover {
	border-color: var(--pdms-accent);
	transform: translateY(-2px);
}

.pdmsg-filter.is-active {
	background: var(--pdms-dark);
	border-color: var(--pdms-dark);
	color: #fff;
	box-shadow: 0 10px 24px rgba(19, 20, 77, 0.22);
}

/* ---------- Grid ---------- */
.pdmsg-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 30px;
	align-items: stretch;
}

/* ---------- Card ---------- */
.pdmsg-card {
	position: relative;
	display: flex;
	flex-direction: column;
	background: var(--pdms-card);
	border-radius: 22px;
	overflow: hidden;
	border: 1px solid rgba(19, 20, 77, 0.06);
	box-shadow: 0 12px 38px rgba(19, 20, 77, 0.08);
	transition: transform .35s ease, box-shadow .35s ease;
	animation: pdmsg-in .6s ease both;
}

.pdmsg-card:hover {
	transform: translateY(-8px);
	box-shadow: 0 28px 60px rgba(19, 20, 77, 0.18);
}

.pdmsg-card.is-hidden {
	display: none;
}

@keyframes pdmsg-in {
	from { opacity: 0; transform: translateY(24px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* stagger */
.pdmsg-card:nth-child(3n+2) { animation-delay: .08s; }
.pdmsg-card:nth-child(3n+3) { animation-delay: .16s; }

/* ---------- Image ---------- */
.pdmsg-thumb {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: linear-gradient(135deg, var(--pdms-dark), #2a2c8f);
	line-height: 0;
}

.pdmsg-thumb::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, transparent 55%, rgba(19, 20, 77, 0.35));
	opacity: 0;
	transition: opacity .35s ease;
}

.pdmsg-card:hover .pdmsg-thumb::after {
	opacity: 1;
}

.pdmsg-thumb img {
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	object-fit: cover;
	margin: 0 !important;
	transition: transform .7s ease;
}

.pdmsg-card:hover .pdmsg-thumb img {
	transform: scale(1.08);
}

.pdmsg-noimg {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 64px;
	font-weight: 800;
	line-height: 1;
	color: rgba(255, 255, 255, 0.85);
}

/* category chip over image */
.pdmsg-cat {
	position: absolute;
	top: 16px;
	left: 16px;
	z-index: 2;
	padding: 7px 14px;
	border-radius: 30px;
	background: var(--pdms-accent);
	color: var(--pdms-dark);
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 1px;
	text-transform: uppercase;
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

/* ---------- Body ---------- */
.pdmsg-body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	padding: 26px 26px 28px;
}

.pdmsg-title {
	margin: 0 0 20px;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--pdms-dark);
}

.pdmsg-title a {
	color: inherit !important;
	text-decoration: none !important;
	background-image: linear-gradient(var(--pdms-accent), var(--pdms-accent));
	background-repeat: no-repeat;
	background-position: 0 100%;
	background-size: 0 2px;
	transition: background-size .35s ease;
}

.pdmsg-card:hover .pdmsg-title a {
	background-size: 100% 2px;
}

/* meta */
.pdmsg-meta {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
	margin-bottom: 18px;
	padding: 16px 0;
	border-top: 1px dashed rgba(19, 20, 77, 0.14);
	border-bottom: 1px dashed rgba(19, 20, 77, 0.14);
}

.pdmsg-meta-item {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.pdmsg-meta-label {
	font-size: 11px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: #8a8ea8;
}

.pdmsg-meta-value {
	font-size: 15px;
	font-weight: 600;
	line-height: 1.4;
	color: var(--pdms-dark);
	overflow-wrap: anywhere;
}

/* technologies */
.pdmsg-tech {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 24px;
}

.pdmsg-tech-icons {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.pdmsg-tech-icon {
	width: 42px;
	height: 42px;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: #fff;
	border: 1px solid #eef0f6;
	box-shadow: 0 4px 12px rgba(19, 20, 77, 0.10);
	overflow: hidden;
	transition: transform .25s ease, border-color .25s ease;
}

.pdmsg-tech-icon:hover {
	transform: translateY(-3px);
	border-color: var(--pdms-accent);
}

.pdmsg-tech-icon img {
	width: 58% !important;
	height: 58% !important;
	max-width: none !important;
	object-fit: contain;
	margin: 0 !important;
}

/* button (pushed to bottom so all cards align) */
.pdmsg-btn {
	margin-top: auto;
	display: inline-flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	width: 100%;
	padding: 8px 8px 8px 24px;
	border-radius: 50px;
	background: var(--pdms-dark);
	color: #fff !important;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: .6px;
	text-transform: uppercase;
	text-decoration: none !important;
	transition: background .25s ease, color .25s ease, transform .25s ease;
}

.pdmsg-btn-arrow {
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: var(--pdms-accent);
	color: var(--pdms-dark);
	transition: transform .3s ease;
}

.pdmsg-btn:hover {
	background: var(--pdms-accent);
	color: var(--pdms-dark) !important;
}

.pdmsg-btn:hover .pdmsg-btn-arrow {
	background: var(--pdms-dark);
	color: var(--pdms-accent);
	transform: rotate(45deg);
}

.pdmsg-empty {
	margin: 30px 0 0;
	text-align: center;
	font-size: 15px;
	color: #8a8ea8;
}

/* ---------- Responsive fallbacks (Elementor controls override columns/gap) ---------- */
@media (max-width: 1024px) {
	.pdmsg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
	.pdmsg-title { font-size: 20px; }
}

@media (max-width: 767px) {
	.pdmsg-grid { grid-template-columns: minmax(0, 1fr); gap: 22px; }
	.pdmsg-filters { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; margin-bottom: 28px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
	.pdmsg-filters::-webkit-scrollbar { display: none; }
	.pdmsg-filter { flex-shrink: 0; padding: 10px 18px; font-size: 13px; }
	.pdmsg-body { padding: 22px 20px 24px; }
	.pdmsg-title { font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
	.pdmsg-card { animation: none; }
	.pdmsg-card, .pdmsg-thumb img, .pdmsg-btn-arrow { transition: none; }
}
