/**
 * Featured Portfolio Showcase — Card Style 5
 *
 * White card: edge-to-edge image top → footer row (title + category | badge).
 *
 * @package Zouetech_Portfolio
 */

.ztp-fs--card-style-5 {
	--ztp-fs-cols-d: 2;
	--ztp-fs-cols-t: 2;
	--ztp-fs-cols-m: 1;
	--ztp-fs-s5-gap: 24px;
	--ztp-fs-s5-card-radius: 14px;
	--ztp-fs-s5-card-bg: #ffffff;
	--ztp-fs-s5-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
	--ztp-fs-s5-footer-pad: 16px 18px 18px;
	--ztp-fs-s5-aspect: 16 / 9;
	--ztp-fs-s5-object-fit: cover;
	--ztp-fs-s5-title-color: #1a1a1a;
	--ztp-fs-s5-title-hover: #333333;
	--ztp-fs-s5-cat-color: #8a8a96;
	--ztp-fs-s5-meta-gap: 4px;
	--ztp-fs-s5-badge-bg: #ffffff;
	--ztp-fs-s5-badge-color: #4a4a55;
	--ztp-fs-s5-badge-border: 1px solid #e4e4ea;
	--ztp-fs-s5-badge-radius: 999px;
	--ztp-fs-s5-badge-pad: 6px 12px;
	--ztp-fs-s5-badge-max: 40%;
}

.ztp-fs--card-style-5.is-fit-cover {
	--ztp-fs-s5-object-fit: cover;
}

.ztp-fs--card-style-5.is-fit-contain {
	--ztp-fs-s5-object-fit: contain;
}

.ztp-fs--card-style-5.is-aspect-16-9 { --ztp-fs-s5-aspect: 16 / 9; }
.ztp-fs--card-style-5.is-aspect-4-3 { --ztp-fs-s5-aspect: 4 / 3; }
.ztp-fs--card-style-5.is-aspect-1-1 { --ztp-fs-s5-aspect: 1 / 1; }

.ztp-fs--card-style-5 .ztp-fs__cards--s5 {
	display: grid;
	grid-template-columns: repeat(var(--ztp-fs-cols-d), minmax(0, 1fr));
	gap: var(--ztp-fs-s5-gap);
	align-items: start;
}

.ztp-fs--card-style-5.is-equal-height .ztp-fs__cards--s5 {
	align-items: stretch;
}

/*
 * Outer card — white bg, radius, border/shadow via Elementor.
 * Base transparent/no-shadow !important excludes .ztp-fs__card--s5.
 */
.ztp-fs--card-style-5 .ztp-fs__card--s5,
.ztp-fs--card-style-5 article.ztp-fs__card.ztp-fs__card--s5 {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 0;
	min-width: 0;
	margin: 0;
	padding: 0;
	background: var(--ztp-fs-s5-card-bg);
	background-color: var(--ztp-fs-s5-card-bg);
	border-radius: var(--ztp-fs-s5-card-radius);
	box-shadow: var(--ztp-fs-s5-shadow);
	overflow: hidden;
	text-decoration: none;
	color: inherit;
	transform: none;
	will-change: auto;
	box-sizing: border-box;
	transition: box-shadow 280ms ease;
}

.ztp-fs--card-style-5 .ztp-fs__card--s5:hover,
.ztp-fs--card-style-5 .ztp-fs__card--s5:focus,
.ztp-fs--card-style-5 .ztp-fs__card--s5:focus-within {
	transform: none;
}

.ztp-fs--card-style-5.is-equal-height .ztp-fs__card--s5 {
	height: 100%;
}

.ztp-fs--card-style-5 .ztp-fs__s5-card-link {
	position: absolute;
	inset: 0;
	z-index: 4;
	border-radius: inherit;
}

/* Image — edge-to-edge top of card */
.ztp-fs--card-style-5 .ztp-fs__s5-media {
	position: relative;
	z-index: 1;
	width: 100%;
	flex: 0 0 auto;
	margin: 0;
	padding: 0;
	overflow: hidden;
	background: #f3f3f3;
}

.ztp-fs--card-style-5 .ztp-fs__s5-media-link {
	display: block;
	width: 100%;
	aspect-ratio: var(--ztp-fs-s5-aspect);
	text-decoration: none;
	overflow: hidden;
}

.ztp-fs--card-style-5 .ztp-fs__s5-media-link img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: var(--ztp-fs-s5-object-fit);
	object-position: center center;
}

/* Footer row — title+category | badge */
.ztp-fs--card-style-5 .ztp-fs__s5-footer {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	margin: 0;
	padding: var(--ztp-fs-s5-footer-pad);
	box-sizing: border-box;
	flex: 1 1 auto;
	min-width: 0;
}

.ztp-fs--card-style-5 .ztp-fs__s5-meta {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--ztp-fs-s5-meta-gap);
	min-width: 0;
	flex: 1 1 auto;
}

.ztp-fs--card-style-5 .ztp-fs__s5-title {
	margin: 0;
	padding: 0;
	font-size: 1.05rem;
	font-weight: 700;
	line-height: 1.35;
	letter-spacing: -0.01em;
	color: var(--ztp-fs-s5-title-color);
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	overflow: hidden;
}

.ztp-fs--card-style-5 .ztp-fs__s5-title a,
.ztp-fs--card-style-5 .ztp-fs__s5-title span {
	color: inherit;
	text-decoration: none;
	transition: color 200ms ease;
}

.ztp-fs--card-style-5 .ztp-fs__s5-title a:hover,
.ztp-fs--card-style-5 .ztp-fs__card--s5:hover .ztp-fs__s5-title a {
	color: var(--ztp-fs-s5-title-hover);
}

.ztp-fs--card-style-5 .ztp-fs__s5-category {
	margin: 0;
	padding: 0;
	font-size: 0.875rem;
	font-weight: 400;
	line-height: 1.4;
	color: var(--ztp-fs-s5-cat-color);
}

.ztp-fs--card-style-5 .ztp-fs__s5-category a,
.ztp-fs--card-style-5 .ztp-fs__s5-category span {
	color: inherit;
	text-decoration: none;
}

/* Dynamic badge/pill — no shrink, ellipsis if long */
.ztp-fs--card-style-5 .ztp-fs__s5-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	max-width: var(--ztp-fs-s5-badge-max);
	margin: 0;
	padding: var(--ztp-fs-s5-badge-pad);
	border: var(--ztp-fs-s5-badge-border);
	border-radius: var(--ztp-fs-s5-badge-radius);
	background: var(--ztp-fs-s5-badge-bg);
	color: var(--ztp-fs-s5-badge-color);
	font-size: 0.8125rem;
	font-weight: 500;
	line-height: 1.2;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	box-sizing: border-box;
}

@media (max-width: 1024px) {
	.ztp-fs--card-style-5 .ztp-fs__cards--s5 {
		grid-template-columns: repeat(var(--ztp-fs-cols-t), minmax(0, 1fr));
	}
}

@media (max-width: 767px) {
	.ztp-fs--card-style-5 .ztp-fs__cards--s5 {
		grid-template-columns: repeat(var(--ztp-fs-cols-m), minmax(0, 1fr));
	}

	.ztp-fs--card-style-5 {
		--ztp-fs-s5-gap: 16px;
		--ztp-fs-s5-footer-pad: 14px 14px 16px;
	}

	.ztp-fs--card-style-5.is-stack-badge-m .ztp-fs__s5-footer {
		flex-direction: column;
		align-items: flex-start;
	}

	.ztp-fs--card-style-5.is-stack-badge-m .ztp-fs__s5-badge {
		max-width: 100%;
	}
}
