/* SPDX-License-Identifier: LGPL-2.1-or-later */
@use "global-variables" as *;

.dynamic-form-group {
    .pf-v6-c-empty-state {
        padding: 0;
    }

    .pf-v6-c-form__label {
        // Don't allow labels to wrap
        white-space: nowrap;
    }

    .remove-button-group {
        // Move 'Remove' button the the end of the row
        grid-column: -1;
        // Move 'Remove' button to the bottom of the line so as to align with the other form fields
        display: flex;
        align-items: flex-end;
    }

    // Set check to the same height as input widgets and vertically align
    .pf-v6-c-form__group-control>.pf-v6-c-check {
        // Set height to the same as inputs
        // Font height is font size * line height (1rem * 1.5)
        // Widgets have 5px padding, 1px border (top & bottom): (5 + 1) * 2 = 12
        // This all equals to 36px
        block-size: calc(var(--pf-t--global--font--size--md) * var(--pf-v6-global--LineHeight--md) + 12px);
        align-content: center;
    }

    // We use FormFieldGroup PF component for the nested look and for ability to add buttons to the header
    // However we want to save space and not add indent to the left so we need to override it
    .pf-v6-c-form__field-group-body {
        // Stretch content fully
        --pf-v6-c-form__field-group-body--GridColumn: 1 / -1;
        // Reduce padding at the top
        --pf-v6-c-form__field-group-body--PaddingTop: var(--pf-t--global--spacer--xs);
    }
}
