/*
 * Motion and polish — additions only, loaded last.
 *
 * Nothing here changes a colour, a font or a layout grid. It gives the site one
 * way of moving (two speeds, one curve), a header that follows the reader, a
 * visible headline on the homepage hero, and a handful of fixes to how text
 * sets and how phones stack. Every hidden state is added by
 * assets/js/pvs-reveal.js, never written into the markup, so with that script
 * blocked or under prefers-reduced-motion the page is simply all there.
 */

:root {
	--pvs-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
	--pvs-fast: 0.2s;
	--pvs-slow: 0.6s;
}

/* ------------------------------------------------ page-to-page cross-fade */

@media (prefers-reduced-motion: no-preference) {
	@view-transition {
		navigation: auto;
	}

	::view-transition-old(root),
	::view-transition-new(root) {
		animation-duration: 0.22s;
		animation-timing-function: var(--pvs-ease);
	}
}

/* ------------------------------------------------------ reveal on scroll */

.pvs-reveal {
	opacity: 0;
	transform: translateY(22px);
	transition: opacity var(--pvs-slow) var(--pvs-ease), transform var(--pvs-slow) var(--pvs-ease);
	transition-delay: calc(var(--pvs-i, 0) * 80ms);
}

.pvs-reveal.pvs-inview {
	opacity: 1;
	transform: none;
}

/*
 * "Our Network" slides its two maps in from the sides. On a phone they are
 * stacked, and a block waiting 32px off to the right made the page wider than
 * the screen until it arrived: there they rise like everything else.
 */
@media (max-width: 767.98px) {
	.section-4-left.pvs-reveal:not(.pvs-inview),
	.section-4-right.pvs-reveal:not(.pvs-inview) {
		transform: translateY(22px);
	}
}

@media print {
	.pvs-reveal {
		opacity: 1 !important;
		transform: none !important;
	}
}

/* --------------------------------------------------------- sticky header */

/*
 * The header is position:absolute on every page, so nothing reflows when it
 * becomes fixed. On the homepage the script also adds .dark-header while it is
 * stuck, which is the site's own dark-on-light treatment for the menu.
 */
.header.pvs-header-stuck {
	position: fixed;
	top: 0;
	left: 0;
	background: #fff;
	border-bottom-color: transparent;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
	padding-top: 10px;
	padding-bottom: 10px;
	animation: pvs-header-in 0.32s var(--pvs-ease) both;
}

@keyframes pvs-header-in {
	from {
		transform: translateY(-100%);
	}
	to {
		transform: none;
	}
}

.header .header-logo--stuck,
.header.pvs-header-stuck .header-logo--top {
	display: none;
}

.header.pvs-header-stuck .header-logo--stuck {
	display: inline;
}

/* The homepage's dropdown arrows are white artwork; darken them on the white bar. */
.header.pvs-header-flip .header-menu ul li a img {
	filter: brightness(0);
	opacity: 0.72;
}

/* ----------------------------------------------------------- hover states */

@media (hover: hover) and (pointer: fine) {
	/* A moving strip is hard to read and harder to click: hold it under the cursor. */
	.slider:hover .slide-track,
	.slider:hover .slide-track2 {
		animation-play-state: paused;
	}
}

:where(a, button, [tabindex]):focus-visible {
	outline: 2px solid #05c;
	outline-offset: 3px;
}

/* ------------------------------------------------------------------ type */

/* Justified text on a narrow column opens rivers of white between words. */
.section-2-row-1-col-1 p,
.section-2-row-1-col-1 ul {
	text-align: left;
}

/* Article text ran 895px wide — about 130 characters a line. */
.single-post .section-2-col-1 > :where(p, ul, ol, h2, h3, h4, blockquote) {
	max-width: 46rem;
}

/* ---------------------------------------------------------------- phones */

/*
 * A service page opened with its photo and spec table and reached the title a
 * screen later. The row is already a wrapping flex container below 992px, so
 * the summary column only needs to go first.
 */
@media (max-width: 991.98px) {
	.pvs-product-main > [class*='col-']:last-child {
		order: -1;
	}

	.pvs-product-main > [class*='col-']:first-child {
		margin-top: 28px;
	}

	/*
	 * The form inside the enquiry box picked up the popup form's own padding
	 * and top margin at this width, on top of the box's: 79px of empty space
	 * above the first field and fields inset 44px on a 390px screen.
	 */
	.pvs-enquiry-box .pvs-enquiry-form {
		margin-top: 0;
		padding: 0;
	}
}

/* ---------------------------------------------------------- less motion */

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/* ===================================================== responsive (1.1.5)
   Fixes for faults seen on real screen sizes, 320px to 3440px. Loaded last. */

/* Awards & Recognition header: two fixed 50% columns left the intro text a
   half-width ribbon on phones. Stack it below tablet landscape. */
@media (max-width: 991.98px) {
	body.pvs .section-2-title-row,
	body.pvs .section-8-title-row {
		flex-wrap: wrap;
	}

	body.pvs .section-2-title-row-left,
	body.pvs .section-2-title-row-right,
	body.pvs .section-8-title-row-left,
	body.pvs .section-8-title-row-right {
		width: 100%;
	}

	body.pvs .section-2-title-row-right,
	body.pvs .section-8-title-row-right {
		justify-content: flex-start;
		margin-bottom: 8px;
	}

	body.pvs .section-2-title-row-left p,
	body.pvs .section-8-title-row-left p {
		max-width: 640px;
		margin: 0 0 18px 0;
		font-size: 16px;
	}
}

/* Small laptops and landscape tablets: the dropdown arrow sat so far from its
   own menu item that it read as belonging to the next one. */
@media (min-width: 993px) and (max-width: 1365px) {
	.header .header-menu ul li a img {
		width: 11px;
		margin-left: 4px;
	}
}

/* Sideways phones: the home slide was far taller than the screen, so its
   headline sat below the fold. */
@media (max-width: 1023.98px) and (orientation: landscape) and (max-height: 600px) {
	body.pvs .section-1-mobile-slider-item img {
		width: 100%;
		height: 100vh;
		height: 100svh;
		object-fit: cover;
		object-position: center 30%;
	}

	body.pvs .section-1-mobile-slider-item-text {
		padding: 0 10% 84px 10%;
		background: linear-gradient(0deg, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0) 70%);
	}

	body.pvs .section-1-mobile-slider-item-text p {
		width: 80%;
		margin-bottom: 0;
		font-size: 14px;
	}
}

/* Floating buttons and the chat bubble covered the open mobile menu. */
body:has(#mobilemenu.active) .pvs-whatsapp-btn,
body:has(#mobilemenu.active) .pvs-enquiry-now-btn,
body:has(#mobilemenu.active) #chat-bot-launcher-container {
	visibility: hidden !important;
}

/* Enquiry list on narrow phones: the Action column ran off the edge. */
@media (max-width: 480px) {
	body.pvs .pvs-tablewrap thead th {
		padding: 12px 6px;
		font-size: 11px;
		letter-spacing: 0;
	}

	body.pvs .pvs-tablewrap tbody td {
		padding: 14px 6px;
	}

	body.pvs .pvs-tablewrap .pvs-row-number,
	body.pvs .pvs-tablewrap .pvs-product-slug,
	body.pvs .pvs-tablewrap .pvs-qty-label {
		display: none;
	}

	body.pvs .pvs-tablewrap .product-remove {
		width: 40px;
	}
}

/* Touch screens: finger-sized list actions, and 16px fields so iPhones do not
   zoom the page when a field is tapped. */
@media (pointer: coarse) {
	body.pvs .pvs-add-another,
	body.pvs .pvs-clear-list {
		min-height: 40px;
	}

	body.pvs .pvs-tablewrap .product-remove .remove {
		min-width: 40px;
		min-height: 40px;
		align-items: center;
		justify-content: center;
	}

	body.pvs input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="file"]),
	body.pvs select,
	body.pvs textarea {
		font-size: 16px !important;
	}
}

/* Long article titles on the smallest phones. */
@media (max-width: 375px) {
	body.pvs .blog-card .title,
	body.pvs h2.title {
		overflow-wrap: anywhere;
	}
}
