/**
 * Site chrome: base, header, navigation, footer, archive. Content blocks are in blocks.css.
 */

/* ---------------------------------------------------------------------------
 * Base
 * ------------------------------------------------------------------------ */

*,
*::before,
*::after {
	box-sizing: border-box;
}

body {
	margin: 0;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

img,
svg,
video,
iframe {
	max-width: 100%;
}

.container {
	width: 100%;
	max-width: calc(var(--wp--style--global--content-size) + 40px);
	margin-inline: auto;
	padding-inline: 20px;
}

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

.skip-link:focus {
	position: fixed !important;
	top: 8px;
	left: 8px;
	z-index: 1000;
	width: auto;
	height: auto;
	padding: 12px 18px;
	margin: 0;
	clip: auto;
	background: #fff;
	color: var(--wp--preset--color--primary);
	font-weight: 700;
}

.icon {
	flex: none;
	width: 1em;
	height: 1em;
}

/* ---------------------------------------------------------------------------
 * Header
 * ------------------------------------------------------------------------ */

.site-header {
	position: relative;
	z-index: 50;
}

.site-header__top {
	display: flex;
	align-items: center;
	gap: 24px;
	min-height: 90px;
	background: linear-gradient(#fff, #e9ecf1);
	max-width: none;
	padding-inline: max(20px, calc((100% - var(--wp--style--global--content-size)) / 2));
	border-bottom: 3px solid var(--wp--preset--color--gold);
}

.site-branding {
	flex: none;
	margin-inline: 60px auto;
}

.custom-logo-link {
	display: block;
}

.custom-logo {
	display: block;
	width: 210px;
	height: auto;
}

.site-title {
	font-family: var(--wp--preset--font-family--heading);
	font-size: 24px;
	font-weight: 700;
	color: var(--wp--preset--color--primary);
	text-decoration: none;
}

.header-contacts {
	display: flex;
	gap: 36px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.header-contacts__item,
.header-contacts__item > a {
	display: flex;
	align-items: center;
	gap: 12px;
	color: inherit;
	text-decoration: none;
}

.header-contacts .icon {
	width: 40px;
	height: 40px;
	color: var(--wp--preset--color--sky);
}

.header-contacts__item--address .icon {
	width: 36px;
	height: 36px;
}

.header-contacts strong,
.header-contacts small {
	display: block;
}

.header-contacts strong {
	color: var(--wp--preset--color--primary-dark);
	font-size: 17px;
	font-weight: 600;
	line-height: 1.3;
}

.header-contacts small {
	color: #7a7a7a;
	font-size: 13px;
	line-height: 1.6;
}

.header-contacts a:hover strong,
.header-contacts a:focus-visible strong {
	color: var(--wp--preset--color--accent);
}

.nav-toggle {
	display: none;
}

/* ---------------------------------------------------------------------------
 * Primary navigation
 * ------------------------------------------------------------------------ */

.site-nav {
	background: var(--wp--preset--color--primary);
}

.site-nav .menu,
.site-nav .sub-menu {
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-nav .menu {
	display: flex;
	align-items: center;
	min-height: 80px;
}

.site-nav .menu > li {
	position: relative;
	display: flex;
	align-items: center;
}

.site-nav .menu > li > a,
.site-nav .menu-parent {
	display: flex;
	align-items: center;
	gap: 6px;
	min-height: 56px;
	padding: 0 45px;
	border: 0;
	background: none;
	color: #fff;
	font: 800 17px/1 var(--wp--preset--font-family--body);
	text-transform: uppercase;
	text-decoration: none;
	cursor: pointer;
}

.site-nav .menu > li > a:hover,
.site-nav .menu-parent:hover,
.site-nav .menu > li > a:focus-visible,
.site-nav .menu-parent:focus-visible,
.site-nav .menu > .current-menu-item > a,
.site-nav .menu > .current-menu-ancestor > a,
.site-nav .menu > .current-menu-ancestor > .menu-parent {
	background: var(--wp--preset--color--gold);
	outline: none;
}

.site-nav .menu-chevron {
	width: 14px;
	height: 14px;
	stroke-width: 3;
	transition: transform 0.15s ease;
}

.site-nav .is-open > .menu-parent .menu-chevron {
	transform: rotate(180deg);
}

.site-nav .submenu-toggle {
	display: flex;
	align-items: center;
	margin-left: -40px;
	padding: 8px;
	border: 0;
	background: none;
	color: #fff;
	cursor: pointer;
}

.site-nav .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 10;
	display: none;
	min-width: 260px;
	padding: 8px 0;
	background: var(--wp--preset--color--primary-dark);
	box-shadow: 0 12px 24px rgb(0 0 0 / 0.2);
}

/* Long submenus (areas) flow into columns. */
.site-nav .sub-menu:has(> li:nth-child(9)) {
	display: none;
	min-width: 680px;
	grid-template-columns: repeat(3, 1fr);
}

.site-nav li:is(.is-open, :hover, :focus-within) > .sub-menu {
	display: block;
}

.site-nav li:is(.is-open, :hover, :focus-within) > .sub-menu:has(> li:nth-child(9)) {
	display: grid;
}

.site-nav .sub-menu a {
	display: block;
	padding: 9px 20px;
	color: #fff;
	font-size: 15px;
	line-height: 1.3;
	text-decoration: none;
	text-transform: capitalize;
	white-space: nowrap;
}

.site-nav .sub-menu a:hover,
.site-nav .sub-menu a:focus-visible,
.site-nav .sub-menu .current-menu-item > a {
	background: var(--wp--preset--color--primary);
	color: #fff;
}

/* ---------------------------------------------------------------------------
 * Main
 * ------------------------------------------------------------------------ */

.site-main {
	display: block;
}

.entry-content {
	padding-bottom: var(--wp--preset--spacing--50);
}

.entry-header {
	padding-top: var(--wp--preset--spacing--50);
	padding-bottom: var(--wp--preset--spacing--30);
}

.entry-title {
	margin: 0;
	font-size: var(--wp--preset--font-size--xx-large);
}

.entry-meta {
	margin: 8px 0 0;
	color: var(--wp--preset--color--slate);
	font-size: 13px;
}

.entry-thumbnail {
	margin-block: 0 var(--wp--preset--spacing--40);
}

.entry-thumbnail img {
	display: block;
	width: 100%;
	height: auto;
}

/* ---------------------------------------------------------------------------
 * Archive
 * ------------------------------------------------------------------------ */

.archive {
	padding-bottom: var(--wp--preset--spacing--60);
}

/* 404 */
.not-found {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 60vh;
	padding-block: var(--wp--preset--spacing--60);
	text-align: center;
}

.not-found__code {
	margin: 0;
	color: var(--msd-primary);
	font-family: var(--wp--preset--font-family--heading);
	font-size: clamp(110px, 22vw, 220px);
	font-weight: 700;
	line-height: 1;
	letter-spacing: -0.02em;
}

.not-found__code::after {
	content: "";
	display: block;
	width: 80px;
	height: 5px;
	margin: 18px auto 0;
	background: var(--msd-accent);
}

.not-found__title {
	margin: 28px 0 10px;
	font-size: clamp(28px, 4vw, 40px);
}

.not-found__text {
	max-width: 460px;
	margin: 0 0 32px;
	color: var(--wp--preset--color--slate);
}

/* Blog: two cards per row, one on phones. */
.post-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 40px 32px;
}

.card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid #e3e6ee;
	background: #fff;
	box-shadow: 0 10px 30px rgb(1 44 109 / 0.08);
}

.card__media {
	display: block;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: var(--wp--preset--color--light);
}

.card__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.card:hover .card__media img {
	transform: scale(1.04);
}

/* No card image: brand-colored block with the truck icon. */
.card__placeholder {
	position: relative;
	display: block;
	height: 100%;
	background: var(--wp--preset--color--primary);
}

.card__placeholder::after {
	content: "";
	position: absolute;
	inset: 0;
	background: rgb(255 255 255 / 0.85);
	-webkit-mask: var(--msd-icon-truck) center / 72px no-repeat;
	mask: var(--msd-icon-truck) center / 72px no-repeat;
}

.card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	padding: 24px 28px 28px;
}

.card__meta {
	margin: 0 0 8px;
	color: var(--wp--preset--color--slate);
	font-size: 13px;
}

.card__title {
	margin: 0;
	font-size: 24px;
	line-height: 1.25;
}

.card__title a {
	color: inherit;
	text-decoration: none;
}

.card__title a:hover,
.card__title a:focus-visible {
	color: var(--wp--preset--color--primary);
}

.card__excerpt {
	margin: 12px 0 20px;
}

.card__more {
	margin-top: auto;
	color: var(--wp--preset--color--primary);
	font-weight: 800;
	text-decoration: none;
	text-transform: uppercase;
	font-size: 14px;
}

.card__more::after {
	content: " ›";
}

.card__more:hover,
.card__more:focus-visible {
	color: var(--wp--preset--color--accent);
}

@media (max-width: 782px) {
	.post-grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 28px;
	}
}

.pagination .nav-links {
	display: flex;
	gap: 8px;
	margin-top: 40px;
}

.pagination .page-numbers {
	padding: 6px 12px;
	background: var(--wp--preset--color--light);
	color: inherit;
	text-decoration: none;
}

.pagination .current {
	background: var(--wp--preset--color--primary);
	color: #fff;
}

/* ---------------------------------------------------------------------------
 * Footer
 * ------------------------------------------------------------------------ */

.site-footer {
	background: var(--wp--preset--color--slate);
	color: #fff;
	font-size: 14px;
}

.site-footer__grid {
	display: grid;
	grid-template-columns: 1.3fr 1fr 1fr 1fr 1.4fr;
	gap: 32px;
	padding-block: 60px 40px;
}

.site-footer .custom-logo {
	width: 170px;
}

.footer-contacts {
	display: grid;
	gap: 14px;
	margin: 36px 0 0;
	padding: 0;
	list-style: none;
}

.footer-contacts li {
	display: flex;
	gap: 14px;
	align-items: flex-start;
}

.footer-contacts .icon {
	width: 16px;
	height: 16px;
	margin-top: 4px;
}

.site-footer a {
	color: rgb(255 255 255 / 0.85);
	text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
	color: #fff;
	text-decoration: underline;
}

.site-footer__title {
	margin: 0 0 16px;
	color: #fff;
	font-family: var(--wp--preset--font-family--body);
	font-size: 16px;
	font-weight: 600;
	text-transform: uppercase;
}

.site-footer__menu {
	display: grid;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
	font-weight: 300;
}

.site-footer__cta p {
	margin: 0 0 16px;
	color: rgb(255 255 255 / 0.85);
	line-height: 1.6;
}

.site-footer .wp-element-button,
.site-footer .wp-element-button:hover {
	color: #fff;
	text-decoration: none;
}

.site-footer__bottom {
	padding-block: 18px;
	border-top: 1px solid rgb(255 255 255 / 0.12);
	font-size: 13px;
}

.site-footer__bottom p {
	margin: 0;
	color: rgb(255 255 255 / 0.7);
}

/* ---------------------------------------------------------------------------
 * Responsive
 * ------------------------------------------------------------------------ */

@media (max-width: 1200px) {
	.site-branding {
		margin-left: 0;
	}

	.header-contacts {
		gap: 24px;
	}

	.site-nav .menu > li > a,
	.site-nav .menu-parent {
		padding-inline: 28px;
	}

	.site-footer__grid {
		grid-template-columns: repeat(3, 1fr);
	}

	.site-footer__brand {
		grid-row: span 2;
	}
}

@media (max-width: 960px) {
	.header-contacts__item--address,
	.header-contacts__item--email {
		display: none;
	}
}

@media (max-width: 782px) {
	/* Mobile header: phone | centered logo | menu button. */
	.site-header__top {
		display: grid;
		grid-template-columns: 1fr auto 1fr;
		min-height: 72px;
		gap: 12px;
	}

	.site-branding {
		grid-column: 2;
		grid-row: 1;
	}

	.custom-logo {
		width: 150px;
	}

	/* The phone moves from the header to the floating call button. */
	.header-contacts {
		display: none;
	}

	.nav-toggle {
		grid-column: 3;
		grid-row: 1;
		justify-self: end;
	}

	.header-contacts .icon {
		width: 28px;
		height: 28px;
	}

	.header-contacts small {
		display: none;
	}

	.header-contacts strong {
		font-size: 15px;
	}

	.nav-toggle {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 44px;
		height: 44px;
		padding: 0;
		border: 2px solid var(--wp--preset--color--primary);
		border-radius: 50%;
		background: #fff;
		color: var(--wp--preset--color--primary);
		cursor: pointer;
	}

	.nav-toggle .icon {
		width: 22px;
		height: 22px;
	}

	.nav-toggle:hover,
	.nav-toggle:focus-visible,
	.nav-is-open .nav-toggle {
		background: var(--wp--preset--color--primary);
		color: #fff;
	}

	.nav-toggle__close,
	.nav-is-open .nav-toggle__open {
		display: none;
	}

	.nav-is-open .nav-toggle__close {
		display: block;
	}

	.site-nav {
		display: none;
	}

	.nav-is-open .site-nav {
		display: block;
	}

	.site-nav .container {
		padding: 0;
	}

	.site-nav .menu {
		flex-direction: column;
		align-items: stretch;
		min-height: 0;
		padding-block: 8px;
	}

	.site-nav .menu > li {
		flex-wrap: wrap;
	}

	.site-nav .menu > li > a,
	.site-nav .menu-parent {
		flex: 1;
		justify-content: space-between;
		min-height: 48px;
		padding-inline: 20px;
	}

	.site-nav .submenu-toggle {
		margin-left: 0;
		padding: 12px 20px;
	}

	.site-nav .sub-menu,
	.site-nav .sub-menu:has(> li:nth-child(9)) {
		position: static;
		flex-basis: 100%;
		min-width: 0;
		box-shadow: none;
		grid-template-columns: 1fr 1fr;
	}

	/* On touch screens open submenus only by tap, not by focus/hover. */
	.site-nav li:is(:hover, :focus-within):not(.is-open) > .sub-menu,
	.site-nav li:is(:hover, :focus-within):not(.is-open) > .sub-menu:has(> li:nth-child(9)) {
		display: none;
	}

	.site-footer__grid {
		grid-template-columns: 1fr 1fr;
	}

	.site-footer__brand,
	.site-footer__cta {
		grid-column: 1 / -1;
		grid-row: auto;
	}
}

@media (max-width: 480px) {
	.header-contacts strong {
		display: none;
	}

	.header-contacts .icon {
		width: 26px;
		height: 26px;
	}
}

/* ---------------------------------------------------------------------------
 * Floating call button (phones and tablets): always visible in the bottom right corner
 * ------------------------------------------------------------------------ */

.call-fab {
	display: none;
}

@media (max-width: 782px) {
	.call-fab {
		position: fixed;
		right: 16px;
		bottom: calc(16px + env(safe-area-inset-bottom, 0px));
		z-index: 90;
		display: flex;
		align-items: center;
		justify-content: center;
		width: 58px;
		height: 58px;
		border-radius: 50%;
		background: var(--wp--preset--color--accent);
		color: #fff;
		box-shadow: 0 6px 18px rgb(0 0 0 / 0.28);
		animation: call-fab-ring 4s ease-in-out 2s infinite;
	}

	.call-fab .icon {
		width: 26px;
		height: 26px;
	}

	.call-fab:focus-visible {
		outline: 3px solid var(--wp--preset--color--sky);
		outline-offset: 3px;
	}

	/* Keep the copyright line clear of the button. */
	.site-footer__bottom {
		padding-bottom: 84px;
	}
}

/* A short "ring" every few seconds to draw attention. */
@keyframes call-fab-ring {
	0%, 82%, 100% { transform: rotate(0); }
	85% { transform: rotate(-14deg); }
	88% { transform: rotate(12deg); }
	91% { transform: rotate(-10deg); }
	94% { transform: rotate(6deg); }
}

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

/* ---------------------------------------------------------------------------
 * Breadcrumbs (services section)
 * ------------------------------------------------------------------------ */

.breadcrumbs {
	background: var(--wp--preset--color--light);
	font-size: 13px;
	line-height: 1.4;
}

.breadcrumbs__list {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 0;
	margin: 0 auto;
	padding-block: 10px;
	list-style: none;
}

.breadcrumbs__item + .breadcrumbs__item::before {
	content: "›";
	margin-inline: 8px;
	color: var(--wp--preset--color--slate);
}

.breadcrumbs a {
	color: var(--wp--preset--color--primary);
	text-decoration: none;
}

.breadcrumbs a:hover,
.breadcrumbs a:focus-visible {
	text-decoration: underline;
}

.breadcrumbs [aria-current="page"] {
	color: #4a5160;
}

/* Trail under the hero photo: glued to the photo, content keeps its usual gap below. */
.entry-content > .breadcrumbs {
	margin-block: 0;
}

.entry-content > .breadcrumbs + * {
	margin-top: var(--wp--preset--spacing--50);
}
