/* Цветовая палитра по изображению Gemini_Generated_Image_.jpg */
:root {
	--bg-color: #f4eee1;
	--text-dark: #4a332c;
	--accent-blue: #3293c4;
	--accent-light: #56b3e0;
	--white: #ffffff;
	--card-bg: rgba(255, 255, 255, 0.7);
	--border-soft: rgba(74, 51, 44, 0.1);
}

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
	font-family: 'Segoe UI', Roboto, Arial, sans-serif;
}

body {
	background-color: var(--bg-color);
	color: var(--text-dark);
	line-height: 1.6;
}

/* ==================== ШАПКА ==================== */
header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 20px 5%;
	border-bottom: 2px solid var(--border-soft);
	background-color: rgba(244, 238, 225, 0.9);
	position: sticky;
	top: 0;
	z-index: 100;
}

.logo {
	font-size: 26px;
	font-weight: 800;
	letter-spacing: 0.5px;
	color: var(--text-dark);
	text-decoration: none;
	cursor: pointer;
}

.logo span {
	color: var(--accent-blue);
}

nav {
	display: flex;
	align-items: center;
}

nav > a,
nav .dropdown > .dropdown-toggle {
	text-decoration: none;
	color: var(--text-dark);
	margin-left: 25px;
	font-weight: 600;
	transition: color 0.3s;
	cursor: pointer;
}

nav > a:hover,
nav > a.active,
nav .dropdown > .dropdown-toggle:hover,
nav .dropdown > .dropdown-toggle.active {
	color: var(--accent-blue);
}

/* ==================== ВЫПАДАЮЩЕЕ МЕНЮ ==================== */
.dropdown {
	position: relative;
	display: inline-block;
}

.dropdown > .dropdown-toggle {
	margin-left: 0;
	background: none;
	border: none;
	font-size: inherit;
	font-family: inherit;
	padding: 0;
	position: relative;
	display: inline-block;
}

/* Контейнер выпадающего списка */
.dropdown-menu {
	position: absolute;
	top: calc(100% + 14px);
	left: 50%;
	min-width: 230px;
	background: var(--white);
	border-radius: 14px;
	box-shadow:
			0 4px 6px rgba(74, 51, 44, 0.04),
			0 12px 40px rgba(74, 51, 44, 0.12);
	border: 1px solid var(--border-soft);
	padding: 8px;
	margin: 0;
	list-style: none;
	z-index: 200;

	/* Начальное состояние: скрыто */
	opacity: 0;
	visibility: hidden;
	transform: translateX(-50%) translateY(-6px) scale(0.98);
	transform-origin: top center;

	/* Плавная анимация появления */
	transition:
			opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
			visibility 0.35s cubic-bezier(0.16, 1, 0.3, 1),
			transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);

	pointer-events: none;
}

/* Треугольник-указатель сверху */
.dropdown-menu::before {
	content: '';
	position: absolute;
	top: -6px;
	left: 50%;
	transform: translateX(-50%) rotate(45deg);
	width: 12px;
	height: 12px;
	background: var(--white);
	border-left: 1px solid var(--border-soft);
	border-top: 1px solid var(--border-soft);
	border-radius: 2px 0 0 0;
}

/* Невидимый мостик между пунктом и меню, чтобы курсор не терял hover */
.dropdown::after {
	content: '';
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	height: 16px;
}

/* Показ меню при наведении */
.dropdown:hover > .dropdown-menu {
	opacity: 1;
	visibility: visible;
	transform: translateX(-50%) translateY(0) scale(1);
	pointer-events: auto;
}

/* === Пункты меню === */
.dropdown-menu li {
	list-style: none;
	margin: 0;
	padding: 0;
}

.dropdown-menu li a {
	display: block;
	padding: 10px 14px;
	color: var(--text-dark);
	text-decoration: none;
	font-size: 14px;
	font-weight: 500;
	border-radius: 8px;
	transition:
			background-color 0.25s ease,
			color 0.25s ease,
			transform 0.25s ease;
}

.dropdown-menu li a:hover {
	background-color: rgba(50, 147, 196, 0.1);
	color: var(--accent-blue);
}

.dropdown-menu li a:active {
	transform: scale(0.98);
}

/* Разделитель между группами пунктов */
.dropdown-menu .divider {
	height: 1px;
	background: var(--border-soft);
	margin: 6px 10px;
}

/* ==================== ГЛАВНЫЙ КОНТЕЙНЕР ==================== */
.container {
	/*max-width: 1000px;*/
	margin: 40px auto;
	padding: 0 20px;
}

.page-section.active {
	display: block;
}

/* ==================== СЕКЦИЯ 1: БЛОГ ==================== */
.blog-header {
	text-align: center;
	margin-bottom: 40px;
}

.blog-header h1 {
	font-size: 36px;
	margin-bottom: 10px;
}

.blog-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	gap: 30px;
}

.post-card {
	background: var(--white);
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 4px 15px rgba(74, 51, 44, 0.05);
	border: 1px solid rgba(74, 51, 44, 0.05);
	transition: transform 0.3s, box-shadow 0.3s;
}

.post-card:hover {
	transform: translateY(-5px);
	box-shadow: 0 10px 25px rgba(50, 147, 196, 0.15);
}

.post-img {
	height: 180px;
	background: linear-gradient(135deg, var(--accent-blue), var(--text-dark));
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--white);
	font-size: 40px;
}

.post-body {
	padding: 20px;
}

.post-tag {
	color: var(--accent-blue);
	font-size: 11px;
	text-transform: uppercase;
	font-weight: bold;
	letter-spacing: 1px;
	margin-bottom: 8px;
}

.post-title {
	font-size: 18px;
	margin-bottom: 12px;
	font-weight: 700;
}

.post-desc {
	font-size: 14px;
	color: rgba(74, 51, 44, 0.8);
	margin-bottom: 15px;
}

.btn-link {
	color: var(--accent-blue);
	text-decoration: none;
	font-weight: bold;
	font-size: 14px;
	cursor: pointer;
}

.btn-link:hover {
	color: var(--accent-light);
}

/* ==================== СЕКЦИЯ 2: СТРАНИЦА СТАТЬИ ==================== */
.article-container {
	background: var(--white);
	padding: 40px;
	border-radius: 16px;
	box-shadow: 0 4px 20px rgba(74, 51, 44, 0.03);
}

.article-meta {
	display: flex;
	gap: 15px;
	font-size: 13px;
	color: rgba(74, 51, 44, 0.6);
	margin-bottom: 15px;
}

.article-category {
	color: var(--white);
	background: var(--accent-blue);
	padding: 2px 10px;
	border-radius: 20px;
	font-weight: 600;
}

.article-container h1 {
	font-size: 32px;
	line-height: 1.3;
	margin-bottom: 25px;
}

.article-banner {
	height: 300px;
	background: linear-gradient(135deg, #3293c4, #4a332c);
	border-radius: 8px;
	margin-bottom: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--white);
	font-size: 70px;
}

.article-content p {
	margin-bottom: 20px;
	font-size: 16px;
	color: rgba(74, 51, 44, 0.95);
	text-align: justify;
}

.article-content h2 {
	font-size: 22px;
	margin: 35px 0 15px 0;
	border-left: 4px solid var(--accent-blue);
	padding-left: 12px;
}

.article-content ul {
	margin: 0 0 20px 20px;
}

.article-content li {
	margin-bottom: 8px;
	font-size: 15px;
}

.quote-box {
	background-color: var(--bg-color);
	border-left: 4px solid var(--text-dark);
	padding: 20px;
	margin: 25px 0;
	font-style: italic;
	border-radius: 0 8px 8px 0;
}

/* ==================== ПОДВАЛ ==================== */
footer {
	text-align: center;
	padding: 40px;
	margin-top: 60px;
	border-top: 1px solid var(--border-soft);
	font-size: 14px;
	color: rgba(74, 51, 44, 0.6);
}

/* ==================== СЕКЦИЯ 3: ВХОД В ЛК ==================== */
.login-wrapper {
	display: flex;
	justify-content: center;
	align-items: center;
	min-height: 55vh;
}

.login-card {
	background: var(--white);
	padding: 40px;
	border-radius: 16px;
	width: 100%;
	max-width: 420px;
	box-shadow: 0 10px 30px rgba(74, 51, 44, 0.08);
	border: 1px solid rgba(74, 51, 44, 0.05);
}

.login-card h2 {
	text-align: center;
	margin-bottom: 10px;
	color: var(--text-dark);
	font-size: 26px;
}

.login-subtitle {
	text-align: center;
	font-size: 14px;
	color: rgba(74, 51, 44, 0.6);
	margin-bottom: 30px;
}

.form-group {
	margin-bottom: 22px;
}

.form-group label {
	display: block;
	margin-bottom: 6px;
	font-weight: 600;
	font-size: 14px;
	color: var(--text-dark);
}

.form-group input[type="text"],
.form-group input[type="password"] {
	width: 100%;
	padding: 12px 15px;
	border-radius: 8px;
	border: 2px solid rgba(74, 51, 44, 0.1);
	background-color: var(--bg-color);
	font-size: 16px;
	color: var(--text-dark);
	transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus {
	outline: none;
	border-color: var(--accent-blue);
	box-shadow: 0 0 0 3px rgba(50, 147, 196, 0.15);
}

.remember-group {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 25px;
	cursor: pointer;
}

.remember-group input[type="checkbox"] {
	width: 16px;
	height: 16px;
	accent-color: var(--accent-blue);
	cursor: pointer;
}

.remember-group label {
	font-size: 14px;
	font-weight: 500;
	user-select: none;
	cursor: pointer;
}

.login-btn {
	width: 100%;
	padding: 14px;
	background-color: var(--accent-blue);
	color: var(--white);
	border: none;
	border-radius: 8px;
	font-size: 16px;
	font-weight: bold;
	cursor: pointer;
	transition: background-color 0.3s, transform 0.1s;
}

.login-btn:hover {
	background-color: var(--accent-light);
}

.login-btn:active {
	transform: scale(0.98);
}

.form-hint {
	font-size: 12px;
	color: rgba(74, 51, 44, 0.5);
	margin-top: 4px;
}

.form-hint tt {
	background: rgba(74, 51, 44, 0.08);
	padding: 2px 4px;
	border-radius: 4px;
	font-family: monospace;
}

.errorMessage {
	color: #d9534f;
	font-size: 13px;
	margin-top: 5px;
	font-weight: 500;
}

/* ==================== МОБИЛЬНАЯ АДАПТАЦИЯ ==================== */
@media (max-width: 768px) {
	.dropdown {
		margin-left: 0;
		margin: 5px 12px;
	}

	.dropdown-menu {
		left: 0;
		transform: translateX(-10%) translateY(-6px) scale(0.98);
		min-width: 200px;
	}

	.dropdown:hover > .dropdown-menu {
		transform: translateX(-10%) translateY(0) scale(1);
	}

	.dropdown-menu::before {
		left: 24px;
		transform: rotate(45deg);
	}
}