/**
 * Site header: top bar, main bar (logo, mega menu, phone, quote button) and the tablet/phone menu.
 */

.site-header { position: sticky; top: 0; z-index: 99; }
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }

/* ---------- Top bar ---------- */
.topbar { background-color: #303030; padding: 0 20px; }
.topbar__inner { display: flex; align-items: center; padding: 10px 0; }
.topbar__half { width: 50%; display: flex; flex-direction: column; gap: 16px; }
.topbar__list { display: flex; flex-wrap: wrap; margin: 0 -8px; padding: 0; list-style: none; font-family: var(--pc-font-body); font-size: 14px; line-height: 1.5; }
.topbar__list--end { justify-content: flex-end; text-align: end; }
.topbar__item { display: flex; align-items: center; position: relative; margin: 0 8px; }
.topbar__list--end .topbar__item { justify-content: flex-end; }
.topbar__item a { display: flex; align-items: center; color: inherit; }
.topbar__icon { display: flex; position: relative; top: 0; }
.topbar__icon svg { display: block; width: 18px; height: 18px; margin-right: 4.5px; }
.topbar__text { display: block; color: #fff; }
.topbar__icon + .topbar__text { padding-left: 5px; }
.topbar__list--end .topbar__text { color: #ccc; }
.topbar__item a:hover .topbar__text { color: #fff; }

/* ---------- Main bar ---------- */
.mainbar { position: relative; background-color: #000; padding: 0 20px; }
.mainbar__inner { display: flex; justify-content: space-between; align-items: stretch; gap: 30px; padding: 10px 0; transition: all .3s ease; }
.mainbar__logo { display: flex; flex-direction: column; justify-content: center; }
.site-logo { display: inline-block; }
.site-logo img { display: inline-block; width: 180px; max-width: 100%; height: auto; transition: all .3s ease; }
.mainbar__logo .site-logo { line-height: 1.5; }
.site-logo__text { color: #fff; font-family: var(--pc-font-head); font-size: 28px; line-height: 1; text-transform: uppercase; }

/* Main menu (desktop) */
.mainnav { width: 43%; display: flex; flex-direction: column; justify-content: center; border-style: solid; border-color: #1e1e1e; border-width: 0 1px; }
.mainnav__list { display: flex; flex-wrap: wrap; align-items: center; justify-content: left; height: 100%; margin: 0; padding: 0; list-style: none; font-family: var(--pc-font-system); font-size: 16px; line-height: 1.5; }
.mainnav__item { position: static; flex-grow: 1; height: 100%; transition: all .25s ease-out; }
.mainnav__item + .mainnav__item { border-left: 1px solid #1e1e1e; box-shadow: inset 1px 0 0 0 rgba(255, 255, 255, .1); }
.mainnav__link {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 6px;
	height: 100%;
	min-height: 40px;
	padding: 13px 20px;
	color: #fff;
	font-weight: bold;
	text-align: left;
	text-decoration: none;
	transition: background-color .25s ease-out, padding .3s ease;
}
.mainnav__arrow { position: absolute; bottom: 5px; display: flex; align-items: center; }
.mainnav__arrow::after { content: "\f347"; font-family: "pcf-dashicons"; font-weight: normal; align-content: center; transition: transform .3s ease; }
.mainnav__item:hover > .mainnav__link,
.mainnav__item.is-open > .mainnav__link,
.mainnav__item.is-current > .mainnav__link,
.mainnav__link:focus-visible { background-color: #1a1a1a; color: #fff; }

/* Mega panels: open when the pointer is over the item (click / Enter on touch and keyboard), instantly, like the reference site.
   The panel is as tall as its content, capped to the window with its own scroll. */
.mega {
	position: absolute;
	left: 0;
	right: 0;
	top: calc(100% - 10px);
	z-index: 999;
	max-height: calc(100vh - 140px);
	overflow-y: auto;
	scrollbar-width: none;
	background-color: transparent;
	font-size: 14px;
	line-height: 1.7;
	color: #666;
	display: none;
}
.mainnav__item--mega.is-open > .mega { display: block; }
.mainnav__item.is-open .mainnav__arrow::after { transform: rotate(180deg); }
.mega__panel { display: flex; padding: 0 16px; overflow: auto; background-color: #1a1a1a; }
.mega__inner { display: flex; flex-direction: column; gap: 16px; width: 100%; max-width: var(--pc-max); margin: 0 auto; padding: 30px 0; }
.mega__group { display: flex; flex-direction: column; gap: 16px; }
.mega__title { margin: 0; padding: 0; font-family: var(--pc-font-body); font-size: 22px; font-weight: 400; line-height: 1.3em; color: #fff; }
.mega__divider { width: 100%; height: 0; margin: 0; border: 0; border-top: 1px solid #303030; }
.mega__empty { padding: 30px 0; }
.mega__posts { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 1fr; gap: 30px 20px; }
/* Popular cards: photo with a dark top fade, title and a small arrow over it. */
.mega-card__link { position: relative; z-index: 1; display: flex; flex-direction: column; width: 100%; max-width: 100%; height: 100%; padding: 0; color: inherit; word-break: break-word; }
.mega-card__media { position: relative; text-align: center; }
.mega-card__media::after { content: ""; position: absolute; top: 0; right: 0; left: 0; width: 100%; height: 100%; border-radius: 6px; background-image: linear-gradient(#000, rgba(0, 0, 0, .73) 0%, rgba(0, 0, 0, 0) 34%); }
/* Card hover (as on the reference): a darker fade comes in over 200ms and the arrow slides right 15px. */
.mega-card__media::before { content: ""; position: absolute; top: 0; right: 0; left: 0; z-index: 1; width: 100%; height: 100%; border-radius: 6px; background-image: linear-gradient(#000, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, 0) 75%); opacity: 0; transition: opacity .2s ease-out; pointer-events: none; }
.mega-card__link:hover .mega-card__media::before { opacity: 1; transition-timing-function: ease-in; }
.mega-card__img { display: inline-block; width: 100%; max-width: 100%; height: 192px; border: none; border-radius: 6px; box-shadow: none; vertical-align: middle; object-fit: cover; object-position: center center; }
.mega-card__bar { position: absolute; z-index: 2; top: 0; right: 0; display: flex; flex-direction: row; justify-content: space-between; gap: 10px; width: 100%; padding: 20px 30px 0; }
.mega-card__head, .mega-card__icon { position: relative; flex: 0 1 auto; min-width: 0; max-width: 100%; }
.mega-card__title { margin: 0; padding: 0; font-family: var(--pc-font-body); font-size: 1rem; font-weight: 700; line-height: 24px; color: #fff; }
.mega-card__icon { transition: transform .2s ease-in-out; }
.mega-card__link:hover .mega-card__icon { transform: translate3d(15px, 0, 0); transition-timing-function: ease-out; }
.mega-card__icon-wrap { text-align: center; }
.mega-card__icon-box { display: inline-block; font-size: 13px; line-height: 1; text-align: center; }
.mega-card__icon-box svg { position: relative; display: block; width: 1em; height: 1em; }
.mega__links { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; grid-template-rows: auto auto; grid-auto-columns: 1fr; gap: 16px; margin: 0; padding: 0; list-style: none; }
.mega__links li { position: static; z-index: 2; display: flex; flex-direction: row; align-items: center; margin: 0 0 0 20px; padding: 15px 0; background: url(../../icons/chevron-gold.svg) no-repeat 95% 50%; transition: all .13s; }
.mega__links li:hover { background-position: 97% 50%; }
.mega__links a { display: flex; flex: 1 1 auto; align-items: center; font-family: var(--pc-font-body); font-size: 16px; font-weight: 700; line-height: 20px; white-space: nowrap; color: #fff; }

/* Phone and availability */
.mainbar__end { display: flex; align-items: center; gap: 40px; }
.mainbar__contact { display: flex; flex-direction: column; align-items: center; padding: 10px; }
.hbox { display: flex; align-items: center; gap: 10px; }
.hbox--status { gap: 11px; }
.hbox__icon { display: inline-block; line-height: 1; text-align: center; }
.hbox__icon svg { display: block; position: relative; width: 25px; height: 25px; fill: #f46f22; }
.hbox--status .hbox__icon svg { width: 8px; height: 8px; fill: #6ec1e4; }
.hbox__body { flex: 1 1 auto; }
.hbox__title { margin: 8px 0 10px; font-family: var(--pc-font-body); font-size: 18px; font-weight: 600; line-height: 1.2; color: #fff; }
.hbox__title a { color: #fff; }
.hbox--status .hbox__title { margin: 8px 0 7px; font-size: 14px; line-height: normal; }

/* Quote button (the original tilts slightly towards the pointer) */
.mainbar__quote { display: flex; flex-direction: column; width: max-content; }
.btn--quote { background: linear-gradient(76deg, #f9a825 0%, #e04327 100%); }
.js-tilt { transform: perspective(1px); transform-style: preserve-3d; }

/* Menu toggle (tablet and phone) */
.mainbar__toggle { display: none; position: static; width: max-content; }
.menu-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto;
	padding: 12px;
	border: 2px solid #a1a1a1;
	border-radius: 8px;
	background-color: rgba(0, 0, 0, .05);
	font-size: 24px;
	line-height: 36px;
	color: #fff;
	cursor: pointer;
}
.menu-toggle__icon { display: block; width: 21px; height: 24px; font-family: "pcf-solid"; font-weight: 900; font-style: normal; line-height: 24px; }
.menu-toggle__icon::before { content: "\f0c9"; }
.menu-toggle[aria-expanded="true"] { background-color: #303030; border-color: #303030; }

/* Tablet / phone menu panel: drops 10px below the button, full window width. */
.mobile-nav { position: absolute; top: calc(50% + 36px); left: 0; right: 0; z-index: 9997; height: 100vh; overflow-x: hidden; overflow-y: auto; background-color: #333438; }
.mobile-nav[hidden] { display: none; }
.mobile-nav__list, .mobile-nav__list .sub-menu { list-style: none; margin: 0; padding: 0; }
.mobile-nav__list li { position: relative; }
.mobile-nav__list a { display: flex; align-items: center; padding: 20px; font-family: var(--pc-font-body); font-size: 1rem; font-weight: 700; line-height: 20px; color: #fff; }
.mobile-nav__list .sub-menu { display: none; background-color: #4d4f53; }
.mobile-nav__list .sub-menu a { border-left: 8px solid transparent; }
.mobile-nav__list .is-open > .sub-menu { display: block; }
.mobile-nav__arrow { position: absolute; top: 10.4px; right: 20px; display: flex; align-items: center; padding: 12px; border: 2px solid #fff; border-radius: 8px; background: none; font-size: 16px; line-height: 16px; color: #fff; cursor: pointer; }
.mobile-nav__arrow::before { content: "\f078"; display: block; font-family: "pcf-solid"; font-size: 11.2px; font-weight: 900; font-style: normal; line-height: 11.2px; }
.mobile-nav__list .is-open > .mobile-nav__arrow { transform: rotate(180deg); background-color: #4d4f53; border-color: #4d4f53; }

@media (min-width: 1025px) {
	.mobile-nav { display: none; }
	/* Sticky header: after the first scroll the main bar shrinks (smaller logo, tighter links), as on the reference site. */
	.mainbar.is-shrunk .mainbar__inner { padding-top: 0; padding-bottom: 0; }
	.mainbar.is-shrunk .site-logo img { width: 155px; }
	.mainbar.is-shrunk .mainnav__link { padding-top: 0; padding-bottom: 0; }
	.mainbar.is-shrunk .mega { top: 100%; max-height: calc(100vh - 133px); }
}
/* Desktop widths: the menu takes the room that is left, nothing wraps, and spacing eases with the window */
@media (min-width: 1025px) {
	.mainbar__inner { gap: clamp(12px, 2vw, 30px); }
	.mainnav { flex: 1 1 auto; width: auto; min-width: 0; }
	.mainnav__list { flex-wrap: nowrap; }
	.mainnav__link { padding-left: clamp(10px, 1.5vw, 20px); padding-right: clamp(10px, 1.5vw, 20px); white-space: nowrap; }
	.mainbar__end { flex: 0 0 auto; gap: clamp(14px, 2.6vw, 40px); }
	.mainbar__contact { padding-left: 0; padding-right: 0; }
	.hbox__title, .btn--quote .btn__text { white-space: nowrap; }
}
@media (min-width: 1025px) and (max-width: 1279px) {
	.site-logo img, .mainbar.is-shrunk .site-logo img { width: 140px; }
	.hbox--status { display: none; }
	.mainnav__link { min-height: 74px; padding-bottom: 28px; }
	.hbox__title { font-size: 16px; }
	.btn--quote { padding-left: 18px; padding-right: 18px; font-size: 16px; }
}
@media (max-width: 1024px) {
	.mainnav { display: none; }
	.mainbar__toggle { display: flex; flex-direction: column; }
	.mainbar__end { gap: 0; }
	.mainbar__contact { margin-right: 40px; }
	.mainbar__quote { margin-right: 20px; }
}

@media (max-width: 767px) {
	.topbar { display: none; }
	.mainbar { padding: 0 15px; }
	.mainbar__inner { padding: 20px 0; }
	.hbox--status, .mainbar__quote { display: none; }
	.mainbar__contact { margin-right: 10px; padding: 0; }
	.hbox--phone .hbox__body { display: none; }
	.hbox--phone .hbox__icon { display: block; padding: 11.5px; border: 2px solid #a1a1a1; border-radius: 8px; line-height: 0; }
	.mainbar__toggle { width: 51.2px; }
}
