/* @define HierarchyEditor */

.HierarchyEditor {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
}

/* stylelint-disable-next-line */
.HierarchyEditor > .Header-main {
    border-bottom: none;
}

.HierarchyEditor-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    padding: 15px 0 0 15px;
}

/*
 * The Tabs component renders intermediate wrapper <div> elements that we cannot
 * target with BEM classes (Vue applies classes to the root, not inner wrappers).
 * We must use descendant selectors to pass height constraints through these
 * wrappers so that overflow-y works correctly on deeply nested scrollable areas
 * (TreeSelector, UnitForm/WorkerForm tab content).
 */

/* stylelint-disable plugin/selector-bem-pattern */

/* Flex-column all Tabs wrappers so they stretch to fill available height */
.HierarchyEditor-body > div,
.HierarchyEditor-body .Tabs {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

/* Allow tab-content to shrink below its content size (enables child overflow) */
.HierarchyEditor-body .tab-content {
    flex: 1 1 auto;
    min-height: 0;
}

/* Each visible tab-pane must fill its parent so percentage heights resolve */
.HierarchyEditor-body .tab-content > .tab-pane {
    height: 100%;
}

/* Stretch form-level tab nav into EntityEditorPane-body's left padding */
.HierarchyEditor-body .UnitForm-tabsBlock .Tab-navBar,
.HierarchyEditor-body .WorkerForm-tabsBlock .Tab-navBar {
    margin-left: -15px;
}

/* Stretch hierarchy-level tab nav into HierarchyEditor-body's left padding */
.HierarchyEditor-body > div > .Tabs > .Tab-navBar {
    margin-left: -15px;
}

/* Remove redundant right/bottom padding from EntityEditorPane within this editor */
.HierarchyEditor-body .EntityEditorPane-body {
    padding-right: 0;
    padding-bottom: 0;
}

/* stylelint-enable plugin/selector-bem-pattern */

.HierarchyEditor-markedForDeletionBanner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    margin-bottom: 15px;
    background: #fdf2d1;
    border: 1px solid #fceec0;
    border-radius: 4px;
}

.HierarchyEditor-markedForDeletionBannerText {
    margin-right: 15px;
    font-size: 14px;
    color: #806420;
}

.HierarchyEditor-linkToHighestAncestorEntityMarkedForDeletion {
    color: #806420;
    text-decoration: underline;
}

.HierarchyEditor-editorPaneHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.HierarchyEditor-editorPaneHeaderText {
    margin: 0;
}

.HierarchyEditor-editorPaneHeaderButtonContainer {
    display: flex;
}

.HierarchyEditor-remoteLinkButton {
    margin-left: 15px;
}

.HierarchyEditor-tabContent {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.HierarchyEditor-tabContent--body {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
}

.HierarchyEditor-tabTitle {
    display: flex;
    align-items: center;
    gap: 6px;
}
