/**
 * Murataj Ltd projects shortcode
 * Shortcode: [tim_projects]
 */

.tim-projects {
	--tim-project-gap: 24px;
	--tim-project-radius: 4px;
	width: 100%;
}

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

/* First three projects: one large card and two stacked cards. */
.tim-projects__featured {
	display: grid;
	grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
	grid-template-rows: repeat(2, minmax(220px, 1fr));
	gap: var(--tim-project-gap);
	min-height: 620px;
}

.tim-projects__featured > .tim-project-card:first-child {
	grid-row: 1 / -1;
}

/* Projects after the first three. */
.tim-projects__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--tim-project-gap);
	margin-top: var(--tim-project-gap);
}

.tim-project-card {
	position: relative;
	min-height: 280px;
	overflow: hidden;
	border-radius: var(--tim-project-radius);
	background-color: #222;
	color: #fff;
}

.tim-project-card__link {
	display: block;
	width: 100%;
	height: 100%;
	min-height: inherit;
	color: inherit;
	text-decoration: none;
}

/* Prevent older cached pseudo-element arrows from appearing as emoji on iOS. */
.tim-project-card__link::before,
.tim-project-card__link::after {
	content: none !important;
	display: none !important;
}

/* Real SVG arrow: identical shape on desktop, Android and iOS. */
.tim-project-card__arrow {
	position: absolute;
	right: 28px;
	bottom: 28px;
	z-index: 2;
	display: grid !important;
	width: 44px;
	height: 44px;
	place-items: center;
	border: 1px solid rgba(255, 255, 255, 0.45);
	color: #fff;
	transition: border-color 0.25s ease,
		background-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.tim-project-card__arrow svg {
	display: block;
	width: 17px;
	height: 17px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.5;
	stroke-linecap: square;
	stroke-linejoin: miter;
}

.tim-project-card__media,
.tim-project-card__media img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.tim-project-card__media img {
	object-fit: cover;
	transition: transform 0.45s ease;
}

.tim-project-card__placeholder {
	position: absolute;
	inset: 0;
	background-color: #333;
}

.tim-project-card__overlay {
	position: absolute;
	inset: 0;
	background:
		linear-gradient(180deg, rgba(0, 0, 0, 0.28) 0%, rgba(0, 0, 0, 0.23) 48%, rgba(0, 0, 0, 0.88) 100%),
		linear-gradient(90deg, rgba(0, 0, 0, 0.24) 0%, transparent 65%) !important;
	pointer-events: none;
}

.tim-project-card__content {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 1;
	padding: 28px 96px 28px 28px !important;
}

.tim-project-card__meta {
	display: block;
	margin-bottom: 8px;
	color: #d6ad60 !important;
	font-size: 11px;
	font-weight: 600;
	line-height: 1.5;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.tim-project-card__title {
	margin: 0;
	color: #fff;
	font-size: clamp(21px, 2vw, 32px);
	font-weight: 600;
	line-height: 1.15;
}

.tim-projects__featured > .tim-project-card:not(:first-child) .tim-project-card__title,
.tim-projects__grid .tim-project-card__title {
	font-size: clamp(19px, 1.5vw, 25px);
}

.tim-project-card__link:hover .tim-project-card__media img,
.tim-project-card__link:focus-visible .tim-project-card__media img {
	transform: scale(1.04);
}

.tim-project-card__link:hover .tim-project-card__arrow,
.tim-project-card__link:focus-visible .tim-project-card__arrow {
	border-color: #d6ad60;
	background-color: #d6ad60;
	color: #111;
	transform: translate(2px, -2px);
}

.tim-project-card__link:focus-visible {
	outline: 3px solid currentColor;
	outline-offset: -5px;
}

/* Tablet layout. */
@media (max-width: 800px) {
	.tim-projects__featured {
		grid-template-columns: 1fr;
		grid-template-rows: auto;
		min-height: 0;
	}

	.tim-projects__featured > .tim-project-card:first-child {
		grid-row: auto;
		min-height: 440px;
	}

	.tim-projects__featured > .tim-project-card:not(:first-child) {
		min-height: 300px;
	}

	.tim-project-card__arrow {
		right: 18px;
		bottom: 18px;
		width: 42px;
		height: 42px;
	}

	.tim-projects__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* Mobile layout. */
@media (max-width: 540px) {
	.tim-projects {
		--tim-project-gap: 16px;
	}

	.tim-projects__featured > .tim-project-card:first-child,
	.tim-projects__featured > .tim-project-card:not(:first-child),
	.tim-projects__grid > .tim-project-card {
		min-height: 320px;
	}

	.tim-projects__grid {
		grid-template-columns: 1fr;
	}

	.tim-project-card__content {
		padding: 22px 82px 22px 22px !important;
	}

	.tim-project-card__arrow {
		right: 16px;
		bottom: 16px;
		width: 40px;
		height: 40px;
	}
}

/* Respect visitors who prefer reduced motion. */
@media (prefers-reduced-motion: reduce) {
	.tim-project-card__media img {
		transition: none;
	}

	.tim-project-card__arrow {
		transition: none;
	}
}
