/*
 * Market V2
 * Thin theme layer over Medical V2. Medical V2 remains the design master.
 */

body.page-template-market-v2 .market-v2 {
	--market-color: #2699D5;
	--market-on-color: #fff;
}

/* Market accent: preserve Medical V2 composition, swap only identity color. */
body.page-template-market-v2 .market-v2 .medical-v2-kicker,
body.page-template-market-v2 .market-v2 .medical-v2-step,
body.page-template-market-v2 .market-v2 .medical-v2-project-brand,
body.page-template-market-v2 .market-v2 .medical-v2-project-more,
body.page-template-market-v2 .market-v2 .medical-v2-text-link,
body.page-template-market-v2 .market-v2 .medical-v2-cap-copy > a {
	color: var(--market-color) !important;
}

body.page-template-market-v2 .market-v2 .medical-v2-btn-primary {
	background: var(--market-color) !important;
	border-color: var(--market-color) !important;
}

body.page-template-market-v2 .market-v2 .medical-v2-proof {
	background: var(--market-color) !important;
	color: var(--market-on-color) !important;
}

body.page-template-market-v2 .market-v2 .medical-v2-proof-item,
body.page-template-market-v2 .market-v2 .medical-v2-proof-item strong,
body.page-template-market-v2 .market-v2 .medical-v2-proof-item span {
	color: var(--market-on-color) !important;
}

/* The existing market identity bar keeps its native icon/logo, but the old
   43px max-height clips tall logos (Agriculture is the clearest example). */
body.page-template-market-v2 header#masthead .bot-header {
	min-height: 74px;
	padding-top: 9px;
	padding-bottom: 9px;
	overflow: visible;
}

body.page-template-market-v2 header#masthead .med-text-logo {
	display: flex;
	align-items: center;
	max-height: none;
	height: 56px;
	overflow: visible;
}

body.page-template-market-v2 header#masthead .med-text-logo svg {
	display: block;
	width: auto;
	max-width: 300px;
	height: 56px;
	max-height: 56px;
	overflow: visible;
}

/* Use the selected market color for the legacy market bar too. */
body.page-template-market-v2 header#masthead .bot-header {
	background-color: var(--market-color, inherit);
}

/* Card images must always occupy their slot if an image is available. */
body.page-template-market-v2 .medical-v2-cap-image img,
body.page-template-market-v2 .medical-v2-project-image img,
body.page-template-market-v2 .medical-v2-media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Market V2 already uses normal document flow.
   Do NOT reset min-height globally: Medical V2 intentionally gives the Hero
   a substantial viewport height. Resetting it causes the video and H1 to crop. */


/* HERO GEOMETRY ------------------------------------------------
   Preserve the Medical V2 hero proportions underneath the fixed site header
   and market identity bar. */
body.page-template-market-v2 .market-v2 .medical-v2-hero {
	position: relative;
	height: auto !important;
	min-height: clamp(560px, calc(100vh - 135px), 760px) !important;
	overflow: hidden;
}

body.page-template-market-v2 .market-v2 .medical-v2-hero-video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	min-width: 100%;
	min-height: 100%;
	object-fit: cover;
	object-position: center center;
}

body.page-template-market-v2 .market-v2 .medical-v2-hero-inner {
	min-height: inherit;
	padding-top: clamp(70px, 8vh, 105px);
	padding-bottom: clamp(70px, 8vh, 105px);
	display: flex;
	align-items: center;
}

body.page-template-market-v2 .market-v2 .medical-v2-hero-copy {
	position: relative;
	z-index: 3;
}

body.page-template-market-v2 .market-v2 .medical-v2-hero h1 {
	margin-top: 0 !important;
}

@media (max-width: 990px) {
	body.page-template-market-v2 .market-v2 .medical-v2-hero {
		min-height: 560px !important;
	}

	body.page-template-market-v2 .market-v2 .medical-v2-hero-inner {
		padding-top: 64px;
		padding-bottom: 64px;
	}
}

@media (max-width: 990px) {
	body.page-template-market-v2 header#masthead .bot-header {
		min-height: 54px;
		padding-top: 5px;
		padding-bottom: 5px;
	}

	body.page-template-market-v2 header#masthead .med-text-logo {
		height: 42px;
	}

	body.page-template-market-v2 header#masthead .med-text-logo svg {
		height: 42px;
		max-height: 42px;
		max-width: 190px;
	}
}
