/* ==========================================================================
   sidebar-layout.css — блок «меню слева + контент справа»
   ==========================================================================
   Меню на десктопе (≥769px):
   — .vmenu-root — вертикальный список, рамка вокруг всего меню.
   — Подменю выезжают ВПРАВО, position: absolute, поверх контента.
   — Раскрытие по hover и по клику на .vmenu-toggle.
   — Аккордеон: открыто не больше одного подменю на уровне.
   — Стрелки/треугольники убраны.
   ========================================================================== */

.sidebar-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 30px;
  align-items: start;
  margin-top: 30px;
  margin-bottom: 0;
}

.sidebar-layout-menu {
  width: 240px;
  background-color: #fff9e6;
  border: 1px solid #c9bca2;
  overflow: visible;
  z-index: 20;
  /* Скругление убрано, чтобы не было артефактов на углах:
     подменю выезжают наружу, поэтому overflow: hidden невозможен,
     а без него фон последнего пункта вылезает за скругление. */
}

.vmenu-root,
.vmenu-sub {
  list-style: none;
  padding: 0;
  margin: 0;
}

.vmenu-item {
  position: relative;
  display: block;
}

.vmenu-root > .vmenu-item:not(:last-child) {
  border-bottom: 1px solid #c9bca2;
}
.vmenu-sub > .vmenu-item:not(:last-child) {
  border-bottom: 1px solid #ebdcb2;
}

.vmenu-link {
  display: block;
  padding: 14px 40px 14px 18px;
  color: #3b0a60;
  text-decoration: none;
  font-size: 14px;
  background-color: #fff9e6;
  box-sizing: border-box;
  transition: background-color 0.15s, color 0.15s;
}

.vmenu-link:hover {
  background-color: #dfcd9d;
  color: #3b0a60;
}

.vmenu-link--active {
  background-color: #ebdcb2;
  color: #3b0a60;
  font-weight: bold;
}

.vmenu-toggle {
  position: absolute;
  top: 0;
  right: 0;
  width: 40px;
  height: 100%;
  background: transparent;
  border: none;
  cursor: pointer;
  opacity: 0;
  padding: 0;
}

.vmenu-sub {
  position: absolute;
  top: 0;
  left: 100%;
  min-width: 220px;
  background-color: #fff9e6;
  border: 1px solid #c9bca2;
  box-shadow: 4px 4px 15px rgba(59, 10, 96, 0.1);
  opacity: 0;
  visibility: hidden;
  transform: translateX(10px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  z-index: 100;
}

.vmenu-item--has-children:hover > .vmenu-sub,
.vmenu-item--has-children.is-open > .vmenu-sub {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.vmenu-sub .vmenu-link {
  padding: 12px 40px 12px 18px;
  font-size: 14px;
  font-weight: normal;
  color: #1a1a1a;
}
.vmenu-sub .vmenu-link:hover {
  background-color: #ebdcb2;
  color: #3b0a60;
}

.sidebar-layout-content {
  min-width: 0;
  align-self: start;   /* ← панель прижата к верхней границе строки grid */
}

.sidebar-layout-content > .block-content:first-child,
.sidebar-layout-content > .content-card:first-child,
.sidebar-layout-content > .stub-pages-wrapper:first-child {
  margin-top: 0;
}

.sidebar-layout-content > * + * {
  margin-top: 30px;
}

body:has(#toggle-hide-slider:checked) .sidebar-layout {
  margin-top: 0;
}

/* Правая колонка — контейнер панелей */
.sidebar-layout-content {
  min-width: 0;
  /* position: relative; */
  /* Нет margin-top, нет padding-top — колонка начинается с самого верха */
}

/* Все панели скрыты по умолчанию */
.sidebar-panel {
  display: none;
}

/* Активная панель — видима */
.sidebar-panel.is-active {
  display: block;
  margin-top: 0;
  padding-top: 0;
}

/* Первый блок внутри панели — без верхнего отступа. */
.sidebar-panel > *:first-child,
.sidebar-layout-content > *:first-child {
  margin-top: 0;
}

/* Внутри панели первый блок не даёт верхний отступ —
   контент встаёт вровень с верхом меню. */
.sidebar-panel > .block-content:first-child,
.sidebar-panel > .content-card:first-child,
.sidebar-panel > .stub-pages-wrapper:first-child {
  margin-top: 0;
}

/* И внутри самого блока — если у его тела есть margin-top */
.sidebar-panel > .block-content:first-child > h2:first-child {
  margin-top: 0;
}