/* ==========================================================================
   Vendavo Multi-Type Card Grid
   - "image_back" card design: featured image as full-bleed background with
     a dark gradient overlay so light text stays readable.
   - Pill-style filter tabs (one per post type + optional "All").
   - AJAX Load More button beneath the grid.
   ========================================================================== */

.vmcg {
	width: 100%;
	--vmcg-transition: 220ms;
	color: #FFFFFF;
}

/* ── Header (heading + tabs sit on the same row) ────────────────────────── */

.vmcg-header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 24px;
}

.vmcg-heading {
	margin: 0;
	font-size: 2.25rem;
	line-height: 1.15;
	font-weight: 700;
	color: #FFFFFF;
}

.vmcg-heading__accent {
	color: #F97676;
}

.vmcg-heading__main {
	color: inherit;
}

/* ── Tabs ───────────────────────────────────────────────────────────────── */

.vmcg-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: flex-end;
}

.vmcg-tab {
	appearance: none;
	cursor: pointer;
	font: inherit;
	line-height: 1.2;
	padding: 8px 22px;
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, 0.45);
	background: transparent;
	color: #FFFFFF;
	transition:
		background-color var(--vmcg-transition) ease,
		color var(--vmcg-transition) ease,
		border-color var(--vmcg-transition) ease,
		transform var(--vmcg-transition) ease;
}

.vmcg-tab:hover {
	background-color: rgba(255, 255, 255, 0.12);
}

.vmcg-tab.is-active {
	background-color: #F97676;
	border-color: #F97676;
	color: #FFFFFF;
}

.vmcg-tab:focus-visible {
	outline: 2px solid #FFFFFF;
	outline-offset: 2px;
}

/* ── Grid ───────────────────────────────────────────────────────────────── */

.vmcg-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
}

/*
 * Staggered layout — 5-column track, two cards per row, with widths that
 * alternate every 4 cards so the visible pattern is:
 *   row 1 → wide  | narrow
 *   row 2 → narrow | wide
 *   row 3 → wide  | narrow
 *   ...
 * Because nth-child keeps counting across all DOM siblings, AJAX-appended
 * Load-More cards continue the same alternation seamlessly.
 */
.vmcg-grid--staggered {
	grid-template-columns: repeat(5, minmax(0, 1fr));
}

.vmcg-grid--staggered > .vmcg-card {
	grid-column: span 3; /* default = wide  (60%) */
}

.vmcg-grid--staggered > .vmcg-card:nth-child(4n + 2),
.vmcg-grid--staggered > .vmcg-card:nth-child(4n + 3) {
	grid-column: span 2; /* narrow (40%) */
}

.vmcg-empty {
	grid-column: 1 / -1;
	text-align: center;
	color: rgba(255, 255, 255, 0.7);
	margin: 24px 0;
}

/* ── Card ───────────────────────────────────────────────────────────────── */

.vmcg-card {
	position: relative;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border-radius: 12px;
	min-height: 280px;
	background: #2D234B center / cover no-repeat;
	color: #FFFFFF;
	transition:
		transform var(--vmcg-transition) ease,
		box-shadow var(--vmcg-transition) ease;
	isolation: isolate;
}

.vmcg-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
}

/* Dark gradient overlay sits ABOVE the bg image but BELOW the card body. */
.vmcg-card::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0.18) 0%, rgba(15, 7, 60, 0.55) 100%);
	z-index: 0;
	pointer-events: none;
	border-radius: inherit;
}

.vmcg-card__body {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 22px 22px 18px;
	flex: 1;
}

.vmcg-card__title {
	margin: 0;
	font-size: 1.1rem;
	font-weight: 600;
	line-height: 1.3;
	color: #FFFFFF;
}

.vmcg-card__title a {
	color: inherit;
	text-decoration: none;
}



.vmcg-card__excerpt {
	margin: 0;
	font-size: .9rem;
	line-height: 1.5;
	color: #E7E2F5;
}

/* ── Meta (time / date / location) ──────────────────────────────────────── */

.vmcg-card__meta {
	list-style: none;
	margin: 6px 0 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
	color: #FFFFFF;
	font-size: .85rem;
}

.vmcg-card__meta-item {
	display: flex;
	align-items: center;
	gap: 8px;
}

.vmcg-card__meta-text {
	line-height: 1.3;
}

.vmcg-icon {
	width: 14px;
	height: 14px;
	display: inline-block;
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
	flex: 0 0 auto;
}

/* Inline SVG data-URLs use white stroke so they read on the dark card. */
.vmcg-icon--time {
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFFFFF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9'/><polyline points='12 7 12 12 15 14'/></svg>");
}

.vmcg-icon--cal {
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFFFFF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='4' width='18' height='18' rx='2'/><line x1='16' y1='2' x2='16' y2='6'/><line x1='8' y1='2' x2='8' y2='6'/><line x1='3' y1='10' x2='21' y2='10'/></svg>");
}

.vmcg-icon--pin {
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFFFFF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 1 1 18 0z'/><circle cx='12' cy='10' r='3'/></svg>");
}

/* ── Footer (pills + arrow) ─────────────────────────────────────────────── */

.vmcg-card__footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: auto;
	padding-top: 14px;
}

.vmcg-card__pills {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	min-width: 0;
}

.vmcg-card__pills--empty {
	display: block; /* keeps the arrow flush right when no pills */
}

.vmcg-pill {
	display: inline-block;
	padding: 5px 14px;
	border-radius: 999px;
	font-size: .78rem;
	background: rgba(0, 0, 0, 0.55);
	border: 1px solid rgba(255, 255, 255, 0.25);
	color: #FFFFFF;
	white-space: nowrap;
}

.vmcg-arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.2);
	border: 1px solid rgba(255, 255, 255, 0.45);
	color: #FFFFFF;
	text-decoration: none;
	flex: 0 0 auto;
	transition:
		transform var(--vmcg-transition) ease,
		background var(--vmcg-transition) ease;
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
}

.vmcg-arrow:hover {
	background: rgba(255, 255, 255, 0.35);
	transform: translateX(2px);
	color: #FFFFFF;
}

/* ── Load More ──────────────────────────────────────────────────────────── */

.vmcg-loadmore-wrap {
	display: flex;
	justify-content: center;
	margin-top: 32px;
}

.vmcg-loadmore-wrap[hidden] {
	display: none;
}

.vmcg-loadmore {
	appearance: none;
	display: inline-block;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	font: inherit;
	line-height: 1.2;
	padding: 12px 36px;
	border-radius: 999px;
	border: 1px solid #F97676;
	background: #F97676;
	color: #FFFFFF;
	min-width: 180px;
	transition:
		transform var(--vmcg-transition) ease,
		filter var(--vmcg-transition) ease,
		opacity var(--vmcg-transition) ease;
}

.vmcg-loadmore:hover {
	filter: brightness(1.08);
	transform: translateY(-1px);
	text-decoration: none;
	color: #FFFFFF;
}

.vmcg-loadmore.is-loading {
	opacity: .6;
	pointer-events: none;
}

.vmcg.is-fetching .vmcg-grid {
	opacity: .55;
	transition: opacity .2s ease;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 1024px) {
	/* Tablet: keep the staggered pattern (still two visible cards per row). */
	.vmcg-grid:not(.vmcg-grid--staggered) {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.vmcg-heading { font-size: 1.85rem; }
}

@media (max-width: 640px) {
	/* Mobile: single column, drop the staggered widths so cards stretch full-bleed. */
	.vmcg-grid {
		grid-template-columns: 1fr;
	}

	.vmcg-grid--staggered > .vmcg-card,
	.vmcg-grid--staggered > .vmcg-card:nth-child(4n + 2),
	.vmcg-grid--staggered > .vmcg-card:nth-child(4n + 3) {
		grid-column: 1 / -1;
	}

	.vmcg-header {
		flex-direction: column;
		align-items: flex-start;
		gap: 12px;
	}

	.vmcg-tabs {
		justify-content: flex-start;
		width: 100%;
	}

	.vmcg-heading { font-size: 1.6rem; }

	.vmcg-card { min-height: 240px; }

	.vmcg-card__title { font-size: 1rem; }
	.vmcg-card__excerpt { font-size: .85rem; }
}
