/*! Native CTA 1.0.0 | GPL-2.0-or-later | Native Distribution
 * Every selector is prefixed with .native-cta so theme styles are left alone.
 */

/* ---------- Slots: fixed containers that stack CTAs sharing a screen area ---------- */
.native-cta-slot {
	position: fixed;
	display: flex;
	flex-direction: column;
	gap: 12px;
	pointer-events: none;
	max-width: calc(100vw - 16px);
	box-sizing: border-box;
}
.native-cta-slot > .native-cta { pointer-events: auto; }

.native-cta-slot--corner-br,
.native-cta-slot--corner-bl {
	bottom: calc(var(--ncta-slot-y, 20px) + var(--native-cta-bottom-inset, 0px) + env(safe-area-inset-bottom, 0px));
	--ncta-slide-from: translateY(16px);
}
.native-cta-slot--corner-tr,
.native-cta-slot--corner-tl {
	top: calc(var(--ncta-slot-y, 20px) + var(--native-cta-top-inset, 0px) + var(--wp-admin--admin-bar--height, 0px));
	--ncta-slide-from: translateY(-16px);
}
.native-cta-slot--corner-br,
.native-cta-slot--corner-tr,
.native-cta-slot--corner-mr { right: var(--ncta-slot-x, 20px); align-items: flex-end; }
.native-cta-slot--corner-bl,
.native-cta-slot--corner-tl,
.native-cta-slot--corner-ml { left: var(--ncta-slot-x, 20px); align-items: flex-start; }
.native-cta-slot--corner-mr,
.native-cta-slot--corner-ml { top: 50%; transform: translateY(-50%); }
.native-cta-slot--corner-mr { --ncta-slide-from: translateX(16px); }
.native-cta-slot--corner-ml { --ncta-slide-from: translateX(-16px); }

.native-cta-slot--edge-right,
.native-cta-slot--edge-left {
	top: var(--ncta-slot-pct, 50%);
	transform: translateY(-50%);
	gap: 8px;
}
.native-cta-slot--edge-right { right: var(--ncta-slot-x, 0px); align-items: flex-end; --ncta-slide-from: translateX(24px); }
.native-cta-slot--edge-left { left: var(--ncta-slot-x, 0px); align-items: flex-start; --ncta-slide-from: translateX(-24px); }

.native-cta-slot--top,
.native-cta-slot--bottom,
.native-cta-slot--sticky-top,
.native-cta-slot--sticky-bottom {
	left: 0;
	right: 0;
	max-width: none;
	width: 100%;
	gap: 0;
}
.native-cta-slot--top { top: var(--wp-admin--admin-bar--height, 0px); --ncta-slide-from: translateY(-100%); }
.native-cta-slot--bottom { bottom: 0; --ncta-slide-from: translateY(100%); }
.native-cta-slot--sticky-top { position: sticky; top: calc(var(--wp-admin--admin-bar--height, 0px) + var(--native-cta-top-inset, 0px)); --ncta-slide-from: translateY(-100%); }
.native-cta-slot--sticky-bottom { position: sticky; bottom: var(--native-cta-bottom-inset, 0px); --ncta-slide-from: translateY(100%); }

/* ---------- Base (scoped) ---------- */
.native-cta,
.native-cta *,
.native-cta *::before,
.native-cta *::after { box-sizing: border-box; }

.native-cta {
	position: relative;
	color: var(--ncta-fg, #fff);
	font-size: var(--ncta-fs, 15px);
	line-height: 1.35;
	text-align: left;
	-webkit-font-smoothing: antialiased;
}
.native-cta p { margin: 0; padding: 0; }
.native-cta [hidden] { display: none !important; }
.native-cta.is-dismissed { display: none !important; }
.native-cta-js .native-cta--deferred { display: none !important; }

.native-cta-sr-only {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

.native-cta__icon {
	display: block;
	width: var(--ncta-icon, 22px);
	height: var(--ncta-icon, 22px);
	flex: none;
}

/* ---------- Buttons (links) ---------- */
.native-cta .native-cta__button,
.native-cta .native-cta__button:visited,
.native-cta .native-cta__button:hover,
.native-cta .native-cta__button:focus,
.native-cta .native-cta__button:active {
	color: var(--ncta-btn-fg, #fff);
	text-decoration: none;
}
.native-cta .native-cta__button {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5em;
	min-height: 44px;
	min-width: 44px;
	margin: 0;
	padding: calc(var(--ncta-pad, 14px) * 0.6) var(--ncta-pad, 14px);
	background: var(--ncta-btn-bg, #1d4ed8);
	border: var(--ncta-bw, 0) solid var(--ncta-border, transparent);
	border-radius: var(--ncta-radius, 8px);
	box-shadow: var(--ncta-shadow, none);
	font: inherit;
	font-weight: var(--ncta-fw, 600);
	line-height: 1.2;
	letter-spacing: normal;
	text-transform: none;
	white-space: nowrap;
	cursor: pointer;
	transition: transform 0.15s ease, filter 0.15s ease;
}
.native-cta .native-cta__button--secondary,
.native-cta .native-cta__button--secondary:visited,
.native-cta .native-cta__button--secondary:hover,
.native-cta .native-cta__button--secondary:focus {
	background: var(--ncta-btn2-bg, #fff);
	color: var(--ncta-btn2-fg, #1e293b);
}
@media (hover: hover) {
	.native-cta .native-cta__button:hover { filter: brightness(1.08); transform: translateY(-1px); }
}

/* Visible focus on any background: white ring + dark halo. */
.native-cta .native-cta__button:focus-visible,
.native-cta .native-cta__tab:focus-visible,
.native-cta .native-cta__close:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 2px;
	box-shadow: 0 0 0 6px #111827;
}

/* Tooltip for icon-only buttons. */
.native-cta .native-cta__tooltip {
	position: absolute;
	top: 50%;
	right: calc(100% + 10px);
	transform: translateY(-50%);
	padding: 5px 9px;
	border-radius: 4px;
	background: #111827;
	color: #fff;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.2;
	white-space: nowrap;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.15s ease;
}
.native-cta-slot--corner-bl .native-cta__tooltip,
.native-cta-slot--corner-tl .native-cta__tooltip,
.native-cta-slot--corner-ml .native-cta__tooltip { right: auto; left: calc(100% + 10px); }
.native-cta .native-cta__button:hover .native-cta__tooltip,
.native-cta .native-cta__button:focus-visible .native-cta__tooltip { opacity: 1; visibility: visible; }

/* ---------- Close / dismiss ---------- */
.native-cta button.native-cta__close {
	-webkit-appearance: none;
	appearance: none;
	position: absolute;
	top: -10px;
	right: -10px;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 2px solid #fff;
	border-radius: 50%;
	background: #111827;
	color: #fff;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
	line-height: 1;
	cursor: pointer;
}
.native-cta button.native-cta__close::before { content: ""; position: absolute; inset: -8px; } /* 44px touch target */
.native-cta button.native-cta__close .native-cta__icon { width: 14px; height: 14px; }
.native-cta-slot--corner-bl .native-cta__close,
.native-cta-slot--corner-tl .native-cta__close,
.native-cta-slot--corner-ml .native-cta__close,
.native-cta--side-right .native-cta__close { right: auto; left: -10px; }
.native-cta--side-left .native-cta__close { right: -10px; left: auto; }

/* ---------- Floating action button & contact buttons ---------- */
.native-cta--fab .native-cta__fab { min-height: var(--ncta-w, 56px); }
.native-cta--display-icon .native-cta__button {
	width: var(--ncta-w, 52px);
	height: var(--ncta-w, 52px);
	padding: 0;
}
.native-cta--contact .native-cta__stack {
	display: flex;
	flex-direction: column;
	gap: var(--ncta-gap, 10px);
	align-items: inherit;
}
.native-cta-slot--corner-br .native-cta__stack,
.native-cta-slot--corner-tr .native-cta__stack,
.native-cta-slot--corner-mr .native-cta__stack { align-items: flex-end; }
.native-cta-slot--corner-bl .native-cta__stack,
.native-cta-slot--corner-tl .native-cta__stack,
.native-cta-slot--corner-ml .native-cta__stack { align-items: flex-start; }

/* ---------- Sticky sidebar tab ---------- */
.native-cta--sidebar .native-cta__tab,
.native-cta--sidebar .native-cta__button.native-cta__tab,
.native-cta--sidebar .native-cta__button.native-cta__tab:visited,
.native-cta--sidebar .native-cta__button.native-cta__tab:hover,
.native-cta--sidebar .native-cta__button.native-cta__tab:focus {
	background: var(--ncta-bg, #1d4ed8);
	color: var(--ncta-fg, #fff);
}
.native-cta--sidebar .native-cta__tab {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	min-width: 44px;
	min-height: 44px;
	margin: 0;
	padding: calc(var(--ncta-pad, 14px) * 0.7) var(--ncta-pad, 14px);
	border: var(--ncta-bw, 0) solid var(--ncta-border, transparent);
	box-shadow: var(--ncta-shadow, none);
	font-weight: var(--ncta-fw, 600);
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	list-style: none;
	user-select: none;
}
.native-cta--sidebar summary.native-cta__tab::-webkit-details-marker { display: none; }
.native-cta--sidebar summary.native-cta__tab::marker { content: ""; }
.native-cta--side-right .native-cta__tab { border-radius: var(--ncta-radius, 8px) 0 0 var(--ncta-radius, 8px); border-right-width: 0; }
.native-cta--side-left .native-cta__tab { border-radius: 0 var(--ncta-radius, 8px) var(--ncta-radius, 8px) 0; border-left-width: 0; }

.native-cta--vertical .native-cta__tab {
	-webkit-writing-mode: vertical-rl;
	writing-mode: vertical-rl;
	padding: var(--ncta-pad, 14px) calc(var(--ncta-pad, 14px) * 0.7);
}
/* Left-edge vertical text reads bottom-to-top; corner radii are pre-rotated. */
.native-cta--vertical.native-cta--side-left .native-cta__tab {
	transform: rotate(180deg);
	border-radius: var(--ncta-radius, 8px) 0 0 var(--ncta-radius, 8px);
	border-left-width: var(--ncta-bw, 0);
	border-right-width: 0;
}
.native-cta--vertical.native-cta--side-left .native-cta__tab .native-cta__icon { transform: rotate(180deg); }
.native-cta--vertical.native-cta--side-left .native-cta__button.native-cta__tab:hover { transform: rotate(180deg); }
@media (hover: hover) {
	.native-cta--sidebar .native-cta__button.native-cta__tab:hover { transform: none; }
	.native-cta--vertical.native-cta--side-left .native-cta__button.native-cta__tab:hover { transform: rotate(180deg); }
}

.native-cta__details { position: relative; margin: 0; padding: 0; border: 0; }
.native-cta__panel {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: var(--ncta-w, 280px);
	max-width: calc(100vw - 72px);
	max-height: calc(100vh - 32px);
	overflow-y: auto;
	padding: var(--ncta-pad, 14px);
	display: flex;
	flex-direction: column;
	gap: 8px;
	background: var(--ncta-btn2-bg, #fff);
	color: var(--ncta-btn2-fg, #1e293b);
	border: var(--ncta-bw, 0) solid var(--ncta-border, transparent);
	border-radius: var(--ncta-radius, 8px);
	box-shadow: 0 12px 32px rgba(15, 23, 42, 0.25);
}
.native-cta--side-right .native-cta__panel { right: calc(100% + 8px); }
.native-cta--side-left .native-cta__panel { left: calc(100% + 8px); }
.native-cta__panel .native-cta__stack { display: flex; flex-direction: column; gap: var(--ncta-gap, 10px); margin-top: 4px; }
.native-cta__panel .native-cta__button { justify-content: flex-start; white-space: normal; text-align: left; }
.native-cta__panel .native-cta__heading { font-weight: 700; font-size: 1.05em; }
.native-cta__panel .native-cta__desc { font-size: 0.92em; opacity: 0.85; }
.native-cta__panel .native-cta__image { width: 56px; height: 56px; }

/* ---------- Banner ---------- */
.native-cta--banner {
	width: 100%;
	background-color: var(--ncta-bg, #0f172a);
	color: var(--ncta-fg, #fff);
	box-shadow: var(--ncta-shadow, none);
}
.native-cta--banner.native-cta--edge-top { border-bottom: var(--ncta-bw, 0) solid var(--ncta-border, transparent); }
.native-cta--banner.native-cta--edge-bottom { border-top: var(--ncta-bw, 0) solid var(--ncta-border, transparent); }
.native-cta--banner.native-cta--has-image {
	background-image: linear-gradient(rgba(0, 0, 0, var(--ncta-overlay, 0.4)), rgba(0, 0, 0, var(--ncta-overlay, 0.4))), var(--ncta-bg-image);
	background-size: cover;
	background-position: center;
}
.native-cta--banner .native-cta__inner {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px var(--ncta-gap, 16px);
	max-width: var(--ncta-w, 1200px);
	margin: 0 auto;
	padding: var(--ncta-pad, 12px) 52px var(--ncta-pad, 12px) 16px;
}
.native-cta--banner.native-cta--align-left .native-cta__inner { justify-content: flex-start; }
.native-cta--banner.native-cta--align-right .native-cta__inner { justify-content: flex-end; }
.native-cta--banner .native-cta__text { min-width: 0; flex: 0 1 auto; }
.native-cta--banner .native-cta__heading { font-weight: 700; font-size: 1.05em; }
.native-cta--banner .native-cta__desc { font-size: 0.92em; opacity: 0.9; }
.native-cta--banner .native-cta__actions { display: flex; flex-wrap: wrap; gap: var(--ncta-gap, 10px); }
.native-cta--banner .native-cta__button { min-height: 40px; box-shadow: none; }
.native-cta--banner button.native-cta__close {
	top: 50%;
	right: 12px;
	left: auto;
	transform: translateY(-50%);
	border-color: transparent;
	background: rgba(255, 255, 255, 0.16);
	color: inherit;
	box-shadow: none;
}
.native-cta__image { display: block; width: 44px; height: 44px; object-fit: cover; border-radius: 6px; flex: none; }
@media (max-width: 600px) {
	.native-cta--banner .native-cta__inner { padding-left: 12px; padding-right: 48px; justify-content: flex-start; }
	.native-cta--banner .native-cta__text { flex-basis: 100%; }
}

/* ---------- Mobile action bar ---------- */
.native-cta--mobile-bar {
	width: 100%;
	padding: var(--ncta-pad, 8px);
	padding-bottom: calc(var(--ncta-pad, 8px) + env(safe-area-inset-bottom, 0px));
	background: var(--ncta-bg, #fff);
	color: var(--ncta-fg, #0f172a);
	border-top: var(--ncta-bw, 0) solid var(--ncta-border, transparent);
	box-shadow: 0 -4px 18px rgba(15, 23, 42, 0.12);
}
.native-cta--mobile-bar.native-cta--shadow-none { box-shadow: none; }
.native-cta--mobile-bar .native-cta__bar { display: flex; gap: var(--ncta-gap, 8px); }
.native-cta--mobile-bar .native-cta__button {
	flex: 1 1 0;
	min-width: 0;
	min-height: var(--ncta-h, 52px);
	box-shadow: none;
}
.native-cta--mobile-bar .native-cta__label { overflow: hidden; text-overflow: ellipsis; }
.native-cta--mobile-bar button.native-cta__close { top: -14px; right: 10px; left: auto; }

/* ---------- Inline (shortcode / block) ---------- */
.native-cta--inline { display: block; margin: 1em 0; }
.native-cta--inline.native-cta--align-center { text-align: center; }
.native-cta--inline.native-cta--align-right { text-align: right; }
.native-cta--inline .native-cta__stack { flex-direction: row; flex-wrap: wrap; align-items: center; }
.native-cta--inline.native-cta--align-center .native-cta__stack { justify-content: center; }
.native-cta--inline.native-cta--sidebar .native-cta__tab {
	writing-mode: horizontal-tb;
	-webkit-writing-mode: horizontal-tb;
	transform: none;
	border-radius: var(--ncta-radius, 8px);
	border-width: var(--ncta-bw, 0);
}
.native-cta--inline.native-cta--sidebar .native-cta__tab .native-cta__icon { transform: none; }
.native-cta--inline .native-cta__panel { position: static; transform: none; margin-top: 8px; text-align: left; }
.native-cta--inline.native-cta--banner { border-radius: var(--ncta-radius, 0); overflow: hidden; }
.native-cta--inline.native-cta--mobile-bar { border-radius: var(--ncta-radius, 0); }
.native-cta--inline .native-cta__close { display: none !important; }
.native-cta-admin-notice { padding: 8px 12px; border-left: 4px solid #d63638; background: #fcf0f1; font-size: 14px; }

/* ---------- Entrance animations (only when the script runs) ---------- */
@keyframes native-cta-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes native-cta-slide { from { opacity: 0; transform: var(--ncta-slide-from, translateY(16px)); } to { opacity: 1; transform: none; } }
.native-cta-js .native-cta--anim-fade { animation: native-cta-fade 0.35s ease-out both; }
.native-cta-js .native-cta--anim-slide { animation: native-cta-slide 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.native-cta-js .native-cta--inline { animation: none; }

@media (prefers-reduced-motion: reduce) {
	.native-cta,
	.native-cta * {
		animation: none !important;
		transition: none !important;
	}
}

@media print {
	.native-cta-slot { display: none !important; }
}
