/* =========================================================
   Zambezi Featured Project — front end
   ========================================================= */

/*
 * .zcu-project-outer is the query container; .zcu-project is the grid.
 * They must be separate elements — a container query never matches the
 * container itself, so a combined element would stay single-column forever.
 */
.zcu-project-outer {
	display: block;
	container-name: zcu-project;
}

.zcu-project {
	display: grid;
	grid-template-columns: 1fr;
	gap: clamp(24px, 4cqi, 64px);
	align-items: center;
}

/* ---------- media ---------- */

.zcu-project__media {
	position: relative;
	margin: 0;
	overflow: hidden;
	border-radius: var(--zcu-radius, 22px);
}

/* ---------- status label ("Coming Soon") ---------- */

.zcu-project__badge {
	position: absolute;
	top: clamp(12px, 3cqi, 20px);
	left: clamp(12px, 3cqi, 20px);
	z-index: 2;
	display: inline-block;
	padding: 7px 14px;
	font-size: 11px;
	font-weight: 800;
	line-height: 1;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: #1b2113;
	background: var(--zcu-accent, #f6a91a);
	border-radius: var(--zcu-radius-pill, 100px);
	box-shadow: 0 8px 20px -10px rgba(27, 33, 19, 0.5);
}

.zcu-project__badge.is-inline {
	position: static;
	margin: 0 0 14px;
}

/* ---------- optional browser chrome ---------- */

.zcu-project__browser {
	overflow: hidden;
	background: var(--zcu-background, #fff);
	border: 1px solid var(--zcu-border, rgba(27, 33, 19, 0.12));
	border-radius: var(--zcu-radius, 22px);
	box-shadow: var(--zcu-shadow-md, 0 18px 40px -18px rgba(27, 33, 19, 0.28));
}

.zcu-project__browserbar {
	display: flex;
	gap: 14px;
	align-items: center;
	padding: 12px 16px;
	background: var(--zcu-background-alt, #f6f4ed);
	border-bottom: 1px solid var(--zcu-border, rgba(27, 33, 19, 0.1));
}

.zcu-project__dots {
	display: flex;
	flex: 0 0 auto;
	gap: 6px;
}

.zcu-project__dots i {
	width: 10px;
	height: 10px;
	background: rgba(27, 33, 19, 0.18);
	border-radius: 50%;
}

.zcu-project__url {
	display: inline-flex;
	gap: 7px;
	align-items: center;
	min-width: 0;
	padding: 5px 14px;
	overflow: hidden;
	font-size: 12px;
	line-height: 1.2;
	white-space: nowrap;
	text-overflow: ellipsis;
	color: var(--zcu-muted, #6a715c);
	background: var(--zcu-background, #fff);
	border-radius: var(--zcu-radius-pill, 100px);
}

.zcu-project__url svg {
	flex: 0 0 auto;
}

/* Inside the frame the image is already clipped by the frame's radius. */
.zcu-project__browser .zcu-project__media {
	border-radius: 0;
}

.zcu-project__img {
	display: block;
	width: 100%;
	height: auto;
	/*
	 * A project image is never cropped. --zcu-project-ratio carries the
	 * image's real width/height when render.php knows them, which reserves the
	 * space and prevents layout shift. When the dimensions are unknown (a bare
	 * URL rather than a media-library pick) it falls back to `auto`, so the
	 * image simply renders at its natural ratio and fills the container width.
	 * Cropping to a fixed box would be worse than a small layout shift.
	 */
	aspect-ratio: var(--zcu-project-ratio, auto);
	object-fit: contain;
}

/* ---------- body ---------- */

.zcu-project__body {
	min-width: 0;
}

.zcu-project__eyebrow {
	display: inline-flex;
	gap: 0.7em;
	align-items: center;
	margin: 0 0 14px;
	font-size: clamp(11px, 1.4cqi, 13px);
	font-weight: 700;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--zcu-accent-alt, #c44b1c);
}

.zcu-project__eyebrow::before {
	content: "";
	display: inline-block;
	width: 30px;
	height: 2px;
	background: currentColor;
}

.zcu-project__name {
	margin: 0 0 16px;
	font-size: clamp(28px, 5cqi, 56px);
	line-height: 1.02;
	letter-spacing: -0.015em;
	color: var(--zcu-foreground, #1b2113);
}

.zcu-project__text {
	max-width: 54ch;
	margin: 0 0 22px;
	font-size: clamp(15px, 1.6cqi, 18px);
	line-height: 1.7;
	color: var(--zcu-muted, #6a715c);
}

/* ---------- category tags ---------- */

.zcu-project__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 0;
	margin: 0 0 26px;
	list-style: none;
}

.zcu-project__tag {
	padding: 6px 14px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--zcu-foreground, #1b2113);
	border: 1px solid var(--zcu-border, rgba(27, 33, 19, 0.16));
	border-radius: var(--zcu-radius-pill, 100px);
}

/* ---------- statistics ---------- */

.zcu-project__stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
	gap: clamp(14px, 2.4cqi, 30px);
	margin: 0 0 28px;
	padding-top: 22px;
	border-top: 1px solid var(--zcu-border, rgba(27, 33, 19, 0.12));
}

.zcu-project__stat {
	min-width: 0;
}

.zcu-project__statvalue {
	margin: 0;
	font-size: clamp(26px, 4cqi, 42px);
	font-weight: 800;
	line-height: 1;
	letter-spacing: -0.02em;
	color: var(--zcu-foreground, #1b2113);
	font-variant-numeric: tabular-nums;
}

.zcu-project__statlabel {
	margin: 8px 0 0;
	font-size: 13px;
	line-height: 1.45;
	color: var(--zcu-muted, #6a715c);
}

.zcu-project__cta {
	margin: 0;
}

/* ---------- dark variant ---------- */

.zcu-project-outer.is-variant-dark .zcu-project__name,
.zcu-project-outer.is-variant-dark .zcu-project__statvalue {
	color: #fff;
}

.zcu-project-outer.is-variant-dark .zcu-project__text,
.zcu-project-outer.is-variant-dark .zcu-project__statlabel {
	color: rgba(242, 239, 229, 0.78);
}

.zcu-project-outer.is-variant-dark .zcu-project__eyebrow {
	color: var(--zcu-accent, #f6a91a);
}

.zcu-project-outer.is-variant-dark .zcu-project__tag {
	color: #f2efe5;
	border-color: rgba(255, 255, 255, 0.28);
}

.zcu-project-outer.is-variant-dark .zcu-project__stats {
	border-top-color: rgba(255, 255, 255, 0.18);
}

/* ---------- two-column from tablet up ---------- */

@container zcu-project (min-width: 860px) {
	.zcu-project {
		grid-template-columns: 1fr 1fr;
	}

	/* Image right: swap the visual order only. Source order stays
	   image-then-body, so the reading order is unchanged. Both selectors are
	   needed because the browser frame, when enabled, becomes the grid child
	   in place of the figure. */
	.zcu-project-outer.is-image-right .zcu-project > .zcu-project__media,
	.zcu-project-outer.is-image-right .zcu-project__browser {
		order: 2;
	}
}

@supports not (container-type: inline-size) {
	@media (min-width: 900px) {
		.zcu-project {
			grid-template-columns: 1fr 1fr;
		}

		.zcu-project-outer.is-image-right .zcu-project > .zcu-project__media,
		.zcu-project-outer.is-image-right .zcu-project__browser {
			order: 2;
		}
	}
}
