/**
 * Copyright (c) Enalean, 2024 - Present. All Rights Reserved.
 *
 * This file is a part of Tuleap.
 *
 * Tuleap is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * Tuleap is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Tuleap. If not, see <http://www.gnu.org/licenses/>.
 */

@use "@tuleap/burningparrot-theme/css/includes/global-variables";
@use "./includes/project-background";
@use "./includes/section-content";
@use "./includes/size";

.artidoc-app {
    --artidoc-app-height: calc(100vh - #{global-variables.$breadcrumb-height});
    --artidoc-container-height: calc(
        var(--artidoc-app-height) - #{size.$artidoc-header-title-height} - 1px
    );
    --artidoc-sticky-top-position: 0px;
    --artidoc-sidebar-button-width: 30px;
    --editor-padding: var(--tlp-form-element-padding-horizontal);

    display: flex;
    flex-direction: column;
    height: var(--artidoc-app-height);
}

.sidebar-collapsed .artidoc-app {
    --artidoc-app-height: calc(
        100vh - #{global-variables.$breadcrumb-height-with-collapsed-sidebar}
    );
}

.has-visible-project-banner {
    .artidoc-app {
        --artidoc-app-height: calc(
            100vh - #{global-variables.$breadcrumb-height} - #{global-variables.$project-banner-base-height}
        );
    }

    &.sidebar-collapsed .artidoc-app {
        --artidoc-app-height: calc(
            100vh - #{global-variables.$breadcrumb-height-with-collapsed-sidebar} - #{global-variables.$project-banner-base-height}
        );
    }
}

.has-visible-platform-banner {
    .artidoc-app {
        --artidoc-app-height: calc(
            100vh - #{global-variables.$breadcrumb-height} - #{global-variables.$platform-banner-base-height}
        );
    }

    &.sidebar-collapsed .artidoc-app {
        --artidoc-app-height: calc(
            100vh - #{global-variables.$breadcrumb-height-with-collapsed-sidebar} - #{global-variables.$platform-banner-base-height}
        );
    }

    &.has-visible-project-banner .artidoc-app {
        --artidoc-app-height: calc(
            100vh - #{global-variables.$breadcrumb-height} - #{global-variables.$project-banner-base-height} -
                #{global-variables.$platform-banner-base-height} - #{global-variables.$extra-platform-banner-white-space-height}
        );
    }

    &.has-visible-project-banner.sidebar-collapsed .artidoc-app {
        --artidoc-app-height: calc(
            100vh - #{global-variables.$breadcrumb-height-with-collapsed-sidebar} - #{global-variables.$project-banner-base-height} -
                #{global-variables.$platform-banner-base-height} - #{global-variables.$extra-platform-banner-white-space-height}
        );
    }
}
