/*
 * Front-end styles for bsm-sidebar.
 *
 * Layout: vertical column inside .bsm-section-layout / .bsm-detail-layout.
 * Markup: ../template-parts/sidebar.php
 *
 * Внешний вид — дерево навигации в карточке с тонкой обводкой, плюс
 * CTA-блок «Связаться» внизу с акцентной полосой.
 */

.bsm-sidebar {
	display: flex;
	flex-direction: column;
	gap: 24px;
	font-family: inherit;
}

/* В дизайн-макете (01-detail.html) sidebar-блок и CTA-блок не имеют
 * своего белого фона и обводки — они лежат прямо на подложке страницы.
 * Акцент делается только через accent-rule (border-left) у CTA. */
.bsm-sidebar__nav,
.bsm-sidebar__empty,
.bsm-sidebar__cta {
	background: transparent;
	border: none;
	padding: 0;
}

/* ---- Navigation ---- */

.bsm-sidebar__title {
	margin: 0 0 14px;
	padding-bottom: 10px;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	color: var(--gray);
	font-weight: var(--font-weight-bold);
	border-bottom: var(--hairline);
}

.bsm-sidebar__menu {
	list-style: none;
	margin: 0 0 24px;
	padding: 0;
}

.bsm-sidebar__menu > li {
	position: relative;
	margin-bottom: 2px;
	border-bottom: none;
}

.bsm-sidebar__menu > li > .bsm-sidebar__link {
	display: block;
	padding: 9px 12px;
	color: var(--text-secondary);
	font-size: 14px;
	line-height: 1.4;
	text-decoration: none;
	border-left: 2px solid transparent;
	transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.bsm-sidebar__menu > li > .bsm-sidebar__link:hover {
	background: var(--bg-soft);
	color: var(--accent-strong);
	text-decoration: none;
}

/* Active (current) — only direct-current, NOT ancestor.
 * В дизайн-макете (01-detail.html) подсвечивается только тот пункт,
 * который ведёт на текущую страницу. Родительские пункты остаются
 * нейтральными. */
.bsm-sidebar__menu > li.current-menu-item > .bsm-sidebar__link,
.bsm-sidebar__menu > li.bsm-current-item > .bsm-sidebar__link {
	background: var(--accent-soft);
	color: var(--accent-strong);
	border-left-color: var(--accent);
	font-weight: var(--font-weight-semibold);
}

/* Submenu (nested level) */
.bsm-sidebar__menu .sub-menu {
	list-style: none;
	margin: 2px 0 6px 16px;
	padding-left: 12px;
	border-left: var(--hairline);
	background: transparent;
}

.bsm-sidebar__menu .sub-menu > li > .bsm-sidebar__link {
	padding: 6px 12px;
	font-size: 13px;
	font-weight: 400;
	color: var(--text-secondary);
}

/* Sub-menu active (current) — аналогично, только direct-current. */
.bsm-sidebar__menu .sub-menu > li.current-menu-item > .bsm-sidebar__link,
.bsm-sidebar__menu .sub-menu > li.bsm-current-item > .bsm-sidebar__link {
	background: var(--accent-soft);
	color: var(--accent-strong);
	border-left-color: var(--accent);
	font-weight: var(--font-weight-semibold);
}

/* ---- Empty state ---- */

.bsm-sidebar__empty-text {
	margin: 0;
	color: var(--gray);
	font-size: 13px;
	font-style: italic;
	line-height: 1.5;
}

/* ---- CTA block ---- */

.bsm-sidebar__cta {
	border-left: none;
}

.bsm-sidebar__cta-title {
	margin: 0 0 14px;
	padding-bottom: 10px;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	color: var(--gray);
	font-weight: var(--font-weight-bold);
	border-bottom: var(--hairline);
}

.bsm-sidebar__cta-text {
	margin: 0 0 14px;
	font-size: 13.5px;
	color: var(--text-secondary);
	line-height: 1.55;
}

.bsm-sidebar__cta-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 10px 18px;
	background: var(--accent);
	color: #fff;
	font-size: 13.5px;
	font-weight: var(--font-weight-semibold);
	text-decoration: none;
	transition: background 0.15s;
}

.bsm-sidebar__cta-btn:hover {
	background: var(--accent-strong);
	color: #fff;
	text-decoration: none;
}

/* ---- Responsive ---- */

@media (max-width: 900px) {
	.bsm-sidebar {
		gap: 12px;
	}

	.bsm-sidebar__nav,
	.bsm-sidebar__empty,
	.bsm-sidebar__cta {
		padding: 16px 18px;
	}
}
