/**
 * Vini Custom Post — front-end grid.
 * Apple-style glassmorphism: light, soft, elevated, responsive.
 */

.vcp-grid-wrap {
	/* Clean white background. */
	--vcp-bg: #ffffff;
	--vcp-card-bg: #ffffff;
	--vcp-card-border: rgba(0, 0, 0, 0.06);
	--vcp-ink: #1d1d1f;
	--vcp-ink-soft: #6e6e73;
	--vcp-accent: #0071e3;
	--vcp-radius: 20px;
	--vcp-gap: 22px;

	box-sizing: border-box;
	width: 100%;
	/* Minimum outer margin — a few pixels only, so hover shadows aren't clipped. */
	margin: 0 auto;
	padding: 4px;
	background: var(--vcp-bg);
	border-radius: 0;
	-webkit-font-smoothing: antialiased;
	font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display",
		"Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.vcp-grid-wrap *,
.vcp-grid-wrap *::before,
.vcp-grid-wrap *::after {
	box-sizing: border-box;
}

.vcp-grid {
	display: grid;
	gap: var(--vcp-gap);
	grid-template-columns: repeat(var(--vcp-cols, 3), minmax(0, 1fr));
}

/* ---------- Card ---------- */
.vcp-card {
	position: relative;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: var(--vcp-card-bg);
	border: 1px solid var(--vcp-card-border);
	border-radius: var(--vcp-radius);
	/* Frosted glass. */
	-webkit-backdrop-filter: blur(22px) saturate(180%);
	backdrop-filter: blur(22px) saturate(180%);
	/* Layered, soft shadow for an elevated, raised feel. */
	box-shadow:
		0 1px 1px rgba(0, 0, 0, 0.04),
		0 10px 24px -8px rgba(20, 30, 60, 0.18),
		inset 0 1px 0 rgba(255, 255, 255, 0.6);
	transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
		box-shadow 0.45s cubic-bezier(0.22, 1, 0.36, 1);
	will-change: transform;
}

.vcp-card:hover,
.vcp-card:focus-within {
	transform: translateY(-7px);
	box-shadow:
		0 1px 1px rgba(0, 0, 0, 0.05),
		0 28px 50px -16px rgba(20, 30, 60, 0.28),
		inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

/* ---------- Media ---------- */
.vcp-card-media {
	display: block;
	overflow: hidden;
	aspect-ratio: 16 / 10;
	background: linear-gradient(135deg, #e9edf6, #dfe4f1);
}

.vcp-thumb {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.vcp-card:hover .vcp-thumb {
	transform: scale(1.05);
}

.vcp-thumb--placeholder {
	background:
		radial-gradient(120% 120% at 0% 0%, rgba(0, 113, 227, 0.12), transparent 60%),
		linear-gradient(135deg, #e9edf6, #dfe4f1);
}

/* ---------- Body ---------- */
.vcp-card-body {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: clamp(18px, 2vw, 24px);
}

.vcp-card-title {
	margin: 0;
	font-size: clamp(1.05rem, 1.2vw, 1.2rem);
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: -0.01em;
	color: var(--vcp-ink);
}

/* Clean title — no underline, even against themes that force one on links. */
.vcp-grid-wrap .vcp-card-title a {
	color: inherit;
	text-decoration: none !important;
	box-shadow: none;
	border-bottom: 0;
	background-image: none;
	transition: color 0.2s ease;
}

.vcp-grid-wrap .vcp-card-title a:hover,
.vcp-grid-wrap .vcp-card-title a:focus-visible {
	color: var(--vcp-accent);
}

.vcp-card-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	font-size: 0.82rem;
	color: var(--vcp-ink-soft);
}

.vcp-meta-sep {
	opacity: 0.5;
}

.vcp-card-excerpt {
	margin: 2px 0 0;
	font-size: 0.94rem;
	line-height: 1.6;
	color: #44454a;
}

.vcp-grid-wrap .vcp-card-link {
	margin-top: 6px;
	align-self: flex-start;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 0.88rem;
	font-weight: 600;
	color: var(--vcp-accent);
	text-decoration: none !important;
	box-shadow: none;
	border-bottom: 0;
}

.vcp-card-link span {
	transition: transform 0.3s ease;
}

.vcp-card-link:hover span,
.vcp-card-link:focus-visible span {
	transform: translateX(4px);
}

/* ---------- Empty state ---------- */
.vcp-empty {
	margin: 0;
	padding: 28px;
	text-align: center;
	color: var(--vcp-ink-soft);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ---------- Accessibility ---------- */
.vcp-card a:focus-visible {
	outline: 2px solid var(--vcp-accent);
	outline-offset: 3px;
	border-radius: 4px;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
	.vcp-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 600px) {
	.vcp-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.vcp-grid-wrap {
		--vcp-gap: 20px;
	}
}

/* Respect users who prefer reduced motion. */
@media (prefers-reduced-motion: reduce) {
	.vcp-card,
	.vcp-thumb,
	.vcp-card-title a,
	.vcp-card-link span {
		transition: none;
	}

	.vcp-card:hover,
	.vcp-card:focus-within {
		transform: none;
	}

	.vcp-card:hover .vcp-thumb {
		transform: none;
	}
}
