/*
 * Pest ID site-wide front-end styles that sit outside Oxygen's element tree.
 * Source of truth: claude-projects/Pest ID/mu-plugin/pestid/pestid-site.css. Deploy with
 * `node tools/deploy-muplugin.js`.
 *
 * Header menu: the [piv_menu] shortcode in the header template (15) prints a WordPress menu
 * (Appearance > Menus). Desktop dropdowns open on hover and keyboard focus; below 1023px the menu
 * sits inside the existing burger panel (.piv-nav) and each dropdown opens from its chevron.
 * Link sizes and colours match the old hand-coded .piv-nav-link.
 */

.piv-nav > .oxy-shortcode,
.piv-menu-wrap {
	display: flex;
}

.piv-menu {
	display: flex;
	align-items: center;
	gap: 2px;
	margin: 0;
	padding: 0;
	list-style: none;
	font-family: "Poppins", sans-serif;
}

.piv-menu li {
	position: relative;
	margin: 0;
	padding: 0;
	list-style: none;
}

.piv-menu > li {
	display: flex;
	align-items: center;
}

.piv-menu a {
	display: block;
	padding: 10px 12px;
	border-radius: 8px;
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.4;
	color: #181818;
	text-decoration: none;
}

.piv-menu a:hover,
.piv-menu a:focus-visible {
	background: #f3f7fa;
	color: #181818;
}

.piv-menu .current-menu-item > a,
.piv-menu .current-menu-ancestor > a,
.piv-menu .current-menu-parent > a {
	color: #c4203b;
}

.piv-menu > li.menu-item-has-children > a {
	padding-right: 2px;
}

.piv-sub-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 38px;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: #181818;
	cursor: pointer;
}

.piv-sub-toggle::before {
	content: "";
	width: 6px;
	height: 6px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: translateY(-2px) rotate(45deg);
	transition: transform 0.2s ease;
}

.piv-menu li.is-open > .piv-sub-toggle::before {
	transform: translateY(2px) rotate(-135deg);
}

.piv-menu .sub-menu {
	display: none;
	margin: 0;
	padding: 8px;
	list-style: none;
	background: #fff;
}

.piv-menu .sub-menu a {
	padding: 8px 12px;
	font-size: 14px;
	white-space: nowrap;
}

/* Third level (Squirrel Proofing Solar Panels under Squirrel Removal): always shown, indented. */
.piv-menu .sub-menu .sub-menu {
	display: block;
	padding: 0 0 0 14px;
	background: none;
}

.piv-menu .sub-menu .sub-menu a {
	font-size: 13px;
}

/* Desktop dropdowns */
@media (min-width: 1024px) {
	.piv-menu > li > .sub-menu {
		position: absolute;
		top: 100%;
		left: 0;
		z-index: 30;
		min-width: 240px;
		border: 1px solid #e6ecf2;
		border-radius: 12px;
		box-shadow: 0 16px 40px rgba(24, 24, 24, 0.12);
	}

	.piv-menu > li:nth-last-child(-n+2) > .sub-menu {
		left: auto;
		right: 0;
	}

	.piv-menu > li:hover > .sub-menu,
	.piv-menu > li:focus-within > .sub-menu,
	.piv-menu > li.is-open > .sub-menu {
		display: block;
	}

	.piv-menu > li.piv-sub-wide:hover > .sub-menu,
	.piv-menu > li.piv-sub-wide:focus-within > .sub-menu,
	.piv-menu > li.piv-sub-wide.is-open > .sub-menu {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		column-gap: 4px;
		width: max-content;
	}

	.piv-menu > li.piv-sub-3col:hover > .sub-menu,
	.piv-menu > li.piv-sub-3col:focus-within > .sub-menu,
	.piv-menu > li.piv-sub-3col.is-open > .sub-menu {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	/* Keep the hover open across the gap between the link and the panel. */
	.piv-menu > li.menu-item-has-children::after {
		content: "";
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		height: 8px;
	}
}

@media (min-width: 1024px) and (max-width: 1119px) {
	.piv-menu a {
		padding-left: 8px;
		padding-right: 8px;
	}
}

/* Burger panel (tablet and phone) */
@media (max-width: 1023px) {
	/* The burger's three bars rendered 0px wide (laid out in a row), so the button was invisible. */
	.piv-nav-toggle {
		flex-direction: column;
		justify-content: center;
		align-items: stretch;
	}

	.piv-nav-toggle > span {
		width: 100%;
	}

	.piv-nav.is-nav-open {
		max-height: calc(100vh - 120px) !important;
		overflow-y: auto !important;
	}

	/* Closed, max-height: 0 can't hide the panel's 12px padding and 1px borders, which showed as a
	   26px white strip under the header on every page. Remove them until the panel opens. */
	.piv-nav:not(.is-nav-open) {
		padding-top: 0;
		padding-bottom: 0;
		border-top-width: 0;
		border-bottom-width: 0;
	}

	.piv-nav > .oxy-shortcode,
	.piv-menu-wrap,
	.piv-menu {
		width: 100%;
	}

	.piv-menu {
		flex-direction: column;
		align-items: stretch;
		gap: 0;
	}

	.piv-menu > li {
		flex-wrap: wrap;
	}

	.piv-menu > li > a {
		flex: 1 1 auto;
		padding: 12px;
	}

	.piv-sub-toggle {
		width: 44px;
		height: 44px;
	}

	.piv-menu > li > .sub-menu {
		flex: 0 0 100%;
		padding: 0 0 8px 12px;
		border-left: 2px solid #e6ecf2;
		margin-left: 12px;
	}

	.piv-menu > li.is-open > .sub-menu {
		display: block;
	}

	.piv-menu .sub-menu a {
		white-space: normal;
	}
}

/*
 * Top bar and header on phones: .piv-container drops its side padding under 768px because page
 * sections supply it, but these two bands sit outside a .piv-section, so they ran edge to edge.
 */
@media (max-width: 767px) {
	.piv-topbar > .piv-container,
	.piv-header > .piv-container,
	.piv-hero > .piv-container {
		padding-left: 20px;
		padding-right: 20px;
	}
}

/*
 * Blog: a post with no featured image gets Oxygen's grey placeholder SVG. Hide it, so the card
 * shows its logo panel (.piv-post-card-media background) and the post page skips the image.
 */
.piv-post-card-img[src^="data:image/svg"],
.piv-post-feature[src^="data:image/svg"] {
	display: none;
}

/*
 * Blog post body. Pages build their spacing from Gutenberg groups; posts are a flat run of
 * paragraphs, headings, lists, images and the live separators, so give that run a rhythm here.
 */
.piv-post-wrap .piv-content > * + * {
	margin-top: 18px;
}

.piv-post-wrap .piv-content > :is(h2, h3) {
	margin-top: 40px;
}

.piv-post-wrap .piv-content > h4 {
	margin-top: 28px;
}

.piv-post-wrap .piv-content > :is(h2, h3, h4) + * {
	margin-top: 12px;
}

/* pestid-blocks.css insets loose page blocks by 32px; in the post column everything is loose. */
.piv-post-wrap .piv-content > :not(.wp-block-group):not(.alignfull) {
	max-width: none;
	padding-left: 0;
	padding-right: 0;
}

.piv-post-wrap .piv-content > :is(ul, ol):not(.wp-block-group):not(.alignfull) {
	padding-left: 22px;
}

.piv-post-wrap .piv-content > :is(ul, ol) > li + li {
	margin-top: 6px;
}

.piv-post-wrap .piv-content > hr,
.piv-post-wrap .piv-content > .wp-block-separator {
	margin-top: 40px;
	margin-bottom: 0;
	border: 0;
	border-top: 1px solid #e6ecf2;
}

.piv-post-wrap .piv-content > :is(hr, .wp-block-separator) + * {
	margin-top: 40px;
}

.piv-post-wrap .piv-content img {
	max-width: 100%;
	height: auto;
	border-radius: 12px;
}

/* Blog archive pagination, as pill buttons like the rest of the site. */
.bde-posts-pagination {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px;
	font-family: "Poppins", sans-serif;
}

.bde-posts-pagination ul {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.bde-posts-pagination :is(ul a, ul span, .bde-posts-prev-next-link a) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	height: 44px;
	padding: 0 16px;
	border: 1px solid #e6ecf2;
	border-radius: 999px;
	background: #fff;
	font-size: 14px;
	font-weight: 600;
	color: #181818;
	text-decoration: none;
}

.bde-posts-pagination :is(ul a, .bde-posts-prev-next-link a):hover {
	border-color: #c4203b;
	color: #c4203b;
}

.bde-posts-pagination ul li a.is-active {
	border-color: #c4203b !important;
	background: #c4203b !important;
	color: #fff !important;
}

.bde-posts-pagination ul span {
	border-color: transparent;
}

.bde-posts-pagination .bde-posts-prev-next-link:empty {
	display: none;
}

/*
 * Google reviews stars: Figma sets them in PingFang SC (macOS and iOS only). Oxygen keeps just the
 * first family it is given, so the fallback stack lives here (13 Oct 2026). Five stars measure
 * 166px in PingFang as in Figma; Windows' symbol fonts draw a narrower star (145px), accepted.
 */
.piv-reviews2-header .piv-stars-yellow,
.piv-avatar-card .piv-stars-yellow {
	font-family: "PingFang SC", "Segoe UI Symbol", "Apple Symbols", sans-serif;
}

/*
 * Homepage hero (18 Oct 2026): from 1120px the photo is inset to 17.47% as in Home V4, but the
 * overlay gradient spans the whole hero, so at the photo's left edge it was only ~90% opaque and
 * the edge showed as a hard seam (worse on wide screens). Fade the photo itself into the #181818
 * hero ground instead, as Kelly's frame does.
 */
@media (min-width: 1120px) {
	.piv-hero-media {
		-webkit-mask-image: linear-gradient(90deg, transparent 0, #000 28%);
		mask-image: linear-gradient(90deg, transparent 0, #000 28%);
	}
}

/*
 * Sticky header (18 Oct 2026): it was 94% white, so over the dark hero it turned light grey and the
 * logo PNG's opaque white ground showed as a white block. Solid white, as in Kelly's frames.
 * (mix-blend-mode on the logo can't fix it: the sticky header is its own stacking context.)
 */
header.piv-header {
	background-color: #fff;
}

/*
 * Footer labels (26 Oct 2026): "Contact Information" and "Business Hours" went from h4 to p so the
 * footer adds no headings (Braedon). Keep the heading line height they had.
 */
.piv-footer-heading {
	line-height: 1.2;
}

/* TrustATrader widget ([piv_trustatrader]) under the homepage review cards. */
.piv-tat-widget {
	width: 100%;
	margin-top: 40px;
}

/*
 * Phone emoji in page copy (18 Oct 2026): the mu-plugin swaps the 📞 character for this inline
 * icon, because WordPress' Twemoji image is a dark receiver that vanished on the dark CTA bands.
 * It takes the colour of the text around it.
 */
.piv-inline-phone {
	display: inline-block;
	width: 1em;
	height: 1em;
	margin-right: .15em;
	vertical-align: -0.125em;
	fill: currentColor;
}

/*
 * Link hover colour (19 Oct 2026, Kelly): Oxygen's global a:hover rule uses
 * --bde-links-color-hover, which was never set, so every text link turned Oxygen blue (#2563eb)
 * on hover. Brand cyan instead. html:root and html .bde-global-css-vars outrank the
 * :root, .bde-global-css-vars declaration in global-settings.css. Buttons and the menu keep their
 * own hover rules, which are more specific.
 */
html:root,
html .bde-global-css-vars {
	--bde-links-color-hover: #3dbed9;
}
