/* ============================================================
   Оболочка сайта: шапка и подвал
   Светлая гамма лендингов satway — эталон /courses/emotions/
   (landings/basic/emotions/css/styles.css)
   ============================================================ */

/* ---------- Шапка ---------- */
.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background-color: var(--color-background);
	border-bottom: 1px solid var(--color-border);
	color: var(--color-foreground);
}

body.admin-bar .site-header {
	top: 32px;
}

.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--spacing-l);
	padding-top: var(--spacing-m);
	padding-bottom: var(--spacing-m);
}

.site-header__logo {
	display: flex;
	align-items: center;
	gap: 12px;
	font-family: var(--font-display);
	font-size: 2rem;
	font-weight: 700;
	line-height: 1;
	color: var(--color-foreground);
	text-decoration: none;
}

.site-header__logo:hover,
.site-header__logo:focus {
	color: var(--color-foreground);
	text-decoration: none;
}

.site-header__logo .custom-logo {
	display: block;
	width: auto;
	max-height: 53px;
}

.site-header__logo-icon {
	width: 56px;
	height: 53px;
	object-fit: contain;
	flex-shrink: 0;
}

/* Меню прижимается вправо: свободное место забирает auto-margin слева,
   поэтому логотип остаётся у левого края, а меню и личный блок — у правого. */
.site-header__menu {
	margin-left: auto;
}

.site-header__menu-list {
	display: flex;
	align-items: center;
	gap: 32px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-header__menu-list a {
	display: inline-flex;
	align-items: center;
	font-family: var(--font-heading);
	font-size: 20px;
	font-weight: 300;
	line-height: 1.2;
	color: var(--color-foreground);
	text-decoration: none;
	transition: opacity 0.2s ease;
}

.site-header__menu-list a:hover,
.site-header__menu-list a:focus {
	color: var(--color-foreground);
	opacity: 0.7;
}

/* Пункт «Клуб» внешней ссылкой (участник клуба → сообщество): значок справа от текста */
.site-header__menu-list .menu-item-club--external > a {
	gap: 3px;
}

.site-header__menu-list .menu-item-club__external {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 12px;
	height: 12px;
	color: var(--color-foreground-muted);
	flex-shrink: 0;
}

.site-header__menu-list .menu-item-club__external svg {
	display: block;
	width: 100%;
	height: 100%;
}

/* Активный пункт — короткая тёмная черта под ссылкой */
.site-header__menu-list .current-menu-item > a,
.site-header__menu-list .current_page_item > a {
	position: relative;
}

.site-header__menu-list .current-menu-item > a::after,
.site-header__menu-list .current_page_item > a::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	bottom: -6px;
	height: 2px;
	background-color: var(--color-primary);
}

.site-header__menu-list .nav-cta > a::after,
.site-footer__menu-list .nav-cta > a::after {
	display: none;
}

/* ---------- Личный блок: «Войти» / аватар и имя (inc/account.php) ---------- */
.site-header__user {
	display: flex;
	align-items: center;
	gap: 16px;
}

/* Корзина: иконка + бейдж с числом товаров (inc/woocommerce.php) */
.site-header__cart {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	color: var(--color-foreground);
	text-decoration: none;
	transition: opacity 0.2s ease;
}

.site-header__cart svg {
	display: block;
	width: 26px;
	height: 26px;
}

.site-header__cart.is-empty {
	display: none;
}

.site-header__cart-count {
	position: absolute;
	top: -4px;
	right: -6px;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 999px;
	background-color: var(--color-primary);
	color: var(--color-background);
	font-family: var(--font-heading);
	font-size: 12px;
	font-weight: 600;
	line-height: 18px;
	text-align: center;
}

.site-header__cart:hover,
.site-header__cart:focus {
	color: var(--color-foreground);
	opacity: 0.7;
}

.site-header__user-link,
.site-header__auth-link {
	display: inline-flex;
	align-items: center;
	font-family: var(--font-heading);
	font-size: 20px;
	font-weight: 300;
	line-height: 1.2;
	color: var(--color-foreground);
	text-decoration: none;
	transition: opacity 0.2s ease;
}

.site-header__user-link {
	gap: 12px;
}

/* Активный личный блок — та же черта, что у пунктов меню, когда открыт кабинет /profile/.
   Черта идёт только под именем, поэтому имя — отдельный бокс с псевдоэлементом. */
.site-header__user-name {
	position: relative;
	max-width: 220px;
}

.site-header__user-name-text {
	display: block;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.site-header__user-link.is-current .site-header__user-name::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	bottom: -6px;
	height: 2px;
	background-color: var(--color-primary);
}

.site-header__user-link:hover,
.site-header__user-link:focus,
.site-header__auth-link:hover,
.site-header__auth-link:focus {
	color: var(--color-foreground);
	opacity: 0.7;
}

/* Круглое фото — как у аватаров отзывов (§7: 50% только для фото) */
.site-header__user-avatar {
	width: 32px;
	height: 32px;
	border: 1px solid var(--color-border);
	border-radius: 50%;
	background-color: var(--color-background);
	object-fit: cover;
	flex-shrink: 0;
}

.site-header__toggle {
	display: none;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	margin-right: -12px;
	color: var(--color-foreground);
}

.site-header__menu-close {
	display: none;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	color: var(--color-foreground);
}

/* ---------- Кнопка-CTA (пункт меню с классом `nav-cta`) ---------- */
.site-header__menu-list .nav-cta > a,
.site-footer__menu-list .nav-cta > a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 12px 32px;
	background-color: var(--color-primary);
	color: var(--color-foreground-light);
	font-family: var(--font-heading);
	font-size: 25px;
	font-weight: 300;
	line-height: 1.2;
	border-radius: 0;
	text-decoration: none;
	opacity: 1;
	transition: background-color 0.2s ease;
}

.site-header__menu-list .nav-cta > a:hover,
.site-header__menu-list .nav-cta > a:focus,
.site-footer__menu-list .nav-cta > a:hover,
.site-footer__menu-list .nav-cta > a:focus {
	background-color: var(--color-primary-hover);
	color: var(--color-foreground-light);
	opacity: 1;
}

/* ---------- Подвал ---------- */
.site-footer {
	background-color: var(--color-background);
	border-top: 1px solid var(--color-border);
	padding-top: 40px;
	padding-bottom: 40px;
	color: var(--color-foreground-muted);
}

.site-footer__inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 24px;
	text-align: center;
}

.site-footer__logo {
	display: flex;
	align-items: center;
	gap: 12px;
	font-family: var(--font-display);
	font-size: 2.25rem;
	font-weight: 700;
	line-height: 1;
	color: var(--color-foreground);
	text-decoration: none;
}

.site-footer__logo:hover,
.site-footer__logo:focus {
	color: var(--color-foreground);
	text-decoration: none;
}

.site-footer__logo .custom-logo {
	display: block;
	width: auto;
	max-height: 53px;
}

.site-footer__logo-icon {
	width: 56px;
	height: 53px;
	object-fit: contain;
	flex-shrink: 0;
}

.site-footer__menu-list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 32px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-footer__menu-list a {
	display: inline-flex;
	align-items: center;
	font-family: var(--font-heading);
	font-size: 18px;
	font-weight: 300;
	line-height: 1.2;
	color: var(--color-foreground-muted);
	text-decoration: none;
	transition: color 0.2s ease;
}

.site-footer__menu-list a:hover,
.site-footer__menu-list a:focus {
	color: var(--color-foreground);
}

.site-footer__copyright {
	font-family: var(--font-body);
	font-size: 13px;
	font-weight: 300;
	color: var(--color-foreground-muted);
}

.site-footer__copyright a {
	color: inherit;
	text-decoration: none;
	transition: color 0.2s ease;
}

.site-footer__copyright a:hover,
.site-footer__copyright a:focus {
	color: var(--color-foreground);
}

/* ============================================================
   Адаптив
   ============================================================ */

/* Планшет и мобильные: ссылки уходят в полноэкранное меню */
@media (max-width: 1299px) {
	.site-header__inner {
		padding-top: 14px;
		padding-bottom: 14px;
	}

	.site-header__logo {
		font-size: 22px;
	}

	.site-header__logo-icon {
		width: 40px;
		height: 38px;
	}

	.site-header__logo .custom-logo {
		max-height: 38px;
	}

	.site-header__toggle {
		display: flex;
	}

	/* Меню уходит в оверлей — правый край занимает личный блок с бургером */
	.site-header__user {
		margin-left: auto;
	}

	.site-header__menu {
		display: none;
	}

	.site-header__menu.is-open {
		display: flex;
		position: fixed;
		inset: 0;
		z-index: 200;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 32px;
		padding: var(--spacing-xl) var(--spacing-l);
		overflow-y: auto;
		background-color: var(--color-background);
	}

	.site-header__menu.is-open .site-header__menu-close {
		display: flex;
		position: absolute;
		top: 16px;
		right: 20px;
	}

	.site-header__menu.is-open .site-header__menu-list {
		flex-direction: column;
		align-items: center;
		gap: 28px;
	}

	.site-header__menu.is-open .site-header__menu-list a {
		font-size: 28px;
	}

	.site-header__menu.is-open .site-header__menu-list .menu-item-club__external {
		width: 16px;
		height: 16px;
	}

	.site-header__menu.is-open .site-header__menu-list .nav-cta > a {
		font-size: 25px;
	}

	.site-header__menu.is-open .site-header__menu-list .current-menu-item > a::after,
	.site-header__menu.is-open .site-header__menu-list .current_page_item > a::after {
		display: none;
	}

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

@media (max-width: 782px) {
	body.admin-bar .site-header {
		top: 46px;
	}
}

@media (max-width: 959px) {
	/* Имя остаётся доступным скринридеру, но не занимает место в баре */
	.site-header__user-name {
		position: absolute;
		width: 1px;
		height: 1px;
		padding: 0;
		margin: -1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
		white-space: nowrap;
		border: 0;
	}

	.site-header__toggle {
		margin-right: -6px;
	}

	.site-footer {
		padding-top: 32px;
		padding-bottom: 32px;
	}

	.site-footer__inner {
		gap: 20px;
	}

	.site-footer__logo {
		font-size: 1.75rem;
	}

	.site-footer__logo-icon {
		width: 40px;
		height: 38px;
	}

	.site-footer__logo .custom-logo {
		max-height: 38px;
	}

	.site-footer__menu-list {
		flex-direction: column;
		gap: 12px;
	}
}
