/*
 * BAK Builders — global styles.
 * Breakpoints (min-width only): 416 / 576 / 768 / 992 / 1200 / 1440.
 */

@font-face {
	font-family: "Neco-Bold";
	src: url("../fonts/Neco-Bold.woff2") format("woff2"), url("../fonts/Neco-Bold.woff") format("woff");
	font-display: swap;
}

@font-face {
	font-family: "Neco-Medium";
	src: url("../fonts/Neco-Medium.woff2") format("woff2"), url("../fonts/Neco-Medium.woff") format("woff");
	font-display: swap;
}

:root {
	--c-white: #fff;
	--c-brandwhite: #fbf7f6;
	--c-tan: #f3e8e4;
	--c-green: #4d784b;
	--c-green-dark: #395937;
	--c-green-light: #61975f;
	--c-dg-400: #2d422c;
	--c-dg-500: #233322;
	--c-dg-600: #182418;
	--c-dg-700: #0e140e;
	--c-red: #71173a;
	--f-display: "Neco-Bold", Georgia, serif;
	--f-display-medium: "Neco-Medium", Georgia, serif;
	--f-label: "sweet-sans-pro", "Helvetica Neue", Arial, sans-serif;
	--f-body: "DM Sans", "Helvetica Neue", Arial, sans-serif;
	--header-offset: 100px;
}

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

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

html {
	line-height: 1.5;
	-webkit-text-size-adjust: 100%;
	scroll-padding-top: var(--header-offset);

	@media (prefers-reduced-motion: no-preference) {
		scroll-behavior: smooth;
	}

	&.has-open-menu {
		overflow: hidden;
	}
}

body {
	margin: 0;
	background: var(--c-white);
	color: #000;
	font-family: var(--f-body);
}

h1, h2, h3, h4, h5, h6, p, ul, ol, figure, blockquote, address {
	margin: 0;
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--f-display);
	font-weight: normal;
}

h1 { font-size: 64px; line-height: 72px; }
h2 { font-size: 56px; line-height: 72px; }
h3 { font-size: 48px; line-height: 48px; }
h4 { font-size: 40px; line-height: 48px; }
h5 { font-size: 32px; line-height: 32px; }
h6 { font-size: 24px; line-height: 32px; }

p,
li {
	font-family: var(--f-body);
	font-size: 16px;
	line-height: 24px;
}

ul,
ol {
	padding: 0;
	list-style: none;
}

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

img,
svg,
video {
	display: block;
	max-width: 100%;
	height: auto;
}

address {
	font-style: normal;
}

button {
	font: inherit;
	color: inherit;
	background: none;
	cursor: pointer;
	padding: 0;
}

:focus-visible {
	outline: 2px solid var(--c-green-light);
	outline-offset: 3px;
}

.lg-p {
	font-family: var(--f-body);
	font-size: 20px;
	line-height: 27px;
}

.sm-p {
	font-family: var(--f-body);
	font-size: 12px;
	line-height: 18px;
}

.tag {
	font-family: var(--f-label);
	font-size: 18px;
	line-height: 32px;
	letter-spacing: 1.5px;
	text-transform: uppercase;
}

.tag-sm {
	font-family: var(--f-label);
	font-size: 12px;
	letter-spacing: 1.2px;
	text-transform: uppercase;
	transition: 0.25s;
}

.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 {
	position: absolute;
	top: -100px;
	left: 1rem;
	z-index: 100001;
	padding: 0.75rem 1rem;
	background: var(--c-tan);
	color: var(--c-dg-500);
	font-family: var(--f-label);
	font-weight: 700;

	&:focus {
		top: 1rem;
	}
}

/* ---------- Buttons and links ---------- */

.btn {
	display: inline-block;
	padding: 13px 24px 12px;
	font-family: var(--f-label);
	font-size: 16px;
	font-weight: 700;
	line-height: 1.5;
	text-transform: uppercase;
	border-left: 8px solid;
	border-right: 1px solid;
	transition: 0.25s;

	&:active {
		transform: scale(0.95);
		transition: 0.05s;
	}
}

.btn--dark,
.btn--light {
	background: var(--c-dg-500);
	color: var(--c-tan);
	border-left-color: var(--c-tan);
	border-right-color: var(--c-dg-500);

	&:hover {
		background: var(--c-tan);
		color: var(--c-green);
		border-left: 1px solid var(--c-tan);
		border-right: 8px solid var(--c-green);
	}
}

.btn--light {
	background: var(--c-green-light);
	border-right-color: var(--c-green-light);
}

.btn--alt,
.btn--red {
	--btn-color: var(--c-dg-500);
	background: var(--c-white);
	color: var(--btn-color);
	border: 1px solid var(--btn-color);
	border-left-width: 8px;

	&:hover {
		background: var(--btn-color);
		color: var(--c-tan);
		border-color: var(--c-white);
		border-left-width: 1px;
		border-right: 8px solid var(--c-tan);
	}
}

.btn--red {
	--btn-color: var(--c-red);
}

.icon-link {
	display: inline-flex;
	align-items: center;
	color: var(--c-tan);
	font-family: var(--f-label);
	font-size: 16px;
	font-weight: 700;
	line-height: 1.5;
	text-transform: uppercase;
	transition: 0.25s;

	.icon-link__icon {
		display: inline-flex;
		align-items: center;
		margin-right: 0.5rem;
	}

	.icon-link__arrow {
		position: relative;
		z-index: 2;
		width: 1.25rem;
		margin-top: -2.1px;
		margin-right: -1rem;
		transition: 0.25s;
	}

	.icon-link__hex {
		width: 1.5rem;
		height: 1.5rem;
		background: url("../img/text-button-icon.svg") no-repeat center / contain;
	}

	&:hover {
		.icon-link__hex {
			background-image: url("../img/text-button-filled.svg");
		}

		.icon-link__arrow {
			transform: translateX(15px);
		}
	}
}

.icon-link--sm {
	margin: 1rem 0;

	.icon-link__arrow {
		width: 0.75rem;
		margin-top: 0;
		padding-top: 0.25rem;
		margin-right: -0.5rem;
	}

	.icon-link__hex {
		width: 1.25rem;
		height: 1rem;
		background-image: url("../img/alt-arrow-hex.png");
	}

	.icon-link__text {
		font-size: 0.7rem;
	}

	&:hover .icon-link__hex {
		background-image: url("../img/alt-arrow-hex.png");
	}
}

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

.site-header {
	position: sticky;
	top: calc(var(--wp-admin--admin-bar--height, 0px) - 1px);
	z-index: 999;
	transition: background-color 0.3s;

	&.is-stuck {
		background-color: var(--c-dg-400);
	}
}

.site-header__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 1rem;

	@media (min-width: 992px) {
		padding: 1rem 4rem;
	}
}

.site-header__logo {
	width: 100%;

	.site-logo {
		max-width: 160px;
		margin: 0 auto;
	}

	@media (min-width: 768px) {
		width: 20%;

		.site-logo {
			max-width: 243px;
			margin: 0;
		}
	}

	@media (min-width: 992px) {
		width: 25%;
	}
}

.site-logo--text {
	color: var(--c-tan);
	font-family: var(--f-display);
	font-size: 2rem;
}

.site-nav {
	display: none;

	@media (min-width: 768px) {
		display: flex;
		align-items: center;
		width: 80%;
	}

	@media (min-width: 992px) {
		width: 75%;
	}
}

.site-nav__list {
	display: flex;
	align-items: center;
	gap: 2rem;
	margin-left: auto;

	a {
		display: block;
		color: var(--c-tan);
		font-family: var(--f-label);
		font-size: 16px;
		font-weight: 800;
		line-height: 1.3;
	}

	> li:last-child > a {
		padding: 13px 24px 12px;
		background: var(--c-green-light);
		font-weight: 700;
		text-transform: uppercase;
		border-left: 8px solid var(--c-tan);
		border-right: 1px solid var(--c-green-light);
		transition: 0.25s;

		&:hover {
			background: var(--c-tan);
			color: var(--c-green);
			border-left: 1px solid var(--c-tan);
			border-right: 8px solid var(--c-green);
		}

		&:active {
			transform: scale(0.95);
			transition: 0.05s;
		}
	}
}

/* Pages that do not start with a hero get a solid header from the top. */
body:not(:has(.site-main > .bak-hero:first-child, .entry-content > .bak-hero:first-child)) .site-header {
	background-color: var(--c-dg-400);
}

/* ---------- Mobile menu ---------- */

.menu-toggle {
	position: fixed;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 100000;
	width: 3rem;
	margin: 0 auto;
	padding: 0 0 30px;

	img {
		width: 100%;
	}

	.menu-toggle__close {
		display: none;
	}

	&[aria-expanded="true"] {
		.menu-toggle__open {
			display: none;
		}

		.menu-toggle__close {
			display: block;
		}
	}

	@media (min-width: 768px) {
		display: none;
	}
}

.mobile-menu {
	position: fixed;
	inset: 0;
	z-index: 99999;
	visibility: hidden;
	transition: visibility 0s 0.9s;

	&.is-open {
		visibility: visible;
		transition-delay: 0s;

		.mobile-menu__backdrop,
		.mobile-menu__panel {
			transform: none;
		}
	}

	@media (min-width: 768px) {
		display: none;
	}
}

.mobile-menu__backdrop {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 10rem;
	background: rgb(35 51 34 / 0.5);
	transform: translateY(-150%);
	transition: transform 0.9s;
}

.mobile-menu__panel {
	position: absolute;
	top: 2rem;
	right: 0;
	bottom: 0;
	left: 0;
	overflow-y: auto;
	padding: 1.5rem 1.5rem 15rem;
	background: var(--c-green) url("../img/mobile-pattern.svg") no-repeat bottom / cover;
	transform: translateY(150%);
	transition: transform 0.8s;

	@media (min-width: 576px) {
		padding-inline: 4rem;
	}
}

.mobile-menu__logo {
	display: block;
	padding: 0.5rem 0 2rem;

	.site-logo {
		max-width: 160px;
	}
}

.mobile-menu__list a {
	display: block;
	padding-bottom: 0.5rem;
	color: var(--c-tan);
	font-family: var(--f-display);
	font-size: 32px;
	line-height: 64px;
}

.mobile-menu__contact {
	padding: 1rem 0;
	color: var(--c-tan);

	address {
		font-family: var(--f-body);
		font-size: 14px;
		font-weight: 500;
	}

	.contact-line {
		display: block;
		margin-top: 0.25rem;
		font-family: var(--f-body);
		font-size: 14px;
		font-weight: 500;
		line-height: 1.5;
	}

	.contact-line--first {
		margin-top: 1.25rem;
	}

	.contact-line__label {
		padding-right: 0.25rem;
		color: var(--c-dg-500);
		font-family: var(--f-label);
		font-weight: 800;
	}
}

/* ---------- Page hero (block + project template) ---------- */

.bak-hero {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	background: var(--c-dg-400);
	color: var(--c-tan);

	.entry-content > &:first-child:not(.is-preview),
	.site-main > &:first-child {
		margin-top: -8rem;
		padding-top: 8rem;
	}
}

.bak-hero__bg {
	position: absolute;
	inset: 0;
	z-index: -1;
	overflow: hidden;
	pointer-events: none;
}

.bak-hero__pattern {
	position: absolute;
	top: 0;
	left: 0;
	max-width: min(1219px, 88rem);
	mix-blend-mode: multiply;

	.bak-hero--home & {
		max-width: 56rem;
	}
}

.bak-hero__inner {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	flex-direction: column-reverse;
	align-items: flex-end;
	max-width: 88rem;
	margin: 0 auto;

	.bak-hero--home & {
		align-items: center;
	}

	@media (min-width: 768px) {
		flex-direction: row;
	}

	@media (min-width: 992px) {
		padding-left: 3rem;
	}
}

.bak-hero__content {
	position: relative;
	z-index: 2;
	width: 100%;
	margin-top: -3rem;
	padding: 1.5rem 1rem 3rem 0.25rem;

	@media (min-width: 768px) {
		width: 50%;
		padding-inline: 2rem;
	}

	.bak-hero--home & {
		@media (min-width: 992px) {
			padding-bottom: 0;
		}
	}
}

.bak-hero__title {
	padding-bottom: 2.5rem;
	font-size: 2.25rem;
	line-height: 1;

	@media (min-width: 768px) {
		font-size: 3rem;
	}

	@media (min-width: 992px) {
		padding-right: 6rem;
	}

	@media (min-width: 1200px) {
		font-size: 64px;
	}

	.bak-hero--compact & {
		@media (min-width: 768px) {
			font-size: 2.25rem;
		}

		@media (min-width: 1200px) {
			font-size: 3rem;
		}
	}
}

.bak-hero__text {
	@media (min-width: 576px) {
		padding-right: 3rem;
	}
}

.bak-hero__anchors {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;

	li {
		width: 50%;
		padding: 0 2rem 1.5rem 0;
		line-height: 1.5;

		@media (min-width: 1200px) {
			width: 33.333%;
		}
	}

	a {
		display: block;
		color: var(--c-tan);
	}
}

.bak-hero__anchors--inline {
	@media (min-width: 1200px) {
		flex-wrap: nowrap;
	}

	li,
	li:last-child {
		width: auto;
		padding: 0 2rem 0.75rem 0;
	}

	li:last-child {
		padding-right: 0;
	}
}

/* Home-style hero whose image overlaps the next section (Project Gallery). */
.bak-hero--overlap {
	z-index: 2;
	overflow: visible;
	overflow-x: clip;
}

.bak-hero__media {
	position: relative;
	width: 100%;
	height: 16rem;
	margin-left: 2rem;

	.bak-hero--compact & {
		margin-left: 0.5rem;
	}

	@media (min-width: 576px) {
		height: 20rem;

		.bak-hero--compact & {
			margin-left: 2rem;
		}
	}

	@media (min-width: 768px) {
		width: 50%;
		height: 28rem;
		margin-bottom: -6rem;

		&,
		.bak-hero--compact & {
			margin-left: 0;
		}

		.bak-hero--home & {
			height: 38rem;
		}
	}
}

.bak-hero__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.bak-hero--interior {
	overflow: visible;
	overflow-x: clip;
	background: linear-gradient(var(--c-dg-400), var(--c-dg-400)) no-repeat top / 100% calc(100% - var(--skirt, 0px)), var(--c-brandwhite);

	@media (min-width: 768px) {
		--skirt: 6rem;
	}

	.bak-hero__bg {
		bottom: var(--skirt, 0px);
	}
}

.bak-hero__skirt {
	height: var(--skirt, 0px);
}

.bak-hero--centered {
	text-align: center;

	.bak-hero__inner {
		justify-content: center;
		padding: 4rem 1rem 8rem;
	}

	.bak-hero__content {
		width: 100%;
		max-width: 48rem;
		margin: 0;
	}

	.bak-hero__title {
		padding-right: 0;
	}

	.bak-hero__text {
		padding: 0 0 2.5rem;
	}
}

/* ---------- Project single ---------- */

.project-gallery {
	padding-top: 3rem;
	background: var(--c-brandwhite);

	@media (min-width: 768px) {
		padding-top: 6rem;
	}

	&::after {
		content: "";
		display: block;
		height: 6rem;
		background: var(--c-white);
	}
}

.project-gallery__grid {
	display: flex;
	flex-wrap: wrap;
	max-width: 80rem;
	margin: 0 auto;
}

.project-gallery__item {
	width: 100%;
	padding: 0.5rem;

	@media (min-width: 576px) {
		width: 50%;
	}
}

.project-gallery__link {
	position: relative;
	display: block;
	height: 16rem;

	@media (min-width: 768px) {
		height: 28rem;
	}
}

.project-gallery__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* ---------- Pre-footer CTA ---------- */

.prefooter-cta {
	background: var(--c-brandwhite);
}

.prefooter-cta__box {
	position: relative;
	z-index: 2;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	max-width: 80rem;
	margin: 0 auto -6rem;
	padding: 4rem 2rem;
	background: var(--c-green);
	color: var(--c-tan);

	@media (min-width: 576px) {
		padding-inline: 3rem;
	}

	@media (min-width: 768px) {
		padding-block: 2rem;
	}

	@media (min-width: 1200px) {
		padding-inline: 8rem;
	}
}

.prefooter-cta__text {
	width: 100%;

	@media (min-width: 768px) {
		width: 50%;
	}
}

.prefooter-cta__title {
	padding-bottom: 1rem;
	font-size: 48px;
	line-height: 48px;
}

.prefooter-cta__actions {
	width: 100%;
	padding: 2rem 0;

	.btn {
		margin-right: 2rem;
	}

	.btn:first-child {
		margin-bottom: 2rem;

		@media (min-width: 992px) {
			margin-bottom: 0;
		}
	}

	@media (min-width: 768px) {
		width: 50%;
		padding: 0;
		text-align: right;
	}
}

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

.site-footer {
	display: flex;
	flex-wrap: wrap;
	padding: 10rem 0.5rem 4rem;
	background: var(--c-dg-400);
	color: var(--c-tan);

	@media (min-width: 768px) {
		padding-inline: 2rem;
	}
}

.site-footer__logo {
	width: 180px;
}

.site-footer__logo--mobile {
	margin: 0 auto;
	padding-bottom: 2.5rem;

	@media (min-width: 768px) {
		display: none;
	}
}

.site-footer__logo--desktop {
	display: none;
	padding-bottom: 1.5rem;

	@media (min-width: 768px) {
		display: block;
	}
}

.site-footer__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	width: 100%;
	max-width: 88rem;
	margin: 0 auto;

	@media (min-width: 1200px) {
		justify-content: space-evenly;
	}
}

.site-footer__col {
	padding: 0 1.5rem 1.5rem;
}

.site-footer__address {
	font-family: var(--f-body);
	font-size: 12px;
	font-weight: 500;

	& + & {
		padding-top: 1.5rem;
	}
}

.footer-menu {
	> li {
		line-height: 24px;

		& + li {
			padding-top: 1.5rem;
		}

		> a {
			display: block;
			padding-bottom: 0.25rem;
			font-family: var(--f-label);
			font-size: 16px;
			font-weight: 800;
		}
	}

	.sub-menu a {
		display: block;
		font-family: var(--f-body);
		font-size: 14px;
		font-weight: 500;
	}
}

.site-footer__lines {
	margin-top: 1.75rem;

	li {
		line-height: 1.5;
	}

	.contact-line {
		font-family: var(--f-body);
		font-size: 14px;
		font-weight: 500;
	}

	.contact-line__label {
		padding-right: 0.5rem;
		color: var(--c-green);
		font-family: var(--f-label);
		font-size: 12px;
		font-weight: 800;
	}
}

.site-footer__bottom {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 3rem 0.5rem 0;

	> * {
		width: 100%;
		padding-bottom: 2rem;
		text-align: center;

		@media (min-width: 768px) {
			width: 33.333%;
			padding-bottom: 0;
		}
	}

	@media (min-width: 576px) {
		padding-inline: 1.5rem;
	}

	@media (min-width: 992px) {
		padding-inline: 4rem;
	}
}

.site-footer__copyright,
.site-footer__credit {
	color: var(--c-white);
	font-family: var(--f-body);
	font-size: 8px;
	font-weight: 500;
	letter-spacing: 0.18px;
	text-transform: uppercase;
}

.site-footer__copyright {
	@media (min-width: 768px) {
		text-align: left;
	}
}

.site-footer__credit {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: calc(5px + 1rem);
}

/* ---------- Carousel controls (Fancyapps) shared by sliders ---------- */

.bak-carousel {
	--f-carousel-slide-width: 100%;
	--f-carousel-gap: 0px;

	.f-carousel.has-dots {
		margin-bottom: 0;
	}

	.f-carousel__viewport {
		overflow: hidden;
	}

	&:not(.is-ready) .bak-carousel__track {
		display: flex;
		overflow: hidden;

		> * {
			flex: 0 0 var(--f-carousel-slide-width);
		}
	}
}

.bak-carousel__arrow {
	flex: none;
	display: none;
	width: 2rem;
	margin: 0 auto;

	@media (min-width: 768px) {
		display: block;
	}
}

.bak-carousel .f-carousel__dots {
	position: static;
	display: flex;
	justify-content: center;
	gap: 0;
	padding: 1rem 3rem;

	@media (min-width: 768px) {
		padding: 20px 3rem 22px;
	}
}

.bak-carousel .f-carousel__dot {
	width: 16px;
	height: 14px;
	margin: 0 4px;
	padding: 0;
	border-radius: 0;
	background: rgb(0 0 0 / 0.2);
	clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
	opacity: 1;
	display: none;

	@media (min-width: 768px) {
		display: block;
	}

	&::after {
		display: none;
	}

	&[aria-current="true"],
	&.is-current {
		background: var(--c-red);
	}
}

/* ---------- Block editor: section blocks use the full canvas width ---------- */

.editor-styles-wrapper .wp-block[data-type^="bak/"] {
	max-width: none;
	margin-inline: 0;
}

/* ---------- Generic content (core blocks placed between sections) ---------- */

.entry-content > :not(.bak-block) {
	max-width: 80rem;
	margin: 1.5rem auto;
	padding-inline: 1rem;

	&:first-child {
		margin-top: 3rem;
	}
}

.entry-content--fallback {
	padding: 4rem 1rem;
}
