/*
 * Structural CSS — only what theme.json cannot express.
 * Palette and type come from theme.json custom properties; nothing is hard-coded
 * twice, so changing a colour there changes it everywhere.
 */

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

.advb-header {
	background: var(--wp--preset--color--white);
}

.advb-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	max-width: 1240px;
	margin-inline: auto;
	padding: 16px 20px;
}

.advb-header__logo img {
	display: block;
	width: 300px;
	max-width: 100%;
	height: auto;
}

/* Primary navigation ------------------------------------------------- */

.advb-nav ul {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 22px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.advb-nav a {
	font-family: var(--wp--preset--font-family--roboto);
	font-size: 15px;
	font-weight: 400;
	line-height: 1.5;
	color: var(--wp--preset--color--accent);
	text-decoration: none;
}

.advb-nav a:hover,
.advb-nav a:focus-visible {
	text-decoration: underline;
}

.advb-nav .current-menu-item > a {
	font-weight: 700;
}

/* Submenu */
.advb-nav li {
	position: relative;
}

.advb-nav .sub-menu {
	position: absolute;
	z-index: 40;
	top: 100%;
	left: 0;
	display: block;
	min-width: 270px;
	flex-direction: column;
	gap: 0;
	padding: 8px 0;
	background: var(--wp--preset--color--white);
	border: 1px solid #e4e4e4;
	box-shadow: 0 10px 30px rgb(0 0 0 / 12%);
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity .16s ease, transform .16s ease, visibility .16s;
}

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

.advb-nav .sub-menu a {
	display: block;
	padding: 9px 18px;
	font-size: 14px;
}

/* Mobile navigation --------------------------------------------------- */

.advb-nav-toggle {
	display: none;
	padding: 10px;
	background: none;
	border: 0;
	color: var(--wp--preset--color--accent);
	cursor: pointer;
	line-height: 0;
}

.advb-nav-toggle svg {
	width: 28px;
	height: 28px;
	fill: currentColor;
}

@media (max-width: 1024px) {
	.advb-nav-toggle {
		display: block;
	}

	/*
	 * Scoped to .advb-header on purpose. Core ships `.wp-block-navigation
	 * { display: flex }` at the same specificity as a bare `.advb-nav`, and the
	 * block library stylesheet loads after the theme — so the single-class form
	 * lost the tie and the menu stayed open on mobile.
	 */
	.advb-header .advb-nav {
		position: absolute;
		z-index: 50;
		inset-inline: 0;
		top: 100%;
		display: none;
		padding: 12px 20px 20px;
		background: var(--wp--preset--color--white);
		border-top: 1px solid #eee;
		box-shadow: 0 12px 24px rgb(0 0 0 / 10%);
	}

	.advb-header__inner {
		position: relative;
		/* No wrapping: the logo shrinks instead, so the toggle stays on the
		   same row rather than dropping to a line of its own. */
		flex-wrap: nowrap;
		gap: 12px;
	}

	.advb-header__logo,
	.advb-header__logo img {
		width: auto;
		max-width: min(220px, 62vw);
		height: auto;
	}

	.advb-nav-toggle {
		flex: 0 0 auto;
	}

	.advb-header.is-open .advb-nav,
	.advb-header.is-open .advb-nav.wp-block-navigation {
		display: block;
	}

	.advb-nav ul {
		flex-direction: column;
		align-items: stretch;
		gap: 0;
	}

	.advb-nav > ul > li > a {
		display: block;
		padding: 12px 0;
		border-bottom: 1px solid #f0f0f0;
		font-size: 16px;
	}

	/* Submenus become static, always-visible lists — no hover on touch. */
	.advb-nav .sub-menu {
		position: static;
		display: block;
		min-width: 0;
		padding: 0 0 8px 16px;
		border: 0;
		box-shadow: none;
		opacity: 1;
		visibility: visible;
		transform: none;
	}
}

/* ------------------------------------------------------------- Hero slider */

/*
 * Each slide is an ordinary core/cover block, so the owner edits the headline
 * and swaps the background image with the normal Gutenberg controls. The theme
 * only stacks them and cross-fades.
 */
.advb-hero {
	position: relative;
	overflow: hidden;
	height: 530px;
}

.advb-hero > .wp-block-cover,
.advb-hero__slide {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	min-height: 0;
	margin: 0;
	background-position: center;
	background-size: cover;
	opacity: 0;
	transition: opacity .7s ease;
}

.advb-hero > .wp-block-cover.is-active,
.advb-hero__slide.is-active {
	opacity: 1;
}

/* A lone slide is a static banner — always visible, never faded out. */
.advb-hero > .wp-block-cover:only-of-type {
	opacity: 1;
}

/* In the editor the slides must not overlap, or only one is reachable. */
.editor-styles-wrapper .advb-hero {
	height: auto;
}

.editor-styles-wrapper .advb-hero > .wp-block-cover {
	position: relative;
	inset: auto;
	min-height: 320px;
	opacity: 1;
}

.advb-hero__content {
	max-width: 1240px;
	padding: 0 20px;
	text-align: center;
}

.advb-hero__content :where(h1, h2, .advb-hero__title) {
	margin: 0;
	font-family: var(--wp--preset--font-family--abel);
	font-size: clamp(34px, 6vw, 63px);
	font-weight: 400;
	line-height: 1.15;
	color: var(--wp--preset--color--hero);
}

.advb-hero__desc {
	margin: 14px 0 0;
	font-family: var(--wp--preset--font-family--roboto);
	font-size: clamp(15px, 2vw, 20px);
	color: var(--wp--preset--color--hero);
}

.advb-hero__nav {
	position: absolute;
	z-index: 2;
	top: 50%;
	translate: 0 -50%;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	background: rgb(0 0 0 / 35%);
	border: 0;
	border-radius: 4px;
	color: #fff;
	cursor: pointer;
}

.advb-hero__nav:hover {
	background: rgb(0 0 0 / 55%);
}

.advb-hero__nav--prev { left: 16px; }
.advb-hero__nav--next { right: 16px; }

.advb-hero__nav svg {
	width: 20px;
	height: 20px;
	fill: currentColor;
}

@media (max-width: 767px) {
	.advb-hero {
		height: 360px;
	}

	.advb-hero__nav {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.advb-hero__slide {
		transition: none;
	}
}

/* ------------------------------------------------------------ Service card */

.advb-service-card {
	height: 100%;
	padding: 26px 22px;
	background: var(--wp--preset--color--white);
	border: 1px solid #ececec;
	border-radius: 6px;
	transition: box-shadow .2s ease, transform .2s ease;
}

.advb-service-card:hover {
	box-shadow: 0 12px 28px rgb(0 0 0 / 8%);
	transform: translateY(-2px);
}

.advb-service-card h3 {
	margin-top: 0;
}

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

.advb-footer {
	background: var(--wp--preset--color--dark);
	color: #cfd2d4;
}

.advb-footer__inner {
	max-width: 1240px;
	margin-inline: auto;
	padding: 38px 20px;
}

.advb-footer a {
	color: #cfd2d4;
	text-decoration: none;
}

.advb-footer a:hover {
	text-decoration: underline;
}

.advb-footer__menu ul {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 26px;
	margin: 0 0 26px;
	padding: 0;
	list-style: none;
}

.advb-footer__menu a {
	font-family: var(--wp--preset--font-family--abel);
	font-size: 14px;
	font-weight: 400;
	line-height: 20px;
	text-transform: uppercase;
}

.advb-footer__offices {
	display: grid;
	gap: 30px;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.advb-footer__office h3 {
	margin: 0 0 10px;
	font-family: var(--wp--preset--font-family--abel);
	font-size: 16px;
	font-weight: 400;
	color: #fff;
	text-transform: uppercase;
}

.advb-footer__office p {
	margin: 0 0 4px;
	font-size: 14px;
	line-height: 1.6;
	color: #cfd2d4;
}

.advb-footer__legal {
	margin-top: 28px;
	padding-top: 18px;
	border-top: 1px solid rgb(255 255 255 / 12%);
	font-size: 13px;
	line-height: 1.6;
	color: #a9adb0;
}

/* --------------------------------------------------------------- Content */

.advb-page-title {
	margin-bottom: 8px;
}

/* Post cards on the news archive */
.advb-card {
	height: 100%;
	border: 1px solid #ececec;
	border-radius: 6px;
	overflow: hidden;
	background: #fff;
}

.advb-card img {
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 10;
	object-fit: cover;
}

.advb-card__body {
	padding: 18px;
}

/* Keep long Cyrillic headings from overflowing narrow cards. */
.advb-card h2,
.advb-card h3 {
	overflow-wrap: break-word;
	font-size: 20px;
	line-height: 1.3;
}

/* Tables inside imported article content */
.entry-content table,
.wp-block-post-content table {
	width: 100%;
	border-collapse: collapse;
}

.entry-content table :is(td, th),
.wp-block-post-content table :is(td, th) {
	padding: 8px 10px;
	border: 1px solid #e0e0e0;
}

/* Imported iframes (maps, video) must not overflow on mobile. */
.wp-block-post-content iframe {
	max-width: 100%;
}

/* Accessibility ------------------------------------------------------- */

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

:where(a, button, input, select, textarea):focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}
