/* components/project-feed/project-feed.css */

.mvc-project-feed .mvc-service-grid__header {
	margin-block-end: var(--space-16);
}

/* Before/after image pair */
.mvc-project-card__before-after {
	display: grid;
	grid-template-columns: 1fr 1fr;
	position: relative;
}

.mvc-project-card__before,
.mvc-project-card__after {
	position: relative;
	overflow: hidden;
	aspect-ratio: 4 / 3;
}

.mvc-project-card__ba-label {
	position: absolute;
	top: var(--space-3);
	left: var(--space-3);
	z-index: 1;
	background-color: rgba(0, 0, 0, 0.6);
	color: #fff;
	font-size: var(--text-xs);
	font-weight: var(--mvc-font-weight-heading, var(--font-weight-bold, 700));
	letter-spacing: var(--tracking-wider);
	text-transform: uppercase;
	padding: var(--space-1) var(--space-3);
	border-radius: var(--radius-sm);
}

.mvc-project-card__service-link {
	font-size: var(--text-xs);
	font-weight: var(--font-medium);
	color: var(--color-primary);
	text-decoration: none;
}

.mvc-project-card__location {
	font-size: var(--text-xs);
	color: var(--color-text-muted);
}

/* ── Style overrides ────────────────────────────────────────────────────── */

/* Overlay grid — image fills card, title/type overlaid at bottom.
   PAINT flows from the card preset; this block is structure-only.
   Image overlay scrim uses the editor-tunable --pf-overlay-* vars. */
.mvc-project-feed--style-overlay-grid .mvc-post-card {
	position: relative;
	overflow: hidden;
	min-height: 300px;
}
.mvc-project-feed--style-overlay-grid .mvc-post-card__thumb-link {
	position: absolute;
	inset: 0;
	z-index: 0;
}
.mvc-project-feed--style-overlay-grid .mvc-post-card__thumb {
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.mvc-project-feed--style-overlay-grid .mvc-post-card::before {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 1;
	background-color: var(--pf-overlay-color, #000);
	opacity: var(--pf-overlay-opacity, 0.4);
	pointer-events: none;
}
.mvc-project-feed--style-overlay-grid .mvc-post-card__body {
	position: relative;
	z-index: 2;
	margin-top: auto;
	background: transparent !important;
	padding: var(--space-6);
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	height: 100%;
}

/* Before/after grid — side-by-side before/after within each card */
.mvc-project-feed--style-before-after-grid .mvc-post-grid {
	grid-template-columns: 1fr 1fr;
	gap: var(--space-6);
}
.mvc-project-feed--style-before-after-grid .mvc-project-card__before-after {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--space-1);
}
@media (max-width: 639px) {
	.mvc-project-feed--style-before-after-grid .mvc-post-grid {
		grid-template-columns: 1fr;
	}
}

/* Featured project — first project spans full width */
.mvc-project-feed--style-featured-project .mvc-post-grid {
	grid-template-columns: 1fr 1fr 1fr;
}
.mvc-project-feed--style-featured-project .mvc-post-card:first-child {
	grid-column: 1 / -1;
	display: grid;
	grid-template-columns: 1fr 1fr;
	align-items: center;
	gap: var(--space-10);
}
.mvc-project-feed--style-featured-project .mvc-post-card:first-child .mvc-post-card__thumb-link {
	aspect-ratio: 16 / 9;
	overflow: hidden;
}
.mvc-project-feed--style-featured-project .mvc-post-card:first-child .mvc-post-card__title {
	font-size: var(--text-3xl);
}
@media (max-width: 767px) {
	.mvc-project-feed--style-featured-project .mvc-post-grid {
		grid-template-columns: 1fr;
	}
	.mvc-project-feed--style-featured-project .mvc-post-card:first-child {
		grid-template-columns: 1fr;
	}
}

/* Masonry — CSS column masonry */
.mvc-project-feed--style-masonry .mvc-post-grid {
	display: block;
	columns: 2;
	column-gap: var(--space-6);
}
@media (min-width: 768px) {
	.mvc-project-feed--style-masonry .mvc-post-grid {
		columns: 3;
	}
}
.mvc-project-feed--style-masonry .mvc-post-card {
	break-inside: avoid;
	margin-block-end: var(--space-6);
	display: block;
}
.mvc-project-feed--style-masonry .mvc-post-card__thumb {
	aspect-ratio: auto;
}

/* Accordion panels */
.mvc-project-feed--style-accordion-panels .mvc-post-grid {
	display: flex !important;
	flex-direction: row;
	gap: 0;
	min-height: 520px;
	overflow: hidden;
	border-radius: var(--mvc-radius, 0.75rem);
}

.mvc-project-feed--style-accordion-panels .mvc-post-card {
	position: relative !important;
	flex: 1;
	overflow: hidden;
	border: none !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	cursor: pointer;
	transition: flex var(--duration-slow, 500ms) cubic-bezier(0.4, 0, 0.2, 1);
	transform: none !important;
}

.mvc-project-feed--style-accordion-panels .mvc-post-card:hover {
	flex: 4;
	transform: none !important;
	box-shadow: none !important;
}

.mvc-project-feed--style-accordion-panels .mvc-post-card__thumb-link {
	position: absolute !important;
	inset: 0;
	display: block;
	z-index: 0;
	background: none !important;
	border: none !important;
	box-shadow: none !important;
}

.mvc-project-feed--style-accordion-panels .mvc-post-card__thumb {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform var(--duration-slow, 500ms) ease;
}

.mvc-project-feed--style-accordion-panels .mvc-post-card:hover .mvc-post-card__thumb {
	transform: scale(1.05);
}

.mvc-project-feed--style-accordion-panels .mvc-post-card::before {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 1;
	background-color: var(--pf-overlay-color, #000) !important;
	opacity: var(--pf-overlay-opacity, 0.4);
	transition: opacity var(--duration-slow, 500ms) ease;
	pointer-events: none;
}

.mvc-project-feed--style-accordion-panels .mvc-post-card:hover::before {
	opacity: calc(var(--pf-overlay-opacity, 0.4) + 0.10);
}

.mvc-project-feed--style-accordion-panels .mvc-post-card__body {
	position: absolute !important;
	inset: 0 !important;
	z-index: 2;
	display: flex !important;
	flex-direction: column !important;
	justify-content: center !important;
	align-items: flex-start !important;
	padding: 1.5rem !important;
	margin: 0 !important;
	background: none !important;
	background-color: transparent !important;
	border: none !important;
	box-shadow: none !important;
	backdrop-filter: none !important;
	-webkit-backdrop-filter: none !important;
}

.mvc-project-feed--style-accordion-panels .mvc-post-card__title {
	font-size: 1.125rem !important;
	font-weight: 700 !important;
	line-height: 1.3 !important;
	margin: 0 0 0.5rem 0 !important;
	background: none !important;
	border: none !important;
	box-shadow: none !important;
	white-space: normal !important;
}

.mvc-project-feed--style-accordion-panels .mvc-post-card__title a {
	text-decoration: none !important;
}

.mvc-project-feed--style-accordion-panels .mvc-post-card__excerpt {
	font-size: 0.875rem !important;
	opacity: 0;
	transition: opacity 250ms ease;
	margin: 0 0 0.75rem 0 !important;
	background: none !important;
	border: none !important;
	box-shadow: none !important;
}

.mvc-project-feed--style-accordion-panels .mvc-post-card__more {
	display: inline-flex !important;
	align-items: center !important;
	gap: 0.25rem !important;
	font-size: 0.875rem !important;
	font-weight: 600 !important;
	text-decoration: underline !important;
	text-underline-offset: 3px !important;
	opacity: 0;
	transition: opacity 250ms ease 50ms;
	margin: 0 !important;
	background: none !important;
	border: none !important;
	box-shadow: none !important;
}

.mvc-project-feed--style-accordion-panels .mvc-post-card:hover .mvc-post-card__excerpt,
.mvc-project-feed--style-accordion-panels .mvc-post-card:hover .mvc-post-card__more {
	opacity: 1 !important;
}

.mvc-project-feed--style-accordion-panels .mvc-post-card + .mvc-post-card {
	border-left: 1px solid rgba(255,255,255,0.12) !important;
}

@media (max-width: 767px) {
	.mvc-project-feed--style-accordion-panels .mvc-post-grid {
		flex-direction: column !important;
		min-height: unset;
	}
	.mvc-project-feed--style-accordion-panels .mvc-post-card {
		flex: none !important;
		min-height: 240px;
	}
	.mvc-project-feed--style-accordion-panels .mvc-post-card__excerpt,
	.mvc-project-feed--style-accordion-panels .mvc-post-card__more {
		opacity: 1 !important;
	}
	.mvc-project-feed--style-accordion-panels .mvc-post-card + .mvc-post-card {
		border-left: none !important;
		border-top: 1px solid rgba(255,255,255,0.12) !important;
	}
}

/* Image overlay — full image with dark scrim, text at bottom */
.mvc-project-feed--style-image-overlay .mvc-post-card {
	position: relative;
	overflow: hidden;
	min-height: 340px;
	border: none !important;
	box-shadow: 0 4px 20px rgba(0,0,0,0.25) !important;
	transition: transform var(--duration-normal) ease, box-shadow var(--duration-normal) ease;
}

.mvc-project-feed--style-image-overlay .mvc-post-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 12px 36px rgba(0,0,0,0.38) !important;
}

.mvc-project-feed--style-image-overlay .mvc-post-card__thumb-link {
	position: absolute;
	inset: 0;
	z-index: 0;
	display: block;
}

.mvc-project-feed--style-image-overlay .mvc-post-card__thumb {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform var(--duration-slow) ease;
}

.mvc-project-feed--style-image-overlay .mvc-post-card:hover .mvc-post-card__thumb {
	transform: scale(1.04);
}

.mvc-project-feed--style-image-overlay .mvc-post-card::before {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 1;
	background-color: var(--pf-overlay-color, #000);
	opacity: var(--pf-overlay-opacity, 0.4);
	pointer-events: none;
	transition: opacity var(--duration-normal) ease;
}

.mvc-project-feed--style-image-overlay .mvc-post-card:hover::before {
	opacity: calc(var(--pf-overlay-opacity, 0.4) + 0.12);
}

.mvc-project-feed--style-image-overlay .mvc-post-card__body {
	position: absolute !important;
	inset: 0 !important;
	z-index: 2;
	display: flex !important;
	flex-direction: column !important;
	justify-content: flex-end !important;
	padding: 1.5rem !important;
	background: none !important;
	border: none !important;
	box-shadow: none !important;
	backdrop-filter: none !important;
	-webkit-backdrop-filter: none !important;
}

.mvc-project-feed--style-image-overlay .mvc-post-card__title,
.mvc-project-feed--style-image-overlay .mvc-post-card__title a,
.mvc-project-feed--style-image-overlay .mvc-post-card__excerpt,
.mvc-project-feed--style-image-overlay .mvc-post-card__more {
	background: none !important;
	border: none !important;
	box-shadow: none !important;
}

/* Featured + grid — first card spans full width, rest in 3-col grid */
.mvc-project-feed--style-featured-plus-grid .mvc-post-grid {
	grid-template-columns: 1fr 1fr 1fr;
}

.mvc-project-feed--style-featured-plus-grid .mvc-post-card:first-child {
	grid-column: 1 / -1;
	display: flex;
	flex-direction: row;
	gap: var(--space-8);
	align-items: center;
}

.mvc-project-feed--style-featured-plus-grid .mvc-post-card:first-child .mvc-post-card__thumb-link {
	flex: 0 0 45%;
}

@media (max-width: 767px) {
	.mvc-project-feed--style-featured-plus-grid .mvc-post-grid {
		grid-template-columns: 1fr;
	}
	.mvc-project-feed--style-featured-plus-grid .mvc-post-card:first-child {
		flex-direction: column;
	}
}

/* ═══════════════════════════════════════════════════════════════════════════
   CARD PRESETS  (PAINT layer)
   Bundled bg + heading + body + border recipes. Selected via the section's
   data-card-preset="..." attribute, emitted by project-feed.php from the
   pf_card_preset ACF field. Presets reference dashboard-driven tokens
   (--color-primary/-surface) so they automatically adapt per client.

   Per [[feedback_variant_css_scoping]], every selector here carries the
   data-card-preset ancestor — no bare .mvc-post-card rules.

   PRESET MAP:
     light          — white card, dark text, subtle border (default)
     light-tinted   — soft warm off-white, dark text
     dark           — primary bg, white text, no border
     dark-gradient  — primary → primary-dark gradient, white text
     brand-gradient — primary → accent gradient, white text

   ── DESIGN MODEL: three independent layers ──
   PAINT (this block, --card-*) → STRUCTURE (style-override blocks above)
   → OVERLAY (--pf-overlay-* on image-using overrides only).
   Presets always paint. Style overrides only rearrange structure — they
   never set colors. Overlay sits on top of any image so the editor can
   tune image darkness without it fighting preset text colors.
   ═══════════════════════════════════════════════════════════════════════════ */

/* Shared base — applies to every preset, every layout. !important is REQUIRED
   on bg/border/color rules to override bg-presets.css [data-bg-preset] which
   applies color !important to every h1-h6/p inside a section's bg preset
   wrapper. See [[project_bg_presets_important]]. */
.mvc-project-feed[data-card-preset] .mvc-post-card {
	background: var(--card-bg, var(--color-surface)) !important;
	border: 1px solid var(--card-border, transparent) !important;
	border-radius: var(--mvc-radius, 0.75rem);
	box-shadow: var(--card-shadow, 0 2px 12px rgba(0, 0, 0, 0.06));
	overflow: hidden;
	transition:
		transform var(--duration-normal) var(--ease-default),
		box-shadow var(--duration-normal) var(--ease-default);
}

.mvc-project-feed[data-card-preset] .mvc-post-card:hover,
.mvc-project-feed[data-card-preset] .mvc-post-card:focus-within {
	transform: translateY(-3px);
	box-shadow: var(--card-shadow-hover, 0 10px 28px rgba(0, 0, 0, 0.16));
}

.mvc-project-feed[data-card-preset] .mvc-post-card__title,
.mvc-project-feed[data-card-preset] .mvc-post-card__title a {
	color: var(--card-heading) !important;
}

.mvc-project-feed[data-card-preset] .mvc-post-card__excerpt {
	color: var(--card-body) !important;
}

.mvc-project-feed[data-card-preset] .mvc-post-card__more {
	color: var(--card-cta, var(--card-heading)) !important;
}

/* ── Light — white card, dark heading, muted body, subtle border ──────── */
.mvc-project-feed[data-card-preset="light"] {
	--card-bg:           #ffffff;
	--card-border:       rgba(0, 0, 0, 0.10);
	--card-heading:      #111111;
	--card-body:         #4b5563;
	--card-cta:          var(--color-primary);
	--card-shadow:       0 2px 12px rgba(0, 0, 0, 0.08);
	--card-shadow-hover: 0 10px 28px rgba(0, 0, 0, 0.14);
}

/* ── Light Tinted — soft warm off-white, dark text ────────────────────── */
.mvc-project-feed[data-card-preset="light-tinted"] {
	--card-bg:           #f5f3ef;
	--card-border:       transparent;
	--card-heading:      #111111;
	--card-body:         #4b5563;
	--card-cta:          var(--color-primary);
	--card-shadow:       0 2px 12px rgba(0, 0, 0, 0.06);
	--card-shadow-hover: 0 10px 28px rgba(0, 0, 0, 0.12);
}

/* ── Dark — solid brand color, white text, no border ──────────────────── */
.mvc-project-feed[data-card-preset="dark"] {
	--card-bg:           var(--color-primary);
	--card-border:       transparent;
	--card-heading:      #ffffff;
	--card-body:         rgba(255, 255, 255, 0.78);
	--card-cta:          var(--color-accent-light);
	--card-shadow:       0 4px 16px rgba(0, 0, 0, 0.18);
	--card-shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.28);
}

/* ── Dark Gradient — brand → deeper-brand, white text ─────────────────── */
.mvc-project-feed[data-card-preset="dark-gradient"] .mvc-post-card {
	background:
		linear-gradient(180deg,
			var(--color-primary) 0%,
			var(--color-primary-dark) 100%) !important;
	border-color: transparent !important;
}
.mvc-project-feed[data-card-preset="dark-gradient"] {
	--card-heading:      #ffffff;
	--card-body:         rgba(255, 255, 255, 0.78);
	--card-cta:          var(--color-accent-light);
	--card-shadow:       0 4px 16px rgba(0, 0, 0, 0.20);
	--card-shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.30);
}

/* ── Brand Gradient — primary → accent, white text ────────────────────── */
.mvc-project-feed[data-card-preset="brand-gradient"] .mvc-post-card {
	background:
		linear-gradient(135deg,
			var(--color-primary) 0%,
			var(--color-accent) 100%) !important;
	border-color: transparent !important;
}
.mvc-project-feed[data-card-preset="brand-gradient"] {
	--card-heading:      #ffffff;
	--card-body:         rgba(255, 255, 255, 0.86);
	--card-cta:          #ffffff;
	--card-shadow:       0 4px 16px rgba(0, 0, 0, 0.20);
	--card-shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.30);
}

/* ═══════════════════════════════════════════════════════════════════════════
   IMAGE OVERLAY (per-section, editor-tunable)
   When a structural style override puts text over a photographic image
   (overlay-grid, accordion-panels, image-overlay), the overlay sits on top of
   the image — color + opacity are set inline by project-feed.php from ACF
   fields pf_overlay_color / pf_overlay_opacity. Defaults: #000 @ 40%.
   ═══════════════════════════════════════════════════════════════════════════ */
.mvc-project-feed {
	--pf-overlay-color: #000000;
	--pf-overlay-opacity: 0.40;
}
