/* UPBUY homepage «Витрина».
 * Colours come from the theme palette, which Blockify swaps for dark mode
 * (neutral-900 is dark text in light mode and light text in dark mode).
 */
.ubh {
	--ubh-bg: var(--wp--preset--color--neutral-50, #0f172a);
	--ubh-fg: var(--wp--preset--color--neutral-900, #f8fafc);
	--ubh-fg2: var(--wp--preset--color--neutral-700, #e2e8f0);
	--ubh-muted: var(--wp--preset--color--neutral-500, #94a3b8);
	--ubh-line: var(--wp--preset--color--neutral-200, #334155);
	--ubh-soft: var(--wp--preset--color--neutral-100, #1e293b);
	--ubh-accent: var(--wp--preset--color--primary-600, #818cf8);
	--ubh-grad: linear-gradient(135deg, #8b5cf6, #5b3fd4);
	--ubh-gutter: clamp(16px, 4vw, 40px);
	--ubh-r: 12px;
	color: var(--ubh-muted);
	font-family: inherit;
	box-sizing: border-box;
}
.ubh *, .ubh *::before, .ubh *::after { box-sizing: border-box; }
.ubh p { margin: 0; }
.ubh a { text-decoration: none; }
.ubh img { display: block; max-width: 100%; }

.ubh-wrap {
	width: 100%;
	max-width: calc(1200px + 2 * var(--ubh-gutter));
	margin-inline: auto;
	padding-left: max(var(--ubh-gutter), env(safe-area-inset-left, 0px));
	padding-right: max(var(--ubh-gutter), env(safe-area-inset-right, 0px));
}
.ubh-sr {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.ubh-h2 {
	margin: 0;
	color: var(--ubh-fg);
	font-size: clamp(24px, 2.6vw, 32px);
	line-height: 1.15;
	font-weight: 700;
	letter-spacing: -0.02em;
	text-wrap: balance;
}
.ubh-eyebrow {
	color: var(--ubh-accent);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

/* chips */
.ubh-chip {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 5px 10px; border-radius: 999px;
	font-size: 12px; font-weight: 600; line-height: 1; letter-spacing: 0.01em;
	color: #fff; background: #6366f1; white-space: nowrap;
}
.ubh-chip--guide { background: #059669; }
.ubh-chip--snapshot { background: #db2777; }
.ubh-chip--update { background: #ea580c; }
.ubh-chip--mod { background: #7c3aed; }
.ubh-chip--map { background: #0284c7; }
.ubh-chip--new { background: #f8fafc; color: #0f172a; box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.14); }
.ubh-chip--new::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #10b981; }

/* buttons */
.ubh-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 44px; padding: 10px 20px; border-radius: 999px; border: 0;
	font: inherit; font-size: 15px; font-weight: 600; line-height: 1.2;
	color: #fff !important; background: var(--ubh-grad);
	box-shadow: 0 6px 22px rgba(124, 92, 240, 0.35);
	cursor: pointer; transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}
.ubh-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(124, 92, 240, 0.45); }
.ubh-btn--ghost {
	color: var(--ubh-fg) !important; background: color-mix(in srgb, var(--ubh-fg) 7%, transparent);
	box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ubh-fg) 16%, transparent);
}
.ubh-btn--ghost:hover { background: color-mix(in srgb, var(--ubh-fg) 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ubh-fg) 24%, transparent); }
.ubh a:focus-visible, .ubh button:focus-visible, .ubh input:focus-visible {
	outline: 2px solid var(--ubh-accent); outline-offset: 3px;
}

/* ================================================================== */
/* Spotlight                                                           */
/* ================================================================== */
.ubh-spot {
	position: relative;
	overflow: hidden;
	isolation: isolate;
	padding-top: calc(var(--ubh-hdr, 76px) + 8px);
	background: var(--ubh-bg);
}
.ubh-spot__bgs { position: absolute; inset: 0; z-index: -2; }
.ubh-spot__bg {
	position: absolute; inset: -80px;
	background-size: cover; background-position: center;
	filter: blur(56px) saturate(1.35);
	opacity: 0; transform: scale(1.1);
	transition: opacity 0.9s ease;
}
.ubh-spot__bg.is-on { opacity: 0.6; }
.ubh-spot__shade {
	position: absolute; inset: 0; z-index: -1;
	background:
		linear-gradient(90deg, color-mix(in srgb, var(--ubh-bg) 94%, transparent) 0%, color-mix(in srgb, var(--ubh-bg) 78%, transparent) 45%, color-mix(in srgb, var(--ubh-bg) 40%, transparent) 100%),
		linear-gradient(180deg, color-mix(in srgb, var(--ubh-bg) 55%, transparent) 0, transparent 22%, transparent 62%, var(--ubh-bg) 100%);
}
.ubh-spot__in { position: relative; display: flex; flex-direction: column; gap: 22px; padding-bottom: 28px; }

.ubh-ver {
	display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
	font-size: 13px; line-height: 1.4; color: var(--ubh-muted);
}
.ubh-ver a { color: var(--ubh-fg2); }
.ubh-ver a:hover { color: var(--ubh-fg); }
.ubh-ver b { color: var(--ubh-fg); font-weight: 600; }
.ubh-ver__dot { width: 7px; height: 7px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.18); }
.ubh-ver__sep { opacity: 0.5; }

.ubh-spot__slides { display: grid; }
.ubh-slide {
	grid-area: 1 / 1;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
	gap: clamp(24px, 4vw, 52px);
	align-items: center;
	opacity: 0; visibility: hidden;
	transition: opacity 0.5s ease, visibility 0s linear 0.5s;
}
.ubh-slide.is-on { opacity: 1; visibility: visible; transition: opacity 0.5s ease, visibility 0s; }
.ubh-slide__copy { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; min-width: 0; }
.ubh-slide__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; font-size: 13px; color: var(--ubh-fg2); }
.ubh-slide__title {
	margin: 0;
	font-size: clamp(28px, 3.5vw, 46px);
	line-height: 1.07; font-weight: 800; letter-spacing: -0.025em;
	text-wrap: balance;
}
.ubh-slide__title a { color: var(--ubh-fg); }
.ubh-slide__title a:hover { color: var(--ubh-accent); }
.ubh-slide__ex { font-size: 16px; line-height: 1.55; color: var(--ubh-fg2); max-width: 52ch; }
.ubh-slide__cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.ubh-slide__art {
	display: block; border-radius: 14px; overflow: hidden; aspect-ratio: 16 / 9;
	background: var(--ubh-soft);
	box-shadow: 0 30px 70px -24px rgba(2, 6, 23, 0.6), 0 0 0 1px color-mix(in srgb, var(--ubh-fg) 10%, transparent);
	transform: translateZ(0);
}
.ubh-slide__art img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.ubh-slide__art:hover img { transform: scale(1.03); }

.ubh-rail { display: grid; grid-template-columns: repeat(var(--ubh-n, 4), minmax(0, 1fr)); gap: 16px; }
.ubh-rail__item {
	position: relative;
	display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 12px; align-items: center;
	padding: 14px 0 4px; margin: 0;
	border: 0; background: none; text-align: left;
	font: inherit; color: var(--ubh-muted); cursor: pointer;
}
.ubh-rail__bar {
	position: absolute; left: 0; right: 0; top: 0; height: 3px; border-radius: 3px; overflow: hidden;
	background: color-mix(in srgb, var(--ubh-fg) 14%, transparent);
}
.ubh-rail__bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #a78bfa, #6366f1); }
.ubh-rail__item.is-on .ubh-rail__bar i { width: 100%; }
.ubh-spot.is-auto .ubh-rail__item.is-on .ubh-rail__bar i { width: 0; animation: ubh-progress var(--ubh-dur, 7s) linear forwards; }
.ubh-spot.is-paused .ubh-rail__item.is-on .ubh-rail__bar i { animation-play-state: paused; }
@keyframes ubh-progress { to { width: 100%; } }
.ubh-rail__thumb { border-radius: 6px; overflow: hidden; aspect-ratio: 16 / 10; background: var(--ubh-soft); }
.ubh-rail__thumb img { width: 100%; height: 100%; object-fit: cover; opacity: 0.75; transition: opacity 0.2s; }
.ubh-rail__t {
	font-size: 13.5px; line-height: 1.3; font-weight: 600;
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ubh-rail__item:hover, .ubh-rail__item.is-on { color: var(--ubh-fg); }
.ubh-rail__item:hover .ubh-rail__thumb img, .ubh-rail__item.is-on .ubh-rail__thumb img { opacity: 1; }

/* ================================================================== */
/* Feed                                                                */
/* ================================================================== */
.ubh-feed { padding-block: clamp(28px, 4vw, 48px) clamp(40px, 6vw, 72px); }
.ubh-feed__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; }
.ubh-search {
	position: relative; display: flex; align-items: center;
	flex: 0 1 420px; min-width: 0; height: 46px;
	border-radius: 999px; background: color-mix(in srgb, var(--ubh-fg) 5%, transparent);
	box-shadow: inset 0 0 0 1px var(--ubh-line);
}
.ubh-search:focus-within { box-shadow: inset 0 0 0 2px var(--ubh-accent); }
.ubh-search__ico { position: absolute; left: 16px; color: var(--ubh-muted); pointer-events: none; }
.ubh .ubh-search input[type="search"] {
	flex: 1; min-width: 0; width: auto; height: 100%;
	margin: 0; padding: 0 8px 0 44px; border: 0; border-radius: 999px; background: none; outline: none; box-shadow: none;
	-webkit-appearance: none; appearance: none;
	font: inherit; font-size: 15px; line-height: 1.2; color: var(--ubh-fg);
}
.ubh .ubh-search input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }
.ubh-search input::placeholder { color: var(--ubh-muted); opacity: 1; }
.ubh-search input:focus-visible { outline: none; }
.ubh .ubh-search button {
	flex: 0 0 auto; height: 36px; min-height: 0; margin: 0 5px 0 0; line-height: 1; padding: 0 16px; border: 0; border-radius: 999px;
	font: inherit; font-size: 14px; font-weight: 600; color: #fff; background: var(--ubh-grad); cursor: pointer;
}
.ubh-pop { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px !important; font-size: 13.5px; }
.ubh-pop__lab { color: var(--ubh-muted); margin-right: 2px; }
.ubh-pop a {
	padding: 6px 12px; border-radius: 999px; color: var(--ubh-fg2);
	box-shadow: inset 0 0 0 1px var(--ubh-line); transition: background 0.2s, color 0.2s;
}
.ubh-pop a:hover { color: var(--ubh-fg); background: color-mix(in srgb, var(--ubh-fg) 7%, transparent); }

.ubh-tabs { margin: 26px 0 22px; position: relative; }
.ubh-tabs__in {
	display: flex; gap: 4px; padding: 5px; width: max-content; max-width: 100%;
	overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity;
	border-radius: 999px; background: color-mix(in srgb, var(--ubh-fg) 5%, transparent);
	box-shadow: inset 0 0 0 1px var(--ubh-line);
}
.ubh-tabs__in::-webkit-scrollbar { display: none; }
.ubh-tab {
	flex: 0 0 auto; scroll-snap-align: start;
	display: inline-flex; align-items: center; gap: 7px;
	min-height: 38px; padding: 8px 16px; border-radius: 999px;
	font-size: 14.5px; font-weight: 600; line-height: 1; color: var(--ubh-fg2);
	transition: background 0.2s, color 0.2s;
}
.ubh-tab em {
	font-style: normal; font-size: 11.5px; padding: 3px 7px; border-radius: 99px;
	background: color-mix(in srgb, var(--ubh-fg) 9%, transparent); color: var(--ubh-muted);
}
.ubh-tab:hover { color: var(--ubh-fg); background: color-mix(in srgb, var(--ubh-fg) 7%, transparent); }
.ubh-tab.is-on { color: #fff; background: var(--ubh-grad); box-shadow: 0 4px 18px rgba(124, 92, 240, 0.35); }
.ubh-tab.is-on em { background: rgba(255, 255, 255, 0.22); color: #fff; }

.ubh-grid {
	display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 24px;
	transition: opacity 0.2s;
}
.ubh-grid[aria-busy="true"] { opacity: 0.45; pointer-events: none; }
.ubh-card { position: relative; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ubh-card__media { position: relative; border-radius: var(--ubh-r); overflow: hidden; aspect-ratio: 16 / 9; background: var(--ubh-soft); }
.ubh-card__img, .ubh-card__ph { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.ubh-card:hover .ubh-card__img { transform: scale(1.04); }
.ubh-card__chips { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; }
.ubh-card__body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ubh-card__title { margin: 0; font-size: 18px; line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; }
.ubh-card__title a { color: var(--ubh-fg); }
.ubh-card__title a::after { content: ""; position: absolute; inset: 0; border-radius: var(--ubh-r); }
.ubh-card:hover .ubh-card__title a { color: var(--ubh-accent); }
.ubh-card__ex {
	font-size: 14.5px; line-height: 1.5;
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ubh-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--ubh-muted); font-variant-numeric: tabular-nums; }
.ubh-meta__type { display: none; }
.ubh-more { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 24px; margin-top: 36px !important; }
.ubh-more [hidden] { display: none !important; }
.ubh-more__all { color: var(--ubh-accent); font-weight: 600; font-size: 15px; }
.ubh-more__all:hover { text-decoration: underline; }

/* ================================================================== */
/* Beginner path                                                       */
/* ================================================================== */
.ubh-path { padding-block: clamp(36px, 5vw, 64px); background: linear-gradient(180deg, transparent, color-mix(in srgb, #8b5cf6 7%, transparent) 50%, transparent); }
.ubh-path__head { display: flex; flex-direction: column; gap: 10px; max-width: 680px; margin-bottom: 28px; }
.ubh-path__lead { font-size: 16px; line-height: 1.55; }
.ubh-path__list {
	list-style: none; margin: 0; padding: 0;
	display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px;
	counter-reset: none;
}
.ubh-step { min-width: 0; }
.ubh-step__in {
	display: flex; flex-direction: column; gap: 6px; height: 100%;
	padding: 10px 10px 14px; border-radius: var(--ubh-r);
	background: color-mix(in srgb, var(--ubh-fg) 4%, transparent);
	box-shadow: inset 0 0 0 1px var(--ubh-line);
	transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}
a.ubh-step__in:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px var(--ubh-accent); background: color-mix(in srgb, var(--ubh-fg) 6%, transparent); }
.ubh-step__img { display: block; border-radius: 8px; overflow: hidden; aspect-ratio: 16 / 9; margin-bottom: 6px; background: var(--ubh-soft); }
.ubh-step__img img { width: 100%; height: 100%; object-fit: cover; }
.ubh-step__n { font-size: 11.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ubh-accent); }
.ubh-step__t { font-size: 15.5px; line-height: 1.25; font-weight: 600; color: var(--ubh-fg); }
.ubh-step__s { font-size: 12.5px; color: var(--ubh-muted); margin-top: auto; }
.ubh-step.is-soon .ubh-step__img img { filter: grayscale(0.7); opacity: 0.45; }
.ubh-step.is-soon .ubh-step__t { color: var(--ubh-fg2); }
.ubh-step.is-soon .ubh-step__n { color: var(--ubh-muted); }

/* ================================================================== */
/* Responsive                                                          */
/* ================================================================== */
@media (max-width: 1100px) {
	.ubh-path__list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
	.ubh-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.ubh-rail__item { grid-template-columns: minmax(0, 1fr); }
	.ubh-rail__thumb { display: none; }
}
@media (max-width: 760px) {
	.ubh-spot { padding-top: calc(var(--ubh-hdr, 64px) + 4px); }
	.ubh-spot__shade {
		background: linear-gradient(180deg, color-mix(in srgb, var(--ubh-bg) 60%, transparent) 0, color-mix(in srgb, var(--ubh-bg) 82%, transparent) 45%, var(--ubh-bg) 100%);
	}
	.ubh-spot__in { gap: 16px; padding-bottom: 20px; }
	.ubh-slide { grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
	.ubh-slide__art { order: -1; border-radius: 12px; }
	.ubh-slide__copy { gap: 12px; }
	.ubh-slide__title { font-size: clamp(23px, 6.4vw, 30px); }
	.ubh-slide__ex { font-size: 15px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
	.ubh-slide__cta { width: 100%; }
	.ubh-slide__cta .ubh-btn { flex: 1 1 auto; }
	.ubh-rail { gap: 6px; }
	.ubh-rail__item { padding: 10px 0 6px; min-height: 36px; }
	.ubh-rail__bar { top: 16px; }
	.ubh-rail__t { display: none; }
	.ubh-ver { font-size: 12px; }
	.ubh-ver__lab { display: none; }
	.ubh-search { flex-basis: 100%; }
	.ubh .ubh-path__list {
		display: flex; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
		margin-inline: calc(-1 * var(--ubh-gutter)); padding-inline: var(--ubh-gutter); scroll-padding-inline: var(--ubh-gutter);
	}
	.ubh-path__list::-webkit-scrollbar { display: none; }
	.ubh .ubh-step { flex: 0 0 min(64vw, 240px); scroll-snap-align: start; margin: 0; }
}
@media (max-width: 560px) {
	.ubh-tabs { margin: 20px calc(-1 * var(--ubh-gutter)) 8px; }
	.ubh-tabs__in { border-radius: 0; background: none; box-shadow: none; padding: 0 var(--ubh-gutter); width: auto; }
	.ubh-tab { box-shadow: inset 0 0 0 1px var(--ubh-line); }
	.ubh-tab.is-on { box-shadow: 0 4px 18px rgba(124, 92, 240, 0.35); }
	.ubh-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
	.ubh-card {
		display: grid; grid-template-columns: minmax(0, 1fr) 112px; gap: 14px; align-items: start;
		padding: 14px 0; border-top: 1px solid var(--ubh-line);
	}
	.ubh-card:first-child { border-top: 0; }
	.ubh-card__media { order: 2; border-radius: 8px; }
	.ubh-card__chips { display: none; }
	.ubh-card__title { font-size: 16px; line-height: 1.28; }
	.ubh-card__title a::after { border-radius: 0; }
	.ubh-card__ex { display: none; }
	.ubh-meta { font-size: 12.5px; gap: 2px 10px; }
	.ubh-meta__type { display: inline; color: var(--ubh-accent); font-weight: 600; order: -1; }
	.ubh-more { margin-top: 20px !important; }
	.ubh-feed__head .ubh-h2 { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
	.ubh *, .ubh *::before, .ubh *::after { transition: none !important; animation: none !important; }
}

/* Advanced Ads #917 «На главной внизу» */
.ubh-ad { padding-block: clamp(24px, 4vw, 40px); }
.ubh-ad__in { display: flex; justify-content: center; min-width: 0; }
.ubh-ad__in > * { max-width: 100%; }
