/* ============================================
   БАЗОВЫЕ СТИЛИ И ПЕРЕМЕННЫЕ
   ============================================ */

:root {
	--bg: #ffffff;
	--text: #111111;
	--accent: #1a73e8;
	--border: rgba(0, 0, 0, 0.06);
}

html.dark {
	--bg: #1a1a1a;
	--text: #ffffff;
	--accent: #1a73e8;
	--border: rgba(255, 255, 255, 0.1);
}

*,
*:after,
*:before {
	box-sizing: border-box;
}

/* Контейнер */
.container {
	max-width: 1280px;
	margin: 0 auto;
	padding: 0 24px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
}

/* Базовые стили header */
.header {
	position: sticky;
	top: 0;
	z-index: 1000;
	background: var(--bg);
	transition: background-color 150ms, color 150ms;
}

.header--not-sticky {
	position: static;
}

/* Логотип */
.logo {
	font-weight: 400;
	letter-spacing: 0.02em;
	text-decoration: none;
	color: var(--text);
	display: flex;
	align-items: center;
	flex-shrink: 0;
}

.logo img {
	display: block;
	height: auto;
	max-width: 200px;
	width: auto;
}

.header .logo img.logo-light {
	display: block;
}

.header .logo img.logo-dark {
	display: none;
}

html.dark .header .logo img.logo-light {
	display: none;
}

html.dark .header .logo img.logo-dark {
	display: block;
}

html.dark .header .logo img.logo-dark:not([src]),
html.dark .header .logo:not(:has(img.logo-dark)) img.logo-light {
	display: block;
}

/* Навигация */
.nav {
	display: flex;
	align-items: center;
	gap: 20px;
	flex-shrink: 0;
}

.nav a {
	text-decoration: none;
	color: var(--text);
	transition: color 150ms, background-color 180ms;
}

.nav a:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 4px;
	border-radius: 4px;
}

/* Кнопка гамбургера */
.mobile-menu-toggle {
	display: none;
	flex-direction: column;
	justify-content: space-around;
	width: 30px;
	height: 30px;
	background: transparent;
	border: none;
	cursor: pointer;
	padding: 0;
	z-index: 1001;
	position: relative;
}

.hamburger-line {
	width: 100%;
	height: 2px;
	background-color: var(--text);
	border-radius: 2px;
	transition: all 0.3s ease;
	transform-origin: center;
}

/* Переопределяем цвет для светлой темы - делаем темным */
.mobile-menu-toggle .hamburger-line {
	background-color: #121212 !important;
}

html.dark .mobile-menu-toggle .hamburger-line {
	background-color: #fff !important;
}

/* Также для активного состояния */
.mobile-menu-toggle.active .hamburger-line:nth-child(1),
.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
	background-color: #121212 !important;
}

html.dark .mobile-menu-toggle.active .hamburger-line:nth-child(1),
html.dark .mobile-menu-toggle.active .hamburger-line:nth-child(3) {
	background-color: #fff !important;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
	transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
	opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
	transform: rotate(-45deg) translate(8px, -8px);
}

/* Кнопка переключения темы */
.theme-toggle {
	background: transparent;
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 160ms;
	color: var(--text);
	padding: 6px;
	border-radius: 10px;
}

.theme-toggle:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

.theme-icon {
	font-size: 1.2rem;
	line-height: 1;
}

/* Overlay для мобильного меню */
.mobile-menu-overlay {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100vh;
	background-color: rgba(0, 0, 0, 0.5);
	z-index: 999;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
	display: block;
	opacity: 1;
}

/* Кастомные кнопки для всех стилей */
.btn--custom {
	color: #fff;
	padding: 8px 14px;
	text-decoration: none;
	font-weight: 600;
	font-size: 0.875rem;
	transition: filter 150ms, opacity 150ms, background-color 150ms;
	border: none;
	cursor: pointer;
	display: inline-block;
}

.btn--custom:hover {
	filter: brightness(0.95);
	opacity: 0.9;
}

.btn--custom:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* Прозрачный фон - цвет текста берется из текущего контекста */
.btn--custom[style*="background-color: transparent"] {
	color: inherit;
}

.btn--custom[style*="background-color: transparent"]:hover {
	opacity: 0.8;
	background-color: rgba(0, 0, 0, 0.05) !important;
}

html.dark .btn--custom[style*="background-color: transparent"]:hover {
	background-color: rgba(255, 255, 255, 0.1) !important;
}
