/* Shared brand image */
.ub-chrome-logo {
	display: block;
	width: 100%;
	height: auto;
}

.ub-chrome-brand-text {
	color: #6200ee;
	font-size: 1.45rem;
	font-weight: 800;
	letter-spacing: -0.04em;
}

.ub-skip-link {
	position: fixed;
	top: -100px;
	left: 1rem;
	z-index: 100003;
	padding: 0.7rem 1rem;
	border-radius: 10px;
	background: #fff;
	color: #4327c9;
}

.ub-skip-link:focus {
	top: 1rem;
}

html {
	scroll-padding-top: 145px;
}

.entry-content h2,
.entry-content h3 {
	scroll-margin-top: 145px;
}

/* Header */
.ub-site-header {
	--ub-h-ink: #1b1d29;
	--ub-h-muted: #6b6e80;
	--ub-h-line: #e7e7ee;
	--ub-h-accent: #5b3df5;
	--ub-h-radius: 6px;
	position: sticky;
	top: 0;
	z-index: 1000;
	background: #fff;
	border-bottom: 1px solid var(--ub-h-line);
}

body.admin-bar .ub-site-header {
	top: 32px;
}

.ub-header-main,
.ub-header-nav-inner {
	width: min(100% - 48px, 1200px);
	margin-inline: auto;
}

.ub-header-main {
	display: flex;
	align-items: center;
	gap: 24px;
	height: 68px;
}

/* The logo PNG has ~4.7% transparent padding on the left; pull it back so
   the lettering lines up with the navigation links below. */
.ub-header-brand {
	--ub-logo-w: 176px;
	display: block;
	flex: 0 0 auto;
	width: var(--ub-logo-w);
	margin-left: calc(var(--ub-logo-w) * -0.047);
}

.ub-header-search {
	flex: 0 1 360px;
	margin-left: auto;
}

.ub-header-search .search-form,
.ub-header-mobile-search .search-form {
	display: flex;
	margin: 0;
}

.ub-header-search .search-form label,
.ub-header-mobile-search .search-form label {
	flex: 1;
	min-width: 0;
	margin: 0;
}

.ub-header-search .search-field,
.ub-header-mobile-search .search-field {
	width: 100%;
	height: 38px;
	padding: 0 12px;
	border: 1px solid var(--ub-h-line);
	border-right: 0;
	border-radius: var(--ub-h-radius) 0 0 var(--ub-h-radius);
	background: #fff;
	color: var(--ub-h-ink);
	font-size: 14px;
}

.ub-header-search .search-field:focus,
.ub-header-mobile-search .search-field:focus {
	border-color: var(--ub-h-accent);
	outline: 0;
}

.ub-header-search .search-submit,
.ub-header-mobile-search .search-submit {
	flex: 0 0 auto;
	height: 38px;
	padding: 0 14px;
	border: 1px solid var(--ub-h-line);
	border-radius: 0 var(--ub-h-radius) var(--ub-h-radius) 0;
	background: #f6f6f9;
	color: var(--ub-h-ink);
	font-size: 14px;
	font-weight: 500;
	line-height: 1;
}

.ub-header-search .search-submit:hover,
.ub-header-mobile-search .search-submit:hover {
	background: #ececf2;
	color: var(--ub-h-ink);
}

/* Language switch: plain "RU | UZ" text */
.ub-header-languages {
	display: flex;
	align-items: center;
	flex: 0 0 auto;
	font-size: 14px;
	line-height: 1;
}

.ub-header-languages a {
	padding: 4px 0;
	color: var(--ub-h-muted);
	font-weight: 500;
	text-decoration: none;
}

.ub-header-languages a + a {
	margin-left: 10px;
	padding-left: 10px;
	border-left: 1px solid var(--ub-h-line);
}

.ub-header-languages a:hover {
	color: var(--ub-h-ink);
}

.ub-header-languages a.is-current {
	color: var(--ub-h-ink);
	font-weight: 600;
}

/* Mobile toggle (hidden on desktop) */
.ub-header-toggle {
	display: none;
	place-items: center;
	flex: 0 0 auto;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 1px solid var(--ub-h-line);
	border-radius: var(--ub-h-radius);
	background: #fff;
	color: var(--ub-h-ink);
}

.ub-header-toggle:hover,
.ub-header-toggle:focus-visible {
	background: #f6f6f9;
	color: var(--ub-h-ink);
}

.ub-header-toggle-icon,
.ub-header-toggle-icon::before,
.ub-header-toggle-icon::after {
	display: block;
	width: 16px;
	height: 1.5px;
	background: currentColor;
	transition: transform 0.15s ease;
}

.ub-header-toggle-icon {
	position: relative;
}

.ub-header-toggle-icon::before,
.ub-header-toggle-icon::after {
	content: "";
	position: absolute;
	left: 0;
}

.ub-header-toggle-icon::before { top: -5px; }
.ub-header-toggle-icon::after { top: 5px; }
.ub-header-toggle[aria-expanded="true"] .ub-header-toggle-icon { background: transparent; }
.ub-header-toggle[aria-expanded="true"] .ub-header-toggle-icon::before { transform: translateY(5px) rotate(45deg); }
.ub-header-toggle[aria-expanded="true"] .ub-header-toggle-icon::after { transform: translateY(-5px) rotate(-45deg); }

/* Second row: navigation */
.ub-header-nav {
	border-top: 1px solid var(--ub-h-line);
}

.ub-header-nav-inner {
	display: flex;
	align-items: stretch;
	height: 48px;
}

.ub-header-links {
	display: flex;
	align-items: stretch;
	gap: 28px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ub-header-links li {
	display: flex;
	margin: 0;
}

.ub-header-link {
	display: flex;
	align-items: center;
	color: var(--ub-h-ink);
	font-size: 14.5px;
	font-weight: 500;
	text-decoration: none;
	white-space: nowrap;
	box-shadow: inset 0 -2px 0 transparent;
}

.ub-header-link:hover {
	color: var(--ub-h-accent);
}

.ub-header-link.is-current {
	color: var(--ub-h-accent);
	box-shadow: inset 0 -2px 0 var(--ub-h-accent);
}

.ub-header-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-left: auto;
}

.ub-header-mega-trigger > a {
	display: flex;
	align-items: center;
	height: 32px;
	padding: 0 14px;
	border: 1px solid var(--ub-h-line);
	border-radius: var(--ub-h-radius);
	background: #fff;
	color: var(--ub-h-ink);
	font-size: 14px;
	font-weight: 500;
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
}

.ub-header-mega-trigger > a:hover,
.ub-header-mega-trigger > a:focus-visible,
.ub-header-mega-trigger > a[aria-expanded="true"] {
	border-color: var(--ub-h-accent);
	color: var(--ub-h-accent);
}

.ub-header-mobile-search {
	display: none;
}

/* Footer */
.site-footer {
	background: #fff;
}

.ub-footer {
	--ub-f-ink: #1b1d29;
	--ub-f-muted: #6b6e80;
	--ub-f-line: #e4e4ec;
	--ub-f-accent: #5b3df5;
	background: #fff;
	border-top: 1px solid var(--ub-f-line);
	color: var(--ub-f-muted);
	font-size: 14px;
	line-height: 1.55;
}

.ub-footer-inner {
	width: min(100% - 48px, 1200px);
	margin-inline: auto;
}

.ub-footer-main {
	display: grid;
	grid-template-columns: 260px minmax(0, 1fr);
	gap: 64px;
	padding: 48px 0 44px;
}

/* Same left-padding compensation for the logo PNG as in the header */
.ub-footer-brand {
	--ub-logo-w: 150px;
	display: block;
	width: var(--ub-logo-w);
	margin-left: calc(var(--ub-logo-w) * -0.047);
}

.ub-footer-about p {
	margin: 14px 0 0;
}

.ub-footer-cross {
	display: inline-block;
	margin-top: 14px;
	color: var(--ub-f-accent);
	font-weight: 500;
	text-decoration: none;
}

.ub-footer-cross:hover,
.ub-footer-cross:focus-visible {
	color: var(--ub-f-accent);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.ub-footer-nav {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 32px;
}

.ub-footer-col-title {
	margin: 0 0 12px;
	color: var(--ub-f-ink);
	font-weight: 600;
}

.ub-footer-col ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.ub-footer-col li {
	margin: 0;
}

.ub-footer-col li + li {
	margin-top: 8px;
}

.ub-footer-col a {
	color: var(--ub-f-muted);
	text-decoration: none;
}

.ub-footer-col a:hover,
.ub-footer-col a:focus-visible {
	color: var(--ub-f-ink);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.ub-footer-col a[aria-current="page"],
.ub-footer-col a.is-parent {
	color: var(--ub-f-ink);
	font-weight: 500;
}

.ub-footer-bottom {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 8px 24px;
	padding: 18px 0;
	border-top: 1px solid var(--ub-f-line);
	font-size: 13px;
}

.ub-footer-bottom p {
	margin: 0;
}

.ub-footer-languages {
	display: flex;
	align-items: center;
	line-height: 1;
}

.ub-footer-languages a {
	color: var(--ub-f-muted);
	font-weight: 500;
	text-decoration: none;
}

.ub-footer-languages a + a {
	margin-left: 10px;
	padding-left: 10px;
	border-left: 1px solid var(--ub-f-line);
}

.ub-footer-languages a:hover,
.ub-footer-languages a.is-current {
	color: var(--ub-f-ink);
}

.ub-footer-languages a.is-current {
	font-weight: 600;
}

@media (max-width: 1080px) {
	.ub-header-links { gap: 20px; }
	.ub-footer-main { grid-template-columns: 220px minmax(0, 1fr); gap: 40px; }
	.ub-footer-nav { gap: 24px; }
}

@media (max-width: 900px) {
	html { scroll-padding-top: 88px; }
	.entry-content h2, .entry-content h3 { scroll-margin-top: 88px; }
	.ub-header-main, .ub-header-nav-inner, .ub-footer-inner { width: min(100% - 32px, 1200px); }
	.ub-header-main { height: 60px; gap: 16px; }
	.ub-header-brand { --ub-logo-w: 150px; }
	.ub-header-search { display: none; }
	.ub-header-languages { margin-left: auto; }
	.ub-header-toggle { display: grid; }
	.ub-header-nav {
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		display: none;
		max-height: calc(100dvh - 60px);
		overflow-y: auto;
		background: #fff;
		border-bottom: 1px solid var(--ub-h-line);
	}
	.ub-header-nav.is-open { display: block; }
	.ub-header-nav-inner {
		flex-direction: column;
		align-items: stretch;
		height: auto;
		padding: 12px 0 16px;
	}
	.ub-header-mobile-search { display: block; margin-bottom: 8px; }
	.ub-header-links { flex-direction: column; gap: 0; }
	.ub-header-links li { border-bottom: 1px solid var(--ub-h-line); }
	.ub-header-link { width: 100%; height: 46px; }
	.ub-header-link.is-current { box-shadow: inset 2px 0 0 var(--ub-h-accent); padding-left: 12px; }
	.ub-header-actions { flex-direction: column; align-items: stretch; gap: 8px; margin: 14px 0 0; }
	.ub-header-mega-trigger > a { justify-content: center; height: 42px; }
	.ub-footer-main { grid-template-columns: 1fr; gap: 32px; padding: 40px 0 36px; }
	.ub-footer-about { max-width: 520px; }
	.ub-footer-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 24px; }
}

@media (max-width: 640px) {
	.ub-header-brand { --ub-logo-w: 134px; }
	.ub-footer-bottom { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 380px) {
	.ub-header-brand { --ub-logo-w: 118px; }
	.ub-header-main { gap: 12px; }
}

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