/* ============================================================================
   footer-l2.css — стили подвала apmo.ru.

   Подключается addString'ом из header.php всех 5 шаблонов, минуя
   Bitrix-композитор (см. RAM.md грабля §7).

   ВАЖНО: палитра light, согласована с lk-header-bundle/header-l2.css —
   та же поверхность (--lk-c-surface), тот же primary (#0051AC), те же
   тени/радиусы, та же 180ms-анимация. Все цвета через var(--lk-*, fallback),
   что бы CSS работал даже без подключённого lk-tokens.css (см. RAM.md §7).

   Структура:
     §1 — корневой контейнер .footer.footer--v2
     §2 — карта сайта .lk-footer-nav
     §3 — контакты .lk-footer-contacts
     §4 — соцсети + подписка .lk-footer-meta
     §5 — реквизиты-обёртка .lk-footer-content
     §6 — bottom-bar + theme toggle
     §7 — кнопка «Наверх»
     §8 — мобильные брейкпоинты (1279/1023/767/479 — как в header-l2.css)
     §9 — dark-mode (data-theme="dark") — покрытие только подвала
     §10 — RU/EN-фрагменты, prefers-reduced-motion
   ============================================================================ */

/* ──────────────────────────────────────────────────────────────────────── *
 * §1. Корневой контейнер: light surface-2 fill, скрытие старой 4-колонной
 *     разметки .footer__content (на случай, если какой-то шаблон случайно
 *     подключит legacy footer.php).
 * ──────────────────────────────────────────────────────────────────────── */

.footer.footer--v2 {
	background: var(--lk-c-surface-2, #f8fafc);
	color: var(--lk-c-ink, #1a1a1a);
	border-top: 1px solid var(--lk-c-line, #e0e0e0);
}
.footer.footer--v2 .container {
	display: block;
	padding-top: 32px;
	padding-bottom: 16px;
}
.footer.footer--v2 .footer__content { display: none; }

/* ──────────────────────────────────────────────────────────────────────── *
 * §2. Карта сайта — .lk-footer-nav, .lk-footer-nav__col / __title / __list / __more
 * ──────────────────────────────────────────────────────────────────────── */

.lk-footer-top {
	display: grid;
	grid-template-columns: minmax(0, 1fr) clamp(220px, 22vw, 320px);
	gap: clamp(20px, 3vw, 48px);
	padding-bottom: 24px;
	border-bottom: 1px solid var(--lk-c-line, #e0e0e0);
}

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

.lk-footer-nav__col {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.lk-footer-nav__title,
.lk-footer-nav__title:visited {
	display: inline-block;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--lk-c-ink, #1a1a1a);
	text-decoration: none;
	border-bottom: 1px solid transparent;
	transition: border-color 180ms, color 180ms;
}
.lk-footer-nav__title:hover,
.lk-footer-nav__title:focus,
.lk-footer-nav__title:focus-visible {
	color: var(--lk-c-primary, #0051AC);
	border-bottom-color: var(--lk-c-primary, #0051AC);
	text-decoration: none;
	outline: none;
}

.lk-footer-nav__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.lk-footer-nav__link,
.lk-footer-nav__link:visited {
	display: inline-block;
	font-size: 14px;
	line-height: 1.4;
	color: var(--lk-c-ink-2, #475569);
	text-decoration: none;
	transition: color 180ms;
}
.lk-footer-nav__link:hover,
.lk-footer-nav__link:focus,
.lk-footer-nav__link:focus-visible {
	color: var(--lk-c-primary, #0051AC);
	text-decoration: underline;
	outline: none;
}

.lk-footer-nav__more,
.lk-footer-nav__more:visited {
	margin-top: auto;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 6px 10px;
	font-size: 13px;
	font-weight: 600;
	color: var(--lk-c-primary, #0051AC);
	text-decoration: none;
	border-radius: var(--lk-r-sm, 8px);
	transition: background-color 180ms, gap 180ms, color 180ms;
}
.lk-footer-nav__more:hover,
.lk-footer-nav__more:focus,
.lk-footer-nav__more:focus-visible {
	background: var(--lk-c-primary-50, #E8F0FB);
	color: var(--lk-c-primary, #0051AC);
	gap: 8px;
	text-decoration: none;
	outline: none;
}
.lk-footer-nav__more .lk-ico {
	width: 14px;
	height: 14px;
	background-color: currentColor;
}

/* ──────────────────────────────────────────────────────────────────────── *
 * §3. Контакты
 * ──────────────────────────────────────────────────────────────────────── */

.lk-footer-contacts {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.lk-footer-contacts__title {
	font-size: 15px;
	font-weight: 600;
	color: var(--lk-c-ink, #1a1a1a);
}
.lk-footer-contacts__body {
	font-size: 14px;
	line-height: 1.5;
	color: var(--lk-c-ink-2, #475569);
}
.lk-footer-contacts__body a,
.lk-footer-contacts__body a:visited {
	color: var(--lk-c-primary, #0051AC);
	text-decoration: none;
	border-bottom: 1px dotted currentColor;
	transition: color 180ms;
}
.lk-footer-contacts__body a:hover,
.lk-footer-contacts__body a:focus {
	color: var(--lk-c-primary-700, #003D80);
	outline: none;
}
.lk-footer-contacts__body p { margin: 0 0 6px; }

/* ──────────────────────────────────────────────────────────────────────── *
 * §4. Соцсети + подписка — стиль 40×40 кнопок как в .lk-topbar__more-btn /
 *     .lk-topbar__search-btn (header-l2.css §4-5).
 * ──────────────────────────────────────────────────────────────────────── */

.lk-footer-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px 24px;
	padding: 18px 0;
	border-bottom: 1px solid var(--lk-c-line, #e0e0e0);
}

.lk-footer-socials {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}
.lk-footer-socials__item,
.lk-footer-socials__item:visited {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	background: var(--lk-c-primary-50, #E8F0FB);
	border: 1px solid transparent;
	border-radius: var(--lk-r-sm, 8px);
	color: var(--lk-c-primary, #0051AC);
	text-decoration: none;
	transition: background-color 180ms, color 180ms, transform 180ms, border-color 180ms;
}
.lk-footer-socials__item:hover,
.lk-footer-socials__item:focus,
.lk-footer-socials__item:focus-visible {
	background: var(--lk-c-primary, #0051AC);
	border-color: var(--lk-c-primary, #0051AC);
	color: #ffffff;
	transform: translateY(-1px);
	text-decoration: none;
	outline: none;
}
.lk-footer-socials__item .lk-ico {
	width: 18px;
	height: 18px;
	background-color: currentColor;
}

.lk-footer-subscribe {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: var(--lk-c-ink-2, #475569);
}
.lk-footer-subscribe__link,
.lk-footer-subscribe__link:visited {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--lk-c-primary, #0051AC);
	text-decoration: none;
	border-bottom: 1px dotted currentColor;
	transition: color 180ms;
}
.lk-footer-subscribe__link:hover,
.lk-footer-subscribe__link:focus {
	color: var(--lk-c-primary-700, #003D80);
	outline: none;
}
.lk-footer-subscribe__link .lk-ico {
	width: 14px;
	height: 14px;
	background-color: currentColor;
}

/* ──────────────────────────────────────────────────────────────────────── *
 * §4b. Обязательные ресурсы (ФПА, АГ, Минюст МО)
 * ──────────────────────────────────────────────────────────────────────── */

.lk-footer-partners {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 16px;
	padding: 14px 0;
	border-bottom: 1px solid var(--lk-c-line, #e0e0e0);
	font-size: 13px;
}
.lk-footer-partners__title {
	font-weight: 600;
	color: var(--lk-c-ink-2, #475569);
	flex-shrink: 0;
}
.lk-footer-partners__list {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 14px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.lk-footer-partners__link,
.lk-footer-partners__link:visited {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	color: var(--lk-c-primary, #0051AC);
	text-decoration: none;
	transition: color 180ms;
}
.lk-footer-partners__link:hover,
.lk-footer-partners__link:focus,
.lk-footer-partners__link:focus-visible {
	color: var(--lk-c-primary-700, #003D80);
	text-decoration: underline;
	outline: none;
}
.lk-footer-partners__link .lk-ico {
	width: 12px;
	height: 12px;
	background-color: currentColor;
	opacity: 0.65;
}

/* ──────────────────────────────────────────────────────────────────────── *
 * §5. Реквизиты-обёртка
 * ──────────────────────────────────────────────────────────────────────── */

.lk-footer-content {
	padding: 16px 0;
	font-size: 12px;
	line-height: 1.5;
	color: var(--lk-c-ink-2, #475569);
	border-bottom: 1px solid var(--lk-c-line, #e0e0e0);
}
.lk-footer-content :where(p, div) { margin: 0 0 6px; }
.lk-footer-content a,
.lk-footer-content a:visited {
	color: var(--lk-c-primary, #0051AC);
	text-decoration: none;
}
.lk-footer-content a:hover { text-decoration: underline; }

/* ──────────────────────────────────────────────────────────────────────── *
 * §6. Bottom-bar + theme toggle.
 *     Theme toggle — та же 40×40 кнопка, что и .lk-topbar__search-btn
 *     (тот же hover-state aria-expanded="true" → primary-50 fill).
 * ──────────────────────────────────────────────────────────────────────── */

.lk-footer-bottom {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 0 4px;
	font-size: 12px;
	color: var(--lk-c-ink-2, #475569);
}
.lk-footer-bottom__copy {
	flex-shrink: 0;
}
.lk-footer-bottom__policy,
.lk-footer-bottom__policy:visited {
	color: var(--lk-c-ink-2, #475569);
	text-decoration: none;
	border-bottom: 1px dotted currentColor;
	transition: color 180ms, border-color 180ms;
}
.lk-footer-bottom__policy:hover,
.lk-footer-bottom__policy:focus,
.lk-footer-bottom__policy:focus-visible {
	color: var(--lk-c-primary, #0051AC);
	border-color: var(--lk-c-primary, #0051AC);
	outline: none;
}

.lk-footer-theme-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 1px solid var(--lk-c-line, #e0e0e0);
	border-radius: var(--lk-r-sm, 8px);
	background: transparent;
	color: var(--lk-c-ink-2, #475569);
	cursor: pointer;
	transition: background-color 180ms, color 180ms, border-color 180ms;
	-webkit-tap-highlight-color: transparent;
}
.lk-footer-theme-toggle:hover,
.lk-footer-theme-toggle:focus,
.lk-footer-theme-toggle:focus-visible {
	background: var(--lk-c-primary-50, #E8F0FB);
	color: var(--lk-c-primary, #0051AC);
	border-color: var(--lk-c-primary-50, #E8F0FB);
	outline: none;
}
.lk-footer-theme-toggle .lk-ico {
	width: 18px;
	height: 18px;
	background-color: currentColor;
}
.lk-footer-theme-toggle__sun  { display: none; }
.lk-footer-theme-toggle__moon { display: inline-block; }
[data-theme="dark"] .lk-footer-theme-toggle__moon { display: none; }
[data-theme="dark"] .lk-footer-theme-toggle__sun  { display: inline-block; }

/* ──────────────────────────────────────────────────────────────────────── *
 * §7. Кнопка «Наверх» — primary CTA, тот же стиль что .lk-topbar__cta.
 *     z-index 50 — выше dropdowns header'а (40), ниже search-panel (60).
 * ──────────────────────────────────────────────────────────────────────── */

.lk-totop {
	position: fixed;
	right: 20px;
	bottom: 20px;
	width: 44px;
	height: 44px;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: 50%;
	background: var(--lk-c-primary, #0051AC);
	color: #ffffff;
	box-shadow: var(--lk-sh-2, 0 4px 12px rgba(15, 23, 42, .15));
	cursor: pointer;
	opacity: 0;
	transform: translateY(8px);
	transition: opacity 180ms, transform 180ms, background-color 180ms, box-shadow 180ms;
	z-index: 50;
	-webkit-tap-highlight-color: transparent;
}
.lk-totop[hidden] { display: none !important; }
.lk-totop.is-visible {
	opacity: 1;
	transform: translateY(0);
}
.lk-totop:hover,
.lk-totop:focus,
.lk-totop:focus-visible {
	background: var(--lk-c-primary-700, #003D80);
	box-shadow: var(--lk-sh-3, 0 12px 32px rgba(15, 23, 42, .14));
	transform: translateY(-2px);
	outline: none;
}
.lk-totop .lk-ico {
	width: 22px;
	height: 22px;
	background-color: currentColor;
}

/* Прячем legacy-кнопку .totop, если она ещё где-то рендерится. */
.totop { display: none !important; }

/* ──────────────────────────────────────────────────────────────────────── *
 * §8. Мобильные брейкпоинты — те же пороги, что в header-l2.css (1279/1023/767).
 * ──────────────────────────────────────────────────────────────────────── */

@media (max-width: 1279px) {
	.lk-footer-top { grid-template-columns: 1fr; }
	.lk-footer-contacts { order: 2; }
}

@media (max-width: 1023px) {
	.lk-footer-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
	.footer.footer--v2 .container { padding-top: 24px; padding-bottom: 12px; }
	.lk-footer-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 14px; }
	.lk-footer-meta { flex-direction: column; align-items: flex-start; gap: 12px; }
	.lk-footer-bottom { flex-direction: column; align-items: flex-start; gap: 10px; }
	.lk-totop { right: 12px; bottom: 12px; width: 40px; height: 40px; }
	.lk-totop .lk-ico { width: 20px; height: 20px; }
}

@media (max-width: 479px) {
	.lk-footer-nav { grid-template-columns: 1fr; gap: 12px; }
	.lk-footer-nav__list { gap: 4px; }
}

/* ──────────────────────────────────────────────────────────────────────── *
 * §9. Dark-mode (data-theme="dark"). Покрытие — только подвал.
 *     Расширение на всю страницу — отдельная фаза lk-theme-bundle.
 * ──────────────────────────────────────────────────────────────────────── */

[data-theme="dark"] .footer.footer--v2 {
	background: #0d1117;
	color: #d6dee9;
	border-top-color: rgba(255,255,255,0.08);
}
[data-theme="dark"] .lk-footer-top,
[data-theme="dark"] .lk-footer-meta,
[data-theme="dark"] .lk-footer-content {
	border-bottom-color: rgba(255,255,255,0.08);
}
[data-theme="dark"] .lk-footer-nav__title,
[data-theme="dark"] .lk-footer-contacts__title { color: #ffffff; }
[data-theme="dark"] .lk-footer-nav__link,
[data-theme="dark"] .lk-footer-contacts__body,
[data-theme="dark"] .lk-footer-content,
[data-theme="dark"] .lk-footer-bottom,
[data-theme="dark"] .lk-footer-subscribe { color: #b3bdcc; }
[data-theme="dark"] .lk-footer-socials__item {
	background: rgba(255,255,255,0.06);
	color: #e6ecf5;
}
[data-theme="dark"] .lk-footer-socials__item:hover,
[data-theme="dark"] .lk-footer-socials__item:focus {
	background: var(--lk-c-primary, #0051AC);
	color: #ffffff;
}
[data-theme="dark"] .lk-footer-theme-toggle {
	border-color: rgba(255,255,255,0.16);
	color: #b3bdcc;
}
[data-theme="dark"] .lk-footer-theme-toggle:hover {
	background: rgba(255,255,255,0.06);
	color: #ffffff;
	border-color: rgba(255,255,255,0.24);
}

/* ──────────────────────────────────────────────────────────────────────── *
 * §10. RU/EN-фрагменты + reduced-motion. Совпадает с header-l2.css §9, §12.
 * ──────────────────────────────────────────────────────────────────────── */

#lngs, .lngs { display: none !important; }

@media (prefers-reduced-motion: reduce) {
	.lk-footer-nav__title,
	.lk-footer-nav__link,
	.lk-footer-nav__more,
	.lk-footer-socials__item,
	.lk-footer-theme-toggle,
	.lk-totop {
		transition: none;
	}
	.lk-footer-nav__more:hover,
	.lk-footer-socials__item:hover,
	.lk-totop:hover {
		transform: none;
	}
	.lk-totop.is-visible { transform: none; }
}
