/* ==========================================================================
   Projects widget  (.aew-projects)
   ========================================================================== */

.aew-projects {
	--aew-accent: var(--aew-red);   /* control: Brand colour */
	--aew-gutter: 24px;             /* control: Side gap */

	box-sizing: border-box;
	background-color: #f9f9f9;
	color: #111;
	font-family: var(--aew-font);
	-webkit-font-smoothing: antialiased;
}

.aew-projects *,
.aew-projects *::before,
.aew-projects *::after {
	box-sizing: border-box;
}

.aew-projects__inner {
	width: calc(100% - (var(--aew-gutter) * 2));
	max-width: 1076px;
	margin-inline: auto;
}

/* ---- Heading row ---- */

.aew-projects__head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px 40px;
	margin-bottom: 44px;
}

.aew-projects__eyebrow {
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 0 0 17px;
	font-size: 11.2px;
	font-weight: 700;
	letter-spacing: 1.2px;
	line-height: 1.4;
	text-transform: uppercase;
}

.aew-projects__eyebrow-line {
	flex: none;
	display: block;
	width: 35px;
	height: 2px;
	background: var(--aew-accent);
}

.aew-projects__eyebrow-text {
	color: var(--aew-accent);
}

/* extra class so the Elementor kit's global h1–h6 styles don't win */
.aew-projects .aew-projects__title {
	margin: 0;
	padding: 0;
	font-family: inherit;
	font-size: 41.8px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: normal;
	text-transform: none;
}

.aew-projects__title-text {
	color: #111;
}

.aew-projects__title-accent {
	color: var(--aew-accent);
}

.aew-projects__side {
	max-width: 260px;
	margin: 0 0 6px;
	font-size: 12.25px;
	line-height: 1.7;
	color: #666;
}

/* ---- Grid ---- */

.aew-projects__grid {
	--aew-card-h: 223px;       /* control: Normal card height */
	--aew-card-h-wide: 252px;  /* control: Wide card height */

	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 15px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.aew-projects__item {
	display: flex;
	min-width: 0;
	margin: 0;
	padding: 0;
}

.aew-projects__item--wide {
	grid-column: span 2;
}

.aew-projects__card {
	--aew-overlay: rgba(0, 0, 0, 0.78);
	--aew-inset: 18px;

	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	min-width: 0;
	min-height: var(--aew-card-h);
	overflow: hidden;
	border: 1px solid #e8e8e8;
	background-color: #fff;
	color: inherit;
	text-decoration: none;
}

.aew-projects__item--wide .aew-projects__card {
	min-height: var(--aew-card-h-wide);
}

a.aew-projects__card:focus-visible {
	outline: 2px solid var(--aew-accent);
	outline-offset: 3px;
}

/* ---- Photo ---- */

.aew-projects__photo {
	position: relative;
	display: block;
	min-height: 0;
	overflow: hidden;
	background-color: #2a2624;
}

/* "photo on top": fixed shape, the rest of the card stays white */
.aew-projects__card--top .aew-projects__photo {
	flex: none;
	aspect-ratio: 1.92 / 1;
}

/* "photo fills the card" */
.aew-projects__card--fill .aew-projects__photo {
	flex: 1 1 auto;
}

/* darkening under the title, so white text stays readable on bright photos */
.aew-projects__photo::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: linear-gradient(to top, var(--aew-overlay) 0%, transparent 60%);
}

.aew-projects__img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	transition: transform 0.5s ease;
}

.aew-projects__tag {
	position: absolute;
	top: 16px;
	left: 13px;
	z-index: 2;
	display: inline-block;
	max-width: calc(100% - 26px);
	padding: 5px 11px;
	background-color: var(--aew-accent);
	font-size: 9.3px;
	font-weight: 700;
	letter-spacing: 0.5px;
	line-height: 1.2;
	text-transform: uppercase;
	color: #fff;
}

.aew-projects__caption {
	position: absolute;
	right: var(--aew-inset);
	bottom: 17px;
	left: var(--aew-inset);
	z-index: 2;
	display: block;
}

.aew-projects__card-title {
	display: block;
	font-size: 12.5px;
	font-weight: 700;
	letter-spacing: 0.5px;
	line-height: 1.3;
	text-transform: uppercase;
	color: #fff;
}

.aew-projects__client {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-top: 4px;
	font-size: 10px;
	line-height: 1.4;
	color: rgba(255, 255, 255, 0.82);
}

.aew-projects__client-icon {
	flex: none;
	display: inline-flex;
	font-size: 9px;
	line-height: 1;
	opacity: 0.85;
}

.aew-projects__client-icon svg {
	width: 1em;
	height: 1em;
}

/* ---- Hover (switchable) ---- */

@media (hover: hover) {
	.aew-projects--hover .aew-projects__card:hover .aew-projects__img {
		transform: scale(1.05);
	}
}

/* ---- Responsive (columns are also a control; these are the defaults) ---- */

@media (max-width: 1024px) {
	.aew-projects__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

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

	/* a "2 columns" card cannot span a column that does not exist */
	.aew-projects__item--wide {
		grid-column: auto;
	}

	.aew-projects__head {
		flex-direction: column;
		align-items: flex-start;
	}
}

@media (prefers-reduced-motion: reduce) {
	.aew-projects__img {
		transition: none;
	}

	.aew-projects--hover .aew-projects__card:hover .aew-projects__img {
		transform: none;
	}
}
