:root {
	--rds-black: #000000;
	--rds-white: #ffffff;
	--rds-beige: #998579;
	--rds-dark-grey: #424242;
	--rds-light-grey: #f5f5f5;
	--rds-mid-grey: #dedede;
	/* page container (Figma frames are 1400 with 48px gutters). Client
	   2026-10-14: most visitors are on 1920 and the side margins were too
	   wide at 1600 → 1824 = 96px margins at 1920 (48 + the 48 gutter). */
	--rds-wrap: 1824px;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	font-family: var(--font-body);
	color: var(--rds-black);
	overflow-x: hidden; /* full-bleed sections (.hero-small) use 100vw, which can overshoot by the scrollbar width */
}

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

/* browsers give form controls their own font (Arial etc.) instead of
   inheriting it; every button / field uses the site font unless a rule
   sets another */
button,
input,
select,
textarea {
	font-family: inherit;
}

img {
	display: block;
	max-width: 100%;
}

/* -- header bar -- */

.site-header__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	/* the bar's background/border stay full-bleed, the logo and the right
	   block line up with the page container on wide screens */
	padding: 12px max(48px, calc((100% - var(--rds-wrap)) / 2 + 48px));
	background: var(--rds-white);
}

.site-header__bar {
	border-bottom: 1px solid var(--rds-black);
}

.site-header__left {
	display: flex;
	align-items: center;
	gap: 96px;
}

.site-header__logo img {
	display: block;
}

/* -- nav + megamenu -- */

.site-nav {
	display: flex;
	align-items: flex-start;
	gap: 48px;
}

.site-nav__item {
	position: relative;
}

.site-nav__link {
	display: inline-block;
	font-size: 16px;
	line-height: 22px;
	letter-spacing: 0.32px;
	white-space: nowrap;
}

.megamenu {
	/* Figma 1.3-home-megamenu: left edge in line with the top-level link
	   (x 245 vs 246), 13px below it; 24px padding, 197px columns 18px
	   either side of a 1px divider. */
	position: absolute;
	top: calc(100% + 13px);
	left: -1px;
	display: flex;
	align-items: stretch;
	gap: 18px;
	padding: 24px;
	background: var(--rds-white);
	border-radius: 20px;
	box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.1);
	opacity: 0;
	visibility: hidden;
	transform: translateY(4px);
	transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
	z-index: 100;
}

/* invisible bridge over the 13px gap, so the dropdown stays open while the
   pointer travels from the link down into it */
.megamenu::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 100%;
	height: 13px;
}

.site-nav__item.has-megamenu:hover > .megamenu,
.site-nav__item.has-megamenu.is-open > .megamenu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.megamenu__column {
	width: 197px;
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.megamenu__divider {
	flex-shrink: 0;
	width: 1px;
	background: #c3b6ae;
}

.megamenu__link {
	display: flex;
	align-items: center;
	gap: 12px;
	white-space: nowrap;
}

.megamenu__link a {
	font-size: 16px;
	line-height: 22px;
	letter-spacing: 0.32px;
}

.megamenu__icon {
	flex-shrink: 0;
}

/* columns row + footer row (Projects only, inc/menu.php: View all +
   quick links) stacked */
.megamenu {
	flex-direction: column;
}

.megamenu__columns {
	display: flex;
	align-items: stretch;
	gap: 18px;
}

.megamenu__footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	margin-top: 6px;
	padding-top: 18px;
	border-top: 1px solid #c3b6ae;
}

.megamenu__all,
.megamenu__quick a {
	font-size: 14px;
	line-height: 20px;
	white-space: nowrap;
	transition: color 0.2s ease;
}

.megamenu__all {
	color: var(--rds-beige);
}

.megamenu__quick {
	display: flex;
	gap: 24px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.megamenu__all:hover,
.megamenu__quick a:hover,
.megamenu__all:focus-visible,
.megamenu__quick a:focus-visible {
	color: #777777;
}

/* -- right side: search / sign up / log in -- */

.site-header__right {
	display: flex;
	align-items: center;
	gap: 24px;
}

.site-header__search {
	appearance: none;
	background: none;
	border: 0;
	padding: 0;
	cursor: pointer;
	line-height: 0;
}

.site-header__cta {
	display: inline-flex;
	align-items: center;
	background: var(--rds-black);
	color: var(--rds-white);
	border-radius: 8px;
	padding: 12px 18px;
	font-size: 14px;
	line-height: 20px;
	text-align: center;
	white-space: nowrap;
}

.site-header__cta-icon {
	flex-shrink: 0;
	margin-right: 8px; /* Figma button/outline gap */
}

.site-header__login {
	font-size: 16px;
	line-height: 22px;
	letter-spacing: 0.32px;
	white-space: nowrap;
	transition: color 0.2s ease;
}

/* hover: same grey (#777777) as the menu and card titles */
.site-header__cta {
	transition: background-color 0.2s ease;
}

.site-header__cta:hover,
.site-header__cta:focus-visible {
	background: #777777;
}

.site-header__login:hover,
.site-header__login:focus-visible {
	color: #777777;
}

/* -- fixed header (client 2026-10-20): one header, always on top, like the
      old RDB site — same logo, it just gets smaller once the visitor has
      scrolled down a bit (header.js toggles body.is-shrunk). The body
      keeps the full header height as padding, so shrinking never moves the
      page content. -- */

/* Logged in with the admin bar: sit below it (32px; 46px under 783px; under
   601px WordPress lets the bar scroll away, so the header goes back to 0). */
body.admin-bar {
	--rds-admin-bar: 32px;
}

@media screen and (max-width: 782px) {
	body.admin-bar {
		--rds-admin-bar: 46px;
	}
}

@media screen and (max-width: 600px) {
	body.admin-bar {
		--rds-admin-bar: 0px;
	}
}

:root {
	--rds-header-h: 96px;       /* 12 + 71 logo + 12 + 1 border */
	--rds-header-h-small: 60px; /* 8 + 43 + 8 + 1 */
}

html {
	/* anchors / scrollIntoView land under the (small) header, not behind it */
	scroll-padding-top: calc(var(--rds-header-h-small) + var(--rds-admin-bar, 0px) + 12px);
}

body {
	padding-top: var(--rds-header-h);
}

.site-header {
	position: fixed;
	top: var(--rds-admin-bar, 0px);
	left: 0;
	right: 0;
	z-index: 1000;
	transition: transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* scrolling down: slides up out of view (shadow too, and past the admin
   bar); scrolling up: slides back down from the top (header.js) */
body.is-header-hidden .site-header {
	transform: translateY(calc(-100% - var(--rds-admin-bar, 0px) - 16px));
}

.site-header__bar,
.site-header__logo img {
	transition: padding 0.3s ease, width 0.3s ease, height 0.3s ease, box-shadow 0.3s ease;
}

.site-header__logo img {
	width: 102px;
	height: 71px;
}

body.is-shrunk .site-header__bar {
	padding-top: 8px;
	padding-bottom: 8px;
	box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.08);
}

body.is-shrunk .site-header__logo img {
	width: 62px;
	height: 43px;
}

@media (prefers-reduced-motion: reduce) {
	.site-header,
	.site-header__bar,
	.site-header__logo img {
		transition: none;
	}
}

/* -- hover + active (current page / its section): same grey as the card
      titles on list pages (#777777). A top-level link stays grey while its
      dropdown is being used. -- */

.site-nav__link,
.megamenu__link a {
	transition: color 0.2s ease;
}

.site-nav__item:hover > .site-nav__link,
.site-nav__item.is-open > .site-nav__link,
.site-nav__link.is-active,
.megamenu__link a.is-active,
.site-nav__link:focus-visible,
.megamenu__link a:hover,
.megamenu__link a:focus-visible {
	color: #777777;
}

/* -- logged-in "Account" button: Figma button/outline (white, black border) -- */

.site-header__cta--account {
	border: 1px solid var(--rds-black);
	background: var(--rds-white);
	color: var(--rds-black);
}

.site-header__cta--account:hover,
.site-header__cta--account:focus-visible {
	background: var(--rds-light-grey);
}

.site-header__cta--account[aria-current="page"] {
	background: var(--rds-light-grey);
}

/* -- mobile (Figma menu_M, 420×72): under 1100px the nav, search and CTAs
      move into the burger panel; bar padding 12/24, logo 69×48. -- */

.site-header__burger,
.mobile-menu__close {
	display: none;
	appearance: none;
	background: none;
	border: 0;
	padding: 0;
	cursor: pointer;
	line-height: 0;
}

@media (max-width: 1100px) {
	.site-header__bar {
		padding: 12px 24px;
	}

	.site-header .site-nav,
	.site-header__right > :not(.site-header__burger) {
		display: none;
	}

	.site-header__burger {
		display: block;
	}

	/* mobile browsers can widen the layout viewport past the screen when
	   something overflows sideways; left/right 0 would then push the
	   burger off-screen in the fixed header. vw is the screen width. */
	.site-header {
		right: auto;
		width: 100vw;
	}

	:root {
		--rds-header-h: 73px;       /* 12 + 48 + 12 + 1 */
		--rds-header-h-small: 57px; /* 8 + 40 + 8 + 1 */
	}

	.site-header__logo img {
		width: 69px;
		height: 48px;
	}

	/* the burger keeps its size, so the bar can't get much lower */
	body.is-shrunk .site-header__logo img {
		width: 58px;
		height: 40px;
	}
}

/* -- mobile menu panel: full screen, slides in from the right like the
      filters drawer; closes through rdsCloseDialog() (modals.js). -- */

.mobile-menu {
	position: fixed;
	inset: 0;
	width: 100vw; /* see .site-header above */
	max-width: none;
	height: 100%;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: var(--rds-white);
	color: var(--rds-black);
	overflow-y: auto;
	overscroll-behavior: contain;
}

.mobile-menu[open] {
	animation: rds-menu-in 0.25s ease-out;
}

.mobile-menu.is-closing {
	animation: rds-menu-out 0.25s ease-in forwards;
}

@keyframes rds-menu-in {
	from { transform: translateX(100%); }
	to { transform: translateX(0); }
}

@keyframes rds-menu-out {
	from { transform: translateX(0); }
	to { transform: translateX(100%); }
}

@media (prefers-reduced-motion: reduce) {
	.mobile-menu[open],
	.mobile-menu.is-closing {
		animation: none;
	}
}

.mobile-menu__panel {
	display: flex;
	flex-direction: column;
	min-height: 100%;
}

.mobile-menu__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 24px;
	border-bottom: 1px solid var(--rds-black);
}

.mobile-menu__close {
	display: block;
}

.mobile-menu__body {
	padding: 12px 24px 24px;
}

.mobile-menu .site-nav {
	flex-direction: column;
	align-items: stretch;
	gap: 0;
}

.mobile-menu .site-nav__item {
	border-bottom: 1px solid var(--rds-mid-grey);
}

.mobile-menu .site-nav__link {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 0;
	font-size: 20px;
	line-height: 28px;
}

/* accordion chevron on the item with a submenu: first tap opens, second
   follows the link (header.js, same as touch on desktop) */
.mobile-menu .has-megamenu > .site-nav__link::after {
	content: "";
	width: 24px;
	height: 24px;
	background: url("../img/icon-chevron-down.svg") center / contain no-repeat;
	transition: transform 0.2s ease;
}

.mobile-menu .has-megamenu.is-open > .site-nav__link::after {
	transform: rotate(180deg);
}

.mobile-menu .megamenu {
	position: static;
	display: none;
	flex-direction: column;
	gap: 18px;
	padding: 0 0 24px;
	border-radius: 0;
	box-shadow: none;
	opacity: 1;
	visibility: visible;
	transform: none;
	transition: none;
}

.mobile-menu .megamenu::before,
.mobile-menu .megamenu__divider {
	display: none;
}

.mobile-menu .has-megamenu.is-open > .megamenu {
	display: flex;
}

.mobile-menu .megamenu__column {
	width: auto;
}

/* accordion: the category columns and the footer stack */
.mobile-menu .megamenu__columns {
	flex-direction: column;
	gap: 18px;
}

/* megamenu footer in the accordion: stacked under the categories */
.mobile-menu .megamenu__footer {
	flex-direction: column;
	align-items: flex-start;
	gap: 18px;
	margin-top: 0;
	padding-top: 18px;
}

.mobile-menu .megamenu__quick {
	flex-direction: column;
	gap: 18px;
}

.mobile-menu .megamenu__all,
.mobile-menu .megamenu__quick a {
	font-size: 16px;
	line-height: 22px;
	letter-spacing: 0.32px;
}

.mobile-menu__search {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	padding: 18px 0;
	appearance: none;
	background: none;
	border: 0;
	border-bottom: 1px solid var(--rds-mid-grey);
	font: inherit;
	font-size: 20px;
	line-height: 28px;
	color: inherit;
	text-align: left;
	cursor: pointer;
}

.mobile-menu__actions {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 18px;
	margin-top: auto;
	padding: 24px;
	text-align: center;
}

.mobile-menu__actions .site-header__cta {
	justify-content: center;
}

body.has-mobile-menu {
	overflow: hidden;
}
