/*
 * Header and footer of the site.
 *
 * Both stand outside the block editor, so they carry the ukrp class and take
 * the shared layer of the block set with them: the tokens, the reset, the
 * content width and the buttons.
 *
 * That shared reset repeats its scope to outrank the theme, and it dresses the
 * same elements as the rules here, so these repeat the class too.
 */

/* The bar is taken out of the flow, so the page starts under it. */
body {
	padding-top: var(--header-height);
}

/* And a jump to an anchor stops below the bar rather than under it. */
html {
	scroll-padding-top: calc(var(--header-height) + 16px);
}

/* The admin bar sits above everything, so the site bar starts under it. */
body.admin-bar .ukrp.ukrp.site-header {
	top: 32px;
}

@media (max-width: 782px) {
	body.admin-bar .ukrp.ukrp.site-header {
		top: 46px;
	}
}

.ukrp.ukrp.site-header {
	--header-pad: 18px;

	position: fixed;
	top: 0;
	right: 0;
	left: 0;
	z-index: 30;
	border-bottom: 1px solid var(--color-divider);
	transition: box-shadow .28s ease, background-color .28s ease;
}

.ukrp.ukrp.site-header.is-stuck {
	background: color-mix(in srgb, var(--color-bg) 92%, transparent);
	backdrop-filter: blur(8px);
	box-shadow: var(--shadow-md);
}

.ukrp.ukrp .site-header__inner {
	position: relative;
	display: flex;
	align-items: center;
	gap: 28px;
	padding-block: var(--header-pad);
}

.ukrp.ukrp .site-header__brand {
	display: flex;
	align-items: center;
	color: var(--color-text);
	font-family: var(--font-heading);
	text-decoration: none;
}

.ukrp.ukrp .site-header__brand img {
	width: auto;
	height: 38px;
}

/* The nav fills the height of the header row: the submenu then hangs from
   the bottom edge of the bar, the way the states board draws it. */
.ukrp.ukrp .site-nav {
	align-self: stretch;
	margin-left: 8px;
}

.ukrp.ukrp .site-nav__list {
	display: flex;
	align-items: stretch;
	height: 100%;
	gap: 22px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ukrp.ukrp .site-nav__link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 100%;
	color: var(--color-text);
	font-family: var(--font-body);
	font-size: 14px;
	text-decoration: none;
	white-space: nowrap;
}

.ukrp.ukrp .site-nav__link:hover,
.ukrp.ukrp .site-nav__link.is-current {
	color: var(--color-lime);
}

/* The item that carries a submenu is a button: it opens a panel rather than
   leading anywhere. */
.ukrp.ukrp .site-nav__summary {
	padding: 0;
	border: 0;
	background: none;
	font-family: inherit;
	font-size: 14px;
	font-weight: inherit;
	line-height: inherit;
	text-transform: none;
	cursor: pointer;
}

.ukrp.ukrp .caret::before {
	content: "\25be";
	font-size: 15px;
	line-height: 1;
}

.ukrp.ukrp .site-nav__item {
	position: relative;
	display: flex;
}

.ukrp.ukrp .site-nav__item.is-open .caret::before {
	content: "\25b4";
}

/* The layout hangs the panel to the left of its item, with the right edge
   reaching just past it. */
.ukrp.ukrp .submenu {
	position: absolute;
	top: 100%;
	right: -21px;
	display: none;
	flex-direction: column;
	min-width: 250px;
	margin: 0;
	margin-top: calc(var(--header-pad) + 9px);
	padding: 8px;
	border-radius: var(--radius-md);
	background: var(--color-panel);
	box-shadow: var(--shadow-md);
	list-style: none;
}

/* Bridge over the gap below the bar, so the pointer reaches the panel
   without the hover being dropped on the way. */
.ukrp.ukrp .submenu::before {
	content: "";
	position: absolute;
	right: 0;
	bottom: 100%;
	left: 0;
	height: calc(var(--header-pad) + 9px);
}

.ukrp.ukrp .site-nav__item.is-open > .submenu {
	display: flex;
}

.ukrp.ukrp .submenu a {
	display: block;
	padding: 10px 14px;
	border-radius: var(--radius-sm);
	color: #14263f;
	font-size: 14px;
	text-decoration: none;
}

.ukrp.ukrp .submenu a:hover {
	background: rgba(7, 27, 56, .07);
}

/* Panel only: the call to action at the foot of the narrow menu. */
.ukrp.ukrp .site-nav > .site-nav__call {
	display: none;
}

.ukrp.ukrp .site-header__aside {
	display: flex;
	align-items: center;
	gap: 18px;
	margin-left: auto;
}

.ukrp.ukrp .site-header__phone {
	display: flex;
	align-items: center;
	gap: 8px;
	color: var(--color-accent);
	font-family: var(--font-heading);
	font-size: 16px;
	text-decoration: none;
	white-space: nowrap;
}

.ukrp.ukrp .lang {
	display: inline-flex;
	flex: none;
	overflow: hidden;
	border: 1px solid var(--color-control-border);
	border-radius: var(--radius-md);
}

.ukrp.ukrp .lang__option {
	display: inline-flex;
	align-items: center;
	padding: 7px 12px;
	color: var(--color-text);
	font-size: 13px;
	text-decoration: none;
}

.ukrp.ukrp .lang__option + .lang__option {
	border-left: 1px solid var(--color-control-border);
}

.ukrp.ukrp .lang__option.is-active {
	box-shadow: inset 0 0 0 1px var(--color-accent);
	color: var(--color-accent);
}

.ukrp.ukrp .lang__option:not(.is-active):hover {
	background: color-mix(in srgb, var(--color-text) 10%, transparent);
}

/* The layout draws desktop and phone as separate boards, so the menu button
   lives in the markup and shows up once the row stops fitting. */
.ukrp.ukrp .nav-toggle {
	display: none;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid var(--color-outline);
	border-radius: var(--radius-md);
	background: none;
	color: var(--color-text);
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
}

.ukrp.ukrp.site-header.is-open .nav-toggle {
	border-color: var(--color-lime);
	background: var(--color-lime);
	color: #071b38;
}

.ukrp.ukrp .nav-toggle__close {
	display: none;
}

.ukrp.ukrp.site-header.is-open .nav-toggle__open {
	display: none;
}

.ukrp.ukrp.site-header.is-open .nav-toggle__close {
	display: block;
}

/* The page stays put while the menu covers it. */
html.ukrp-menu-open {
	overflow: hidden;
}

@media (min-width: 1101px) {
	.ukrp.ukrp .site-nav__item:hover > .submenu,
	.ukrp.ukrp .site-nav__item:focus-within > .submenu {
		display: flex;
	}

	.ukrp.ukrp .site-nav__item.is-open > .site-nav__summary,
	.ukrp.ukrp .site-nav__item:hover > .site-nav__summary {
		color: var(--color-lime);
	}
}

/* --------------------------------------------------------------------------
 * Tablet and narrower: the menu becomes a panel
 * -------------------------------------------------------------------------- */

@media (max-width: 1100px) {
	.ukrp.ukrp .nav-toggle {
		display: grid;
	}

	.ukrp.ukrp.site-header,
	.ukrp.ukrp.site-header.is-stuck {
		--header-pad: 12px;

		background: var(--color-bg);
		backdrop-filter: none;
	}

	.ukrp.ukrp .site-header__inner {
		gap: 10px;
	}

	.ukrp.ukrp .site-header__brand {
		margin-right: auto;
	}

	.ukrp.ukrp .site-header__brand img {
		height: 26px;
	}

	.ukrp.ukrp .site-header__aside {
		gap: 10px;
		margin-left: 0;
	}

	/* The open menu is a light panel dropped under the bar: it hangs off the
	   header instead of growing it, and redeclares the tokens instead of
	   repainting every element. */
	.ukrp.ukrp .site-nav {
		--color-text: #071b38;
		--color-muted: #47556a;
		--color-muted-strong: #2b3a4f;
		--color-subtle: #6b7683;
		--color-accent: #071b38;
		--color-divider: rgba(7, 27, 56, .14);
		--color-control-border: rgba(7, 27, 56, .14);

		/* The offsets resolve against the padding box of the bar, which
		   already spans the gutters, so zero reaches both edges. */
		position: absolute;
		top: 100%;
		right: 0;
		left: 0;
		display: none;
		flex-direction: column;
		align-self: auto;
		height: calc(100vh - var(--header-height));
		height: calc(100dvh - var(--header-height));
		overflow-y: auto;
		margin-left: 0;
		padding: 8px var(--gutter) 20px;
		background: #ffffff;
		color: var(--color-text);
		box-shadow: var(--shadow-md);
	}

	.ukrp.ukrp.site-header.is-open .site-nav {
		display: flex;
	}

	.ukrp.ukrp .site-nav__list {
		flex: none;
		flex-direction: column;
		align-items: stretch;
		height: auto;
		gap: 0;
	}

	.ukrp.ukrp .site-nav__link {
		display: flex;
		width: 100%;
		height: auto;
		padding: 14px 0;
		border-bottom: 1px solid var(--color-divider);
		font-family: var(--font-heading);
		font-size: 18px;
	}

	.ukrp.ukrp .site-nav__link:hover,
	.ukrp.ukrp .site-nav__link.is-current {
		color: var(--color-accent);
	}

	.ukrp.ukrp .site-nav__item {
		position: static;
		display: block;
		border-bottom: 1px solid var(--color-divider);
	}

	.ukrp.ukrp .site-nav__summary {
		justify-content: space-between;
		border-bottom: 0;
		font-size: 18px;
	}

	.ukrp.ukrp .caret {
		color: var(--color-accent);
	}

	.ukrp.ukrp .submenu {
		position: static;
		gap: 12px;
		min-width: 0;
		margin: 0;
		padding: 0 0 12px 16px;
		border-radius: 0;
		background: none;
		box-shadow: none;
	}

	.ukrp.ukrp .submenu::before {
		content: none;
	}

	.ukrp.ukrp .submenu a {
		padding: 0;
		color: var(--color-muted-strong);
		font-size: 15px;
	}

	.ukrp.ukrp .submenu a:hover {
		background: none;
		color: var(--color-accent);
	}

	/* The call to action holds the foot of the panel whatever the list
	   above it comes to. */
	.ukrp.ukrp .site-nav > .site-nav__call {
		display: flex;
		flex: none;
		margin-top: auto;
		padding: 14px;
		font-size: 16px;
	}
}

/* --------------------------------------------------------------------------
 * Phone: every control in the bar is one target
 * -------------------------------------------------------------------------- */

@media (max-width: 680px) {
	.ukrp.ukrp .site-header__brand img {
		height: 44px;
	}

	.ukrp.ukrp .site-header__phone {
		justify-content: center;
		width: 44px;
		height: 44px;
		border: 1px solid var(--color-accent);
		border-radius: var(--radius-md);
		font-size: 17px;
	}

	.ukrp.ukrp .site-header__phone-text {
		display: none;
	}

	.ukrp.ukrp .site-header__aside .lang {
		height: 44px;
	}

	.ukrp.ukrp .site-header__aside .lang__option {
		padding: 0 12px;
		font-size: 13px;
	}
}

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

.ukrp.ukrp.site-footer {
	padding-top: 56px;
	border-top: 1px solid var(--color-divider);
}

.ukrp.ukrp .site-footer__grid {
	display: grid;
	grid-template-columns: 1.1fr .8fr .9fr 1.2fr;
	gap: 40px;
}

.ukrp.ukrp .site-footer__logo {
	width: auto;
	height: 34px;
	margin-bottom: 16px;
}

.ukrp.ukrp .site-footer__about {
	color: var(--color-muted);
	font-family: var(--font-body);
	font-size: 13px;
}

.ukrp.ukrp .site-footer__label {
	margin-bottom: 10px;
	color: var(--color-subtle);
	font-family: var(--font-body);
	font-size: 11px;
	letter-spacing: .12em;
	text-transform: uppercase;
}

.ukrp.ukrp .footer-nav {
	margin: 0;
	padding: 0;
	list-style: none;
}

.ukrp.ukrp .footer-nav a {
	display: block;
	padding: 4px 0;
	color: var(--color-muted);
	font-size: 13px;
	text-decoration: none;
}

.ukrp.ukrp .footer-nav a:hover,
.ukrp.ukrp .footer-nav a.is-current {
	color: var(--color-accent);
}

.ukrp.ukrp .site-footer__phone {
	display: block;
	margin-bottom: 6px;
	color: var(--color-lime);
	font-family: var(--font-heading);
	font-size: 17px;
	text-decoration: none;
}

.ukrp.ukrp .site-footer__mail {
	display: block;
	margin-bottom: 16px;
	color: var(--color-muted-strong);
	font-size: 13px;
	text-decoration: none;
	overflow-wrap: anywhere;
}

.ukrp.ukrp .socials {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ukrp.ukrp .socials a {
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	border: 1px solid var(--color-control-border);
	border-radius: 50%;
	color: var(--color-muted-strong);
	font-size: 11px;
	letter-spacing: .02em;
	text-decoration: none;
}

.ukrp.ukrp .socials a:hover {
	border-color: var(--color-accent);
	color: var(--color-accent);
}

/* --------------------------------------------------------------------------
 * Form of the footer
 * -------------------------------------------------------------------------- */

.ukrp.ukrp .contact-form {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	margin: 0;
}

.ukrp.ukrp .field {
	margin: 0;
}

.ukrp.ukrp .field > label {
	display: block;
	margin-bottom: 5px;
	color: var(--color-muted);
	font-size: 12px;
}

/* Inputs keep a light ground on the dark strip, so the typed text stays
   readable. */
.ukrp.ukrp .input {
	width: 100%;
	min-height: 36px;
	padding: 6px 10px;
	border: 1px solid var(--color-divider);
	border-radius: var(--radius-md);
	background: #ffffff;
	color: #071b38;
	font: inherit;
	font-size: 14px;
	caret-color: var(--color-lime-hover);
}

.ukrp.ukrp .input::placeholder {
	color: #6b7683;
	opacity: 1;
}

.ukrp.ukrp .input:hover {
	border-color: rgba(7, 27, 56, .45);
}

.ukrp.ukrp textarea.input {
	resize: vertical;
}

.ukrp.ukrp .field-wide {
	grid-column: span 2;
}

.ukrp.ukrp .contact-form__message {
	min-height: 70px;
}

.ukrp.ukrp .contact-form__submit {
	grid-column: span 2;
	margin-top: 8px;
}

.ukrp.ukrp .contact-form .upc-form__note {
	grid-column: span 2;
	margin: 0;
	font-size: 13px;
}

.ukrp.ukrp .contact-form .upc-form__note:empty {
	display: none;
}

.ukrp.ukrp .contact-form .upc-form__note.is-ok {
	color: #b7f07f;
}

.ukrp.ukrp .contact-form .upc-form__note.is-error {
	color: #ff9b86;
}

/* The honeypot is for machines, nobody else is meant to see it. */
.ukrp.ukrp .upc-form__trap {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.ukrp.ukrp .site-footer__bottom {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: 44px;
	padding: 18px 0;
	border-top: 1px solid var(--color-divider);
	color: var(--color-subtle);
	font-size: 12px;
}

.ukrp.ukrp .site-footer__bottom a {
	color: var(--color-muted);
	text-decoration: none;
}

@media (max-width: 1100px) {
	.ukrp.ukrp .site-footer__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 860px) {
	.ukrp.ukrp.site-footer {
		padding-top: 32px;
	}

	.ukrp.ukrp .site-footer__grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 20px;
	}

	.ukrp.ukrp .site-footer__logo {
		height: 30px;
		margin-bottom: 12px;
	}

	/* The list of links reads better in two columns than in one long run. */
	.ukrp.ukrp .footer-nav {
		display: grid;
		grid-template-columns: 1fr 1fr;
	}

	.ukrp.ukrp .site-footer__phone {
		margin-bottom: 4px;
		font-size: 18px;
	}

	.ukrp.ukrp .site-footer__mail {
		margin-bottom: 14px;
	}

	.ukrp.ukrp .contact-form__submit {
		padding: 13px;
	}

	.ukrp.ukrp .site-footer__bottom {
		flex-direction: column;
		align-items: flex-start;
		gap: 6px;
		margin-top: 28px;
		padding: 16px 0;
	}
}

@media (max-width: 520px) {
	.ukrp.ukrp .contact-form {
		grid-template-columns: minmax(0, 1fr);
	}

	.ukrp.ukrp .field-wide,
	.ukrp.ukrp .contact-form__submit,
	.ukrp.ukrp .contact-form .upc-form__note {
		grid-column: auto;
	}
}
