/* You can add global styles to this file, and also import other style files */

// importing from cardinal via npm
@import "node_modules/@cardinal/spacing/spacing.scss";
@import "node_modules/@cardinal/color/color.scss";
@import "node_modules/@cardinal/z-depth/z-depth.scss";
@import "node_modules/@cardinal/grid/grid.scss";
@import "node_modules/@cardinal/typography/typography.scss";
@import "node_modules/@cardinal/iconography/iconography.scss";
@import "node_modules/@cardinal/lists/lists.scss";

// // import tools not avaliable in cardinal via npm
@import "generic/cardinal-reboot";
@import "tools/functions/helpers";
@import "utilities/accessibility";
@import "utilities/helpers";
@import "elements/general";

// // import below for importing project styles locally. WARNIING: run all components in development mode when working with sass locally or updating none component styles.
// @import "../projects/cardinal/src/styles/core-styles.scss";

//variables specific to catalog design
$monaco: monaco, Consolas, "Lucida Console", monospace !default;

//general styles for overal design
html {
  min-width: fit-content;
}

body {
  height: 100%;
  margin: 0;
}

strong {
  font-weight: $font-weight-semibold;
}

p { width: 55%; }

li,
.li {
  padding: 1.5% 0;
}

// helpers not in cardinal
.-displayBlock {
  display: block !important;
}

.-displayFlex {
  display: flex !important;
}

.-semiBold {
  font-weight: $font-weight-semibold !important;
}

//Pages Overview Sections
.overview {
  p {
    font-size: $body-lg-font-size;
    font-weight: $font-weight-light;

    &:first-of-type {
      margin-bottom: $spacing-lg !important;
    }
  }
}

.usage-guides,
.icon-library {
  margin-top: $spacing-5xl;
  max-width: 960px;

  a:not(.ta-button):not(.ta-iconButton) {
    margin-left: 0 !important;
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  .h5,
  h6 {
    margin-left: 0 !important;
    text-transform: capitalize;

    code {
      margin: 0;
    }
  }

  h2 {
    margin-bottom: $spacing-2xl;
    line-height: normal;
  }

  h4 {
    margin: $spacing-2xl $spacing-none $spacing-xl $spacing-none;
  }

  p {
    margin: $spacing-xl auto $spacing-xl $spacing-none;
    width: 55%;
  }

  .code-example {
    background-color: $ta-grey100;
    padding: $spacing-4xl $spacing-6xl;
    display: flex;
    justify-content: center;

    .ta-container {
      width: -webkit-fill-available;
      width: -moz-available;
      width: stretch;
    }

    p {
      width: 100%;
      margin: 0;
      font-size: $h5-font-size;
    }

    table {
      width: 80%;
    }

    th {
      border-bottom: 1px solid #ccc;
    }

    td,
    th {
      text-align: left;
      padding: 2% 2% 2% 0;
    }
  }

  .font-families-examples {
    h4 {
      font-size: $body-lg-font-size;
    }
  }

  hr {
    margin: $spacing-5xl 0;
  }

  pre {
    margin: 2% 0 !important;
  }

  ol,
  ul {
    p {
      width: 60%;
    }
  }
}

code,
.code {
  background: $ta-grey200;
  border-color: transparent;
  display: inline-block;
  font-family: $monaco;
  font-size: $default-font-size;
  padding: 0 5px;
  margin: 1% 0;
}

p > code,
li > code {
  background: $ta-grey200;
}

//divider under titles in catalog
hr.ta-shortDivider {
  width: 6%;
  color: $ta-red500;
  border: none;
  background-color: $ta-red500;
  height: 0.125rem;
  margin: $spacing-xs 0 $spacing-xl 0;
}

.usage-warning {
  margin-top: $spacing-xl;
  margin-bottom: $spacing-3xl;
  max-width: 960px;

  p {
    width: 100%;
  }
}

.usage-warning-img,
.usage-warning-illustrations {
  width: 100%;
  max-width: 960px;
  height: auto;
}

.table {
  p {
    margin: $spacing-2xl $spacing-none $spacing-xl $spacing-none !important;
  }

  table {
    border: 0.5rem;
    border-collapse: collapse;
    margin-top: $spacing-xl;
    width: auto;
  }

  thead tr {
    border-bottom: 2px solid $ta-grey700;

    th {
      border-collapse: separate;
      font-size: $label-font-size;
      font-weight: $font-weight-medium;
      text-transform: capitalize;
      padding: $spacing-sm $spacing-lg;
      padding-left: 0;
    }
  }

  tr,
  td,
  th {
    text-align: left;
    padding: $spacing-md  $spacing-lg $spacing-md $spacing-none;
    font-weight: $font-weight-book;
  }

  tbody tr {
    border-bottom: 2px solid $ta-grey400;

    &:last-child {
      border-bottom: none;
    }

    td {
      text-align: left;
      padding: $spacing-md $spacing-lg $spacing-md $spacing-none;
      font-weight: $font-weight-book;
    }
  }
}

.cardinalTable {
  tbody tr {
    td {
      font-weight: $font-weight-book;
      font-size: inherit;
      text-align: left;
      padding: $spacing-md $spacing-2xl $spacing-md $spacing-none;
    }
  }
}

//wrapping the entire main section of catalog evenly
.main-document {
  width: 100%;
  max-width: $ta-bp-lg;
  padding: 0 10%;
  margin-top: $spacing-5xl;
  margin-bottom: $spacing-4xl;
}

//using the note styles for informative notes on catalog
.note {
  width: 55% !important;

  p {
    line-height: inherit;
    font-weight: $font-weight-light !important;
    width: 55% !important;
  }

  span {
    margin-right: $spacing-xs;
    font-weight: $font-weight-semibold;
  }

  li {
    margin-bottom: $spacing-lg;
    width: 55%;
  }
}

//tabs and highlights on focusable elements
:focus {
  outline: $ta-blue500 auto 5px;
}

// Removes focus when links are selected by mouse, leaves them for all other cases
.js-focus-visible :focus:not([data-focus-visible-added]) {
  outline: none;
}

//for warning areas specific to catalog page. use component for usage warnings under design and code usage warnings
i {
  &.warning {
    &::before {
      content: $error;
      color: $caution;
      padding-right: 1%;
    }
  }
}

//design usage page
.new-icons-intro {
  display: flex;
  margin-top: 5%;

  &__images {
    display: flex;
    flex-direction: column;

    img {
      width: 90% !important;
    }

    p,
    h5 {
      margin-top: $spacing-md;
    }
  }
}

// Override for prism.js toolbar plugin styling
.code-toolbar {
  pre,
  pre[class*="language-"] {
    background-color: $black;
    color: $ta-grey100;
    margin-top: $spacing-none !important;
    padding: $spacing-xs $spacing-sm;
  }

  code[class*="language-"] {
    font-family: $monaco;

    span {
      color: $ta-grey100;
    }
  }
}

.toolbar {
  top: $spacing-md !important;
  right: $spacing-sm !important;

  .toolbar-item a {
    background-color: $ta-blue500 !important;
    border-radius: 2px !important;
    color: $ta-white100 !important;
    font-family: $whitney;
    font-weight: 600;
    font-size: 1rem !important;
    transition: all ease 0.3s;
    padding: $spacing-sm $spacing-md !important;
    white-space: nowrap;

    &:hover {
      background-color: lighten($ta-blue500, 5%) !important;
    }

    &:active {
      background-color: darken($ta-blue500, 5%) !important;
    }
  }
}

//over view area icon in p tag
.icon-overview.ta-icon.ta-info-icon {
  align-items: center;
  display: inline-flex;
  margin-left: $spacing-xs;

  &::before {
    color: #406a9c;
    font-size: rem(20px);
  }
}

//tabs page specific
.tab-themes {
  display: flex;
  justify-content: space-between;

  .usage-warning-img,
  .usage-warning-illustrations {
    max-width: 45.5rem;
  }

  .tabsColorList {
    margin-right: 3rem;
  }
}

// Breakpoint Examples
.bpEx1 {
  padding: $spacing-sm;
  text-align: center;

  @include ta-media('>md') {
    padding: $spacing-xl;
  }
}

$catalog-weird-breakpoints: ">200px", "<815px";

$phone: 0;
$tablet: 480px;
$desktop: 840px;

$phone-only: ">=$#{phone}", "<#{tablet}";
$tablet-only: ">=#{$tablet}", "<#{$desktop}";
$desktop-only: ">=#{$desktop}";

.bpAliases {
  background-color: $ta-blue500;
  color: $white;
  text-align: center;

  @include ta-media($tablet-only...) {
    background-color: $ta-red500;
  }

  @include ta-media($desktop-only...) {
    background-color: $ta-pink500;
  }
}

#your-component {
  align-items: center;
  background-color: $ta-grey200;
  display: flex;
  height: 30vh;
  margin-top: 2%;
  justify-content: center;
}

// TODO (Jacy): Remove from catalog during reskin
.-noCatalogFlexWrap {
  flex-wrap: nowrap !important;
}
