// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
// See LICENSE in the project root for license information.

// Styles in this document are standardized are NOT to be edited.
// All styles for the custom element are located in the ./src directory.

// ----------------------- DO NOT EDIT -----------------------------
@import './../../node_modules/@aurodesignsystem/design-tokens/dist/legacy/auro-classic/SCSSVariables';
@import './../../node_modules/@aurodesignsystem/design-tokens/dist/themes/alaska/SCSSVariables--alaska';

@import './../breakpoints';
@import './../grids';

// Creates baseline output in CSS
@import './../fonts/legacy/auro-classic';
@import './../normalize';
@import './../headings';
@import './../blockquote';
@import './../componentSupport/table';
@import './../focus-visible';
@import './../essentials/legacy/auro-classic';

/* stylelint-disable selector-type-no-unknown */

// Custom styles per demo pages
// 1:1 match to ./src/sass/demo.scss file in docsite
.auro-markdown {
  h1,
  h2,
  h3 {
    @extend .heading;
  }

  h1 {
    @extend .heading--display;
  }

  h2 {
    @extend .heading--700;
  }

  h3 {
    @extend .heading--600;
  }

  h4 {
    @extend .heading--500;
  }

  a {
    @extend .hyperlink;
  }

  p {
    @extend p;

    &:last-child {
      margin-bottom: 0;
    }
  }

  table {
    @extend .auro_table;
  }
}

// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Code / syntax highlighting
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

.hljs {
  background-color: unset !important;
  padding: unset !important;
}

pre {
  background: var(--ds-color-brand-gray-100, $ds-color-brand-gray-100) !important;
  border: unset !important;
  padding: var(--ds-size-200) !important;
  margin-bottom: var(--ds-size-300, $ds-size-300) !important;
  border-style: solid !important;
  border-width: 1px !important;
  border-color: var(--ds-color-border-secondary-default) !important;
  border-radius: .5rem;
  margin-top: var(--ds-size-200) !important;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.1) !important;
  overflow-x: scroll !important;

  code {
    font-size: .85rem !important;
    font-family: monospace;
    text-shadow: none;
  }
}

.pre-wrapper:last-of-type pre {
  margin-bottom: 0 !important;
}

code:not(.html):not(.css):not(.js):not([class*='language-']) {
  color: var(--ds-color-brand-flamingo-500, $ds-color-brand-flamingo-500);
  margin-bottom: 0 !important;
}

.token.operator {
  background-color: unset !important;
}

auro-accordion:not(.section) {
  margin-top: 1rem !important;
  display: block;
}

auro-accordion:not(.section):nth-child(2) {
  margin-block-start: 0;
}

auro-accordion[class~="section"]::part(accordion) {
  padding-right: 2px;
  display: block;
}

.accordion-content {
  padding-top: 1rem;
}

.token.operator {
  background-color: unset !important;
}

auro-accordion:not(auro-accordion-group *) {
  margin-top: 1rem !important;
  display: block;
}

.pre-wrapper {
  position: relative;
}

.copy-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  opacity: 0;
  transition: opacity 0.15s ease;
  background: var(--ds-color-container-primary-default, #fff);
  border: 1px solid var(--ds-color-border-secondary-default, #ccc);
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  color: var(--ds-color-text-secondary-default, #333);
  z-index: 1;

  &:hover {
    background: var(--ds-color-container-secondary-default, #f0f0f0);
  }
}

.pre-wrapper:hover .copy-btn {
  opacity: 1;
}

// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Example wrappers
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

.exampleWrapper {
  background-color: var(--ds-basic-color-surface-default);
  padding: 1rem;
  border-radius: 0.5rem;
  margin-top: 1rem;
}

.exampleWrapper--ondark {
  background-color: var(--ds-basic-color-surface-inverse);
  padding: 1rem;
  border-radius: 0.5rem;
  margin-top: 1rem;
}

// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Tables
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

table {
  --ds-color-container-secondary-default: transparent;

  &.compressed {
    width: unset !important;
    margin: var(--ds-size-50) 0 var(--ds-size-100) !important;

    th,
    td {
      padding: var(--ds-size-50) !important;
    }
  }
}

tr:not(:last-of-type) {
  border-bottom: 1px solid var(--ds-color-border-tertiary-default);
}

// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Layout
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

body {
  padding: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.contentWrapper {
  display: flex;
  flex-direction: row-reverse;
  gap: 25px;
  align-items: flex-start;

   > nav {
    width: 200px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;

    auro-nav {
      display: block;
    }
  }
}

// .contentWrapper > nav {
//   width: 200px;
//   flex-shrink: 0;
//   position: sticky;
//   top: 0;
//   height: 100vh;
//   overflow-y: auto;
// }

// .contentWrapper > nav auro-nav {
//   display: block;
// }

.mainContent {
  flex: 1;
  display: flex;
  flex-direction: column;
  flex-basis: 0;
  box-sizing: border-box;
  min-width: 0;
}

.scrollWrapper {
  flex: 1;
  min-height: 0;
}

auro-nav {
  max-width: 200px;
  position: sticky;
  top: 2rem;
  align-self: flex-start;
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
}

// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Misc elements
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

auro-anchorlink[class~="level2"] {
  padding-left: var(--ds-size-200);
}

p:first-of-type {
  margin-top: 0;
}

.note,
.warning {
  margin: 10px 0;
  padding: 10px;
  border-radius: 6px;
  font-style: italic;
}

.note{
  background-color: var(--ds-basic-color-surface-neutral-subtle);
  color: var(--ds-basic-color-texticon-muted);
}

.warning {
  background-color: var(--ds-basic-color-status-error-subtle);
  color: var(--ds-basic-color-status-error)
}

auro-header {
  margin-top: 1rem;
}