@import 'modern-normalize/modern-normalize.css';
@import '@blueprintui/themes/dist/index.min.css';
@import '@blueprintui/themes/dist/dark/index.min.css';
@import '@blueprintui/themes/dist/compact/index.min.css';
@import '@blueprintui/typography/dist/index.min.css';
@import '@blueprintui/layout/dist/index.min.css';
@import './styles/code.css';
@import './styles/carbon.css';

*:not(:defined) {
  display: none;
}

html,
body {
  height: 100%;
  scroll-padding-top: 24px;
}

body {
  --background: var(--bp-layer-background-100);
  background: var(--background);
}

[bp-theme~='dark'] body {
  background: linear-gradient(0deg, hsl(228deg, 12%, 13%) 0%, var(--bp-layer-background-100) 14%);
  background-attachment: fixed;
}

.heading-logo a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

body > bp-page > bp-header bp-header-item:not(:first-child):has(a) {
  display: none;
}

@media (width >= 1024px) {
  body > bp-page > bp-header bp-header-item:not(:first-child):has(a) {
    display: block;
  }
}

.heading-logo img {
  width: 30px;
  margin-top: -2px;
}

pre[class*='language-'] {
  overflow-x: auto;
}

#carbonads {
  display: none;
}

bp-page .page-content {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px;
}

@media (width >= 1100px) {
  bp-page .page-content {
    padding: 48px 18px;
  }
}

@media (width >= 1800px) {
  bp-page .page-content {
    padding-inline: 130px;
    max-width: calc(1200px + 260px);
  }
}

bp-page > div:has(aside) {
  max-width: 1300px;
}

bp-page:has(.no-container) {
  --padding: 0 !important;
}

.page-content:has(.demo-grid.no-container) {
  margin: 0;
  padding: 0;
  max-width: 100%;
}

bp-panel#nav-panel {
  --width: 260px;
  --padding: var(--bp-size-500) var(--bp-size-500) var(--bp-size-500) 0;

  bp-tree-item a {
    font-weight: var(--bp-text-weight-semibold);
    text-decoration: none;
  }

  bp-tree-item bp-tree-item {
    font-weight: var(--bp-text-weight-regular);

    a {
      font-size: var(--bp-text-size-200);
    }
  }
}

article aside {
  padding-left: 12px;
  position: sticky;
  top: 24px;
  display: none;
}

article aside a {
  color: var(--bp-text-color-400);
  text-decoration: none;
}

article aside a:hover {
  text-decoration: underline;
}

article h2[docs-heading] {
  margin-top: var(--bp-space-md);
}

article h3[docs-heading] {
  margin-top: var(--bp-space-xs);
}

article h1[docs-heading],
article bp-divider + [docs-heading] {
  margin-top: 0;
}

article [bp-text='subsection'] a {
  color: inherit;
}

@media (width >= 1200px) {
  #carbonads {
    display: block;
  }

  article aside {
    display: flex;
  }

  article .article-header-section {
    min-height: 110px;
  }
}

[demo] > *:not([bp-layout*='grid']) {
  background: var(--bp-layer-background-300);
  min-width: var(--bp-size-1000);
  min-height: var(--bp-size-1000);
  display: flex;
  align-items: center;
  justify-content: center;
}

[demo] {
  background: var(--bp-layer-background-200);
  padding: var(--bp-size-500);
}

[demo] > [demo] {
  padding: 0;
}

[resizable] {
  overflow: auto;
  resize: horizontal;
}

article pre + h2 {
  margin-top: var(--bp-size-900);
}

.element-example {
  --example-padding: var(--bp-size-800);
  background: var(--bp-layer-background-100);
  border: var(--bp-object-border-width-100) solid var(--bp-object-border-color-200);
  border-radius: var(--bp-object-border-radius-100);
  padding: var(--example-padding);
  width: 100%;
  resize: horizontal;
  overflow: hidden;
}

.element-example details {
  width: calc(100% + calc(var(--example-padding) * 2));
  margin: calc(var(--example-padding) * -1);
  margin-top: var(--example-padding);
}

.element-example summary {
  cursor: pointer;
  width: 100%;
  padding: var(--bp-size-500) var(--bp-size-600);
  border-top: var(--bp-object-border-width-100) solid var(--bp-object-border-color-200);
  filter: brightness(0.97);
  color: var(--bp-text-color-400);
  font-size: var(--bp-text-size-200);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 24px;

  thead {
    border-bottom: var(--bp-object-border-width-100) solid var(--bp-object-border-color-200);
  }

  th {
    text-align: start;
    padding: 8px;
  }

  td {
    padding: 8px;
    border-bottom: var(--bp-object-border-width-100) solid var(--bp-object-border-color-200);
  }
}

.token-table tr td:first-child {
  padding-right: 40px;
  position: relative;
}

.token-table tr td:first-child bp-button-icon {
  position: absolute;
  right: 0;
}

.demo-grid {
  outline: 2px solid var(--bp-object-border-color-200);
}

.demo-grid-all {
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
}

.demo-grid-card {
  outline: 1px solid var(--bp-object-border-color-200);
  min-height: 300px;
  place-items: center;
  place-content: center;
  display: flex;
  flex-direction: column;
  padding: 36px 0 12px;
  gap: 12px;
  position: relative;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: background-color 100ms linear;
}

.demo-grid-card:focus {
  outline: var(--bp-interaction-outline); /* stylelint-disable-line declaration-block-no-duplicate-properties */
  outline: var(--bp-interaction-outline-webkit); /* stylelint-disable-line declaration-block-no-duplicate-properties */
  outline-offset: var(--bp-interaction-outline-offset);
}

.demo-grid-card:hover {
  background: hsl(232deg 19% 40% / 5%);
}

.demo-grid-card {
  position: relative;
}

.demo-grid-card h3 {
  position: absolute;
  top: 18px;
  left: 18px;
}

.demo-grid-card .demo-grid-content {
  scale: 85%;
  width: 100%;
}

.demo-grid-card-link {
  position: absolute;
  inset: 0;
  z-index: 99;
}

.demo-grid [bp-layout~='block'],
.demo-grid [bp-layout~='inline'] {
  align-content: center;
  justify-content: center;
}

.demo-grid bp-nav {
  --height: 200px !important;
}

.home {
  padding: 18px;
}

.home-demo-grid {
  opacity: 0.08;
  z-index: -1;
  position: fixed;
  inset: 0;
  width: 100%;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  outline: 0;
}

.home-demo-grid .demo-grid-content {
  scale: 85%;
}

.home-demo-grid[hidden] {
  display: none !important;
}

.home-demo-grid .demo-grid-card {
  min-height: min(250px, 25vh);
  padding: 0 12px;
  background: transparent;
  border-color: var(--bp-object-border-color-100);
}

@media (width >= 1800px) {
  .home-demo-grid {
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  }

  .home-demo-grid .demo-grid-card {
    min-height: min(300px, 25vh);
  }
}

[bp-theme*='dark'] .home-demo-grid {
  opacity: 0.1;
}

.home-demo-grid .demo-grid-card {
  opacity: 0;
}

[bp-theme*='dark'] .home .hero h1,
[bp-theme*='dark'] .home .hero p {
  text-shadow: #000 0 0 12px, #000 0 0 24px;
  filter: initial !important;
}

.home-demo-grid .demo-grid-card:not([hidden]) {
  display: flex !important;
  animation: fade-in .8s ease-out forwards;
}

.home .hero {
  padding: 24px;
  position: relative;
  z-index: 1;
}

.home bp-card[slot="header"] {
  border: 0;
}

.home .element-example {
  max-width: 550px;
}

@keyframes fade-in {
  0% {
    display: none;
    opacity: 0;
  }

  1% {
    display: block;
  }

  100% {
    display: block;
    opacity: 1;
  }
}
