/* Layout: container, header, footer, page header and the two-column page layouts. */

.container {
	width: 100%;
	max-width: calc(var(--utomhus-max) + 2 * var(--utomhus-gutter));
	margin-inline: auto;
	padding-inline: var(--utomhus-gutter);
}

.site-main {
	min-height: 50vh;
	padding-bottom: var(--wp--preset--spacing--70);
}

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

.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: var(--wp--preset--color--white);
	box-shadow: 0 1px 0 var(--wp--preset--color--border);
}

.admin-bar .site-header {
	top: var(--wp-admin--admin-bar--height, 0px);
}

/* The logo bar is a layer above the category bar, so its dropdowns open over the category
   links and the search field. */
.site-header__bar {
	position: relative;
	z-index: 2;
	display: flex;
	align-items: center;
	gap: 1.5rem;
	min-height: var(--utomhus-header-height);
}

.site-header__brand {
	flex: none;
}

.site-header__brand img,
.custom-logo {
	display: block;
	width: auto;
	max-height: 48px;
}

.site-title {
	color: var(--wp--preset--color--text);
	font-size: 1.25rem;
	font-weight: 600;
	text-decoration: none;
}

.site-nav {
	margin-left: auto;
}

.site-nav__menu,
.category-nav__menu,
.site-footer__menu,
.site-footer__social {
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-nav__menu {
	display: flex;
	align-items: center;
	gap: 0.25rem;
}

.site-nav__menu > li {
	position: relative;
}

.site-nav__menu a {
	display: block;
	white-space: nowrap;
	padding: 0.5rem 0.6rem;
	border-radius: var(--utomhus-radius-small);
	color: var(--wp--preset--color--text);
	font-size: 0.95rem;
	font-weight: 500;
	text-decoration: none;
}

.site-nav__menu a:hover,
.site-nav__menu .current-menu-item > a,
.site-nav__menu .current-menu-ancestor > a {
	color: var(--wp--preset--color--primary);
}

.site-nav__menu .menu-item-has-children > a::after {
	margin-left: 0.45em;
	transform: translateY(-0.2em) rotate(45deg);
}

.site-nav__menu .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 220px;
	margin: 0;
	padding: 0.4rem;
	list-style: none;
	background: var(--wp--preset--color--white);
	border-radius: var(--utomhus-radius);
	box-shadow: var(--utomhus-shadow);
	opacity: 0;
	visibility: hidden;
	transform: translateY(4px);
	transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}

.site-nav__menu li:hover > .sub-menu,
.site-nav__menu li:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: none;
}

.site-header__actions {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.icon-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0;
	border: 0;
	border-radius: var(--utomhus-radius-small);
	background: transparent;
	color: var(--wp--preset--color--text);
	cursor: pointer;
}

.icon-button:hover {
	background: var(--wp--preset--color--surface);
}

.site-header__search-toggle,
.site-header__menu-toggle {
	display: none;
}

.site-header__sub {
	background: var(--wp--preset--color--surface);
}

.site-header__sub-inner {
	display: flex;
	align-items: center;
	gap: 1.5rem;
	min-height: 3.5rem;
}

/* The category bar is one row at every width: where it doesn't fit (beside the search, or
   on phones) it scrolls sideways and fades out at the right. */
.category-nav {
	flex: 1 1 auto;
	min-width: 0;
	overflow-x: auto;
	scrollbar-width: none;
	-webkit-mask-image: var(--utomhus-fade-right);
	mask-image: var(--utomhus-fade-right);
}

.category-nav::-webkit-scrollbar {
	display: none;
}

.category-nav__menu {
	display: flex;
	flex-wrap: nowrap;
	gap: 1.1rem;
	width: max-content;
	padding-right: 2.5rem;
	white-space: nowrap;
}

.category-nav__menu a {
	color: var(--wp--preset--color--text);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	text-decoration: none;
}

.category-nav__menu a:hover,
.category-nav__menu .current-menu-item > a {
	color: var(--wp--preset--color--primary);
}

.site-search {
	position: relative;
	flex: 0 1 380px;
	margin-left: auto;
}

.site-search input[type="search"] {
	min-height: 2.5rem;
	padding-right: 2.75rem;
	border-color: transparent;
	border-radius: var(--utomhus-radius-pill);
	font-size: var(--wp--preset--font-size--small);
}

.site-search button {
	position: absolute;
	top: 50%;
	right: 0.35rem;
	display: inline-flex;
	padding: 0.4rem;
	border: 0;
	background: none;
	color: var(--wp--preset--color--primary);
	transform: translateY(-50%);
	cursor: pointer;
}

.site-search--inline {
	max-width: 480px;
	margin: 0 0 1.5rem;
}

.site-search--inline input[type="search"] {
	border-color: var(--wp--preset--color--border);
}

/* Menu button: the menu icon, or the close icon while the phone menu is open. */
.site-header__menu-toggle .icon--close,
.site-header__menu-toggle[aria-expanded="true"] .icon--menu {
	display: none;
}

.site-header__menu-toggle[aria-expanded="true"] .icon--close {
	display: block;
}

/* Phone menu: a panel from the logo bar to the bottom of the screen, over the category bar and
   the page, holding side menus (template-parts/side-nav.php) and the contact details. It
   scrolls inside itself; the page behind stays still (theme.js sets has-open-menu). */
.mobile-menu {
	position: fixed;
	inset: calc(var(--wp-admin--admin-bar--height, 0px) + var(--utomhus-header-height)) 0 0;
	z-index: 1;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	padding: 0.75rem var(--utomhus-gutter) 2rem;
	overflow-y: auto;
	overscroll-behavior: contain;
	border-top: 1px solid var(--wp--preset--color--border);
	background: var(--wp--preset--color--white);
}

.mobile-menu[hidden] {
	display: none;
}

@media (max-width: 1279px) {
	html.has-open-menu {
		overflow: hidden;
	}
}

/* Rows sized for fingers. */
.mobile-menu .side-nav__link {
	padding-block: 0.75rem;
	font-size: 1rem;
}

.mobile-menu .side-nav__sublink {
	padding-block: 0.6rem;
	font-size: 0.9375rem;
}

.mobile-menu__contact {
	padding: 1rem 1.5rem;
	border-radius: var(--utomhus-radius);
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
}

.mobile-menu__contact > * {
	margin: 0 0 0.6rem;
}

.mobile-menu__contact > :last-child {
	margin-bottom: 0;
}

.mobile-menu__contact strong a {
	font-size: 1rem;
}

@media (min-width: 1280px) {
	.mobile-menu {
		display: none;
	}
}

/* Below 1280 px the main pages move behind the menu button; the category bar and the search
   stay in the header. */
@media (max-width: 1279px) {
	.site-nav {
		display: none;
	}

	.site-header__bar {
		gap: 0.5rem;
	}

	.site-header__actions {
		margin-left: auto;
	}

	.site-header__menu-toggle {
		display: inline-flex;
	}
}

/* Below 1100 px the category bar runs edge to edge on its own row; the search form opens below
   it from the search button. */
@media (max-width: 1100px) {
	.site-header__search-toggle {
		display: inline-flex;
	}

	.site-header__sub-inner {
		flex-wrap: wrap;
		gap: 0;
		min-height: 0;
	}

	.category-nav {
		flex: 1 1 100%;
		margin-inline: calc(var(--utomhus-gutter) * -1);
	}

	.category-nav__menu {
		padding: 0.75rem calc(var(--utomhus-gutter) + 1.5rem) 0.75rem var(--utomhus-gutter);
	}

	.site-search {
		display: none;
		flex: 1 1 100%;
		margin: 0 0 0.75rem;
	}

	.site-header.is-search-open .site-search {
		display: block;
	}
}

/* ---- Page header ---- */

.page-header {
	padding-block: var(--wp--preset--spacing--60) 1.5rem;
}

/* Under the breadcrumbs the trail's own spacing separates the title from the header. */
.breadcrumbs + .page-header,
.breadcrumbs + * > .page-header:first-child {
	padding-top: 0;
}

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

.page-header__row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

/* ---- Sidebar layout: the side menu beside the main column (shop archives, article list) ---- */

.sidebar-layout {
	display: grid;
	grid-template-columns: var(--utomhus-sidebar) minmax(0, 1fr);
	gap: var(--wp--preset--spacing--60);
	align-items: start;
}

.sidebar-layout--single {
	grid-template-columns: minmax(0, 1fr);
	max-width: 900px;
}

/* The side menu sticks just below the header and scrolls inside itself when it is taller than
   the screen, so every link stays reachable. */
.sidebar-layout__nav {
	position: sticky;
	top: calc(var(--wp-admin--admin-bar--height, 0px) + var(--utomhus-header-height) + 4.5rem);
	max-height: calc(100vh - var(--wp-admin--admin-bar--height, 0px) - var(--utomhus-header-height) - 5.5rem);
	overflow-y: auto;
	overscroll-behavior: contain;
	border-radius: var(--utomhus-radius);
}

@media (max-width: 900px) {
	.sidebar-layout {
		grid-template-columns: minmax(0, 1fr);
		gap: 1.25rem;
	}

	.sidebar-layout__nav {
		position: static;
		max-height: none;
		overflow: visible;
	}

	/* A menu that hides on phones takes its empty column with it. */
	.sidebar-layout__nav:has(> .side-nav--hide) {
		display: none;
	}
}

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

.site-footer {
	background: var(--wp--preset--color--dark);
	color: #e8e8e8;
	font-size: var(--wp--preset--font-size--small);
}

.site-footer a {
	color: #e8e8e8;
	text-decoration: none;
}

.site-footer a:hover {
	color: var(--wp--preset--color--white);
	text-decoration: underline;
}

.site-footer__grid {
	display: grid;
	grid-template-columns: 1.4fr repeat(3, 1fr);
	gap: var(--wp--preset--spacing--60);
	padding-block: var(--wp--preset--spacing--70) var(--wp--preset--spacing--60);
}

.site-footer__logo img {
	display: block;
	width: 180px;
	height: auto;
	margin-bottom: 1.25rem;
}

.site-footer__contact p {
	margin: 0 0 0.4rem;
}

.site-footer__heading {
	margin-bottom: 1rem;
	color: var(--wp--preset--color--white);
	font-size: 1rem;
}

.site-footer__menu li {
	margin-bottom: 0.55rem;
}

.site-footer__social {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1rem;
	margin-top: 1.5rem;
}

.site-footer__bottom {
	padding-block: 1.25rem;
	border-top: 1px solid rgb(255 255 255 / 0.12);
	color: #b8b8b8;
}

.site-footer__bottom p {
	margin: 0;
}

@media (max-width: 900px) {
	.site-footer__grid {
		grid-template-columns: 1fr 1fr;
	}

	.site-footer__contact {
		grid-column: 1 / -1;
	}
}

@media (max-width: 520px) {
	.site-footer__grid {
		grid-template-columns: 1fr;
	}
}

/* ---- Coming soon (coming-soon.php) ---- */

.coming-soon__main {
	display: grid;
	min-height: 100vh;
	align-content: center;
	justify-items: center;
	gap: 1rem;
	padding-block: var(--wp--preset--spacing--70);
	text-align: center;
}

.coming-soon__logo .custom-logo {
	max-height: 72px;
}

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

.coming-soon__lead {
	max-width: 36rem;
	margin: 0;
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--large);
}

.coming-soon__contact {
	padding: 1.25rem 1.5rem;
	border-radius: var(--utomhus-radius-small);
	background: var(--wp--preset--color--surface);
}

.coming-soon__contact p {
	margin: 0 0 0.5rem;
}

.coming-soon__contact p:last-child {
	margin-bottom: 0;
}

.coming-soon__login {
	margin: 0;
	font-size: var(--wp--preset--font-size--small);
}
