/* =============================================================
   PID CTA Banners — v1.0.1
   -------------------------------------------------------------
   Selector pattern mirrors the offering-cards convention:
     .pid-cta-banner.theme-{dark|light}.layout-{large|wide|compact}.logo-{sm|md|lg|xl}

   Child selectors are deliberately chained with .pid-cta-banner
   to push specificity above common Kadence / theme overrides
   such as `.entry-content a` (specificity 0,1,1). All visual
   properties also carry !important so theme rules using
   !important do not slip through.

   Brand CSS variables are inherited from custom.css; the
   --cta-* fallbacks make the block stand-alone in the editor
   preview where the site stylesheet may not be loaded.
   ============================================================= */

.pid-cta-banner {
	--cta-navy:            var( --pid-navy,             #002032 );
	--cta-dark-blue:       var( --pid-dark-blue,        #003F63 );
	--cta-cyan:            var( --pid-cyan,             #2EC1EF );
	--cta-cyan-accessible: var( --pid-cyan-accessible,  #0070D1 );
	--cta-pink:            var( --pid-pink,             #DB0047 );
	--cta-light-blue:      var( --pid-light-blue,       #0F71A9 );
	--cta-pale-blue:       var( --pid-pale-blue,        #C7ECF5 );
	--cta-light-bg:        var( --pid-light-bg,         #F0F8FA );
	--cta-off-white:       var( --pid-off-white,        #FAFAFA );
	--cta-near-black:      var( --pid-near-black,       #3D3D3D );

	box-sizing: border-box;
	display: block;
	margin: 2rem 0;
	border-radius: 14px;
	position: relative;
	font-family: Helvetica, Arial, sans-serif;
	line-height: 1.45;
	box-shadow: 0 4px 18px rgba( 0, 32, 50, 0.10 );
	transition: box-shadow 0.25s ease, transform 0.25s ease;
}

/* Background clip handled by background-clip rather than overflow:hidden,
   so the chooser popup can extend outside the banner. */
.pid-cta-banner {
	background-clip: padding-box;
}

.pid-cta-banner:hover {
	box-shadow: 0 10px 28px rgba( 0, 32, 50, 0.18 );
}

.pid-cta-banner *,
.pid-cta-banner *::before,
.pid-cta-banner *::after {
	box-sizing: inherit;
}

/* -------------------------------------------------------------
   Inner wrapper
   ------------------------------------------------------------- */
.pid-cta-banner .pid-cta-banner__inner {
	position: relative;
	z-index: 1;
	display: flex;
	gap: 1.75rem;
	padding: 2rem 2.25rem;
}

/* Logo block */
.pid-cta-banner .pid-cta-banner__logo {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
}

.pid-cta-banner .pid-cta-banner__logo img {
	display: block;
	max-width: 100%;
	height: auto;
}

/* Content block */
.pid-cta-banner .pid-cta-banner__content {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	justify-content: center;
}

.pid-cta-banner .pid-cta-banner__headline {
	margin: 0 !important;
	padding: 0 !important;
	font-family: Helvetica, Arial, sans-serif !important;
	font-weight: 700 !important;
	font-size: clamp( 1.4rem, 2.4vw, 2rem ) !important;
	line-height: 1.15 !important;
	letter-spacing: -0.005em;
}

.pid-cta-banner .pid-cta-banner__body {
	margin: 0 !important;
	padding: 0 !important;
	font-size: clamp( 0.95rem, 1.2vw, 1.05rem ) !important;
	line-height: 1.5 !important;
	max-width: 56ch;
}

/* Action block */
.pid-cta-banner .pid-cta-banner__action {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
}

/* -------------------------------------------------------------
   Button — every visual property pinned with !important and the
   selector chained for specificity. Belt and braces against the
   site cascade.
   ------------------------------------------------------------- */
.pid-cta-banner .pid-cta-banner__button,
.pid-cta-banner a.pid-cta-banner__button {
	display: inline-block !important;
	padding: 0.85rem 1.6rem !important;
	margin: 0 !important;
	border-radius: 999px !important;
	font-family: Helvetica, Arial, sans-serif !important;
	font-weight: 600 !important;
	font-size: 1rem !important;
	letter-spacing: 0.005em !important;
	text-decoration: none !important;
	text-transform: none !important;
	line-height: 1 !important;
	white-space: nowrap !important;
	border: 2px solid transparent !important;
	box-shadow: none !important;
	cursor: pointer;
	transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.pid-cta-banner .pid-cta-banner__button:hover,
.pid-cta-banner .pid-cta-banner__button:focus-visible {
	text-decoration: none !important;
	transform: translateY( -1px );
	box-shadow: 0 6px 18px rgba( 0, 32, 50, 0.18 ) !important;
}

.pid-cta-banner .pid-cta-banner__button:focus-visible {
	outline: 2px solid var( --cta-cyan ) !important;
	outline-offset: 3px;
}

/* =============================================================
   THEMES — diagonal 135deg gradient overlays mirroring the
   offering-cards pattern.
   ============================================================= */

/* ---- DARK ---- */
.pid-cta-banner.theme-dark {
	background: linear-gradient( 135deg, var( --cta-navy ) 0%, #001520 100% );
	color: var( --cta-off-white );
}

.pid-cta-banner.theme-dark .pid-cta-banner__headline {
	color: var( --cta-off-white ) !important;
	text-shadow: none !important;
}

.pid-cta-banner.theme-dark .pid-cta-banner__body {
	color: rgba( 250, 250, 250, 0.88 ) !important;
}

.pid-cta-banner.theme-dark .pid-cta-banner__button,
.pid-cta-banner.theme-dark a.pid-cta-banner__button {
	background-color: var( --cta-light-blue ) !important;
	color: #FFFFFF !important;
	text-decoration: none !important;
}

.pid-cta-banner.theme-dark .pid-cta-banner__button:hover,
.pid-cta-banner.theme-dark .pid-cta-banner__button:focus-visible {
	background-color: var( --cta-cyan ) !important;
	color: var( --cta-navy ) !important;
}

/* ---- LIGHT ---- */
.pid-cta-banner.theme-light {
	background: linear-gradient( 135deg, var( --cta-light-bg ) 0%, var( --cta-pale-blue ) 100% );
	color: var( --cta-near-black );
}

.pid-cta-banner.theme-light .pid-cta-banner__headline {
	color: var( --cta-navy ) !important;
	text-shadow: none !important;
}

.pid-cta-banner.theme-light .pid-cta-banner__body {
	color: var( --cta-dark-blue ) !important;
}

.pid-cta-banner.theme-light .pid-cta-banner__button,
.pid-cta-banner.theme-light a.pid-cta-banner__button {
	background-color: var( --cta-navy ) !important;
	color: #FFFFFF !important;
	text-decoration: none !important;
}

.pid-cta-banner.theme-light .pid-cta-banner__button:hover,
.pid-cta-banner.theme-light .pid-cta-banner__button:focus-visible {
	background-color: var( --cta-light-blue ) !important;
	color: #FFFFFF !important;
}

/* ---- CYAN (accessible #0070D1 → darker #005AA8) ---- */
.pid-cta-banner.theme-cyan {
	background: linear-gradient( 135deg, var( --cta-cyan-accessible ) 0%, #005AA8 100% );
	color: var( --cta-off-white );
}

.pid-cta-banner.theme-cyan .pid-cta-banner__headline {
	color: var( --cta-off-white ) !important;
	text-shadow: none !important;
}

.pid-cta-banner.theme-cyan .pid-cta-banner__body {
	color: rgba( 250, 250, 250, 0.92 ) !important;
}

.pid-cta-banner.theme-cyan .pid-cta-banner__button,
.pid-cta-banner.theme-cyan a.pid-cta-banner__button {
	background-color: var( --cta-navy ) !important;
	color: #FFFFFF !important;
	text-decoration: none !important;
}

.pid-cta-banner.theme-cyan .pid-cta-banner__button:hover,
.pid-cta-banner.theme-cyan .pid-cta-banner__button:focus-visible {
	background-color: var( --cta-pink ) !important;
	color: #FFFFFF !important;
}

/* ---- PINK (#DB0047 → darker #B00039) ---- */
.pid-cta-banner.theme-pink {
	background: linear-gradient( 135deg, var( --cta-pink ) 0%, #B00039 100% );
	color: var( --cta-off-white );
}

.pid-cta-banner.theme-pink .pid-cta-banner__headline {
	color: var( --cta-off-white ) !important;
	text-shadow: none !important;
}

.pid-cta-banner.theme-pink .pid-cta-banner__body {
	color: rgba( 250, 250, 250, 0.92 ) !important;
}

.pid-cta-banner.theme-pink .pid-cta-banner__button,
.pid-cta-banner.theme-pink a.pid-cta-banner__button {
	background-color: var( --cta-navy ) !important;
	color: #FFFFFF !important;
	text-decoration: none !important;
}

.pid-cta-banner.theme-pink .pid-cta-banner__button:hover,
.pid-cta-banner.theme-pink .pid-cta-banner__button:focus-visible {
	background-color: var( --cta-cyan-accessible ) !important;
	color: #FFFFFF !important;
}

/* =============================================================
   LAYOUTS
   ============================================================= */

/* ---- LARGE ---- */
.pid-cta-banner.layout-large .pid-cta-banner__inner {
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 1.5rem;
	padding: 3.25rem 2.5rem;
}

.pid-cta-banner.layout-large .pid-cta-banner__logo {
	margin-bottom: 0.25rem;
}

.pid-cta-banner.layout-large .pid-cta-banner__logo img {
	width: 220px;
	max-width: 60%;
}

.pid-cta-banner.layout-large .pid-cta-banner__headline {
	font-size: clamp( 1.75rem, 3vw, 2.6rem ) !important;
	max-width: 22ch;
}

.pid-cta-banner.layout-large .pid-cta-banner__body {
	max-width: 52ch;
	font-size: clamp( 1rem, 1.3vw, 1.15rem ) !important;
}

.pid-cta-banner.layout-large .pid-cta-banner__action {
	margin-top: 0.5rem;
}

.pid-cta-banner.layout-large .pid-cta-banner__button {
	padding: 1rem 2rem !important;
	font-size: 1.05rem !important;
}

/* ---- WIDE ---- */
.pid-cta-banner.layout-wide .pid-cta-banner__inner {
	flex-direction: row;
	align-items: center;
	gap: 1.75rem;
	padding: 1.75rem 2.25rem;
}

.pid-cta-banner.layout-wide .pid-cta-banner__logo {
	flex: 0 0 auto;
}

.pid-cta-banner.layout-wide .pid-cta-banner__logo img {
	width: 160px;
}

.pid-cta-banner.layout-wide .pid-cta-banner__content {
	flex: 1 1 auto;
}

.pid-cta-banner.layout-wide .pid-cta-banner__headline {
	font-size: clamp( 1.35rem, 2vw, 1.7rem ) !important;
}

/* ---- COMPACT ---- */
.pid-cta-banner.layout-compact .pid-cta-banner__inner {
	flex-direction: row;
	align-items: center;
	gap: 1.5rem;
	padding: 1.25rem 1.75rem;
}

.pid-cta-banner.layout-compact .pid-cta-banner__logo img {
	width: 140px;
}

.pid-cta-banner.layout-compact .pid-cta-banner__content {
	flex: 1 1 auto;
}

.pid-cta-banner.layout-compact .pid-cta-banner__headline {
	font-size: clamp( 1.2rem, 1.8vw, 1.5rem ) !important;
}

.pid-cta-banner.layout-compact .pid-cta-banner__body {
	display: none !important;
}

/* =============================================================
   RESPONSIVE — collapse to stacked on narrow viewports
   ============================================================= */
@media ( max-width: 768px ) {

	.pid-cta-banner.layout-wide .pid-cta-banner__inner,
	.pid-cta-banner.layout-compact .pid-cta-banner__inner {
		flex-direction: column;
		text-align: center;
		gap: 1rem;
		padding: 1.75rem 1.5rem;
	}

	.pid-cta-banner.layout-wide .pid-cta-banner__content,
	.pid-cta-banner.layout-compact .pid-cta-banner__content {
		align-items: center;
	}

	.pid-cta-banner.layout-wide .pid-cta-banner__body {
		text-align: center;
	}

	.pid-cta-banner.layout-large .pid-cta-banner__inner {
		padding: 2.5rem 1.5rem;
	}

	.pid-cta-banner .pid-cta-banner__logo img {
		max-width: 150px !important;
	}
}

/* =============================================================
   EDITOR PREVIEW
   ============================================================= */
.pid-cta-banner.is-editor-preview {
	pointer-events: auto;
}

.pid-cta-banner.is-editor-preview .pid-cta-banner__button {
	pointer-events: none;
}

.pid-cta-banner .block-editor-rich-text__editable {
	background: transparent;
	border: none;
	outline: none;
}

/* =============================================================
   CHOOSER POPUP — mini-FAB attached to the banner button.
   Selected when buttonAction = 'chooser'.
   ============================================================= */

.pid-cta-banner__chooser-wrap {
	position: relative;
	display: inline-block;
}

/* The trigger button shares the .pid-cta-banner__button class for theme
   styling, plus a chevron caret to signal that it expands. */
.pid-cta-banner__button--chooser {
	display: inline-flex !important;
	align-items: center !important;
	gap: 0.5rem !important;
}

.pid-cta-banner__chooser-caret {
	display: inline-block;
	width: 10px;
	height: 10px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate( 45deg );
	transition: transform 0.2s ease;
	margin-left: 2px;
	margin-bottom: 2px;
}

/* Open + opens-up: caret rotates to point up (menu is above) */
.pid-cta-banner__chooser-wrap.is-open:not(.opens-down) .pid-cta-banner__chooser-caret {
	transform: rotate( -135deg );
	margin-bottom: -2px;
	margin-top: 2px;
}

/* Open + opens-down: caret stays pointing down (menu is below) — no change needed */

/* The popup itself — positioned above the trigger by default; flipped to
   below by the opens-down class when JS detects the trigger is near the
   top of the viewport. */
.pid-cta-banner__chooser {
	position: absolute;
	bottom: calc( 100% + 14px );
	right: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-width: 220px;
	opacity: 0;
	visibility: hidden;
	transform: translateY( 8px );
	transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
	pointer-events: none;
	z-index: 50;
}

.pid-cta-banner__chooser-wrap.opens-down .pid-cta-banner__chooser {
	bottom: auto;
	top: calc( 100% + 14px );
	transform: translateY( -8px );
}

.pid-cta-banner__chooser-wrap.is-open .pid-cta-banner__chooser {
	opacity: 1;
	visibility: visible;
	transform: translateY( 0 );
	pointer-events: auto;
}

.pid-cta-banner__chooser-wrap.opens-down.is-open .pid-cta-banner__chooser {
	transform: translateY( 0 );
}

/* Each option pill — matches the FAB widget styling for visual consistency. */
.pid-cta-banner .pid-cta-banner__chooser-option {
	display: flex !important;
	align-items: center !important;
	gap: 10px !important;
	padding: 12px 20px !important;
	margin: 0 !important;
	border-radius: 28px !important;
	border: none !important;
	background: var( --cta-off-white ) !important;
	color: var( --cta-navy ) !important;
	font-family: Helvetica, Arial, sans-serif !important;
	font-size: 14px !important;
	font-weight: 500 !important;
	line-height: 1 !important;
	text-align: left !important;
	text-decoration: none !important;
	white-space: nowrap !important;
	cursor: pointer !important;
	box-shadow: 0 3px 12px rgba( 0, 0, 0, 0.18 ) !important;
	transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease !important;
}

.pid-cta-banner .pid-cta-banner__chooser-option:hover,
.pid-cta-banner .pid-cta-banner__chooser-option:focus-visible {
	transform: translateY( -1px ) !important;
	box-shadow: 0 5px 18px rgba( 0, 0, 0, 0.22 ) !important;
	outline: none !important;
}

.pid-cta-banner .pid-cta-banner__chooser-option:focus-visible {
	outline: 2px solid var( --cta-cyan-accessible ) !important;
	outline-offset: 2px;
}

/* Icons — inline SVG data URIs, matching the FAB widget's icon set. */
.pid-cta-banner__chooser-icon {
	display: inline-block;
	width: 20px;
	height: 20px;
	flex-shrink: 0;
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
}

.pid-cta-banner__chooser-icon--callback {
	background-image: url( "data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27%23002032%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Cpath d=%27M15.05 5A5 5 0 0 1 19 8.95M15.05 1A9 9 0 0 1 23 8.94%27/%3E%3Cpath d=%27M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z%27/%3E%3C/svg%3E" );
}

.pid-cta-banner__chooser-icon--phone {
	background-image: url( "data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27%23002032%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Cpath d=%27M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z%27/%3E%3C/svg%3E" );
}

.pid-cta-banner__chooser-icon--envelope {
	background-image: url( "data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27%23002032%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Crect x=%272%27 y=%274%27 width=%2720%27 height=%2716%27 rx=%272%27/%3E%3Cpath d=%27M22 4l-10 8L2 4%27/%3E%3C/svg%3E" );
}

/* Centred-layout adjustment: when the chooser is inside a large/centred
   action, anchor the popup to the centre rather than the right edge. */
.pid-cta-banner.layout-large .pid-cta-banner__chooser {
	right: 50%;
	transform: translate( 50%, 8px );
}

.pid-cta-banner.layout-large .pid-cta-banner__chooser-wrap.opens-down .pid-cta-banner__chooser {
	transform: translate( 50%, -8px );
}

.pid-cta-banner.layout-large .pid-cta-banner__chooser-wrap.is-open .pid-cta-banner__chooser,
.pid-cta-banner.layout-large .pid-cta-banner__chooser-wrap.opens-down.is-open .pid-cta-banner__chooser {
	transform: translate( 50%, 0 );
}

/* Mobile — narrower min-width so the popup fits comfortably and centres
   the popup horizontally under/above its trigger. */
@media ( max-width: 768px ) {
	.pid-cta-banner__chooser {
		min-width: 180px;
		right: 50%;
		transform: translate( 50%, 8px );
	}
	.pid-cta-banner__chooser-wrap.opens-down .pid-cta-banner__chooser {
		transform: translate( 50%, -8px );
	}
	.pid-cta-banner__chooser-wrap.is-open .pid-cta-banner__chooser,
	.pid-cta-banner__chooser-wrap.opens-down.is-open .pid-cta-banner__chooser {
		transform: translate( 50%, 0 );
	}
}

/* Editor preview — show the chooser inline so the editor can see the options
   alongside the button without needing JS interaction. */
.pid-cta-banner.is-editor-preview .pid-cta-banner__chooser {
	position: static;
	opacity: 1;
	visibility: visible;
	transform: none;
	pointer-events: auto;
	margin-top: 12px;
	min-width: 0;
	width: max-content;
	max-width: 100%;
}
