/*
 * ADJASA layout
 * --------------------------------------------------------------------------
 * Page frame: header, navigation, mobile menu, footer. Public site only.
 * All values come from tokens.css.
 */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden; }
body.adjasa-menu-open { overflow: hidden; }
img { max-width: 100%; height: auto; }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	margin: -1px; padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}
.skip-link:focus {
	position: fixed !important;
	top: 8px; left: 8px;
	z-index: 1000;
	width: auto; height: auto;
	margin: 0; padding: 0.75rem 1rem;
	clip: auto; clip-path: none;
	background: var(--adj-black);
	color: var(--adj-white);
	text-decoration: none;
}
:focus-visible { outline: 2px solid var(--adj-focus-ring); outline-offset: 3px; }

/* Header ------------------------------------------------------------------ */
.site-header {
	position: relative;
	z-index: 20;
	background-color: var(--adj-header-bg);
	color: var(--adj-header-text);
}
.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 2rem;
	padding: var(--adj-header-pad) var(--adj-page-padding);
}
.site-branding { flex: 0 1 auto; min-width: 0; line-height: 1.2; }
.site-branding .custom-logo-link { display: block; }
.site-branding .custom-logo {
	display: block;
	width: auto;
	max-width: 100%;
	height: auto;
	max-height: var(--adj-logo-height);
}
.site-title {
	margin: 0;
	color: inherit;
	font-family: var(--adj-font-heading);
	font-weight: var(--adj-title-weight);
	font-size: calc((var(--adj-title) - 1) * var(--adj-f) + 1rem);
	line-height: 1.2;
	letter-spacing: var(--adj-heading-spacing);
	text-decoration: none;
}
.site-title:hover { opacity: 0.7; }

/* Desktop navigation */
.site-nav { flex: 0 0 auto; }
.site-nav ul {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 0.4rem max(var(--adj-nav-gap), 1.1rem);
	margin: 0; padding: 0;
	list-style: none;
}
.site-nav li { margin: 0; }
.site-nav a {
	display: inline-block;
	padding: 0.1em 0;
	color: inherit;
	font-family: var(--adj-font-body);
	font-weight: var(--adj-nav-weight);
	font-size: calc((var(--adj-nav) - 1) * var(--adj-f) + 1rem);
	line-height: 1.4;
	text-decoration: none;
}
.site-nav a:hover { opacity: 0.7; }
.site-nav .current-menu-item > a,
.site-nav .current_page_item > a,
.site-nav .current-menu-ancestor > a {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.3em;
}
.site-nav .sub-menu { display: none; }

/* Burger */
.nav-toggle {
	display: none;
	position: relative;
	z-index: 40;
	flex: 0 0 auto;
	width: 44px; height: 44px;
	margin: -6px -9px -6px 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	cursor: pointer;
}
.nav-toggle span {
	position: absolute;
	left: 9px;
	width: 26px; height: 1px;
	background: currentColor;
	transition: transform 0.25s cubic-bezier(0.2, 0.6, 0.3, 1), top 0.25s cubic-bezier(0.2, 0.6, 0.3, 1);
}
.nav-toggle span:nth-child(1) { top: 17px; }
.nav-toggle span:nth-child(2) { top: 26px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { top: 21.5px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { top: 21.5px; transform: rotate(-45deg); }

/* Mobile menu: full-screen overlay with large centred links */
.mobile-menu {
	position: fixed;
	inset: 0;
	z-index: 30;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 110px 6vw 6vw;
	overflow-y: auto;
	background-color: var(--adj-header-bg);
	color: var(--adj-header-text);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}
.mobile-menu.is-open { opacity: 1; visibility: visible; transition: opacity 0.3s ease; }
.mobile-menu ul { margin: 0; padding: 0; list-style: none; text-align: center; }
.mobile-menu li { margin: 3vw 0; }
.mobile-menu a {
	color: inherit;
	font-family: var(--adj-font-body);
	font-weight: var(--adj-nav-weight);
	font-size: 8.5vmin;
	line-height: 1.2;
	text-decoration: none;
}
.mobile-menu .current-menu-item > a,
.mobile-menu .current_page_item > a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }

@media (max-width: 799px) {
	.site-nav { display: none; }
	.nav-toggle { display: block; }
	.site-header.is-menu-open { position: relative; z-index: 35; }
}
@media (min-width: 800px) {
	.mobile-menu { display: none; }
}

/* Main -------------------------------------------------------------------- */
.site-main { flex: 1 0 auto; display: block; }
.entry-content::after { content: ""; display: table; clear: both; }

/* Anything placed on a page outside a section still gets sensible margins. */
.entry-content > :not(.alignfull):not(.adjasa-section) {
	width: calc(100% - 2 * var(--adj-page-padding));
	max-width: var(--adj-content-width);
	margin-left: auto;
	margin-right: auto;
}
.entry-content > .alignwide:not(.adjasa-section) { max-width: var(--adj-max-width); }
.entry-content > :not(.adjasa-section):first-child { margin-top: var(--adj-section-pad); }
.entry-content > :not(.adjasa-section):last-child  { margin-bottom: var(--adj-section-pad); }

/* Blog posts, archives, search, 404 */
.adjasa-plain {
	width: calc(100% - 2 * var(--adj-page-padding));
	max-width: var(--adj-content-width);
	margin: 0 auto;
	padding: var(--adj-section-pad) 0;
}
.adjasa-plain > :first-child { margin-top: 0; }
.adjasa-plain .entry-title a { text-decoration: none; }
.adjasa-plain .entry-meta { margin: -1rem 0 2rem; opacity: 0.65; font-size: calc((var(--adj-small) - 1) * var(--adj-f) + 1rem); }
.adjasa-plain article + article { margin-top: 4rem; padding-top: 4rem; border-top: 1px solid rgba(0, 0, 0, 0.12); }
.adjasa-plain .entry-content > :not(.alignfull):not(.adjasa-section) { width: 100%; }
.adjasa-plain .entry-content > :first-child { margin-top: 0; }
.adjasa-plain .entry-content > :last-child { margin-bottom: 0; }
.adjasa-pagination { display: flex; justify-content: space-between; gap: 2rem; margin-top: 4rem; }

/* Footer ------------------------------------------------------------------ */
.site-footer {
	flex: 0 0 auto;
	background-color: var(--adj-footer-bg);
	color: var(--adj-footer-text);
}
.site-footer__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.5rem 2rem;
	padding: var(--adj-section-pad-s) var(--adj-page-padding);
	font-size: calc((var(--adj-small) - 1) * var(--adj-f) + 1rem);
}
.site-footer p { margin: 0; }
.site-footer a { color: inherit; }
.site-footer ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; margin: 0; padding: 0; list-style: none; }
.site-footer li { margin: 0; }

@media (prefers-reduced-motion: reduce) {
	.nav-toggle span, .mobile-menu, .mobile-menu.is-open { transition: none; }
}
