/* Service CTA — inc/service-cta.php, assets/js/conditional/service-cta.js.
   Loaded on every Service Hub page with the rest of this folder; the
   markup only exists on pages where Service CTAs are turned on.

   Buttons keep the site's .button styling (Design Tokens → Buttons) and
   only add layout here: inline-flex for the glyph, no trailing margin. */

/* --- Shared pieces --- */
#SD .service-cta__row
{
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem 1.5rem;
}
#SD A.button.service-cta__button
{
	display: inline-flex !important; /* buttons.css sets inline-block !important on every .button; the glyph needs a row */
	align-items: center;
	gap: 0.6em;
	min-height: 48px;
	margin-right: 0;
}
#SD .service-cta__glyph
{
	aspect-ratio: auto !important; /* the runtime wrapper sets the artboard's ratio inline; the glyph is cropped square */
	width: 1.75em;
	height: 1.75em;
	flex: none;
	margin-left: -0.25em;
}
#SD .service-cta__glyph svg
{
	display: block;
	width: 100%;
	height: 100%;
}
#SD .service-cta__textlink
{
	font-weight: bold;
	text-decoration: underline;
	text-underline-offset: 0.25em;
}
#SD .service-cta__micro
{
	margin: 0;
	font-size: var(--small);
	opacity: 0.8;
}

/* --- Hero position: under the subtitle, on the subtitle's left edge.
   Mirrors the .page-supertitle width-tier rules (page-supertitle.css),
   since the subtitle is what this row lines up with. --- */
#SD .service-cta-hero
{
	display: grid;
	gap: 0.75rem;
	margin-top: calc(var(--defaultInterval) * 1.5);
	margin-bottom: calc(var(--defaultInterval) * 2);
	margin-left: var(--LRMargin);
}
#SD.width-boxed .service-cta-hero
{
	max-width: var(--boxedWidth);
	margin-left: auto;
	margin-right: auto;
}
#SD.width-wide .service-cta-hero
{
	max-width: var(--wideWidth);
	margin-left: auto;
	margin-right: auto;
}
#SD.width-very_wide .service-cta-hero
{
	max-width: var(--veryWideWidth);
	margin-left: auto;
	margin-right: auto;
}
#SD.width-full .service-cta-hero
{
	margin-left: var(--LRMargin);
}
@media only screen and (max-width: 999px)
{
	#SD.width-wide .service-cta-hero,
	#SD.width-very_wide .service-cta-hero
	{
		margin-left: var(--defaultInterval);
		margin-right: var(--defaultInterval);
	}
}

/* --- Closing panel. Its background is the artwork's own ground color
   (set inline from the recipe), so the art sits in it seamlessly. --- */
#SD .service-cta-close
{
	--service-cta-ground: var(--colG);
	--service-cta-ink: #ffffff;
	display: grid;
	width: min(var(--maxWidthPixels), 100% - var(--defaultInterval) * 2);
	margin: calc(var(--defaultInterval) * 4) auto calc(var(--defaultInterval) * 3);
	border-radius: var(--defaultBorderRadius);
	overflow: hidden;
	background-color: var(--service-cta-ground);
	color: var(--service-cta-ink);
}
#SD .service-cta-close.is-light
{
	--service-cta-ink: var(--colGrey);
}
#SD .service-cta-close__art
{
	height: clamp(180px, 32vw, 380px);
}
#SD .service-cta-close__art .shew-tuned-svg
{
	aspect-ratio: auto !important; /* fill the band; letterboxing is invisible because the panel is the art's ground color */
	width: 100%;
	height: 100%;
}
/* The art fills the whole panel behind the text; the animation's chosen
   composition places it (runtime.js), and the text keeps to the left. */
#SD .service-cta-close.is-bleed
{
	position: relative;
	isolation: isolate;
	align-content: center;
	min-height: clamp(300px, 28vw, 360px);
}
#SD .service-cta-close.is-bleed .service-cta-close__art
{
	position: absolute;
	inset: 0;
	z-index: -1;
	height: auto;
	pointer-events: none;
}
#SD .service-cta-close__text
{
	display: grid;
	gap: 1rem;
	padding: calc(var(--defaultInterval) * 0.5) clamp(var(--defaultInterval), 5vw, 60px) clamp(var(--defaultInterval) * 1.5, 4vw, 48px);
}
#SD .service-cta-close.is-bleed .service-cta-close__text
{
	max-width: 58%;
	padding-top: clamp(var(--defaultInterval) * 1.5, 4vw, 48px);
}
@media only screen and (max-width: 767px)
{
	/* Phones: the art sits across the top (the composition's phone placement),
	   the text below it at full width. */
	#SD .service-cta-close.is-bleed
	{
		align-content: end;
		min-height: 0;
	}
	#SD .service-cta-close.is-bleed .service-cta-close__text
	{
		max-width: none;
		padding-top: 170px;
	}
}
#SD .service-cta-close__headline
{
	margin: 0;
	color: inherit;
	font-size: var(--h3Size);
	line-height: 1.1;
	text-wrap: balance;
}
#SD .service-cta-close .service-cta__textlink
{
	color: inherit;
}

/* --- Sticky position: phones only. Starts below the screen; the JS adds
   .is-visible between the hero button and the closing panel. Stays under
   the header/menu (z-index 89000 in SDheaderNavRegion.css). --- */
#SD .service-cta-sticky
{
	display: none;
}
@media only screen and (max-width: 767px)
{
	#SD .service-cta-sticky
	{
		display: block;
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 8000;
		padding: 0.625rem var(--defaultInterval) calc(0.625rem + env(safe-area-inset-bottom, 0px));
		background-color: #ffffff;
		border-top: 1px solid var(--colLiteGrey);
		transform: translateY(110%);
		transition: transform 250ms ease;
	}
	#SD .service-cta-sticky.is-visible
	{
		transform: none;
	}
	#SD .service-cta-sticky .service-cta__button
	{
		width: 100%;
		justify-content: center;
	}
	/* Room at the bottom so the bar never covers the end of the footer. */
	body#SD:has(.service-cta-sticky)
	{
		padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
	}
}
@media (prefers-reduced-motion: reduce)
{
	#SD .service-cta-sticky
	{
		transition: none;
	}
}
