/*
Theme Name: Helpermedia
Description: Тема сообщества Helpermedia.ru. Работает в связке с плагином HelperMedia Core.
Author: Дмитрий
Version: 1.0.0
Text Domain: helpermedia
*/

:root {
	--hm-bg: #ffffff;
	--hm-black: #1a1a1a;
	--hm-orange: #ff6a00;
	--hm-orange-light: #ff8a33;
	--hm-gray: #6b6b6b;
	--hm-border: #e8e8e8;
	--hm-radius: 12px;
	--hm-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

/*
 * Это базовый файл-заглушка для этапа 1 — переменные акцентов уже заданы
 * (фон белый, чёрный + оранжевый), полная вёрстка колонок и карточек
 * будет добавлена на этапе 2 (дизайн-система) и этапе 3 (лента постов).
 */

* { box-sizing: border-box; }

body {
	font-family: var( --hm-font );
	background: var( --hm-bg );
	color: var( --hm-black );
	margin: 0;
}

a {
	color: inherit;
	text-decoration: none;
}

/* ===================== ШАПКА ===================== */

.hm-header {
	background: var( --hm-bg );
	border-bottom: 1px solid var( --hm-border );
	position: sticky;
	top: 0;
	z-index: 100;
}

.hm-header-inner {
	max-width: 1280px;
	margin: 0 auto;
	padding: 12px 20px;
	display: flex;
	align-items: center;
	gap: 24px;
}

.hm-logo {
	display: flex;
	align-items: center;
	flex-shrink: 0;
}

.hm-logo img {
	display: block;
}

.hm-logo-text {
	font-weight: 800;
	font-size: 22px;
	color: var( --hm-black );
}

.hm-logo-text::after {
	content: '';
}

.hm-nav-desktop {
	flex: 1;
}

.hm-nav-list {
	list-style: none;
	display: flex;
	gap: 28px;
	margin: 0;
	padding: 0;
}

.hm-nav-list a {
	font-weight: 600;
	font-size: 15px;
	color: var( --hm-black );
	padding: 8px 0;
	border-bottom: 2px solid transparent;
	transition: border-color .15s ease, color .15s ease;
}

.hm-nav-list a:hover,
.hm-nav-list li.current-menu-item a {
	color: var( --hm-orange );
	border-bottom-color: var( --hm-orange );
}

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

.hm-btn-publish-desktop {
	background: var( --hm-orange );
	color: #fff;
	font-weight: 700;
	font-size: 14px;
	padding: 10px 18px;
	border-radius: 999px;
	white-space: nowrap;
	transition: background .15s ease;
}

.hm-btn-publish-desktop:hover {
	background: #e05f00;
}

.hm-publish-cross-mobile {
	display: none;
	color: var( --hm-black );
}

.hm-menu-toggle {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 32px;
	height: 32px;
	background: none;
	border: none;
	cursor: pointer;
	padding: 0;
}

.hm-menu-toggle span {
	display: block;
	height: 2px;
	width: 100%;
	background: var( --hm-black );
	border-radius: 2px;
}

/* ===================== МОБИЛЬНОЕ МЕНЮ ===================== */

.hm-mobile-menu-overlay {
	position: fixed;
	inset: 0;
	background: rgba( 0, 0, 0, .4 );
	opacity: 0;
	visibility: hidden;
	transition: opacity .2s ease;
	z-index: 150;
}

.hm-mobile-menu-overlay.is-open {
	opacity: 1;
	visibility: visible;
}

.hm-mobile-menu {
	position: fixed;
	top: 0;
	right: 0;
	height: 100%;
	width: min( 280px, 80vw );
	background: var( --hm-bg );
	border-left: 1px solid var( --hm-border );
	transform: translateX( 100% );
	transition: transform .2s ease;
	z-index: 200;
	padding: 24px 20px;
	overflow-y: auto;
}

.hm-mobile-menu.is-open {
	transform: translateX( 0 );
}

.hm-mobile-nav-list {
	list-style: none;
	margin: 0 0 20px;
	padding: 0;
}

.hm-mobile-nav-list li {
	border-bottom: 1px solid var( --hm-border );
}

.hm-mobile-nav-list a {
	display: block;
	padding: 14px 4px;
	font-weight: 600;
	font-size: 16px;
	color: var( --hm-black );
}

.hm-mobile-publish {
	display: block;
	text-align: center;
	background: var( --hm-orange );
	color: #fff;
	font-weight: 700;
	padding: 12px;
	border-radius: 999px;
	margin-top: 12px;
}

body.hm-menu-open {
	overflow: hidden;
}

/* ===================== ХЛЕБНЫЕ КРОШКИ ===================== */

.hm-breadcrumbs-wrap {
	max-width: 1280px;
	margin: 0 auto;
	padding: 14px 20px 0;
}

.hm-breadcrumbs ol {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0;
	padding: 0;
	font-size: 13px;
	color: var( --hm-gray );
}

.hm-breadcrumbs li {
	display: flex;
	align-items: center;
	gap: 6px;
}

.hm-breadcrumbs a:hover {
	color: var( --hm-orange );
}

.hm-breadcrumbs-sep {
	color: var( --hm-border );
}

/* ===================== ПОДВАЛ ===================== */

.hm-footer {
	background: var( --hm-black );
	color: #fff;
	margin-top: 60px;
}

.hm-footer-inner {
	max-width: 1280px;
	margin: 0 auto;
	padding: 28px 20px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.hm-footer .hm-logo-text {
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	opacity: .8;
}

.hm-footer-nav-list {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	margin: 0;
	padding: 0;
}

.hm-footer-nav-list a {
	color: #fff;
	opacity: .8;
	font-size: 14px;
}

.hm-footer-nav-list a:hover {
	opacity: 1;
	color: var( --hm-orange-light );
}

/* ===================== КНОПКА "НАВЕРХ" ===================== */

.hm-back-to-top {
	position: fixed;
	right: 20px;
	bottom: 20px;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var( --hm-black );
	color: #fff;
	border: none;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	opacity: 0;
	visibility: hidden;
	transform: translateY( 8px );
	transition: opacity .2s ease, transform .2s ease, background .15s ease;
	z-index: 90;
}

.hm-back-to-top.is-visible {
	opacity: 1;
	visibility: visible;
	transform: translateY( 0 );
}

.hm-back-to-top:hover {
	background: var( --hm-orange );
}

/* ===================== АДАПТИВ ===================== */

@media ( max-width: 860px ) {
	.hm-nav-desktop,
	.hm-btn-publish-desktop {
		display: none;
	}

	.hm-publish-cross-mobile {
		display: inline-flex;
	}

	.hm-menu-toggle {
		display: flex;
	}
}
