/*
 * SPDX-License-Identifier: Apache-2.0
 *
 * The OpenSearch Contributors require contributions made to
 * this file be licensed under the Apache-2.0 license or a
 * compatible open source license.
 *
 * Any modifications Copyright OpenSearch Contributors. See
 * GitHub history for details.
 */

/*
 * Licensed to Elasticsearch B.V. under one or more contributor
 * license agreements. See the NOTICE file distributed with
 * this work for additional information regarding copyright
 * ownership. Elasticsearch B.V. licenses this file to you under
 * the Apache License, Version 2.0 (the "License"); you may
 * not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

.osdOverviewWrapper {
  background-color: $euiColorEmptyShade;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - #{$euiHeaderHeightCompensation});

  .headerIsExpanded & {
    min-height: calc(100vh - #{$euiHeaderHeightCompensation * 2});
  }
}

.osdOverviewContent {
  margin: 0 auto;
  max-width: 1200px;
  padding: $euiSizeXL $euiSize;
  width: 100%;

  // Ensure card heights are stretched equally when wrapped with this element
  .osdRedirectCrossAppLinks {
    align-items: flex-start;
    display: flex;
    flex: 1;
    flex-direction: column;
  }
}

.osdOverviewApps__item {
  .osdOverviewApps__group--primary & {
    @include euiBreakpoint("m", "l", "xl") {
      max-width: calc(50% - #{$euiSizeM * 2});
    }
  }

  .osdOverviewApps__group--secondary & {
    @include euiBreakpoint("m", "l", "xl") {
      max-width: calc(25% - #{$euiSizeM * 2});
    }
  }
}

.osdOverviewNews__content article {
  & + article {
    margin-top: $euiSizeL;
  }

  &,
  header {
    & > * + * {
      margin-top: $euiSizeXS;
    }
  }

  h3 {
    font-weight: inherit;
  }
}

.osdOverviewMore__item {
  @include euiBreakpoint("m", "l", "xl") {
    max-width: calc(33.3333% - #{$euiSizeM * 2});
  }
}

.osdOverviewSolution__icon {
  background-color: $euiColorEmptyShade !important;
  box-shadow: none !important;
  height: $euiSizeL * 2;
  padding: $euiSizeM;
  width: $euiSizeL * 2;
}

.osdOverviewSupplements--noNews .osdOverviewMore {
  h2 {
    @include euiBreakpoint("m", "l", "xl") {
      text-align: center;
    }
  }

  .osdOverviewMore__content {
    @include euiBreakpoint("m", "l", "xl") {
      justify-content: center;
    }
  }
}

.osdOverviewData--expanded {
  flex-direction: column;

  &,
  & > * {
    margin-bottom: 0 !important;
    margin-top: 0 !important;
  }
}

// Accounting for no `flush="both"` prop on EuiButtonEmpty
.osdOverviewDataAdd__actionButton {
  margin-right: 0;
}

.osdOverviewDataManage__item:not(:only-child) {
  @include euiBreakpoint("m", "l", "xl") {
    flex: 0 0 calc(50% - #{$euiSizeM * 2});
  }
}