/*
 * APS Theme: newsletter. The native footer form (replaces Elementor template 7427), the pop-up of the front page (replaces Elementor
 * popup 5082) and the unsubscribe card. Loaded on every page after main.css (inc/features/newsletter.php); tokens (--c-ink, --c-text,
 * --c-primary, --accent, --grad-cta, --ease) come from main.css.
 *
 * Markup: inc/features/newsletter.php. The footer card itself (.footer-newsletter: white, 24px radius, soft shadow) is still drawn by
 * main.css; this file styles what is inside it. Input and button selectors carry four classes or more because, while Elementor is still
 * active, its kit rules for inputs and buttons (.elementor-kit-N input:not([type=button]):not([type=submit]) and the :focus and :hover
 * variants) are as specific as three classes and an element, and the reset of main.css gives every button a pink hover.
 */

/* ======================================================================
   Shared: heading, text, the capsule (one field and the round send button), the message
   ====================================================================== */

.aps-nl {
	--nl-font: var(--wp--preset--font-family--cairo, Cairo, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif);
	color: var(--c-ink);
	font-family: var(--nl-font);
}

.aps-nl .aps-nl__title {
	margin: 0 0 6px;
	color: var(--c-ink);
	font-family: inherit;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.25;
}
.aps-nl .aps-nl__text {
	margin: 0;
	color: #6b7c8c;
	font-family: inherit;
	font-size: 14px;
	line-height: 1.55;
}

.aps-nl .aps-nl__form { position: relative; margin: 0; }
.aps-nl .aps-nl__capsule {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: 6px;
	padding: 6px;
	border: 1px solid #d9e5ee;
	border-radius: 999px;
	background: #fff;
	box-shadow: inset 0 1px 2px rgba(16, 47, 65, 0.04);
	transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.aps-nl .aps-nl__capsule:focus-within {
	border-color: var(--accent);
	box-shadow: 0 0 0 4px rgba(12, 131, 200, 0.2), inset 0 1px 2px rgba(16, 47, 65, 0.04);
}
.aps-nl.is-invalid .aps-nl__capsule {
	border-color: #b42318;
	box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.14), inset 0 1px 2px rgba(16, 47, 65, 0.04);
}

/* The field: no border of its own (the capsule has it), 16px so that iOS does not zoom, 44px high. */
.aps-nl .aps-nl__capsule input.aps-nl__input[type="email"],
.aps-nl .aps-nl__capsule input.aps-nl__input[type="email"]:focus {
	flex: 1 1 auto;
	width: 100%;
	min-width: 0;
	height: 44px;
	min-height: 0;
	margin: 0;
	padding: 0 18px;
	border: 0;
	border-radius: 999px;
	background: transparent;
	box-shadow: none;
	color: var(--c-ink);
	font-family: inherit;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.2;
	outline: 0;
}
.aps-nl .aps-nl__input::placeholder {
	color: #627384;
	font-weight: 500;
	opacity: 1;
}
.aps-nl .aps-nl__capsule input.aps-nl__input[type="email"]:-webkit-autofill {
	-webkit-text-fill-color: var(--c-ink);
	box-shadow: 0 0 0 48px #fff inset;
}

/* The send button: the brand gradient, a paper plane that nudges up and right on hover. */
.aps-nl .aps-nl__capsule button.aps-nl__send,
.aps-nl .aps-nl__capsule button.aps-nl__send:hover,
.aps-nl .aps-nl__capsule button.aps-nl__send:focus {
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	min-width: 56px;
	height: 44px;
	margin: 0;
	padding: 0 20px;
	border: 0;
	border-radius: 999px;
	background: var(--grad-cta);
	box-shadow: 0 6px 16px rgba(8, 113, 179, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.28);
	color: #fff;
	cursor: pointer;
	transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), filter 0.2s var(--ease);
}
.aps-nl .aps-nl__capsule button.aps-nl__send:hover,
.aps-nl .aps-nl__capsule button.aps-nl__send:focus-visible {
	box-shadow: 0 10px 22px rgba(8, 113, 179, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.28);
	filter: brightness(1.04);
	transform: translateY(-1px);
}
.aps-nl .aps-nl__capsule button.aps-nl__send:active { transform: scale(0.96); }
.aps-nl .aps-nl__capsule button.aps-nl__send:focus-visible {
	outline: 2px solid var(--c-primary);
	outline-offset: 2px;
}
.aps-nl .aps-nl__capsule button.aps-nl__send svg {
	width: 18px;
	height: 18px;
	transition: transform 0.25s var(--ease);
}
.aps-nl .aps-nl__capsule button.aps-nl__send:hover svg { transform: translate(2px, -2px); }
.aps-nl .aps-nl__form[aria-busy="true"] .aps-nl__capsule button.aps-nl__send {
	cursor: progress;
	opacity: 0.75;
}

/* The message (a live region that is always in the page, empty until there is something to say). Empty it takes no room. */
.aps-nl .aps-nl__status {
	margin: 10px 0 0;
	padding: 0 6px;
	color: var(--c-text);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.45;
}
.aps-nl .aps-nl__status:empty { margin: 0; padding: 0; }
.aps-nl .aps-nl__status:focus { outline: 0; }
.aps-nl .aps-nl__status.aps-nl__status--ok { color: #0b7a3f; }
.aps-nl .aps-nl__status.aps-nl__status--error { color: #b42318; }

/* The honeypot: clipped, never display:none. (The wrapper carries the same rule inline.) */
.aps-nl .aps-nl__hp {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	border: 0;
	white-space: nowrap;
}

/* ======================================================================
   Footer: heading and text on the left, the capsule on the right (inside .footer-newsletter of main.css)
   ====================================================================== */

.aps-nl--footer {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 340px);
	gap: 24px;
	align-items: center;
}

/* ======================================================================
   Pop-up: a native dialog (top layer, so no z-index fights with the promo bar or the floating buttons). White card of 520px, 28px radius,
   the envelope bubble, a centred heading, a larger capsule. Closed it is display:none: it takes no room and moves nothing.
   ====================================================================== */

.aps-nl-pop {
	box-sizing: border-box;
	width: min(520px, calc(100vw - 32px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
	max-width: none;
	max-height: none;
	margin: auto;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--c-ink);
	overflow: visible;
}
.aps-nl-pop:not([open]) { display: none; }
.aps-nl-pop::backdrop {
	background: rgba(3, 17, 30, 0.74);
	-webkit-backdrop-filter: blur(8px) saturate(1.1);
	backdrop-filter: blur(8px) saturate(1.1);
}
.aps-nl-pop[open] { animation: aps-nl-pop-in 0.5s var(--ease) both; }
.aps-nl-pop[open]::backdrop { animation: aps-nl-pop-fade 0.35s var(--ease) both; }
@keyframes aps-nl-pop-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}
@keyframes aps-nl-pop-in {
	from { opacity: 0; transform: translateY(18px) scale(0.97); }
	to { opacity: 1; transform: none; }
}

/* Scroll lock while the pop-up is open. The scrollbar gutter stays (when the page has a scrollbar), so nothing behind moves. */
html.aps-nl-open { overflow: hidden; }
html.aps-nl-open.aps-nl-open--bar { scrollbar-gutter: stable; }

.aps-nl-pop .aps-nl-pop__card {
	position: relative;
	overflow: hidden;
	border-radius: 28px;
	background: #fff;
	box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 36px 90px rgba(2, 11, 24, 0.55);
	isolation: isolate;
	outline: 0;
}
.aps-nl-pop .aps-nl-pop__card::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background:
		radial-gradient(72% 58% at 100% 0%, rgba(86, 204, 242, 0.24), transparent 70%),
		radial-gradient(64% 52% at 0% 100%, rgba(18, 108, 172, 0.08), transparent 72%);
}
.aps-nl-pop .aps-nl-pop__body {
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	padding: 56px 44px 44px;
	overflow-y: auto;
	overscroll-behavior: contain;
}

/* Close: a round 44px chip with the brand blue ring for the keyboard. */
.aps-nl-pop button.aps-nl-pop__close,
.aps-nl-pop button.aps-nl-pop__close:hover,
.aps-nl-pop button.aps-nl-pop__close:focus {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--c-mist);
	box-shadow: inset 0 0 0 1px rgba(16, 47, 65, 0.06);
	color: var(--c-ink);
	cursor: pointer;
	transition: background-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.25s var(--ease);
}
.aps-nl-pop button.aps-nl-pop__close:hover {
	background: var(--c-primary);
	color: #fff;
	transform: rotate(90deg);
}
.aps-nl-pop button.aps-nl-pop__close:focus-visible {
	outline: 2px solid var(--c-primary);
	outline-offset: 2px;
}
.aps-nl-pop .aps-nl-pop__close svg { width: 16px; height: 16px; }

/* Inside the pop-up everything is centred. */
.aps-nl--popup { text-align: center; }
.aps-nl--popup .aps-nl__bubble {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	margin: 0 auto 22px;
	border-radius: 50%;
	background: linear-gradient(145deg, rgba(86, 204, 242, 0.34), rgba(18, 108, 172, 0.12));
	box-shadow: inset 0 0 0 1px rgba(12, 131, 200, 0.2), 0 0 0 8px rgba(86, 204, 242, 0.1);
	color: #126cac;
}
.aps-nl--popup .aps-nl__bubble svg { width: 30px; height: 30px; }
.aps-nl.aps-nl--popup .aps-nl__title {
	margin: 0;
	font-size: 28px;
	font-weight: 800;
	letter-spacing: -0.015em;
	line-height: 1.2;
	text-wrap: balance;
}
.aps-nl--popup .aps-nl__title::after {
	content: "";
	display: block;
	width: 48px;
	height: 4px;
	margin: 16px auto 0;
	border-radius: 99px;
	background: linear-gradient(90deg, #126cac, #56ccf2);
}
.aps-nl.aps-nl--popup .aps-nl__text {
	max-width: 400px;
	margin: 16px auto 0;
	color: #5b6b78;
	font-size: 16px;
	font-weight: 500;
	line-height: 1.65;
	text-wrap: balance;
}
.aps-nl--popup .aps-nl__panel { margin-top: 30px; }
.aps-nl--popup .aps-nl__capsule { box-shadow: inset 0 1px 2px rgba(16, 47, 65, 0.05), 0 8px 24px rgba(16, 47, 65, 0.07); }
.aps-nl--popup .aps-nl__capsule:focus-within { box-shadow: 0 0 0 4px rgba(12, 131, 200, 0.2), inset 0 1px 2px rgba(16, 47, 65, 0.05); }
.aps-nl--popup.is-invalid .aps-nl__capsule { box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.14), inset 0 1px 2px rgba(16, 47, 65, 0.05); }
.aps-nl--popup .aps-nl__capsule input.aps-nl__input[type="email"],
.aps-nl--popup .aps-nl__capsule input.aps-nl__input[type="email"]:focus { height: 48px; }
.aps-nl--popup .aps-nl__capsule button.aps-nl__send,
.aps-nl--popup .aps-nl__capsule button.aps-nl__send:hover,
.aps-nl--popup .aps-nl__capsule button.aps-nl__send:focus {
	width: 48px;
	min-width: 48px;
	height: 48px;
	padding: 0;
	border-radius: 50%;
}
.aps-nl--popup .aps-nl__status { margin-top: 16px; text-align: center; }
.aps-nl--popup .aps-nl__status:empty { margin: 0; }
/* After a successful signup the form gives way to the message (and the code in it). */
.aps-nl--popup.is-done .aps-nl__form { display: none; }
.aps-nl--popup.is-done .aps-nl__status { margin-top: 24px; font-size: 16px; }

/* ======================================================================
   Unsubscribe card (inside the page kit of main.css: .aps-hero above, .aps-card here)
   ====================================================================== */

.aps-page .aps-nl-card { text-align: center; }
.aps-page .aps-nl-card p {
	margin: 0 0 18px;
	color: var(--c-text);
	font-size: 17px;
	line-height: 1.7;
}
.aps-page .aps-nl-card strong { color: var(--c-ink); }
.aps-page .aps-nl-card .aps-nl-card__form { margin: 8px 0 20px; }
.aps-page .aps-nl-card button.aps-nl-card__button,
.aps-page .aps-nl-card button.aps-nl-card__button:hover,
.aps-page .aps-nl-card button.aps-nl-card__button:focus {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 12px 32px;
	border: 0;
	border-radius: 999px;
	background: var(--grad-strong);
	box-shadow: 0 6px 16px rgba(8, 113, 179, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.28);
	color: #fff;
	font-family: inherit;
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
	transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), filter 0.2s var(--ease);
}
.aps-page .aps-nl-card button.aps-nl-card__button:hover { filter: brightness(1.06); transform: translateY(-1px); }
.aps-page .aps-nl-card button.aps-nl-card__button:focus-visible {
	outline: 3px solid var(--c-sky);
	outline-offset: 3px;
}
.aps-page .aps-nl-card .aps-nl-card__actions { margin: 0; }
.aps-page .aps-nl-card a.aps-nl-card__link {
	display: inline-block;
	padding: 10px 6px;
	color: var(--accent);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* ======================================================================
   Phones: the footer card stacks, the pop-up keeps a safe margin (16px of page on each side), the fields stay 16px.
   ====================================================================== */

@media (max-width: 767px) {
	.aps-nl--footer { grid-template-columns: 1fr; gap: 16px; }
	.aps-nl-pop .aps-nl-pop__card { border-radius: 24px; }
	.aps-nl-pop .aps-nl-pop__body { padding: 52px 24px 28px; }
	.aps-nl--popup .aps-nl__bubble { width: 56px; height: 56px; margin-bottom: 18px; }
	.aps-nl--popup .aps-nl__bubble svg { width: 26px; height: 26px; }
	.aps-nl.aps-nl--popup .aps-nl__title { font-size: 24px; }
	.aps-nl--popup .aps-nl__title::after { margin-top: 14px; }
	.aps-nl.aps-nl--popup .aps-nl__text { margin-top: 14px; font-size: 15px; line-height: 1.6; }
	.aps-nl--popup .aps-nl__panel { margin-top: 26px; }
	.aps-nl--popup .aps-nl__capsule input.aps-nl__input[type="email"],
	.aps-nl--popup .aps-nl__capsule input.aps-nl__input[type="email"]:focus { padding: 0 16px; }
}
@media (max-width: 359px) {
	.aps-nl-pop .aps-nl-pop__body { padding: 48px 18px 24px; }
}

/* ======================================================================
   Motion preferences: the entrance, the hover movements and the transitions are dropped (the colours still change).
   ====================================================================== */

@media (prefers-reduced-motion: reduce) {
	.aps-nl-pop[open],
	.aps-nl-pop[open]::backdrop { animation: none; }
	.aps-nl .aps-nl__capsule,
	.aps-nl .aps-nl__capsule button.aps-nl__send,
	.aps-nl .aps-nl__capsule button.aps-nl__send svg,
	.aps-nl-pop button.aps-nl-pop__close,
	.aps-page .aps-nl-card button.aps-nl-card__button { transition: none; }
	.aps-nl .aps-nl__capsule button.aps-nl__send:hover,
	.aps-nl .aps-nl__capsule button.aps-nl__send:focus-visible,
	.aps-nl .aps-nl__capsule button.aps-nl__send:active,
	.aps-nl .aps-nl__capsule button.aps-nl__send:hover svg,
	.aps-nl-pop button.aps-nl-pop__close:hover,
	.aps-page .aps-nl-card button.aps-nl-card__button:hover { transform: none; }
}
