/* ==========================================================
   Nirvana Dezigns – Light / Dark mode
   Colours for light mode are generated by nd-theme-mode.js.
   This file holds the toggle button and a few fixed overrides.
   ========================================================== */

/* ---------- Toggle button: just the icon, sits in the header ---------- */
/* Hard reset: the theme styles every <button> (padding, background, shapes),
   which is what stretched the old round button into an oval on phones. */
button.nd-theme-toggle,
button.nd-theme-toggle:hover,
button.nd-theme-toggle:focus,
button.nd-theme-toggle:active {
	all: unset;
	box-sizing: border-box;
	position: relative;
	display: inline-grid;
	place-items: center;
	flex: 0 0 auto;
	width: 40px !important;
	height: 40px !important;
	min-width: 0 !important;
	min-height: 0 !important;
	padding: 0 !important;
	line-height: 1 !important;
	border-radius: 50% !important;
	aspect-ratio: 1 / 1;
	cursor: pointer;
	color: #fff;
	background: none !important;
	border: 0 !important;
	box-shadow: none !important;
	-webkit-tap-highlight-color: transparent;
}
button.nd-theme-toggle::before,
button.nd-theme-toggle::after { display: none !important; content: none !important; }
html.nd-light button.nd-theme-toggle { color: #111317; }

button.nd-theme-toggle:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; border-radius: 50%; }

.nd-theme-toggle svg {
	grid-area: 1 / 1;
	width: 24px;
	height: 24px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	transition: transform 0.5s cubic-bezier(.34,1.56,.64,1), opacity 0.3s;
}
.nd-theme-toggle .nd-icon-sun circle,
.nd-theme-toggle .nd-icon-moon { fill: currentColor; stroke: none; }
.nd-theme-toggle .nd-icon-moon { width: 21px; height: 21px; }

/* Dark mode shows the sun (= "switch to light"); light mode shows the moon */
.nd-theme-toggle .nd-icon-moon { opacity: 0; transform: rotate(-90deg) scale(0.4); }
html.nd-light .nd-theme-toggle .nd-icon-sun { opacity: 0; transform: rotate(90deg) scale(0.4); }
html.nd-light .nd-theme-toggle .nd-icon-moon { opacity: 1; transform: none; }

@media (hover: hover) {
	.nd-theme-toggle:hover .nd-icon-sun { transform: rotate(45deg); }
	html.nd-light .nd-theme-toggle:hover .nd-icon-moon { transform: rotate(-15deg); }
}

/* Desktop: sits left of "Book A Call Now" */
.nd-toggle-host {
	display: flex !important;
	align-items: center;
	justify-content: flex-end;
	gap: 14px;
}
/* Phone: sits left of the menu icon */
button.nd-theme-toggle.nd-toggle-mobile { margin-right: 10px; width: 36px !important; height: 36px !important; }
.nd-toggle-mobile svg { width: 23px; height: 23px; }

/* Fallback (pages without the normal header) */
button.nd-theme-toggle.nd-toggle-floating {
	position: fixed; right: 30px; bottom: 106px; z-index: 9999;
	border-radius: 50%; background: rgba(22, 23, 27, 0.72) !important;
}
html.nd-light button.nd-theme-toggle.nd-toggle-floating { background: rgba(255, 255, 255, 0.85) !important; }

/* ---------- White logos -> black in light mode ---------- */
html.nd-light .tecko-logo-widget img,
html.nd-light .pxl-logo img,
html.nd-light .logo img,
html.nd-light .client-item img {
	filter: invert(1);
}

/* Service cards: clean white cards in light mode */
html.nd-light .pxl-fancy-box-widget-bg-layer-1 {
	background-color: #fff !important;
	box-shadow: 0 1px 2px rgba(17, 19, 23, 0.04), 0 10px 30px rgba(17, 19, 23, 0.06);
}
html.nd-light .pxl-fancy-box-widget-bg-layer-2 { opacity: 0.35; }
/* Round arrow buttons (cards, carousels) */
html.nd-light .box-icon-link,
html.nd-light .swiper-nav-button {
	background-image: none !important;
	background-color: rgba(17, 19, 23, 0.06) !important;
}

/* ---------- Switching animation ---------- */
/* Fallback for browsers without View Transitions: fade colours */
html.nd-switching,
html.nd-switching *:not(.nd-theme-toggle):not(.nd-theme-toggle *) {
	transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease, fill 0.4s ease !important;
}
/* View Transitions: circular reveal from the button (animated in JS) */
::view-transition-old(root),
::view-transition-new(root) {
	animation: none;
	mix-blend-mode: normal;
}

/* Hide the page for a moment while light colours are prepared (light-mode visitors only) */
html.nd-pending body { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
	.nd-theme-toggle, .nd-theme-toggle svg { transition: none; }
}
