/*
 * CaryTamura Marketing page (/marketing/, Page 5445).
 *
 * SCOPE. Loaded on the marketing page only (functions.php, is_page()), after
 * page-hero.css. It tunes that page's CT Page Hero band to the live marketing
 * hero, lays out the nine-card services grid (.ct-marketing) and places the
 * global Work With Cary template (.ct-marketing-work-with). The template
 * itself is untouched.
 *
 * VALUES. Every value is measured from carytamura.com/marketing at 1920,
 * 1440, 1024, 768, 767, 574/560 and 375 wide (FACT) unless marked. The live
 * page frames its sections in the 12px body padding down to 768 and runs edge
 * to edge from 767, as the home page does.
 *
 * MOTION. The live hero and grid have no entrance animation; the only motion
 * is the card hover reproduced below (overlay, photo zoom, title lift and
 * rule), with the live timings.
 */

/* ------------------------------------------------------------------ hero --
 * Live: a 600px band at every width, framed 12px on desktop, one flat 45%
 * black scrim over the photo (no top gradient), title centred and lifted by
 * its 24px bottom margin. */
.ct-page-hero.e-con {
	--width: calc(100% - 2 * var(--ct-body-padding));
	margin: var(--ct-body-padding) var(--ct-body-padding) 0;
	min-height: 0;
	height: 600px;
	padding: 0 var(--ct-body-padding);
}

.ct-page-hero::before {
	background-color: var(--ct-overlay-strong);
}

.ct-page-hero::after {
	content: none;
}

.ct-page-hero .ct-page-hero__title {
	max-width: 900px;
}

.ct-page-hero .ct-page-hero__title .elementor-heading-title {
	margin: 0 0 24px;
	font-size: var(--ct-size-h1);
	line-height: 1.25;
}

/* --------------------------------------------------------------- grid --
 * The page body's own padding is dropped: the grid section carries the
 * live spacing itself — 95px above, and below the last row its 50px card
 * margin plus the section's 46px (20px + 46px under 1200, 20px + 44px from
 * 768). */
.ct-page-body:has(.ct-marketing) {
	padding-block: 0;
}

.ct-marketing.e-con {
	--width: calc(100% - 2 * var(--ct-body-padding));
	--padding-top: 95px;
	--padding-bottom: 96px;
	--padding-left: 0px;
	--padding-right: 0px;
	--gap: 0px;
	margin-inline: var(--ct-body-padding);
}

/* Live content box: 1550px cap, 135px side padding, cards inset a further
 * 3px (row -7px, column 10px). Three columns, 20px apart, 50px between rows. */
.ct-marketing .ct-marketing__grid.e-con {
	--padding-top: 0px;
	--padding-bottom: 0px;
	--padding-left: 138px;
	--padding-right: 138px;
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 50px 20px;
	width: 100%;
	max-width: 1550px;
	margin-inline: auto;
}

/* ---------------------------------------------------------------- card -- */
.ct-marketing .ct-marketing-card.e-con {
	--padding-top: 20px;
	--padding-bottom: 20px;
	--padding-left: 20px;
	--padding-right: 20px;
	--gap: 0px;
	position: relative;
	flex-direction: column;
	justify-content: flex-end;
	width: auto;
	height: 350px;
	overflow: hidden;
	text-decoration: none;
	cursor: pointer;
}

/* Scrim: 30% black plus a foot gradient, the whole at 60%; 50% black on
 * hover over half a second. Replaces Elementor's background-overlay layer,
 * which the card does not use. */
.ct-marketing .ct-marketing-card.e-con::before {
	content: "";
	display: block;
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.3);
	background-image: linear-gradient(rgba(0, 0, 0, 0) 76.6%, rgb(0, 0, 0));
	opacity: 0.6;
	mix-blend-mode: normal;
	border-radius: 0;
	transform: translate3d(0, 0, 0);
	transition: background-color 0.5s;
	z-index: 1;
	pointer-events: none;
}

.ct-marketing .ct-marketing-card.e-con:hover::before {
	background-color: rgba(0, 0, 0, 0.5);
}

.ct-marketing .ct-marketing-card__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	overflow: hidden;
	z-index: 0;
}

.ct-marketing .ct-marketing-card__img img {
	display: block;
	width: 100%;
	max-width: none;
	height: 100%;
	object-fit: cover;
	transform: translate3d(0, 0, 0);
	transition: transform 0.75s ease-out;
}

.ct-marketing .ct-marketing-card__title {
	position: relative;
	width: 100%;
	margin: 0;
	z-index: 2;
}

.ct-marketing .ct-marketing-card__title .elementor-heading-title {
	position: relative;
	margin: 0;
	padding-bottom: 20px;
	font-family: var(--ct-font-display);
	font-size: 26px;
	font-weight: 400;
	line-height: 1.3;
	letter-spacing: 3px;
	text-transform: uppercase;
	text-align: center;
	color: var(--ct-on-dark);
	transform: translate3d(0, 0, 0);
	transition: all 0.3s;
}

/* The rule that drops in beneath the title on hover. */
.ct-marketing .ct-marketing-card__title .elementor-heading-title::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: 100%;
	border-bottom: 1px solid;
	opacity: 0;
	transition: all 0.3s;
}

@media (hover: hover) and (pointer: fine) {
	.ct-marketing .ct-marketing-card:hover .ct-marketing-card__img img {
		transform: scale(1.05);
	}

	.ct-marketing .ct-marketing-card:hover .ct-marketing-card__title .elementor-heading-title {
		transform: translateY(-51px);
	}

	.ct-marketing .ct-marketing-card:hover .ct-marketing-card__title .elementor-heading-title::after {
		opacity: 0.3;
		transform: translateY(20px);
	}
}

/* ------------------------------------------------------ work with cary --
 * The global template, placed through a Template widget straight after the
 * grid. It keeps its own padding, heights and colours; the placement adds
 * only the page frame. Elementor's tablet range starts at 1024, where the
 * live section is still its desktop 689px, as on the home page. */
.ct-marketing-work-with.elementor-widget {
	--kit-widget-spacing: 0px;
	margin-block: 0;
	margin-inline: var(--ct-body-padding);
}

@media (min-width: 901px) and (max-width: 1024px) {
	.ct-marketing-work-with .ct-work-with.e-con {
		min-height: 689px;
	}
}

/* ---------------------------------------------------------- responsive -- */
@media (max-width: 1199px) {
	.ct-marketing.e-con {
		--padding-bottom: 66px;
	}

	.ct-marketing .ct-marketing__grid.e-con {
		row-gap: 20px;
	}
}

/* Live applies its phone column padding (5px) from 768 while still three
 * across, so the 768 layout is 10px apart and 2px outside the content box. */
@media (max-width: 768px) {
	.ct-page-hero .ct-page-hero__title .elementor-heading-title {
		font-size: 32px;
	}

	.ct-marketing.e-con {
		--padding-bottom: 64px;
	}

	.ct-marketing .ct-marketing__grid.e-con {
		--padding-left: 133px;
		--padding-right: 133px;
		column-gap: 10px;
	}
}

@media (max-width: 767px) {
	.ct-page-hero.e-con {
		--width: 100%;
		margin: 0;
		height: 600px;
		padding: 0 var(--ct-body-padding);
	}

	.ct-marketing.e-con {
		--width: 100%;
		margin-inline: 0;
	}

	.ct-marketing .ct-marketing__grid.e-con {
		--padding-left: 18px;
		--padding-right: 18px;
		grid-template-columns: minmax(0, 1fr);
	}

	.ct-marketing-work-with.elementor-widget {
		margin-inline: 0;
	}
}

/* Live line height opens up on small phones (between 561 and 573 wide;
 * 568 is the implementation's choice within that range). */
@media (max-width: 568px) {
	.ct-page-hero .ct-page-hero__title .elementor-heading-title,
	.ct-marketing .ct-marketing-card__title .elementor-heading-title {
		line-height: 1.6;
	}
}

@media (max-width: 360px) {
	.ct-page-hero .ct-page-hero__title .elementor-heading-title {
		font-size: 22px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ct-marketing .ct-marketing-card.e-con::before,
	.ct-marketing .ct-marketing-card__img img,
	.ct-marketing .ct-marketing-card__title .elementor-heading-title,
	.ct-marketing .ct-marketing-card__title .elementor-heading-title::after {
		transition: none;
	}
}
