/*
 * Visual & interactive bug fixes across desktop and mobile.
 * Loaded site-wide after style.css via assets/css/ (included in deploy payload).
 */

/* 0. Keyboard skip link */
.dw-skip-link {
	position: absolute;
	left: -9999px;
	top: 12px;
	z-index: 100000;
	padding: 12px 18px;
	border-radius: 6px;
	background: #007d89;
	color: #fff !important;
	font: 700 14px/1.2 "Manrope", Arial, sans-serif;
	text-decoration: none;
	box-shadow: 0 8px 20px rgba(7, 23, 34, 0.35);
}

.dw-skip-link:focus,
.dw-skip-link:focus-visible {
	left: 16px;
	outline: 3px solid #76e2dd;
	outline-offset: 2px;
}

/* 1. Mobile hero framing, slide switcher clearance, and floating widget overlap fixes */
@media (max-width: 767px) {
	html body.home .dw-home-hero .dw-home-hero__media picture[data-kind="tinkerdale"] img {
		object-position: center bottom;
	}

	body.home .dw-hero-demo-nav {
		left: 14px !important;
		right: 78px;
		bottom: 14px !important;
		max-width: none !important;
		gap: 4px !important;
		padding: 0 8px !important;
		overflow-x: auto;
		scrollbar-width: none;
	}

	body.home .dw-hero-demo-nav::-webkit-scrollbar {
		display: none;
	}

	body.home .dw-hero-demo-nav button {
		min-width: 0 !important;
		padding: 0 6px !important;
		font-size: 11px !important;
		white-space: nowrap;
	}

	body.home .dw-hero-demo-nav .dw-hero-demo-nav__toggle {
		width: 34px !important;
		flex: 0 0 34px;
	}

	/* Keep redundant scroll-to-top button from colliding with assistant launcher & CTAs on phones */
	#wpfront-scroll-top-container {
		display: none !important;
	}

	.dw-site-assistant {
		right: 14px !important;
		bottom: 14px !important;
	}

	#footer-bottom {
		padding-bottom: 84px !important;
	}
}

/* 2. Homepage Services device switcher: clean crossfade without stacked text overlap */
.dw-device-slide {
	visibility: hidden;
	z-index: 0;
	transition: opacity 260ms ease, visibility 260ms ease !important;
}

.dw-device-slide.is-active {
	opacity: 1;
	visibility: visible;
	z-index: 1;
}

/* 3. Prevent blank-white initial flash on /about/ and /contact/ */
body.page-id-606 .dw-reveal,
body.page-id-22 .dw-reveal,
body.page-id-606 .elementor-invisible,
body.page-id-22 .elementor-invisible,
body.page-id-606 .elementor-element.animated,
body.page-id-22 .elementor-element.animated {
	opacity: 1 !important;
	visibility: visible !important;
	transform: none !important;
	translate: none !important;
	filter: none !important;
	animation: none !important;
	transition: none !important;
}

/* 4. Clean single-caret <select> controls on /contact/ and /portfolio/ */
.page-id-22 .dw-contact-action div.wpforms-container-full .wpforms-form select,
.dw-work-gallery-controls select {
	display: block !important;
	box-sizing: border-box !important;
	white-space: nowrap !important;
	overflow: hidden !important;
	text-overflow: ellipsis !important;
	appearance: none !important;
	-webkit-appearance: none !important;
	-moz-appearance: none !important;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9' fill='none'%3E%3Cpath d='M1.5 1.5L7 7L12.5 1.5' stroke='%230f5d6a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
	background-repeat: no-repeat !important;
	background-position: right 16px center !important;
	background-size: 13px 8px !important;
	padding-right: 44px !important;
	line-height: 1.35 !important;
}

.page-id-22 .dw-contact-action div.wpforms-container-full .wpforms-form .dw-contact-makeover-priority select {
	background-image: none !important;
	padding-right: 16px !important;
}

.page-id-22 .dw-contact-action .select-wrapper .caret,
.dw-work-gallery-controls .select-wrapper .caret,
.page-id-22 .dw-contact-action div.wpforms-container-full .wpforms-form select::picker-icon,
.dw-work-gallery-controls select::picker-icon {
	display: none !important;
}

/* 5. Contact page visible intro banner & sidebar cleanup */
.dw-contact-intro-banner {
	width: min(92%, 1180px);
	margin: 112px auto 0;
	padding: 20px 0 8px;
}

.dw-contact-intro-banner h1 {
	margin: 0 0 10px;
	color: #0b2230;
	font-family: "Newsreader", Georgia, serif;
	font-size: clamp(34px, 4vw, 52px);
	font-weight: 500;
	line-height: 1.1;
	letter-spacing: 0;
	text-wrap: balance;
}

.dw-contact-intro-banner p {
	max-width: 60ch;
	margin: 0;
	color: #405963;
	font-family: "Manrope", Arial, sans-serif;
	font-size: 16px;
	line-height: 1.65;
}

@media (min-width: 768px) {
	body.page-id-22 .dw-contact-action {
		margin-top: 20px !important;
	}
}

@media (max-width: 767px) {
	.dw-contact-intro-banner {
		margin-top: 84px;
		padding: 12px 0 4px;
	}
}

/* Remove decorative map-pin graphic that overlapped Hours & Phone in Contact sidebar */
.page-id-22 .dw-contact-action .elementor-column:not(:has(div.wpforms-container-full)):not(:has(.elementor-widget-google_maps)) > .elementor-widget-wrap::after,
.page-id-22 .dw-contact-action .elementor-top-column:not(:has(div.wpforms-container-full)):not(:has(.elementor-widget-google_maps)) > .elementor-widget-wrap::after {
	display: none !important;
}

/* 6. Portfolio card CLS stability + bottom conversion CTA */
.dw-work-tile {
	aspect-ratio: 16 / 10;
}

.dw-work-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: top center;
}

.dw-work-cta {
	width: calc(100% - clamp(12px, 2vw, 28px));
	max-width: 1432px;
	margin: 48px auto 64px;
	padding: clamp(32px, 5vw, 56px) clamp(24px, 4vw, 52px);
	border-radius: 10px;
	background: #0b2230;
	color: #fff;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 24px 36px;
	box-sizing: border-box;
}

.dw-work-cta__copy {
	max-width: 560px;
}

.dw-work-cta__copy h2 {
	margin: 0 0 10px;
	color: #fff;
	font-family: "Newsreader", Georgia, serif;
	font-size: clamp(30px, 3.6vw, 44px);
	font-weight: 500;
	line-height: 1.12;
	letter-spacing: 0;
}

.dw-work-cta__copy p {
	margin: 0;
	color: #d0e2e6;
	font-family: "Manrope", Arial, sans-serif;
	font-size: 16px;
	line-height: 1.65;
}

.dw-work-cta__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px 20px;
}

.dw-work-cta__primary {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	min-height: 52px;
	padding: 12px 24px;
	border-radius: 8px;
	background: #008d98;
	color: #fff !important;
	font: 700 15px/1.2 "Manrope", Arial, sans-serif;
	text-decoration: none !important;
	transition: background-color 160ms ease;
}

.dw-work-cta__primary:hover,
.dw-work-cta__primary:focus-visible {
	background: #00a7b3;
	outline: 2px solid #76e2dd;
	outline-offset: 3px;
}

.dw-work-cta__phone {
	color: #9cebe6 !important;
	font: 700 15px/1.2 "Manrope", Arial, sans-serif;
	text-decoration: underline;
	text-underline-offset: 4px;
}

.dw-work-cta__phone:hover,
.dw-work-cta__phone:focus-visible {
	color: #fff !important;
}
