/*******************************************************************************
 * Global Variables
 ******************************************************************************/
:root {
  /* COLORS */
  --colors-white: #ffffff;
  --colors-ultramarine: #071385;
  --colors-blue-ribbon: #2e42f5;
  --colors-fountain-blue: #54bec5;
  --colors-black-rock: #160226;
  --colors-lemon-chiffon: #fff9c4;

  /* PADDING */
  --padding-global: clamp(2.5rem, 5vw, 5rem);
  --padding-column-gap: 2.4rem;

  /* FONTS */
  --font-size-smaller: clamp(calc(1.4rem * 0.95), 1.4vw, 1.4rem);
  --font-size-small: clamp(calc(1.6rem * 0.9), 1.6vw, 1.6rem);
  --font-size-normal: clamp(calc(2rem * 0.85), 2vw, 2rem);
  --font-size-large: clamp(calc(2.4rem * 0.8), 2.4vw, 2.4rem);

  --font-family-headline: 'Vazirmatn', helvetica, sans-serif;
  --font-family-body: 'Vazirmatn', helvetica, sans-serif;
}

/*******************************************************************************
 * Resets and Global Defaults
 ******************************************************************************/
::selection {
  background: var(--colors-blue-ribbon);
  color: var(--colors-white);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Remove all animations and transitions for people that prefer not to see them */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Remove default margin */
body,
h1,
h2,
h3,
h4,
p,
figure,
fieldset,
blockquote,
dl,
dd,
ul,
ol {
  margin: 0;
  padding: 0;
}

/* Set core root defaults */
html {
  scroll-behavior: smooth;
  font-size: 62.5%;
  min-height: 100vh;
}

/* Set core body defaults */
body {
  text-rendering: optimizeSpeed;
  font-family: var(--font-family-body);
  font-size: var(--font-size-normal);
  color: var(--colors-black-rock);
}

/* Inherit fonts for inputs and buttons */
input,
button,
textarea,
select {
  font: inherit;
  -webkit-appearance: none;
}

fieldset {
  border: 0;
}

img {
  width: 100%;
}

small {
  font-size: var(--font-size-smaller);
}

a,
a > * {
  color: var(--colors-fountain-blue);
  text-decoration: none;
}

a:hover,
a > *:hover {
  color: var(--colors-blue-ribbon);
}

iframe {
  width: 100%;
  height: 70rem;
  border: 0;
  border-radius: 0.75rem;
  box-shadow: rgba(0, 0, 0, 0.4) 0 0.2rem 0.4rem, rgba(0, 0, 0, 0.3) 0 0.7rem 1.3rem -0.3rem,
    rgba(0, 0, 0, 0.2) 0 -0.3rem 0 inset;
}

/*******************************************************************************
 * List Styles
 ******************************************************************************/

/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
ul[role='list'],
ol[role='list'] {
  margin-left: 0;
  list-style: none;
}

ul:not([role='list']),
ol:not([role='list']) {
  margin: 1.6rem 0 1.6rem 2.4rem;
}

li li {
  list-style: disc;
  margin-left: 3.6rem;
}

/*******************************************************************************
 * Code Styles
 ******************************************************************************/

pre {
  width: 100%;
  overflow: auto;
  font-size: inherit;
  border-radius: 0.75rem;
  box-shadow: 0 0 1rem rgba(0, 0, 0, 0.5);
  border: 0;
  transition: box-shadow 0.5s;
  background: var(--colors-black-rock);
}

pre:hover {
  box-shadow: 0 0 2rem var(--colors-fountain-blue);
}

code,
pre {
  font-family: monospace;
  font-size: 80%;
}

code {
  background: var(--colors-lemon-chiffon);
  color: var(--colors-black-rock);
  padding: 0.1rem 0.2rem;
  border-radius: 0.2rem;
}

code[class*='language-'],
pre[class*='language-'] {
  font-size: var(--font-size-small) !important;
}

/*******************************************************************************
 * Table Styles
 ******************************************************************************/

table {
  border-collapse: collapse;
  font-size: var(--font-size-small);
  box-shadow: 0 0 1rem rgba(0, 0, 0, 0.5);
  transition: box-shadow 0.5s;
}

table:hover {
  box-shadow: 0 0 2rem var(--colors-fountain-blue);
}

thead {
  background: var(--colors-black-rock);
  color: var(--colors-white);
}

th,
td {
  padding: 1rem;
}

td {
  border: 0.1rem solid var(--colors-black-rock);
}

td:nth-child(3) {
  text-align: center;
}

tr:nth-child(even) {
  background: #eeeeee;
}

/*******************************************************************************
 * Button Styles
 ******************************************************************************/

button {
  cursor: pointer;
  padding: 1.2rem 2.6rem;
  border: 0;
  font-size: var(--font-size-small);
  transition: all 150ms ease-in-out;
  font-weight: 600;
  color: var(--colors-black-rock);
  border-radius: 1rem;
  border: none;
  text-shadow: 0 0.1rem 0.1rem rgba(0, 0, 0, 0.12);
  background: linear-gradient(
      180deg,
      rgba(255, 255, 255, 0) 70.48%,
      #fff 93.62%,
      rgba(255, 255, 255, 0) 100%
    ),
    linear-gradient(180deg, rgba(30, 54, 87, 0) 0%, rgba(30, 54, 87, 0.01) 100%), #fafafa;
  box-shadow: rgba(0, 0, 0, 0.08) 0 0 0 0.1rem, rgba(0, 0, 0, 0.08) 0 -0.2rem 0.1rem 0 inset,
    rgba(255, 255, 255, 0.5) 0 0.2rem 0.1rem 0 inset, 0 0.2rem 0.5rem -0.1rem rgba(0, 0, 0, 0.05),
    0 0.1rem 0.3rem -0.1rem rgba(0, 0, 0, 0.3);
}

button:hover {
  background-color: #f5f5f5;
}

button:active {
  background-color: #f1f1f1;
  box-shadow: rgba(0, 0, 0, 0.08) 0 0 0 0.1rem, rgba(0, 0, 0, 0.08) 0 0.1rem 0.1rem 0 inset,
    rgba(255, 255, 255, 0.1) 0 0.2rem 0.1rem 0 inset, 0 0.2rem 0.5rem -0.1rem rgba(0, 0, 0, 0.05);
}

.content-wrapper h1 + *,
.content-wrapper h2 + *,
.content-wrapper h3 + *,
.content-wrapper h4 + *,
.content-wrapper h5 + *,
.content-wrapper h6 + *,
.content-wrapper p + * .content-wrapper table + *,
.content-wrapper ol + *,
.content-wrapper ul + *,
.content-wrapper iframe + * {
  margin-top: 1.2rem;
}

.content-wrapper .content > * + p {
  margin-bottom: 2.4rem;
}

.content-wrapper h1:has(code),
.content-wrapper h2:has(code),
.content-wrapper h3:has(code),
.content-wrapper h4:has(code),
.content-wrapper h5:has(code),
.content-wrapper h6:has(code) {
  margin-top: 3rem;
}

.example-iframe {
  margin-top: 2.4rem;
}

/*******************************************************************************
 * Mobile Nav Button Styles
 ******************************************************************************/

.is-scrolling .mobile-nav-toggle {
  opacity: 0;
}

.mobile-nav-toggle {
  display: none;
  padding: 0.75rem 1.2rem 0.6rem;
  position: fixed;
  right: var(--padding-global);
  top: var(--padding-global);
  z-index: 2;
  opacity: 1;
  transition: right 0.3s 0.1s, opacity 0.1s;
}

.mobile-nav-open .mobile-nav-toggle {
  right: calc((var(--padding-global) + 5rem) * -1);
}

.mobile-nav-toggle .mobile-nav-toggle-icon {
  width: 2.4rem;
}

/*******************************************************************************
 * Site Styles
 ******************************************************************************/

.three-columns {
  --sidebar-width: clamp(20rem, 25vw, 25rem);
  display: flex;
  width: 100%;
}

.left-column {
  padding: var(--padding-global) calc(var(--padding-global) / 2);
  position: sticky;
  top: 0;
  width: var(--sidebar-width);
  height: 100vh;
  font-size: var(--font-size-small);
  box-shadow: 0 0.2rem 1rem rgba(0, 0, 0, 0.1);
}

.table-of-contents {
  margin-top: 1.6rem;
}

.middle-column {
  width: calc(100% - var(--sidebar-width));
  max-width: 90rem;
  margin: 0 auto;
  padding: var(--padding-global) var(--padding-global) 0 var(--padding-global);
}

.content-wrapper-footer {
  padding: var(--padding-global) 0;
}

/*******************************************************************************
 * Mobile Styles
 ******************************************************************************/

@media (max-width: 750px) {
  .three-columns {
    --sidebar-width: 30rem;
  }

  .left-column {
    width: var(--sidebar-width);
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1;
    background: #fff;
    font-size: var(--font-size-large);
    transform: translateX(calc(var(--sidebar-width) * -1));
    transition: transform 0.3s;
  }

  .mobile-nav-toggle {
    display: inline-block;
  }

  .mobile-nav-open .left-column {
    transform: translateX(0);
  }

  .table-of-contents li {
    padding: 0.75rem 0;
  }

  .table-of-contents li li {
    padding: 0.25rem 0;
  }

  .middle-column {
    width: 100%;
    max-width: 90rem;
    margin: 0 auto;
    padding: var(--padding-global);

    filter: blur(0);
    opacity: 1;
    transition: filter 0.3s, opacity 0.3s;
  }

  .mobile-nav-open .middle-column {
    filter: blur(0.5rem);
    opacity: 0.5;
  }
}

/*
 * Synthwave '84 Theme originally by Robb Owen [@Robb0wen] for Visual Studio Code
 * Demo: https://marc.dev/demo/prism-synthwave84
 *
 * Ported for PrismJS by Marc Backes [@themarcba]

 * Ported even further by us, MARKIII, Inc [@mkiiiai]
 */

code[class*='language-'],
pre[class*='language-'] {
  color: #fff;
  text-shadow: 0 0 0.2rem #100c0f, 0 0 0.5rem #dc078e33, 0 0 1rem #fff3;
  background: none;
  font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
  font-size: 1em;
  text-align: left;
  white-space: pre;
  word-spacing: normal;
  word-break: normal;
  word-wrap: normal;
  line-height: 1.5;

  -moz-tab-size: 4;
  -o-tab-size: 4;
  tab-size: 4;

  -webkit-hyphens: none;
  -moz-hyphens: none;
  -ms-hyphens: none;
  hyphens: none;
}

/* Code blocks */
pre[class*='language-'] {
  padding: 1em;
  margin: 0.5em 0;
  overflow: auto;
}

:not(pre) > code[class*='language-'],
pre[class*='language-'] {
  background-color: var(--colors-black-rock);
  /*background-image: linear-gradient(to bottom, #2a2139 75%, #34294f);*/
}

/* Inline code */
:not(pre) > code[class*='language-'] {
  padding: 0.1em;
  border-radius: 0.3em;
  white-space: normal;
}

.token.comment,
.token.block-comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: #8e8e8e;
}

.token.punctuation {
  color: #ccc;
}

.token.tag,
.token.attr-name,
.token.namespace,
.token.number,
.token.unit,
.token.hexcode,
.token.deleted {
  color: #e2777a;
}

.token.property,
.token.selector {
  color: #72f1b8;
  text-shadow: 0 0 0.2rem #100c0f, 0 0 1rem #257c5575, 0 0 3.5rem #21272475;
}

.token.function-name {
  color: #6196cc;
}

.token.boolean,
.token.selector .token.id,
.token.function {
  color: #54bec5;
  text-shadow: 0 0 0.2rem #001716, 0 0 0.3rem #03edf975, 0 0 0.5rem #03edf975, 0 0 0.8rem #03edf975;
}

.token.class-name {
  color: #54bec5;
  text-shadow: 0 0 0.2rem #001716, 0 0 0.3rem #03edf975, 0 0 0.5rem #03edf975, 0 0 0.8rem #03edf975;
}

.token.constant,
.token.symbol {
  color: #2e42f5;
  text-shadow: 0 0 0.2rem #100c0f, 0 0 0.5rem #dc078e33, 0 0 1rem #fff3;
}

.token.important,
.token.atrule,
.token.keyword,
.token.selector .token.class,
.token.builtin {
  color: #f92aad;
  text-shadow: 0 0 0.2rem #393a33, 0 0 0.8rem #f39f0575, 0 0 0.2rem #f39f0575;
}

.token.string,
.token.char,
.token.attr-value,
.token.regex,
.token.variable {
  color: #f87c32;
}

.token.operator,
.token.entity,
.token.url {
  color: #67cdcc;
}

.token.important,
.token.bold {
  font-weight: bold;
}

.token.italic {
  font-style: italic;
}

.token.entity {
  cursor: help;
}

.token.inserted {
  color: green;
}
