/**
 * Шапка сайта: стиль как у блоков темы (#2c3e50 / #2a3746), адаптив.
 */

.main-header {
	margin-bottom: 16px;
}

.main-header__inner {
	background: linear-gradient(145deg, #2a3746 0%, #1e2a36 55%, #243240 100%);
	border-radius: 16px;
	border: 1px solid rgba(95, 134, 166, 0.35);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.06),
		0 8px 28px rgba(0, 0, 0, 0.35);
	padding: 12px 14px 14px;
	overflow: hidden;
}

/* Верхняя полоса: логотип + вход */
.main-header__top {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 12px;
	margin-bottom: 14px;
}

.main-header__brand {
	display: flex;
	justify-content: center;
	text-align: center;
}

.main-logo {
	display: flex;
	justify-content: center;
	width: 100%;
}

.main-logo__link {
	font-size: clamp(2.15rem, 4vw, 1.75rem);
	font-weight: 800;
	color: #e8f4fc;
	text-decoration: none;
	letter-spacing: 0.04em;
	text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
	line-height: 1.2;
	transition: color 0.2s, filter 0.2s;
	word-break: break-word;
	text-transform: uppercase;
}

.main-logo__link:hover,
.main-logo__link:focus {
	color: #fff;
	filter: brightness(1.08);
	outline: none;
}

.main-header__user {
	width: 100%;
}

.register-telegram {
	display: flex;
	justify-content: center;
	width: 100%;
	margin: 0;
}

.register-telegram__block {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	justify-content: center;
	gap: 8px;
	width: 100%;
	max-width: 420px;
	margin: 0 auto;
	background: rgba(0, 0, 0, 0.22);
	padding: 6px;
	border-radius: 12px;
	border: 1px solid rgba(95, 134, 166, 0.3);
	box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.25);
}

.register-telegram__logout {
	margin: 0;
	padding: 0;
	border: none;
	background: transparent;
	flex: 1 1 auto;
	min-width: 0;
}

.register-telegram__block--inner {
	flex: 1 1 auto;
	min-width: 0;
	min-height: 44px;
	padding: 10px 14px;
	margin: 0;
	font-size: 0.875rem;
	font-weight: 600;
	text-decoration: none;
	color: #f0f6fa;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	border: none;
	border-radius: 10px;
	cursor: pointer;
	background: linear-gradient(180deg, #3d566d 0%, #2c3e50 100%);
	box-shadow:
		0 3px 10px rgba(0, 0, 0, 0.3),
		inset 0 1px 0 rgba(255, 255, 255, 0.08);
	transition: filter 0.2s, transform 0.15s;
	font-family: inherit;
	width: 100%;
}

.register-telegram__block--inner:hover,
.register-telegram__block--inner:focus {
	filter: brightness(1.1);
	outline: none;
}

.register-telegram__block--inner:active {
	transform: scale(0.98);
}

.register-telegram__block--inner .fa-solid {
	color: #9ecae8;
	font-size: 0.95rem;
}

.register-telegram__block--inner--logout {
	background: linear-gradient(180deg, #4a3d4d 0%, #352a32 100%);
	height: 100%;
}

.register-telegram__block--inner--logout .fa-solid {
	color: #e8b4b4;
}

/* Telegram CTA */
.main-header .telegram-subscribe,
a.main-header__telegram {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	gap: 10px;
	flex-wrap: wrap;
	text-decoration: none;
	color: #e8f4fc;
	padding: 12px 16px;
	margin-bottom: 14px;
	border-radius: 12px;
	background: linear-gradient(135deg, rgba(36, 163, 217, 0.25) 0%, rgba(44, 62, 80, 0.9) 100%);
	border: 1px solid rgba(54, 162, 219, 0.45);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
	transition: filter 0.2s, border-color 0.2s;
}

.main-header__telegram:hover,
.main-header__telegram:focus {
	filter: brightness(1.08);
	border-color: rgba(126, 214, 255, 0.55);
	color: #fff;
	outline: none;
}

.main-header__telegram-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.75rem;
	color: #7dd3fc;
	line-height: 1;
}

.main-header__telegram-text {
	font-size: 0.95rem;
	font-weight: 600;
	text-align: center;
	line-height: 1.35;
}

/* Меню под шапкой (внутри header) */
.main-header .main-navigation {
	background: rgba(0, 0, 0, 0.15);
	border-radius: 12px;
	border: 1px solid rgba(95, 134, 166, 0.25);
	margin-bottom: 12px;
	box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2);
}

.main-header .navigation-list {
	padding: 8px;
	gap: 6px;
}

.main-header .navigation-item a {
	border-radius: 10px;
	line-height: 1.3;
	min-height: 44px;
	padding: 10px 14px;
	align-items: center;
	background: linear-gradient(180deg, #34495e 0%, #2c3e50 100%);
	border: 1px solid rgba(0, 0, 0, 0.2);
	transition: filter 0.2s;
}

.main-header .navigation-item a:hover,
.main-header .navigation-item a:focus {
	filter: brightness(1.08);
	outline: none;
}

/* Слайдер постеров */
.main-header .navigation-slider {
	background: rgba(0, 0, 0, 0.12);
	border-radius: 12px;
	border: 1px solid rgba(95, 134, 166, 0.2);
	overflow: visible;
}

.main-header .slider-list {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	justify-content: flex-start;
	gap: 10px;
	padding: 10px;
	overflow-x: auto;
	overflow-y: hidden;
	-webkit-overflow-scrolling: touch;
	scroll-snap-type: x proximity;
	scrollbar-color: rgba(126, 184, 216, 0.5) rgba(0, 0, 0, 0.2);
	scrollbar-width: thin;
}

.main-header .slider-list::-webkit-scrollbar {
	height: 6px;
}

.main-header .slider-list::-webkit-scrollbar-thumb {
	background: rgba(126, 184, 216, 0.45);
	border-radius: 4px;
}

.main-header .slider-item {
	flex: 0 0 auto;
	scroll-snap-align: start;
	max-width: min(140px, 42vw);
}

.main-header .slider-item a {
	display: block;
	border-radius: 10px;
	overflow: hidden;
	border: 1px solid rgba(0, 0, 0, 0.35);
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
	transition: transform 0.2s, box-shadow 0.2s;
}

.main-header .slider-item a:hover,
.main-header .slider-item a:focus {
	transform: translateY(-2px);
	box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
	outline: none;
}

.main-header .slider-item img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 2 / 3;
	object-fit: cover;
	vertical-align: middle;
}

/* Попап входа — в стиле тёмной темы */
.popup--auth.popup {
	background: rgba(10, 15, 20, 0.92);
}

.popup-content--dark {
	background: linear-gradient(165deg, #2a3746 0%, #1a252f 100%);
	border: 1px solid rgba(95, 134, 166, 0.4);
	color: #e8f0f6;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.popup-content--dark .close-popup {
	color: #9ecae8;
	background: transparent;
	border: none;
	font-size: 1.5rem;
	line-height: 1;
	padding: 4px 8px;
	border-radius: 8px;
	top: 8px;
	right: 8px;
}

.popup-content--dark .close-popup:hover,
.popup-content--dark .close-popup:focus {
	color: #fff;
	background: rgba(255, 255, 255, 0.08);
}

.popup-content--dark h2 {
	color: #f0f6fa;
}

.popup-content--dark label {
	color: #c5d8e8;
}

.popup-content--dark input {
	width: 100%;
	box-sizing: border-box;
	background: rgba(0, 0, 0, 0.25);
	border: 1px solid rgba(95, 134, 166, 0.45);
	color: #fff;
	border-radius: 10px;
}

.popup-content--dark input:focus {
	border-color: #5f86a6;
	outline: none;
	box-shadow: 0 0 0 2px rgba(95, 134, 166, 0.25);
}

.popup-content--dark button[type="submit"] {
	background: linear-gradient(180deg, #4a6d8c 0%, #3d5a73 100%);
	color: #fff;
	border: none;
	border-radius: 10px;
	font-weight: 600;
}

.popup-content--dark button[type="submit"]:hover {
	filter: brightness(1.08);
}

.popup-content--dark p,
.popup-content--dark a {
	color: #9ecae8;
}

.popup-content--dark a:hover {
	color: #fff;
}

/* Планшет и десктоп */
@media screen and (min-width: 640px) {
	.main-header__top {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		gap: 16px;
	}

	.main-header__brand {
		justify-content: flex-start;
		text-align: left;
		flex: 1 1 auto;
		min-width: 0;
	}

	.main-logo {
		justify-content: flex-start;
	}

	.main-header__user {
		flex: 0 1 auto;
		width: auto;
	}

	.register-telegram {
		justify-content: flex-end;
	}

	.register-telegram__block {
		max-width: none;
		width: auto;
		min-width: 280px;
		flex-wrap: nowrap;
	}

	.register-telegram__block--inner {
		width: auto;
		min-width: 140px;
	}

	.register-telegram__logout {
		flex: 0 0 auto;
	}
}

@media screen and (min-width: 1055px) {
	.main-header .navigation-list {
		flex-direction: row;
		justify-content: stretch;
		flex-wrap: wrap;
	}

	.main-header .navigation-item {
		flex: 1 1 0;
		min-width: 0;
	}

	.main-header .navigation-item a {
		justify-content: center;
		border-radius: 10px;
	}

	.main-header .slider-list {
		justify-content: center;
		flex-wrap: wrap;
		overflow-x: visible;
	}

	.main-header .slider-item {
		max-width: 185px;
	}
}
