/* ==========================================================================
   Sputnik — базовые стили: сетка, типографика, кнопки, шапка, подвал.
   Цвета, радиусы и шрифты приходят из CSS-переменных (--sp-*), см. inc/presets.php
   ========================================================================== */

/* Значения по умолчанию (селектор html слабее :root из настроек темы) */
html {
	--sp-container: 1200px;
	--sp-gap: 16px;
	--sp-header: #101935; --sp-header-text: #fff; --sp-header-nav: #c9d3f0; --sp-header-muted: rgba(255,255,255,.35);
	--sp-bg: #0a1029; --sp-surface: #141d3d; --sp-surface-2: #1d2850; --sp-border: #2a3766;
	--sp-text: #eef2ff; --sp-muted: #a3aed0;
	--sp-cta: #2563eb; --sp-cta-text: #fff; --sp-alt: #21c35b; --sp-alt-text: #06200f;
	--sp-accent: #7fa6ff; --sp-ok: #4ade80; --sp-bad: #ff7a85;
	--sp-r: 8px; --sp-r-lg: 14px;
	--sp-font: system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
	--sp-font-head: var(--sp-font);
	--sp-logo-w: 140px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 16px; }
body {
	margin: 0;
	background: var(--sp-bg);
	color: var(--sp-text);
	font-family: var(--sp-font);
	font-size: 16px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}
img, svg, video, iframe { max-width: 100%; }
img { height: auto; display: block; }
a { color: var(--sp-link, var(--sp-accent)); text-underline-offset: 2px; }
a:hover { color: var(--sp-link-hover, var(--sp-accent)); }
.sp-btn:hover, .sp-btn { text-decoration: none; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--sp-accent); outline-offset: 2px; }

.sp-skip { position: absolute; left: -9999px; top: 8px; z-index: 1000; background: var(--sp-cta); color: var(--sp-cta-text); padding: 10px 16px; border-radius: var(--sp-r); }
.sp-skip:focus { left: 8px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); white-space: nowrap; }

.sp-container { width: 100%; max-width: var(--sp-container); margin: 0 auto; padding: 0 var(--sp-gap); }
.sp-main { display: block; min-height: 50vh; }

/* ---------- Типографика ---------- */
h1, h2, h3, h4 { font-family: var(--sp-font-head); line-height: 1.15; margin: 0 0 .5em; font-weight: 800; letter-spacing: -.01em; }
/* CJK: не рвать слова посреди слога. */
:lang(ko) :is(h1, h2, h3, h4, p, li, td, th, .sp-btn), :lang(ja) :is(h1, h2, h3, h4) { word-break: keep-all; overflow-wrap: break-word; }
:lang(th) :is(h1, h2, h3) { line-break: loose; }
h1, .sp-h1 { font-size: clamp(28px, 4.4vw, 48px); line-height: 1.08; }
h2, .sp-h2 { font-size: clamp(24px, 3vw, 32px); }
h3, .sp-h3 { font-size: clamp(18px, 2vw, 21px); }
p { margin: 0 0 1em; }
.sp-muted { color: var(--sp-muted); }

/* ---------- Кнопки ---------- */
.sp-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 48px; padding: 0 22px;
	border: 1.5px solid transparent; border-radius: var(--sp-r);
	font-weight: 800; font-size: 15px; line-height: 1.15; text-decoration: none; text-align: center;
	cursor: pointer; transition: transform .15s ease, opacity .15s ease, box-shadow .15s ease;
	white-space: nowrap;
}
.sp-btn:hover { opacity: 1; transform: translateY(-1px); box-shadow: 0 8px 20px -10px rgba(0,0,0,.6); }
.sp-btn:active { transform: translateY(0); }
.sp-btn--cta { background: var(--sp-cta); color: var(--sp-cta-text); }
.sp-header .sp-btn--cta { background: var(--sp-hdr-cta, var(--sp-cta)); color: var(--sp-hdr-cta-text, var(--sp-cta-text)); }
.sp-btn--alt { background: var(--sp-alt); color: var(--sp-alt-text); }
.sp-btn--outline { border-color: var(--sp-border); color: var(--sp-text); background: transparent; }
.sp-btn--ghost { background: var(--sp-surface-2); color: var(--sp-text); }
.sp-btn--sm { min-height: 44px; padding: 0 14px; font-size: 14px; }
.sp-btn--lg { min-height: 56px; padding: 0 30px; font-size: 17px; }
.sp-btn--block { display: flex; width: 100%; }
.sp-btn__text { display: inline-flex; flex-direction: column; }
.sp-btn__sub { font-size: 12px; font-weight: 600; opacity: .9; }
.sp-btn--has-sub { min-height: 60px; }
.sp-btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 1em; }
.sp-btn-row--center { justify-content: center; }
.sp-btn-row--right { justify-content: flex-end; }
.sp-inline-code { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-weight: 800; padding: 2px 8px; border-radius: 6px; background: var(--sp-surface-2); border: 1px dashed var(--sp-accent); }

/* ---------- Промо-полоса ---------- */
.sp-promobar {
	display: block; padding: 8px 16px; text-align: center;
	background: var(--sp-cta); color: var(--sp-cta-text);
	font-size: 13px; font-weight: 800; text-decoration: none;
}

/* ---------- Шапка ---------- */
.sp-header { background: var(--sp-header); color: var(--sp-header-text); position: relative; z-index: 50; }
.sp-header__row { display: flex; align-items: center; gap: 12px 20px; min-height: 64px; padding-top: 10px; padding-bottom: 10px; }
.sp-logo { display: inline-flex; align-items: center; color: var(--sp-header-text); text-decoration: none; flex: none; }
.sp-logo__img { width: var(--sp-logo-w); max-height: 48px; object-fit: contain; object-position: left center; }
.sp-logo__text { font-family: var(--sp-font-head); font-weight: 900; font-size: 20px; letter-spacing: .02em; }
.sp-nav { flex: 1 1 auto; min-width: 0; }
.sp-nav-spacer { flex: 1 1 auto; }
.sp-nav__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px; }
.sp-nav__list > li { position: relative; }
.sp-nav__list a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; color: var(--sp-header-nav); text-decoration: none; font-weight: 600; font-size: 14px; border-radius: var(--sp-r); }
.sp-nav__list a:hover, .sp-nav__list .current-menu-item > a { color: var(--sp-header-text); background: var(--sp-header-hover, rgba(255,255,255,.08)); }
.sp-nav__list .sub-menu { display: none; position: absolute; top: 100%; left: 0; min-width: 200px; list-style: none; margin: 0; padding: 6px; background: var(--sp-header); border: 1px solid rgba(255,255,255,.12); border-radius: var(--sp-r); box-shadow: 0 16px 40px -12px rgba(0,0,0,.6); }
.sp-nav__list li:hover > .sub-menu, .sp-nav__list li:focus-within > .sub-menu { display: block; }
.sp-nav__list .sub-menu a { display: flex; }
.sp-nav__list .menu-item-has-children > a::after { content: ''; width: 6px; height: 6px; margin-left: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); }
.sp-header__actions { display: flex; gap: 8px; flex: none; }
.sp-header .sp-btn--outline { border-color: var(--sp-header-muted); color: var(--sp-header-text); }
.sp-burger { display: none; width: 44px; height: 44px; border: 0; border-radius: var(--sp-r); background: rgba(255,255,255,.08); color: var(--sp-header-text); cursor: pointer; align-items: center; justify-content: center; flex: none; }

/* ---------- Иконочное меню ---------- */
.sp-iconnav { background: var(--sp-surface); border-bottom: 1px solid var(--sp-border); }
.sp-iconnav__row { display: flex; gap: 8px; padding-top: 8px; padding-bottom: 8px; overflow-x: auto; scrollbar-width: thin; }
.sp-iconnav__item {
	flex: none; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
	min-width: 84px; min-height: 60px; padding: 6px 10px; border-radius: 10px;
	background: var(--sp-surface-2); color: var(--sp-text); text-decoration: none; font-size: 12px; font-weight: 700; text-align: center;
}
.sp-iconnav__item .sp-icon { color: var(--sp-accent); }
.sp-iconnav__item.is-current { background: var(--sp-cta); color: var(--sp-cta-text); }
.sp-iconnav__item.is-current .sp-icon { color: var(--sp-cta-text); }

/* ---------- Мобильное меню ---------- */
.sp-drawer { position: fixed; inset: 0; z-index: 200; }
.sp-drawer[hidden] { display: none; }
.sp-drawer__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.55); }
.sp-drawer__panel {
	position: absolute; top: 0; left: 0; bottom: 0; width: min(320px, 86vw);
	background: var(--sp-header); color: var(--sp-header-text);
	padding: 14px 16px 24px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px;
	animation: sp-slide .2s ease-out;
}
@keyframes sp-slide { from { transform: translateX(-100%); } to { transform: none; } }
.sp-drawer__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.sp-drawer__close { width: 44px; height: 44px; border: 0; border-radius: var(--sp-r); background: rgba(255,255,255,.08); color: inherit; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.sp-drawer__items { display: flex; flex-direction: column; }
.sp-drawer__item { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 10px; border-radius: var(--sp-r); color: var(--sp-header-text); text-decoration: none; font-weight: 700; font-size: 15px; }
.sp-drawer__item .sp-icon { color: var(--sp-accent); }
.sp-drawer__item.is-current { background: rgba(255,255,255,.08); }
.sp-drawer__menu { list-style: none; margin: 0; padding: 8px 0 0; border-top: 1px solid rgba(255,255,255,.12); }
.sp-drawer__menu a { display: flex; align-items: center; min-height: 44px; padding: 0 10px; color: var(--sp-header-nav); text-decoration: none; font-weight: 600; }
.sp-drawer__menu .sub-menu { list-style: none; padding-left: 14px; }
.sp-drawer__note { margin: auto 0 0; padding-top: 12px; font-size: 12px; color: var(--sp-header-nav); }
.sp-drawer .sp-btn--outline { border-color: var(--sp-header-muted); color: var(--sp-header-text); }
body.sp-drawer-open { overflow: hidden; }

/* ---------- Страница ---------- */
.sp-page { padding-top: 20px; padding-bottom: 64px; }
.sp-page__title { margin-bottom: 12px; }
.sp-page__meta { font-size: 13px; color: var(--sp-muted); }
.sp-crumbs ol { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 13px; color: var(--sp-muted); }
.sp-crumbs li + li::before { content: '›'; margin-right: 8px; }
.sp-crumbs a { color: var(--sp-muted); text-decoration: none; }
.sp-crumbs a:hover { color: var(--sp-text); }

/* Контент Gutenberg */
.sp-content > * + * { margin-top: 0; }
.sp-content > .sp-block { margin-bottom: 56px; }
.sp-content > .sp-block:last-child { margin-bottom: 0; }
.sp-content > p + .sp-block, .sp-content > ul + .sp-block, .sp-content > ol + .sp-block, .sp-content > figure + .sp-block, .sp-content > .sp-table-scroll + .sp-block { margin-top: 40px; }
.sp-content > .sp-block + h2 { margin-top: 0; }
.sp-content > h2 { margin-top: 48px; }
.sp-section { margin: 0 0 40px; }
.sp-section > h2 { margin-top: 0; }
.sp-section > p, .sp-section > ul, .sp-section > ol { color: var(--sp-muted); font-size: 16px; line-height: 1.7; }
.sp-section > ul, .sp-section > ol { padding-left: 22px; margin: 0 0 1.2em; }
.sp-section > ul li::marker, .sp-section > ol li::marker { color: var(--sp-accent); }
.sp-section > .sp-block { margin: 28px 0; }
.sp-section > *:last-child { margin-bottom: 0; }
.sp-content > h3 { margin-top: 28px; }
.sp-content > p, .sp-content > ul, .sp-content > ol { color: var(--sp-muted); font-size: 16px; line-height: 1.7; }
.sp-content > p strong, .sp-content li strong { color: var(--sp-text); }
.sp-content > ul, .sp-content > ol, .sp-content .wp-block-list { padding-left: 22px; margin: 0 0 1.2em; }
.sp-content > ul li, .sp-content > ol li, .sp-content .wp-block-list li { margin-bottom: 6px; }
.sp-content > ul li::marker, .sp-content > ol li::marker, .sp-content .wp-block-list li::marker { color: var(--sp-accent); }
.sp-content .wp-block-image { margin: 0 0 1.5em; }
.sp-content .wp-block-image img { border-radius: var(--sp-r-lg); }
.sp-content .wp-block-image figcaption { font-size: 13px; color: var(--sp-muted); text-align: center; margin-top: 6px; }
.sp-content blockquote { margin: 0 0 1.5em; padding: 16px 20px; background: var(--sp-surface); border: 1px solid var(--sp-border); border-radius: var(--sp-r-lg); }
.sp-content hr { border: 0; border-top: 1px solid var(--sp-border); margin: 32px 0; }
.sp-content .wp-block-buttons { margin-bottom: 1.2em; }
.sp-content .wp-block-button__link { border-radius: var(--sp-r); background: var(--sp-cta); color: var(--sp-cta-text); font-weight: 800; padding: 14px 24px; }

/* Таблицы (core/table) */
.sp-table-scroll { overflow-x: auto; margin: 0 0 1.5em; border: 1px solid var(--sp-border); border-radius: var(--sp-r-lg); -webkit-overflow-scrolling: touch; }
.sp-table-scroll .wp-block-table { margin: 0; }
.sp-content table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 14px; background: var(--sp-surface); }
.sp-content th, .sp-content td { padding: 12px 16px; text-align: left; border: 0; border-top: 1px solid var(--sp-border); vertical-align: top; }
.sp-content thead th { background: var(--sp-surface-2); border-top: 0; font-weight: 800; }
.sp-content tbody tr:first-child td { border-top: 0; }
.sp-content thead + tbody tr:first-child td { border-top: 1px solid var(--sp-border); }
.sp-content td:first-child { font-weight: 700; }
.sp-content .wp-block-table figcaption { font-size: 13px; color: var(--sp-muted); padding: 8px 16px; }

/* ---------- Инфо-страница ---------- */
.sp-info { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.sp-info__side { flex: 1 1 240px; background: var(--sp-surface); border: 1px solid var(--sp-border); border-radius: var(--sp-r-lg); padding: 10px; }
.sp-info__menu { list-style: none; margin: 0; padding: 0; }
.sp-info__menu a { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: var(--sp-r); color: var(--sp-text); text-decoration: none; font-weight: 700; font-size: 14px; }
.sp-info__menu .current-menu-item > a { background: var(--sp-surface-2); color: var(--sp-accent); }
.sp-info__body { flex: 999 1 600px; min-width: 0; }

/* ---------- 404 ---------- */
.sp-404 { padding-top: 56px; padding-bottom: 80px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.sp-404__code { font-family: var(--sp-font-head); font-weight: 900; font-size: clamp(96px, 16vw, 180px); line-height: 1; color: var(--sp-accent); letter-spacing: -.04em; }
.sp-404__text { color: var(--sp-muted); max-width: 520px; }
.sp-404__links { width: 100%; max-width: 900px; margin-top: 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.sp-404__links .sp-drawer__item { background: var(--sp-surface); border: 1px solid var(--sp-border); border-radius: var(--sp-r-lg); color: var(--sp-text); justify-content: center; min-height: 64px; }

/* ---------- Список записей ---------- */
.sp-posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-bottom: 32px; }
.sp-post-card { background: var(--sp-surface); border: 1px solid var(--sp-border); border-radius: var(--sp-r-lg); overflow: hidden; }
.sp-post-card__body { padding: 16px; }
.sp-post-card__title { font-size: 18px; margin-bottom: 6px; }
.sp-post-card__title a { color: var(--sp-text); text-decoration: none; }
.sp-post-card p { color: var(--sp-muted); font-size: 14px; margin: 0; }
.nav-links { display: flex; gap: 6px; flex-wrap: wrap; }
.nav-links .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 10px; border-radius: var(--sp-r); background: var(--sp-surface); border: 1px solid var(--sp-border); color: var(--sp-text); text-decoration: none; }
.nav-links .current { background: var(--sp-cta); color: var(--sp-cta-text); border-color: var(--sp-cta); }

/* ---------- Подвал ---------- */
.sp-footer { background: var(--sp-footer, var(--sp-header)); color: var(--sp-footer-text, var(--sp-header-nav)); margin-top: 24px; }
.sp-footer__inner { padding-top: 36px; padding-bottom: 36px; display: flex; flex-direction: column; gap: 24px; }
.sp-footer__top { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; align-items: center; }
.sp-footer__menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; }
.sp-footer__menu a { color: var(--sp-footer-text, var(--sp-header-nav)); text-decoration: none; font-size: 14px; min-height: 32px; display: inline-flex; align-items: center; }
.sp-footer__menu a:hover { color: var(--sp-footer-hover, var(--sp-header-text)); }
.sp-footer__pay { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.sp-footer__pay li { height: 36px; min-width: 64px; padding: 6px 10px; border-radius: 6px; background: rgba(255,255,255,.08); display: flex; align-items: center; justify-content: center; }
.sp-footer__pay img { max-height: 24px; width: auto; }
.sp-footer__bottom { border-top: 1px solid rgba(255,255,255,.14); padding-top: 18px; display: flex; gap: 14px; align-items: flex-start; font-size: 12px; line-height: 1.6; }
.sp-footer__legal p { margin: 0 0 6px; }
.sp-badge18 { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 2px solid currentColor; display: inline-flex; align-items: center; justify-content: center; font-weight: 900; font-size: 13px; }

/* ---------- Липкая панель (мобильная) ---------- */
.sp-sticky { display: none; }

/* ---------- Пустой блок в редакторе ---------- */
.sp-empty { padding: 18px; border: 2px dashed var(--sp-border); border-radius: var(--sp-r-lg); color: var(--sp-muted); font-size: 14px; text-align: center; display: flex; flex-direction: column; gap: 4px; }
.sp-empty b { color: var(--sp-text); font-size: 15px; }


/* ---------- Варианты шапки ---------- */
.sp-header-sticky .sp-header { position: sticky; top: var(--wp-admin--admin-bar--height, 0px); background: color-mix(in srgb, var(--sp-header) 80%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid color-mix(in srgb, var(--sp-header-text) 10%, transparent); }
.sp-header-capsule .sp-header { position: sticky; top: calc(var(--wp-admin--admin-bar--height, 0px) + 10px); background: transparent; padding: 10px 12px 0; }
.sp-header-capsule .sp-header__row { max-width: calc(var(--sp-container) - 16px); background: var(--sp-header); border: 1px solid color-mix(in srgb, var(--sp-header-text) 12%, transparent); border-radius: 999px; padding: 6px 8px 6px 20px; min-height: 60px; box-shadow: 0 14px 40px -14px rgba(0,0,0,.55); }
.sp-header-capsule .sp-header .sp-btn { border-radius: 999px; }
.sp-header-capsule .sp-iconnav { margin-top: 10px; }
@media (max-width: 1023px) { .sp-header-capsule .sp-header__row { padding-left: 8px; } }

/* ---------- Варианты футера ---------- */
.sp-footer-center .sp-footer__top, .sp-footer-center .sp-footer__bottom { flex-direction: column; align-items: center; text-align: center; }
.sp-footer-center .sp-footer__menu, .sp-footer-center .sp-footer__pay { justify-content: center; }
.sp-footer-compact .sp-footer__inner { padding-top: 22px; padding-bottom: 22px; gap: 14px; }
.sp-footer-compact .sp-footer__pay { display: none; }
.sp-footer-compact .sp-footer__bottom { padding-top: 12px; }

/* ---------- Дата обновления ---------- */
.sp-updated { margin: 32px 0 0; font-size: 13px; color: var(--sp-muted); }

/* ==========================================================================
   Адаптив
   ========================================================================== */
@media (max-width: 1023px) {
	.sp-nav { display: none; }
	.sp-nav-spacer { display: block; }
	.sp-burger { display: inline-flex; }
	.sp-header__row { gap: 10px; }
	.sp-header__actions { margin-left: auto; }
}
@media (max-width: 767px) {
	.sp-hdr-btn:not(.sp-hdr-btn--main) { display: none; }
	.sp-header__row { min-height: 56px; padding-top: 8px; padding-bottom: 8px; }
	.sp-logo__img { max-height: 36px; width: min(var(--sp-logo-w), 120px); }
	.sp-iconnav__item { min-width: 72px; min-height: 56px; font-size: 11px; }
	.sp-content > .sp-block { margin-bottom: 40px; }
	.sp-btn { white-space: normal; }

	body.sp-has-sticky { padding-bottom: 76px; }
	.sp-sticky {
		position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
		display: flex; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
		background: var(--sp-header); box-shadow: 0 -8px 24px rgba(0,0,0,.35);
		transform: translateY(110%); transition: transform .25s ease;
	}
	.sp-sticky.is-visible { transform: none; }
	.sp-sticky .sp-btn { flex: 1 1 0; min-height: 50px; }
	.sp-sticky .sp-btn--cta { flex-grow: 2; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.sp-btn, .sp-sticky, .sp-drawer__panel { transition: none; animation: none; }
}

/* ---------- Подсказка администратору ---------- */
.sp-admin-hint { position: fixed; left: 12px; bottom: 12px; z-index: 300; max-width: 360px; padding: 12px 14px; border-radius: 10px; background: #fff7d6; color: #3d2f00; font-size: 13px; line-height: 1.45; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.sp-admin-hint a { color: #6b4e00; font-weight: 700; }
.sp-admin-hint ul { margin: 6px 0 0; padding-left: 18px; }
body.sp-has-sticky .sp-admin-hint { bottom: 90px; }
