@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-display: swap;
  src: 
  local("Open Sans"), url("./fonts/OpenSans-Regular.woff2") format("woff2");
}

:root.light-mode {
  --grey-fg: #aeaeae;
  --bg: #ffffff;
  --fg: #383838;
  --card-bg: #f0f1f3;
  --card-fg: #383838;
  /* text (api side menus h3...)  */
  --menu-grey: #888;
  --hover-border: #484848;
  --hover-bg: #d3d3d3;
  --hover-fg: #353434;
  --border: #d9e1e4;
  --link: #0e78ce;
  /* docs related */
  --box-fg: #181818;
  --info-bg: #cfd4fc;
  --info-accent: #0f1c8a;
  --notice-bg: #fceac5;
  --notice-accent: #2e1d00;
  --warn-bg: #fad1df;
  --warn-accent: #8a0f3a;
  --code-bg: #f0f1f3;
  /* support page related */
  --supported-fg: #009000;
  --eol-fg: #ff0000;
}
:root.dark-mode {
  --bg: #0c0c0c;
  --fg: #fafafa;
  --card-bg: #181818;
  --card-fg: #f7f4f4;
  --hover-bg: #3f3e3e;
  --hover-fg: #f2f2f2;
  --hover-border: #fafafa;
  --border: #d9e1e4;
  /* text (api side menus h3...) */
  --menu-grey: silver;
  --link: #259dff;
  --menu-em: #a2a0a0eb;
  /* docs related */
  --box-fg: #ffffff;
  --info-bg: #171d4f;
  --info-accent: #bdc3ff;
  --notice-bg: #4e4022;
  --notice-accent: #f9e8c3;
  --warn-bg: #4e2232;
  --warn-accent: #f9c3d6;
  --code-bg: #2b2b2b;
  /* support page related */
  --supported-fg: #299009;
  --eol-fg: #ff1a1a;
}

:root {
  --nav-border-radius: 5px;
  --btn-border-radius: 10px;
  --header-height: 60px;
  --nav-font-weight: 700;
  --version-icon-border-radius: 8px;
}

ul {
  list-style: none;
}

a {
  color: var(--link);
  text-decoration: underline;
}

.button {
  display: block;
  padding: 3px 5px;
  border-radius: 3px;
  cursor: pointer;
  color: var(--box-fg);
}

body {
  font-family: "Open Sans Variable", sans-serif, system-ui;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  background: var(--bg);
  margin: 0;
  padding: 0;
  color: var(--fg);
}

body.no-scroll {
  overflow: hidden;
}

body.scroll header {
  box-shadow: 0 0 4px var(--card-bg);
}

header {
  /* position: fixed;
    top: 0;
    left: 0; */
  background: var(--card-bg);
  width: 100%;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* padding-inline: 1; */
  /* z-index: 100; */
  border-bottom: 1px solid var(--hover-fg);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-inline-end: 1rem;
  margin-inline-start: auto;
}

/* logo branding */
.logo-container {
  margin-left: 2rem;
  margin-top: 0.5rem;
  a {
    text-decoration: none;
  }

  @media screen and (max-width:400px) {
    margin-left: 4rem;
  }
}

.ex-logo {
  fill: var(--card-fg);
}


/* theme and lang btn */
button.theme-btn {
  background-image: url(./images/moon.svg);
  background-size: 100%;
  background-repeat: no-repeat;
  background-position: center;
  width: 30px;
}

button.theme-btn,
button.lang-btn {
  cursor: pointer;
  appearance: none;
  background-color: inherit;
  border: 0;
  border-radius: var(--nav-border-radius);
  height: 30px;
  &:is(:hover, :focus) {
    color: var(--hover-fg);
    background-color: var(--hover-bg);
  }
}

button.lang-btn {
  color: var(--card-fg);
  font-size: inherit;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;

  &::after {
    content: "";
    display: block;
    width: 0.8em;
    height: 0.5em;
    background-color: var(--card-fg);
    clip-path: polygon(100% 0%, 0 0%, 50% 100%);
    cursor: pointer;
    pointer-events: none;
    transition: transform 0.4s ease-in-out;

    @media screen and (max-width:510px) {
      display: none;
      #current-lang {
        display: none;
      }
    }
  }

  @media screen and (max-width:510px) {
    #current-lang {
      display: none;
    }
  }
}

div.desktop-lang-switcher {
  position: relative;
  > button.lang-btn {
    &:is(:focus, :hover) {
      & + ul {
        display: block;
        opacity: 1;
        visibility: visible;
      }
    }
  }
  /* enable lang list tabbing on keyboard focus */
  &:focus-within .lang-list {
    display: block;
    opacity: 1;
    visibility: visible;
  }

  > ul.lang-list {
    display: none;
    opacity: 0;
    position: absolute;
    list-style: none;
    visibility: hidden;
    &:is(:hover, :focus) {
      display: block;
      opacity: 1;
      visibility: visible;
    }
    li a {
      display: block;
      padding: 5px 20px 5px 20px;
      text-decoration: none;
      color: var(--card-fg);
      &:is(:hover, :focus) {
        background: var(--hover-bg);
      }
    }

    @media screen and (max-width:510px) {
      left: -1rem;
    }
  }

  /* rotate arrow */
  &:is(:hover, :focus-within) button.lang-btn::after {
    transform: rotate(180deg);
  }
}

/* primary navigation */
.nav-container {
  display: flex;
  gap: 5rem;
  align-items: center;
  margin-inline-start: 3rem;

  @media screen and (max-width:850px) {
    gap: 0;
    flex-direction: row-reverse;
  }

  @media screen and (max-width:510px) {
    margin-inline-start: 1rem;
  }
}

ul.navbar-list {
  display: flex;
  gap: 0.5rem;
  padding: 0;
  margin: 0;

  li a {
    text-decoration: none;
    color: var(--card-fg);
    display: flex;
    height: 2rem;
    width: 5rem;
    justify-content: center;
    align-items: center;
    border-radius: var(--nav-border-radius);

    &:is(:hover, :focus) {
      color: var(--hover-fg);
      background-color: var(--hover-bg);
    }
  }

  li a.active {
    color: var(--hover-fg);
    background-color: var(--hover-bg);
  }

  @media screen and (max-width:850px) {
    display: none;
    gap: 0;
    &.open {
      display: flex;
      flex-direction: column;
      position: absolute;
      top: var(--header-height);
      left: 0;
      max-height: fit-content;
      z-index: 100;
      background-color: var(--card-bg);
      color: var(--card-fg);
      width: 100vw;
      margin: 0;

      li a {
        justify-content: flex-start;
        width: 100vw; 
        border-radius: 0;
        border-bottom: 1px solid var(--border);
        padding-inline: 1rem;
       }
    }   
  }
}

.page-content {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto;

  nav.sidebar {
    padding: 2rem 2rem 1rem;
    /* border-right: 1px solid var(--card-fg); */
    grid-column: 1/2;
    grid-row: 1/1;
  }
  main {
    padding: 2rem;
    grid-column: 2/3;
    grid-row: 1/1;
  }
  nav.tocbar {
    padding: 2rem  1rem 1rem 0;
    /* border-left: 1px solid var(--card-fg); */
    transition: height 0.6s ease-in;
    grid-column: 3/4;
    grid-row: 1/1;
  }

  nav.sidebar,
  nav.tocbar {
    position: sticky;
    top: 0;
    height: 100vh;
    width: 15rem;
    min-width: 15rem;
  }

  @media screen and (min-width:1550px) { 
    grid-template-columns: 1fr auto minmax(600px, 900px) auto 1fr;

    nav.sidebar {
      grid-column: 2/3;
    }

    main {
      grid-column: 3/4;
    }

    nav.tocbar {
      grid-column: 4/5;
    }
  }

  @media screen and (max-width:1200px) { 
    nav.sidebar {
      min-width: 10rem;
    }
    nav.tocbar {
      min-width: 14rem;
    }
  }
   
  @media screen and (max-width:1100px) {
    nav.tocbar {
      padding: 0.5rem;
    }

    nav.sidebar {
      padding: 1rem;
    }

    main {
      padding-inline: 1rem;
    }
  }

  @media screen and (max-width:950px) {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto 1fr;

    nav.sidebar {
      grid-column: 1/2;
      grid-row: 1/3;
    }

    main {
      grid-column: 2/3;
      grid-row: 2/3;
    }

    nav.tocbar {
      grid-column: 2/3;
      grid-row: 1/2;

      position: static;
      height: fit-content;
      display: grid;
      grid-template-columns: 1fr max-content;
      grid-template-rows: max-content 1fr;
      padding: 1rem;
      padding-bottom: 0;
      border: none;
      > .toc-container {
        grid-column: 1/1;
        grid-row: 1/3;
        > .toc-toggle-btn {
          display: flex;
          justify-content: space-between;
          opacity: 1;
        }
      }
      > .edit-github-btn {
        grid-column: 2/3;
        grid-row: 1/2;
        margin: 0;
      }
    }
  }

  @media screen and (max-width:700px) {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(2, auto) 1fr;
    nav.sidebar {
      grid-column: 1/1;
      grid-row: 1/2;
      position: static;
      width: 90vw;
      height: fit-content;
      border: none; 
      margin-inline: auto;
      padding-bottom: 0;
      > .version-toggle-btn {
        display: flex;
        justify-content: space-between;
        opacity: 1;
        width: 100%;
      }
      > #sidebar {/* sidebar label*/
        display: none;
      }
    }
    main {
      grid-column: 1/1;
      grid-row: 3/4;
      min-width: 85vw;
    }
    nav.tocbar {
      grid-column: 1/1;
      grid-row: 2/3;
      padding-top: 0;
      grid-template-columns: 1fr;
      grid-template-rows: 1fr max-content;
      margin-inline: auto;
      width: 90vw;
      > .toc-container {
        grid-column: 1/1;
        grid-row: 1/1;
        width: 100%;
        > .toc-toggle-btn {
          width: 100%;
        }
      }
      > .edit-github-btn {
        grid-column: 1/1;
        grid-row:2/3;
        padding: 0.3rem;
        margin-top: 0.5rem;
      }
   }
  }

  @media screen and (max-width:400px) {
    nav.sidebar,
    nav.tocbar {
      width: 85vw;
    }
  }
}

/* sidebar navigation */

ul.ex-version {
  padding: 0;
  li {
    width: 100%;
    margin-block-start: 1rem;
    margin-inline: auto;
  }
  a {
    padding-inline: 1rem;
    display: block;
    text-decoration: none;
    color: var(--menu-grey);
    font-weight: var(--nav-font-weight);
    &:is(:hover, :focus) {
      border-radius: var(--btn-border-radius);
      color: var(--fg);
      outline: 1px solid var(--card-fg);
    }
  }
  a.active {
    border-radius: var(--btn-border-radius);
    color: var(--fg);
    outline: 1px solid var(--card-fg)
  }

  @media screen and (max-width:700px) {
    display: none;
    margin-top: 0;
    padding: 0.2rem;
    border-radius: var(--nav-border-radius);
    width: 100%;
    &.open {
      display: block;
      background-color: var(--card-bg);
    }
    li {
      margin-block-start: 0.3rem;
    }
  }
}

/* github btn */

a.edit-github-btn {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  width: fit-content;
  padding: 0.5rem;
  border-radius: var(--btn-border-radius);
  margin: 1rem;

  .gh-icon {
    fill: var(--card-fg);
  }

  &:is(:hover, :active, :focus) {
    color: var(--fg);
    background-color: var(--hover-bg);
    outline: 1px solid var(--card-fg);
  }
}

button.mobile-nav {
    display: none;
    border: none;
    cursor: pointer;
    background-color: inherit;
    border-radius: var(--nav-border-radius);

    &::after {
      content: "";
      height: 2rem;
      width: 2rem;
      mask-image: url(./images/nav-mobile-icon.svg);
      mask-size: 2rem;
      mask-repeat: no-repeat;
      mask-position: center;
      display: flex;
      justify-content: center;
      align-items: center;
      background-color: var(--card-fg);
    }

    &:is(:hover, :focus) {
      background-color: var(--hover-bg);
      outline: var(--border) solid 1px;
    }

    @media screen and (max-width:850px) {
      display: block;
    }
}

/* show deprecated icon */
.ex-version a.deprecated {
  display: flex;
  justify-content: space-between;
  &::after {
    content: "";
    mask-image: url("./images/deprecate-icon.svg");
    mask-size: 15px;
    width: 15px;
    height: 15px;
    mask-position: center;
    mask-repeat: no-repeat;
    background-color: var(--eol-fg);
    margin-block: auto;
  }
}

/* show latest icon */
.ex-version a.latest {
  display: flex;
  justify-content: space-between;
  &::after {
    font-size: 0.7rem;
    padding-block: 2px;
    padding-inline: 5px;
    content: "5.1.0 latest";
    width: fit-content;
    height: 15px;
    color : white;
    background-color: var(--supported-fg);
    margin-block: auto;
    border-radius: var(--version-icon-border-radius);
  }
}

/* show LTS icon */
.ex-version a.lts {
  display: flex;
  justify-content: space-between;
  &::after {
    font-size: 0.7rem;
    padding-inline: 5px;
    padding-block: 2px;
    content: "4.2.1 maintenance";
    width: fit-content;
    height: 15px;
    color : white;
    background-color: var(--supported-fg);
    margin-block: auto;
    border-radius: var(--version-icon-border-radius);
  }
}

#overlay {
  position: fixed;
  left: 0;
  top: 0;
  opacity: 0.6;
  width: 100%;
  height: 100%;
  display: none;
  z-index: 1;
  background-color: var(--bg);
}

/* ************** */
h1 {
  font-size: 30px;
  line-height: 36px;
}

#intro h2,
#api-doc h1 {
  font-weight: normal;
}

h1,
h2,
h3 {
  margin: 5px 0;
  color: var(--card-fg);
  -webkit-font-smoothing: antialiased;
}

/* .content h1 {
  margin-bottom: 20px;
}

.content table a.ignore-underline {
  text-decoration: none;
} */

p em {
  font-weight: bold;
  color: var(--card-fg);
}

p {
  margin: 10px 0;
  line-height: 1.35em;
}

strong,
th {
  color: var(--card-fg);
}

main.home {
  max-width: 75rem;
  margin: 40px auto 2%;
  padding-inline: 5%;
}

#home-content {
  display: flex;
}

.en-doc #home-content {
  margin-top: 150px;
}

.non-en-doc:has(#i18n-notice-box.hidden) #home-content {
  margin-top: 150px;
}

/* .non-en-doc:has(#i18n-notice-box:not(.hidden)) .content {
  margin-top: 50px;
} */

#homepage-leftpane {
  min-width: 500px;
  margin-right: 30px;
  font-size: 90%;
  padding-top: 13px;
}

#homepage-rightpane {
  min-width: 500px;
  padding: 25px 30px 0px 0px;
}

#homepage-rightpane iframe {
  min-width: 100%;
  min-height: 273px;
}

#announcements {
  margin-top: 40px;
  padding: 0 16px;
  background: var(--notice-bg);
  border: 1px solid var(--notice-accent);
  border-radius: 3px;
  font-size: 0.9em;
  & a {
    color: var(--notice-accent);
    text-decoration: underline;
  }
}

#announcements ul {
  padding-left: 0;
}

#announcements li {
  list-style: none;
  margin-bottom: 16px;
}

#announcements p {
  margin: 6px 0;
}

#announcements time {
  font-weight: normal;
  margin-right: 12px;
}

.announcement-title {
  font-weight: bold;
  margin-bottom: 11px;
  display: flex;
  align-items: center;
  column-gap: 8px;
}

#install-command {
  font-family: Consolas, Monaco, "Andale Mono", monospace;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 3px;
  max-width: 375px;
}

/* .content {
  margin: 153px 0 7%;
  display: flex;
  flex-direction: row-reverse;
} */

/* .content main {
  padding-inline: 16px;
  max-width: 900px;
  margin-inline: auto;
} */

.flex-row-content {
  flex-direction: row;
}

span.block-section {
  display: block;
}

#intro h2 {
  font-size: 25px;
  margin-bottom: 10px;
}

#api-doc section {
  padding-left: 0.5rem;
}

#api-doc > h3 {
  padding-top: 10px;
  padding-bottom: 5px;
  font-weight: bold;
  font-size: 24px;
  color: var(--menu-grey);
}

#api-doc h2 {
  font-weight: bold;
  font-size: 29px;
  margin: 40px 0 20px;
}

#api-doc section h3 {
  padding-top: 10px;
  padding-bottom: 5px;
  font-weight: bold;
  font-size: 18px;
}

#api-doc h4 {
  font-size: 16px;
  font-weight: bold;
}

#api-doc h5 {
  font-size: 14px;
  font-weight: bold;
  color: var(--menu-grey);
}

/* scroll */

*::-webkit-scrollbar {
  background-color: opacity(var(--box-fg), 0.145);
  width: 16px;
}

*::-webkit-scrollbar-thumb {
  border-radius: 8px;
  border: 4px solid transparent;
  background-clip: content-box;
  background-color: var(--menu-grey);
}

*::-webkit-scrollbar-thumb:hover {
  background-color: var(--hover-bg);
}

*::-webkit-scrollbar-thumb:active {
  background-color: var(--menu-grey);
}

/* links */

.h2:target {
  display: block;
  padding-top: 40px;
}

#api-doc *:target,
#page-doc *:target {
  margin-top: -120px;
  padding-top: 120px;
  z-index: -1;
}



#description .express {
  display: block;
  font: 4.5em "Helvetica Neue", "Open Sans", sans-serif;
  font-weight: 100;
  margin-bottom: 0.25em;
}

#description .express > a {
  color: var(--card-fg);
  text-decoration: none;
}

#description .express a#express-version {
  font-size: 0.2em;
  margin-left: 0.5em;
  color: var(--link);
  font-weight: 400;
  text-decoration: underline;
}

#description {
  margin-bottom: 43px;
  -webkit-font-smoothing: antialiased;
}

#description .description {
  position: relative;
  top: -5px;
  font: 100 4.1em "Helvetica Neue", "Open Sans", sans-serif;
  color: var(--menu-grey);
  line-height: 0.87;
  margin: unset;
}

#description .description a {
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

#doc-langs {
  text-align: center;
  font-size: 12px;
}

#doc-langs p {
  margin: 3px 0;
}

/* code */

code {
  background-color: var(--code-bg);
  color: var(--card-fg);
  margin-block: -0.125rem;
  font-size: 13px;
  padding: 0.125rem 0.375rem;
  border-radius: 6px;
}

pre {
  padding: 16px;
  border-radius: 3px;
  border: 1px solid #ddd;
  background-color: var(--code-bg);
}

pre code {
  padding: 0;
}

/* top button */

.scroll #top {
  opacity: 0.5;
  display: initial;
}

.scroll #top:hover {
  opacity: 1;
}

#top {
  line-height: 0;
  border-radius: 2px;
  position: fixed;
  bottom: 15px;
  right: 15px;
  padding: 8px;
  text-decoration: none;
  opacity: 0;
  transition: opacity 300ms;
  border: 1px solid var(--border);
  background-color: var(--card-bg);
  color: var(--card-fg);
  display: none;
}

/* clearfix */

.clearfix:after {
  content: ".";
  display: block;
  clear: both;
  visibility: hidden;
  line-height: 0;
  height: 0;
}

.clearfix {
  display: inline-block;
}

html[xmlns] .clearfix {
  display: block;
}

* html .clearfix {
  height: 1%;
}

/* boxes */

#boxes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  row-gap: 20px;
  column-gap: 50px;
  margin-top: 30px;
}

#boxes h2 {
  line-height: 1.25em;
  color: var(--card-fg);
  background: none;
  margin-top: 0;
  padding-top: 0;
}

#boxes h2 a {
  text-decoration: none;
  color: var(--card-fg);
}

#boxes div {
  list-style: none;
}

/* doc specific */

.doctable,
table {
  /* margin: 1em 1em 1em 0; */
  border: 1px solid var(--border);
  border-collapse: collapse;
  width: 100%;
  @media screen and (max-width:600px) {
    font-size: smaller;
  }
}

.doctable td,
.doctable th,
table td,
table th {
  padding: 7px;
  line-height: 120%;
  vertical-align: top;
  border: 1px solid var(--border);
}

.doctable tr th,
table tr th {
  background: var(--card-bg);
  font-size: 110%;
}

.doctable td p:first-child {
  margin-top: 0;
}

.doctable td p,
li p {
  width: 100% !important;
}

.doctable ul {
  margin: 20px 0;
}

/* doc boxes */

.doc-box {
  padding: 16px;
  color: var(--box-fg);
  border-radius: 0 6px 6px 0;
  margin-bottom: 1rem;
}

.doc-box p {
  margin: 0 0 8px 0;
}

.doc-box p:last-child {
  margin: 0;
}

.doc-title {
  display: flex;
  align-items: center;
  gap: 3px;
  font-weight: 600;
}

.doc-notice {
  background: var(--notice-bg);
  border-left: 3px solid var(--notice-accent);
}

.doc-notice a {
  color: var(--notice-accent);
  text-decoration: underline;
}

.doc-info {
  background: var(--info-bg);
  border-left: 3px solid var(--info-accent);
}

.doc-info a {
  color: var(--info-accent);
  text-decoration: underline;
}

.doc-warn {
  background: var(--warn-bg);
  border-left: 3px solid var(--warn-accent);
}

.doc-warn a {
  color: var(--warn-accent);
  text-decoration: underline;
}

#i18n-notice-box {
  margin: 100px 3% 20px 3%;
  position: relative;
}

#close-i18n-notice-box {
  position: absolute;
  top: 3px;
  right: 4px;
  color: var(--notice-accent);
  cursor: pointer;
}

/* general */

#app-settings-property {
  width: 200px;
}


/* #mobile-menu {
  display: none;
  position: relative;
} */

pre,
code {
  white-space: pre-wrap !important;
}

footer {
  font-size: 12px;
  /* margin: 60px 5% 30px; */
  display: flex;
  gap: 24px;
  flex-direction: column;
  border-top: 1px solid var(--card-fg);
  padding: 4rem;
}

#footer-content {
  width: 100%;
  justify-content: space-between;
  gap: 32px;
  display: flex;
}

#footer-copyright {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
}

#footer-copyright a {
  width: fit-content;
}

#footer-copyright img {
  max-width: 125px;
}

#footer-policy {
  display: flex;
  flex-wrap: wrap;
  column-gap: 20px;
  row-gap: 8px;
  justify-content: center;
  font-size: 15px;
}

#footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-social {
  display: flex;
  gap: 20px;
  font-size: 20px;
  @media screen and (max-width: 340px) {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 2.5rem;
  }
}

/* navigation */
/* #navbar {
  line-height: 30px;
  display: flex;
  align-items: center;
}

#navbar a {
  color: var(--card-fg);
  text-decoration: none;
}

#navbar a.active {
  font-weight: bold;
}

#navbar ul {
  list-style: none;
}

#navmenu {
  display: flex;
  gap: 20px;
} */

/* content doc */

/* #blog-doc {
  padding: 0.5rem;
  width: fit-content;
} */

/* dropdown menu */

.submenu {
  position: relative;
  list-style: none;
}

.submenu-content {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translate(-50%);
  margin: auto;
  box-shadow: 1px 2px var(--hover-fg);
  z-index: 1000;
  min-width: max-content;
  width: fit-content;
  border: 1px solid var(--border);
  border-radius: 12px;
  background-color: var(--bg);
  padding: 0;
  display: none;
}

.submenu-content li:first-child a {
  border-radius: 12px 12px 0 0;
}

.submenu-content li:last-child a {
  border-radius: 0px 0px 12px 12px;
}

/* .submenu.open .submenu-content {
  display: initial;
} */
/* 
#navmenu {
  padding: 0;
  margin: 0;
  right: 0px;
  z-index: 1000;
  margin-right: 15px;
}

.submenu-content li a {
  display: block;
  padding: 2px 20px 2px 20px;
}

#navbar .submenu-content a:hover {
  background: var(--hover-bg);
  text-decoration: none;
} */
/* 
#language-picker-menu {
  display: none;
} */

/* TOC side menu */
/* TODO TOC style is reusable but need to remove ID selectors */
#menu {
  /* min-width: 13rem; */
  padding-inline: 0.5rem;
  font-size: 1rem;
  overflow-y: auto;
  max-height: 65vh;
  padding-block-end: 0.5rem;
  margin-block: 0;
}

/* #menu.blog-side-menu {
  max-width: 20rem;
  max-height: fit-content;
} */

#menu ul a,
#menu > li > a {
  display: block;
  color: var(--menu-grey);
  padding-inline: 0.5rem;
  text-decoration: none;

  &:is(:hover, :active, :focus) {
    border-radius: var(--btn-border-radius);
    color: var(--fg);
    outline: 1px solid var(--card-fg);
  }
}

#menu ul a.active {
  border-radius: var(--btn-border-radius);
  color: var(--fg);
  outline: 1px solid var(--card-fg);
}

#menu em {
  font-weight: bold;
  color: var(--menu-em);
  font-size: 1rem;
}

#menu li {
  cursor: pointer;
  list-style: none;
  margin-block-start: 0.3rem;
}

#menu ul,
ul#side-menu {
  display: none;
  opacity: 0;
  height: 0;
  overflow: hidden;
}

#menu ul.active,
ul#side-menu.active {
  height: auto;
  padding-inline: 0.5rem;
  display: block;
  opacity: 1;
  padding-block: 0.5rem;
}

#menu > li > a {
  font-weight: var(--nav-font-weight);
  padding-inline-start: 1rem;
}

@media  screen and (max-width:950px) {
  #menu {
    display: none;
    opacity: 0;
    max-height: 0;
    background-color: var(--card-bg);
  }

  #menu.open {
    display: block;
    opacity: 1;
    max-height: 35vh;
    padding-inline: 1rem;
    border-left: 2px solid var(--border);
    margin-top: 0.3rem;
    border-bottom-right-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
  }

  #menu > li > a,
  #menu ul a {
    padding: 0.5rem;
    color: var(--card-fg);
    &:is(:hover, :active, :focus) {
      color: var(--hover-fg);
      background: var(--hover-bg);
    }
  }

  #menu li ul li > em {
    font-size: 0.8rem;
    padding-inline: 1rem;
    padding-block: 0.3rem;
    background-color: var(--hover-bg);
    border-radius: 0.3rem;
  }
}

/**********/

/* can't find this in proj*/
h2 a {
  color: var(--card-fg) !important;
}



/* keep search as it is */

/* search */

/* #q {
  display: none;
  height: 2.5em;
  max-width: 100%;
  padding: 5px;
} */

.algolia-autocomplete {
  /* max-width: 9em; */
  > input {
    cursor: pointer;
    color: var(--fg);
    background-color: var(--bg);
  }
  > input::placeholder {
    color: var(--fg);
  }
  #q {
    height: 2.5em;
    display: initial;
    border-radius: var(--nav-border-radius);
    border: 1px solid var(--border);
    transition: color 0.3s ease;
    padding-inline: 12px;
    outline: none;
    &:focus-visible,
    &:focus {
      border-color: var(--hover-border);
      border-width: 2px;
    }

    @media all and (max-width: 1000px) {
      max-width: 4.75rem;
      padding-inline: 5px;
    }

    @media all and (max-width: 500px) {
      display: none;
    }
  }
}

/* @media all and (min-width: 950px) {
  .algolia-autocomplete {
    margin-right: 15px;
    max-width: 12em;
  }
} */

/* TODO navbar id is removed */
#navbar {
  .ds-dropdown-menu .ds-dataset-1 {
    background-color: var(--bg);
    .ds-suggestions {
      /* background-color: var(--bg); */
      color: var(--fg);
    }
    .ds-suggestion a {
      background-color: var(--bg);
      color: var(--fg);
    }
    .ds-suggestion a {
      background-color: var(--bg);
      color: var(--fg);
    }
    .algolia-docsearch-suggestion--category-header {
      color: var(--fg);
    }
    .algolia-docsearch-suggestion--wrapper {
      background-color: var(--bg);
      .algolia-docsearch-suggestion--subcategory-column {
        color: var(--menu-grey);
      }
      .algolia-docsearch-suggestion--title,
      .algolia-docsearch-suggestion--text {
        color: var(--fg);
      }
      .algolia-docsearch-suggestion--highlight {
        color: var(--link);
        background-color: initial;
      }
    }
    .algolia-docsearch-suggestion {
      background-color: initial;
    }
    .algolia-docsearch-suggestion--content
      .algolia-docsearch-suggestion--no-results {
      background-color: initial;
    }
  }
  .ds-suggestion.ds-cursor .algolia-docsearch-suggestion--title,
  .ds-suggestion.ds-cursor .algolia-docsearch-suggestion--content {
    background-color: var(--hover-bg);
  }
}

/* *********** */

.content-404 {
  height: 70vh;
  padding: 153px 32px 7%;
  text-align: center;
  display: flex;
  justify-content: center;
  flex-direction: column;
}

.content-404 p {
  font-size: 16px;
}


/* toc title */
.toc-heading {
  display: block;
  cursor: default;
  padding-inline-start: 1rem;
  & > em {
    font-weight: bold;
    color: var(--menu-em);
    font-size: 1rem;
  }

  @media screen and (max-width:950px) {
    display: none;
  }
}

/* TOC toggle btn */

.toc-toggle-btn,
.version-toggle-btn {
  cursor: pointer;
  display: none;
  font-size: 1rem;
  padding-block: 0.5rem;
  padding-inline: 0.75rem;
  opacity: 0;
  width: 40vw;
  border: 1px solid #000;
  border-radius: var(--btn-border-radius);
  color: #000;
  background-color: #fff;

  &:is(:hover, :active, :focus) {
    background-color: #ebf2f5;
  }

  &::after {
    content: "";
    display: block;
    width: 0.8em;
    height: 0.5em;
    background-color: black;
    clip-path: polygon(100% 0%, 0 0%, 50% 100%);
    cursor: pointer;
    pointer-events: none;
    margin-top: 0.34rem;
    transition: transform 0.4s ease-in-out;
  }

  &.open::after {
    transform: rotate(180deg);
  }
}

/* responsive */

/* @media all and (max-width: 1440px) {
  #menu {
    top: 75px;
  }
} */

@media all and (max-width: 1110px) {
  #boxes {
    grid-template-columns: 1fr 1fr;
  }

  #home-content {
    flex-direction: column;
  }

  #install-command {
    display: none;
  }

  #home-content .pane {
    min-width: auto;
    font-size: 74%;
  }

  #homepage-leftpane {
    padding-top: 0px;
  }

  #homepage-rightpane {
    padding-top: 0;
    padding-right: 0;
  }

  .table-scroller {
    width: 100%;
    overflow: scroll;
  }

  code {
    word-break: break-all;
  }

  ul {
    padding-left: 5%;
  }

  h1 {
    font-size: 22px;
    line-height: 26px;
  }

  h2 {
    font-size: 18px;
    line-height: 25px;
  }

  h3 {
    font-size: 16px;
    line-height: 23px;
    word-break: break-all;
  }

  h4 {
    font-size: 16px;
    line-height: 18px;
    font-weight: normal;
  }

  #home-content {
    margin: 60px 0 0 5%;
    padding-right: 5%;
  }

  #description {
    margin-bottom: 35px;
  }

  #description .express {
    display: none;
  }

  #description .description {
    font-size: 3em;
    line-height: 0.9em;
    font-weight: 200;
  }

  #install-command {
    width: 100%;
    margin-right: 5%;
  }
/* 
  .logo-container {
    margin-inline: auto;
  } */

  #home-menu {
    display: block;
    position: absolute;
    top: 7px;
  }

  #overlay.blurs {
    display: block;
  }

  .menu ul {
    display: block;
  }

  #footer-content {
    flex-wrap: wrap;
    justify-content: center;
  }

  #footer-copyright > a {
    width: 100%;
    display: flex;
    justify-content: center;
  }

  #doc-langs {
    font-size: 11px;
  }

  /* .header-right {
    display: flex;
    align-items: center;
    gap: 8px;
  } */
/* 
  #language-picker-menu #navmenu > li:first-child {
    display: flex;
  }

  #language-picker-menu #navmenu {
    max-height: 70vh;
    overflow-y: auto;
    scrollbar-width: thin;
    text-align: center;
  }

  #language-picker-menu {
    display: block;
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
  } */
}

/* TOC responsive */
@media all and (max-width: 800px) {
  /* .content {
    margin-inline: 0.5rem;
    margin-block-start: 100px;
    flex-direction: column;
  } */

  #api-doc,
  #blog-doc,
  #page-doc {
    /* padding-inline: 1rem; */
    /* width: 100%; */
  }

  /* .toc-container {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 1rem;
  } */

  /* #menu {
    display: none;
    opacity: 0;
    max-height: 0;
    background-color: var(--card-bg);
    min-width: 100%;
  }

  #menu.open {
    display: block;
    opacity: 1;
    max-height: 35vh;
    padding-inline: 1rem;
    border-left: 2px solid var(--border);
    margin-top: 0.3rem;
    border-bottom-right-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
  } */

  /* .toc-container {
    width: 100%;
  } */

  /* #menu-toggle.show {
    display: block;
    opacity: 1;
  } */

  /* #menu > li > a,
  #menu ul a {
    padding: 0.5rem;
    &:is(:hover, :active, :focus) {
      background: var(--hover-bg);
    }
  } */

  /* #menu li ul li > em {
    font-size: 0.8rem;
    padding-inline: 1rem;
    padding-block: 0.3rem;
    background-color: var(--hover-bg);
    border-radius: 0.3rem;
  } */

  /* .toc-heading {
    display: none;
  } */
}

@media all and (max-width: 540px) {
  #boxes {
    grid-template-columns: 1fr;
  }
}

@media all and (max-width: 420px) {
  #app-settings-property {
    width: auto;
  }

  #description .express {
    display: none;
  }
}

@media print {
  header {
    position: absolute;
  }

  /* #mobile-menu {
    display: none;
  } */
}

/* For image callouts in writing-middleware.md  */

.callout {
  position: relative;
}

#mw-fig {
  border-collapse: separate;
  padding: 0;
  border: 0;
  width: 960px;
  margin-bottom: 20px;
}
#mw-fig-imgcell {
  margin: 0;
  padding: 0px;
  border: 0;
  width: 410px;
}
#mw-fig-img {
  margin: 0px;
  padding: 0px;
  width: 410px;
  height: 308px;
}

.mw-fig-callouts {
  margin: 0;
  padding: 0 0 0 5px;
  border: 0;
  width: 550px;
}

/* Blog page styles*/
/* #blog-doc {
  margin: 0 1rem;
  @media all and (max-width: 800px) {
    margin: 0;
  }
} */
#blog-doc:has(> h1#express-blog),
#blog-doc:has(> h1#write-a-blog-post) {
  min-height: 300px;
}
#blog-doc .blog-details ~ p > img {
  width: 200px;
  float: right;
  margin: 0.5rem;
}
#blog-doc p {
  font-size: 1.1em;
}
.blog-posts {
  display: flex;
  flex-direction: column;
  row-gap: 10px;
}
.blog-post {
  width: 100%;
  background-color: var(--card-bg);
  display: flex;
  padding: 10px;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 5px;
  border: 1px solid var(--border);
  box-shadow: 2px 3px var(--hover-fg);
  transition: 0.3s;
}
.blog-post:hover {
  background-color: var(--hover-bg);
  border: 1px solid var(--hover-border);
  box-shadow: 2px 3px var(--menu-grey);
}
.blog-post img {
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
}
.blog-post .blog-details {
  display: flex;
  flex-direction: column;
}
.blog-details div:first-child {
  margin-bottom: 5px;
}
.blog-tag {
  font-size: 12px;
}
.blog-title {
  font-size: 1.3rem;
  line-height: 1.5rem;
  font-weight: 500;
  padding-right: 0.2em;
}
.blog-title a {
  color: var(--card-fg);
}
.blog-excerpt {
  font-size: 0.75rem;
}
.blog-img {
  max-width: 100%;
  margin: auto;
}
.blog-author {
  font-style: italic;
}
.blog-date {
  font-weight: bold;
  font-size: 85%;
}
/* mobile-only */
@media (max-width: 500px) {
  #blog-doc {
    display: flex;
    flex-wrap: wrap;
    flex-direction: column;
    align-items: center;
    margin-right: 0;
    padding-right: 10px;
  }

  #blog-doc .blog-details + p > img {
    margin-bottom: 15px;
  }
}

/* blog tablet and up*/
@media (min-width: 768px) {
  .blog-post {
    margin: auto;
  }
  .blog-tags {
    margin-bottom: 20px;
  }
  .blog-title {
    font-size: 1.3rem;
    margin-bottom: 20px;
    line-height: 1.5rem;
  }
  .blog-post .blog-details {
    display: flex;
    flex-direction: row;
    margin-left: 1rem;
    font-size: 90%;
  }
  .blog-post .blog-details div:first-child {
    margin-right: 20px;
  }
  .blog-details {
    font-size: 1rem;
  }
  .blog-excerpt {
    line-height: initial;
    font-size: 0.85rem;
    font-weight: 300;
    margin-top: auto;
    margin-bottom: 10px;
    max-width: 80%;
  }
}

strong.supported {
  color: var(--supported-fg);
}
strong.eol {
  color: var(--eol-fg);
}

.logo-table {
  display: flex;
  flex-wrap: wrap;
  row-gap: 8px;
  column-gap: 48px;
}

.logo-table h3 {
  margin-bottom: 12px;
}

.hidden-dark {
  display: flex;
}

.hidden-light {
  display: none;
}

blockquote {
  margin-left: 0;
  font-weight: 600;
  font-style: italic;
  padding-left: 1.2em;
  border-left: 0.25rem solid var(--border);
}

@media all and (max-width: 1110px) {
  /* header {
    column-gap: 12px;
    padding-inline: 32px;
  } */

  /* .desktop-lang-switcher {
    display: none;
  } */

  /* #mobile-menu {
    display: block;
  } */

  /* .algolia-autocomplete {
    display: none !important;
  } */
/* 
  #navbar {
    padding: 0;
    top: 1px;
    position: static;
  }

  #navmenu > li:first-child {
    display: none;
  }

  #navmenu > li {
    border-bottom: 1px solid var(--border);
    margin: 0;
    min-height: 47px;
    background: var(--card-bg);
    cursor: pointer;
    display: flex;
    align-items: center;
  }

  #navmenu > li.open:hover {
    background: var(--card-bg);
  }
  #navmenu > li:hover {
    background: var(--hover-bg);
    & ul {
      background-color: var(--card-bg);
    }
  }

  #navmenu {
    left: 0;
    padding: 0;
    top: 57px;
    width: 100%;
    position: absolute;
    display: none;
  }

  #navmenu.opens {
    display: block;
  }

  #navbar a {
    font-size: 19px;
    margin: 0;
    width: 100%;
    height: 100%;
    padding-left: 5%;
  }

  #navbar .submenu.open {
    flex-direction: column;
    align-items: initial;
    > a {
      border-bottom: 1px solid var(--border);
    }
  } */

  /* .submenu.open > a {
    display: flex;
    align-items: center;
    min-height: 47px;
  }

  .submenu-content {
    width: 100%;
    position: static;
    display: none;
    margin-top: 7px;
    background-color: var(--card-bg);
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    max-height: 190px;
    overflow-y: auto;
    overflow-x: hidden;
    transform: none;
    cursor: pointer;
  }

  .submenu-content li > a {
    width: 100%;
  } */
/* 
  .submenu-content li:first-child a {
    border-radius: 0;
  }

  .submenu-content li:last-child {
    border-bottom: 0;
  }

  .submenu-content li:last-child a {
    border-radius: 0;
  }

  .submenu-content.open {
    display: inline-block;
  }

  #navbar .submenu-content li a {
    font-size: 16px;
    padding: 5px 5px 5px 5%;
    padding-left: 10%;
  }

  .submenu-content li {
    border-bottom: 1px solid var(--border);
  } */
}

/* write new css below */

.trans-icon {
  mask-image: url(./images/translation.svg);
  background-color: var(--card-fg);
  mask-position: center;
  mask-size: cover;
  mask-repeat: no-repeat;
  width: 20px;
  height: 20px;
}
