/* Plumber Call CTA — frontend
   Colours and fonts come from CSS variables set per-site in Settings. */

.pcta {
	--pcta-heading: #1a5b8e;
	--pcta-text: #33404f;
	--pcta-number: #a6282a;
	--pcta-btn-bg: #a6282a;
	--pcta-btn-text: #ffffff;
	--pcta-screen-num: #1a5b8e;
	--pcta-key: #43536b;
	--pcta-call: #16a34a;
	--pcta-phone: #15181d;
	--pcta-screen-top: #f2f6fc;
	--pcta-screen-bot: #dde7f4;
	--pcta-card: #ffffff;
	--pcta-overlay: 0;
	--pcta-heading-font: system-ui, sans-serif;
	--pcta-body-font: system-ui, sans-serif;
	--pcta-heading-size: 26px;
	--pcta-text-size: 17px;
	--pcta-btn-size: 16px;
	--pcta-screen-size: 19px;
	--pcta-maxwidth: 920px;
	--pcta-align: left;
	--pcta-align-items: flex-start;

	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: clamp(28px, 5vw, 56px);
	max-width: var(--pcta-maxwidth, 920px);
	margin: 0 auto;
	padding: clamp(28px, 4vw, 44px);
	font-family: var(--pcta-body-font);
	color: var(--pcta-text);
	background-color: var(--pcta-card);
}

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

.pcta--rounded {
	border-radius: 24px;
}

.pcta--shadow {
	box-shadow: 0 1px 2px rgba(15, 30, 50, .05), 0 24px 60px -28px rgba(15, 30, 50, .35);
}

/* Background image sits over the background colour, with a colour overlay
   whose opacity is controlled in settings (for readability). */
.pcta--has-bg {
	position: relative;
	overflow: hidden;
	background-image: var(--pcta-bg-image);
	background-size: cover;
	background-position: center;
}

.pcta--has-bg::before {
	content: "";
	position: absolute;
	inset: 0;
	background-color: var(--pcta-card);
	opacity: var(--pcta-overlay, 0);
	pointer-events: none;
	z-index: 0;
}

.pcta--has-bg > * {
	position: relative;
	z-index: 1;
}

/* Full-width: break out of the content container, edge to edge. */
.pcta--full {
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	border-radius: 0 !important;
	padding-left: max(24px, calc((100vw - 960px) / 2));
	padding-right: max(24px, calc((100vw - 960px) / 2));
}

/* ----------------------------------------------------------------------- */
/* Phone device                                                             */
/* ----------------------------------------------------------------------- */

.pcta__phone {
	flex-shrink: 0;
}

.pcta__device {
	position: relative;
	width: 232px;
	padding: 14px 12px 18px;
	background: linear-gradient(160deg, color-mix(in srgb, var(--pcta-phone) 88%, #fff 12%), var(--pcta-phone));
	border-radius: 38px;
	box-shadow:
		inset 0 0 0 2px color-mix(in srgb, var(--pcta-phone) 70%, #fff 30%),
		inset 0 0 0 7px var(--pcta-phone),
		0 22px 45px -18px rgba(10, 20, 35, .55);
}

.pcta__notch {
	position: absolute;
	top: 16px;
	left: 50%;
	transform: translateX(-50%);
	width: 64px;
	height: 7px;
	background: rgba(255, 255, 255, .18);
	border-radius: 10px;
	z-index: 3;
}

.pcta__screen {
	position: relative;
	margin-top: 22px;
	border-radius: 26px;
	background: linear-gradient(180deg, var(--pcta-screen-top), var(--pcta-screen-bot));
	padding: 16px 16px 18px;
	overflow: hidden;
}

.pcta__status {
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: 10px;
	font-weight: 600;
	letter-spacing: .02em;
	color: color-mix(in srgb, var(--pcta-key) 70%, transparent);
	margin-bottom: 10px;
}

.pcta__status-icons {
	display: inline-flex;
	gap: 3px;
	align-items: center;
}

.pcta__status-icons i {
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: color-mix(in srgb, var(--pcta-key) 55%, transparent);
	display: inline-block;
}

.pcta__display {
	height: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: var(--pcta-screen-size, 19px);
	font-weight: 700;
	letter-spacing: -.3px;
	color: var(--pcta-screen-num);
	margin-bottom: 14px;
}

.pcta__caret {
	width: 2px;
	height: 20px;
	margin-left: 2px;
	background: var(--pcta-screen-num);
	opacity: 0;
}

.pcta.is-dialing .pcta__caret {
	opacity: 1;
	animation: pcta-blink 1s steps(1) infinite;
}

@keyframes pcta-blink {
	50% { opacity: 0; }
}

.pcta__pad {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 10px;
}

.pcta__key {
	aspect-ratio: 1;
	border-radius: 50%;
	border: 1.5px solid color-mix(in srgb, var(--pcta-screen-num) 28%, transparent);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	color: var(--pcta-key);
	background: color-mix(in srgb, #fff 35%, transparent);
	transition: transform .12s ease, background-color .12s ease, color .12s ease, border-color .12s ease;
}

.pcta__key-num {
	font-size: 17px;
	font-weight: 600;
	line-height: 1;
}

.pcta__key-sub {
	font-size: 7px;
	font-weight: 600;
	letter-spacing: .12em;
	margin-top: 2px;
	color: color-mix(in srgb, var(--pcta-key) 60%, transparent);
}

.pcta__key.is-pressed {
	background: var(--pcta-screen-num);
	border-color: var(--pcta-screen-num);
	color: #fff;
	transform: scale(.9);
}

.pcta__key.is-pressed .pcta__key-sub {
	color: rgba(255, 255, 255, .75);
}

.pcta__callwrap {
	display: flex;
	justify-content: center;
	margin-top: 14px;
}

.pcta .pcta__call {
	-webkit-appearance: none;
	appearance: none;
	box-sizing: border-box;
	width: 46px !important;
	height: 46px !important;
	min-width: 46px;
	padding: 0 !important;
	margin: 0;
	border: none !important;
	border-radius: 50% !important;
	background: var(--pcta-call) !important;
	color: #fff !important;
	display: flex !important;
	align-items: center;
	justify-content: center;
	line-height: 0;
	cursor: pointer;
	text-decoration: none !important;
	opacity: .92;
	box-shadow: none;
	transition: transform .15s ease, opacity .15s ease, filter .15s ease;
}

.pcta .pcta__call:hover,
.pcta .pcta__call:focus-visible {
	opacity: 1;
	transform: scale(1.06);
	filter: brightness(1.05);
}

.pcta .pcta__call:focus-visible {
	outline: 3px solid color-mix(in srgb, var(--pcta-call) 45%, transparent);
	outline-offset: 3px;
}

.pcta .pcta__call svg {
	display: block;
	width: 22px;
	height: 22px;
	fill: #fff;
}

.pcta.is-ringing .pcta__call {
	opacity: 1;
	animation: pcta-ring .9s ease-in-out infinite;
}

@keyframes pcta-ring {
	0%, 100% { transform: rotate(0) scale(1); box-shadow: 0 0 0 0 color-mix(in srgb, var(--pcta-call) 55%, transparent); }
	25% { transform: rotate(-9deg) scale(1.05); }
	50% { transform: rotate(9deg) scale(1.05); box-shadow: 0 0 0 12px color-mix(in srgb, var(--pcta-call) 0%, transparent); }
	75% { transform: rotate(-6deg) scale(1.02); }
}

/* ----------------------------------------------------------------------- */
/* Text content                                                             */
/* ----------------------------------------------------------------------- */

.pcta__content {
	display: flex;
	flex-direction: column;
	align-items: var(--pcta-align-items, flex-start);
	text-align: var(--pcta-align, left);
	max-width: calc(var(--pcta-maxwidth, 920px) - 320px);
}

.pcta__heading {
	font-family: var(--pcta-heading-font);
	font-size: clamp(20px, 4vw, var(--pcta-heading-size, 26px));
	font-weight: 600;
	line-height: 1.2;
	color: var(--pcta-heading);
	margin: 0 0 10px;
	text-wrap: balance;
}

.pcta__text {
	font-size: var(--pcta-text-size, 17px);
	line-height: 1.5;
	margin: 0 0 20px;
}

.pcta__number {
	color: var(--pcta-number);
	font-weight: 700;
	text-decoration: none;
	white-space: nowrap;
}

.pcta__number:hover {
	text-decoration: underline;
}

.pcta .pcta__btn,
.pcta .pcta__btn:link,
.pcta .pcta__btn:visited,
.pcta .pcta__btn:hover,
.pcta .pcta__btn:focus,
.pcta .pcta__btn:active {
	text-decoration: none !important;
	box-shadow: none;
}

.pcta__btn,
.pcta__btn:link,
.pcta__btn:visited {
	display: inline-flex;
	align-items: center;
	background: var(--pcta-btn-bg);
	color: var(--pcta-btn-text);
	font-family: var(--pcta-body-font);
	font-size: var(--pcta-btn-size, 16px);
	font-weight: 600;
	line-height: 1;
	padding: 14px 24px;
	border-radius: 12px;
	transition: background-color .18s ease, transform .18s ease;
}

.pcta__btn:hover,
.pcta__btn:focus-visible {
	color: var(--pcta-btn-text);
	background: color-mix(in srgb, var(--pcta-btn-bg) 84%, #000 16%);
	transform: translateY(-1px);
}

.pcta__btn:focus-visible {
	outline: 3px solid color-mix(in srgb, var(--pcta-btn-bg) 45%, transparent);
	outline-offset: 3px;
}

/* ----------------------------------------------------------------------- */
/* Entrance + responsive                                                    */
/* ----------------------------------------------------------------------- */

.pcta__phone,
.pcta__content {
	opacity: 0;
	transform: translateY(16px);
	transition: opacity .6s ease, transform .6s ease;
}

.pcta.is-visible .pcta__phone,
.pcta.is-visible .pcta__content {
	opacity: 1;
	transform: none;
}

.pcta.is-visible .pcta__content {
	transition-delay: .12s;
}

@media (max-width: 600px) {
	.pcta,
	.pcta--right {
		flex-direction: column;
		text-align: center;
		gap: 28px;
	}

	.pcta__content {
		align-items: center;
		order: 2;
	}

	.pcta__phone {
		order: 1;
	}
}

@media (prefers-reduced-motion: reduce) {
	.pcta__phone,
	.pcta__content,
	.pcta__key,
	.pcta__call {
		transition: none;
		animation: none !important;
	}
}
