*,
:after,
:before {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  justify-content: normal;
  counter-reset: number;
  color: #333;
}

section {
  position: relative;
  width: 90%;
  max-width: 900px;
  margin: 30px auto;
}

h1 {
  position: relative;
  width: 100%;
  margin-top: 30px;
  line-height: 1;
  font-size: clamp(2rem, -0.875rem + 8.333vw, 3.3rem);
}

h2 {
  position: relative;
  font-size: clamp(1rem, -0.875rem + 8.333vw, 2.5rem);
  line-height: 100%;
  padding: 0 30px 0 0;
}

iframe {
  display: block;
  width: 100%;
  border: 0;
}

.title-link {
  display: inline-block;
  color: #333;
  text-decoration: none;
}

.title-link span {
  position: relative;
  display: inline-block;
}

.title-link img {
  transition: filter 0.5s ease-in-out;
}

.title-link:hover img {
  transition: filter 1s ease-in-out;
  filter: invert(1);
}

.logo-leaflet {
  position: absolute;
  top: -3px;
  z-index: -1;
  right: -70px;
  width: 140px;
}

@media (max-width: 750px) {
  .logo-leaflet {
    top: 5px;
    right: -50px;
    width: 100px;
  }
}

@media (max-width: 600px) {
  .logo-leaflet {
    top: 10px;
    right: -30px;
    width: 60px;
  }
}

.logo-leaflet svg {
  pointer-events: painted;
}

.iframe-wrapper {
  margin: 30px auto;
  border: 2px solid #333;
  overflow: hidden;
  resize: both;
}

.grid {
  display: grid;
  width: 100%;
  grid-template-areas:
    "nav head"
    "nav main";
  grid-template-columns: 300px 1fr;
  grid-template-rows: 100px;
  gap: 0 30px;
  max-width: 1350px;
}

header {
  grid-area: head;
  padding-right: 30px;
}

nav {
  grid-area: nav;
}

main {
  grid-area: main;
  width: 100%;
  padding-right: 30px;
  margin: 0 auto 40px auto;
  overflow: auto;
}

nav {
  width: 100%;
  height: 100vh;
  background: #fff;
  overflow-y: auto;
  min-height: 100%;
  padding-bottom: 30px;
  border-right: 2px solid #333;
  box-shadow: 0 0 10px rgba(51, 51, 51, 0.2);
}

nav a {
  position: relative;
  display: block;
  text-decoration: none;
  color: #000;
  padding: 10px 10px 10px 40px;
  font-size: 16px;
}

nav a:hover {
  background: #343434;
  color: #fff;
  text-decoration: none;
}

.active-menu {
  background: #3e3e3e;
}

a.active-menu {
  color: #fff;
}

.show-menu {
  display: none;
  cursor: pointer;
  border: 0;
}

@media (max-width: 900px) {
  .grid {
    grid-template-columns: 100%;
    grid-template-areas:
      "head"
      "main";
    gap: 0;
  }

  .show-menu {
    position: fixed;
    display: block;
    bottom: 30px;
    right: 0;
    padding: 10px 15px;
    background: #333;
    color: #fff;
    border-radius: 5px 0 0 5px;
    z-index: 10;
  }

  nav {
    position: fixed;
    z-index: 9;
    max-width: 320px;
    min-height: 100%;
    width: 100%;
    bottom: 0;
    top: 0;
    transform: translateX(-400px);
    transition: transform 0.5s ease-in-out;
  }

  .show-menu-examples nav {
    transform: translateX(0);
  }

  main {
    padding: 10px;
  }
  header {
    padding: 10px;
  }
}

.icon {
  position: absolute;
  display: inline-block;
  cursor: pointer;
  width: 2em;
  height: 2em;
  stroke-width: 0;
  right: 0;
  stroke: currentColor;
  fill: #03a9f4;
  top: 7px;
}

.icon:hover {
  fill: #f40303;
}

.item {
  position: relative;
  border-bottom: 1px solid rgba(58, 58, 58, 0.268);
  transition: color 0.2s ease-in-out, background-color 0.2s ease-in-out;
}

.item:before {
  display: flex;
  align-items: center;
  justify-content: center;
  content: attr(rel);
  position: absolute;
  left: 0;
  line-height: 120%;
  background-color: #fff;
  border-radius: 0 30% 30% 0;
  font-size: 16px;
  width: 30px;
  height: 30px;
  top: 0;
  bottom: 0;
  margin: auto;
}

.active-menu.item:before {
  background-color: #0095ff;
  color: #fff;
}
.active-menu.item:hover:before {
  color: #fff;
}

.item:before,
.item:hover:before {
  color: #000;
}

.code-place-js,
.code-place-css {
  font-size: 1rem;
  margin: 10px auto 50px;
}

.code-place-js code,
.code-place-css code {
  border-radius: 5px;
  padding: 3rem 1.5em 1.5rem;
}

.language {
  position: relative;
}

[data-lang="js"]::before,
[data-lang="css"]::before {
  content: attr(data-lang);
  position: absolute;
  top: 5px;
  left: 5px;
  color: #fff;
  background-color: #000;
  padding: 10px;
  border-radius: 5px 0 0 0;
  text-transform: uppercase;
}

.copy-code {
  position: absolute;
  top: 5px;
  right: 5px;
  color: #fff;
  background-color: #000;
  padding: 10px;
  border-radius: 0 5px 0 0;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  transition: color 0.3s ease-in-out, background-color 0.3s ease-in-out;
}

.copy-code:hover {
  color: #000;
  background-color: #fff;
}

details {
  display: flex;
  align-items: center;
}

details > summary {
  list-style-type: none;
  outline: none;
  cursor: pointer;
  border-radius: 5px;
  color: #2094f3;
}

details > summary::-webkit-details-marker {
  display: none;
}

details > summary::before {
  content: "→ ";
}

details[open] > summary::before {
  padding-right: 8px;
  content: "↓ ";
}

details[open] > summary {
  margin-bottom: 0.5rem;
}

.open-source {
  white-space: nowrap;
}
