
.interface-interface-skeleton__editor {
    background-color: white;
}

.interface-interface-skeleton__header {
    top: 0;
    right: 0;
    left: 0;
    border-bottom: 1px solid lightgray;
    background-color: white;
    z-index: 30; // Below the components-popover, which is at index 31.
}

.interface-interface-skeleton__body {
    width: 100%;
    background-color: var(--givewp-gray-10);
    overflow: hidden;
}

.interface-interface-skeleton__secondary-sidebar {
    position: relative;
}

.interface-interface-skeleton.givewp-form-settings__editor {
    .interface-interface-skeleton__body {
        background-color: var(--givewp-shades-white);
    }

    .interface-interface-skeleton__content {
        margin: 0;
        padding: 0;
        width: 100%;
    }
}

.interface-interface-skeleton__content {
    height: calc(100vh - 60px);
    width: 100%;
    margin: auto;
    padding: 100px 0; /* Leave room for toolbar above first block. */
    flex-grow: unset;
    box-sizing: border-box;

    .givewp-form-builder__design-tab & {
        display: block;
        width: 100%;
    }

    #form-blocks-canvas {
        display: flex;
        justify-content: center;
    }

    @media screen and (max-width: 782px) {
        padding: 1rem 0;
    }

    *,
    *:before,
    *:after {
        box-sizing: inherit;
    }

    input:not([type=radio]):not([type=checkbox]),
    select,
    .components-text-control__input,
    .components-select-control__input {
        inline-size: 100%;
        padding: 16px;

        border: 1px solid var(--givewp-grey-500) !important;
        border-radius: 5px;

        background-color: #fff;
        color: var(--givewp-gray-60);
        font-size: 16px !important;
        font-weight: normal;
        line-height: 20px;
        height: auto;
    }

    .components-select-control__input {
        height: auto !important;

        & ~ .components-input-control__suffix {
            & > div {
                padding: 0 10px;
            }

            svg {
                height: 24px;
                width: 24px;
                fill: var(--givewp-gray-60);
            }
        }
    }

    .components-input-control__backdrop {
        display: none !important;
    }

    .components-base-control__label,
    .components-input-control__label {
        font-size: 1rem !important;
        font-weight: 500 !important;
        color: var(--givewp-gray-100);
        text-transform: none !important;
    }

    .give-is-required .components-base-control__label::after,
    .give-is-required .components-input-control__label::after {
        content: ' *';
        color: var(--givewp-alert-100);
    }
}

[data-type='givewp/section'],
[data-type='givewp/donor-info'],
[data-type='givewp/donation-amount'],
[data-type='givewp/payment-details'] {
    & > div > .block-editor-inner-blocks > .block-editor-block-list__layout {
        display: flex;
        gap: 2rem;
        flex-direction: column;
    }
}

[data-type='givewp/paragraph'] .rich-text {
    font-size: 1.1rem;
    line-height: 1.5;
}

.block-editor-list-view-leaf.is-selected,
.block-editor-list-view-leaf.is-selected td {
    background: var(--wp-admin-theme-color);
}

.block-editor-block-list__block {
    position: relative;

    .wp-block {

        &.is-selected, &.is-selected:focus {
            // Outline doesn't seem to respect border-radius directly,
            // but adding a 1px border-radius seems to get it close.
            border-radius: 1px;
            outline: 1px solid var(--wp-admin-theme-color);
            outline-offset: 0.5rem;
        }
    }

    &:not(.is-selected) {
        .block-editor-default-block-appender {
            display: none;
        }
    }

    &.is-selected {
        .block-editor-block-list__layout-section {
            border-color: var(--wp-admin-theme-color);
        }
    }

    .block-editor-default-block-appender .block-editor-inserter {
        position: relative;
    }

    .block-list-appender {
        position: absolute;
        bottom: -36px;
        width: 100%;
        left: 0;
        display: flex;
        align-items: center;
        justify-content: center;

        &:only-child {
            bottom: 0;

            .block-editor-default-block-appender__content {
                display: none;
            }
        }
    }

    .components-base-control__field {
        margin-bottom: 0;
    }
}

.popover-slot {
    position: fixed;
}

.block-editor-inserter__main-area {
    width: 100%;
}

.components-popover.block-editor-block-popover .components-popover__content {
    top: -0.5rem;
    position: relative;
}

.interface-interface-skeleton {
    left: 0 !important;
    top: 0;
}

.block-editor-block-list__layout {
    display: flex;
    flex-direction: column;
    gap: 2rem;

    .block-editor-block-list__block {
        max-width: 720px;
        padding: 0 0.5rem;

        &:not([contenteditable]):focus::after {
            box-shadow: none;
            content: none;
            outline-width: 0;
        }

        &.is-highlighted {
            box-shadow: none;

            &::after {
                box-shadow: none;
                outline: none;
            }
        }
    }
}

.block-editor-block-list__layout-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
    border-radius: 5px;
    border: 1px solid lightgray;
    padding: 36px 40px 46px 40px;
    background-color: white;
}

.givewp-support-link.components-external-link > svg {
    display: none; /* Hide included icon, in favor of menu item icon. */
}

.givewp-block-editor-design-sidebar {
    &__settings {
        .components-panel__body > div {
            border-top: 0;
            padding: 0 !important;
        }

        .block-editor-tools-panel-color-gradient-settings__item.first {
            margin-top: 0;
        }
    }
}

.givewp-block-editor-sidebar {
    &__tabs {
        display: flex; // WP 6.5 backwards compatibility
        flex: 1 1 0;
        justify-content: center;

        li {
            flex: 1;
            margin: 0; // WP 6.5 backwards compatibility

            > .components-button {
                display: block;
                width: 100%;
                text-align: center;

                // WP 6.5 backwards compatibility
                position: relative;
                height: 48px;
                padding: 3px 16px;

                &:focus {
                    outline: none;
                    box-shadow: none;
                }

                &.is-active:after {
                    height: calc(var(--wp-admin-border-width-focus) * 1);
                    outline: 1px solid transparent;
                    outline-offset: -1px;
                }

                &:after {
                    content: "";
                    background: var(--wp-admin-theme-color);
                    border-radius: 0;
                    bottom: 0;
                    height: calc(var(--wp-admin-border-width-focus) * 0);
                    pointer-events: none;
                    position: absolute;
                    left: 0;
                    right: 0;
                    transition: all .1s linear;
                }
            }
        }
    }
}

.givewp-form-settings__editor .interface-interface-skeleton {
    width: 100%;
}
