header {
  position: static;
  top: 0;
  background-color: var(--barva-pozadi);
  z-index: 100;
  border-bottom: 1.5px solid var(--pm-color);
  padding-block: .8rem;
  font-family: var(--header-font);
}

header>.container {
  display: grid;
  position: relative;
  grid-template-areas:
    'logo lang'
    'logo links';
}

.langbar {
  grid-area: lang;
  justify-self: end;
  display: flex;
  gap: 0.5rem;
}

.langbar a {
  color: var(--pm-color);
  text-decoration: underline;
}

.logo-wrapper {
  grid-area: logo;
  /* max-height: clamp(50px, 5vh, 150px); */
  height: 90px;
}

.logo {
  max-height: 100%;
  width: auto;
  max-width: 90%;
}

nav {
  grid-area: links;
  align-self: self-end;
  justify-self: end;
}

/* DESKTOP STYLES (Default or Min-width) */
@media screen and (min-width: 801px) {
  header {
    position: sticky;
  }

  #menuToggle input,
  #menuToggle span {
    display: none;
  }

  #menuList {
    display: flex;
    gap: 1rem;
    padding: 0;
    margin: 0;
    list-style-type: none;
    align-self: end;
    justify-self: end;
  }

  #menuList li {
    padding: 0;
    font-size: 0.9rem;
  }

  #menuList a {
    text-decoration: none;
    color: var(--pm-color);
    /* text-transform: uppercase; */
    font-weight: 600;
  }

  #menuList a:hover {
    color: var(--text-color);
  }

  .mobile-lang {
    display: none;
  }
}


/* MOBILE STYLES */
@media screen and (max-width: 800px) {

  /* hide menu on the right side */
  body {
    overflow-x: hidden;
  }

  .langbar {
    display: none;
  }

  nav {
    grid-area: lang;
    align-self: self-end;
  }

  #menuToggle {
    display: block;
    position: relative;
    grid-area: lang;
    right: 3vw;
    top: 3vw;
    z-index: 500;
    user-select: none;
    -webkit-user-select: none;
  }

  #menuToggle input {
    display: block;
    width: 38px;
    height: 38px;
    position: absolute;
    top: -7px;
    left: -3px;
    cursor: pointer;
    opacity: 0;
    z-index: 2;
    -webkit-touch-callout: none;
  }

  #menuToggle span {
    display: block;
    width: 40px;
    height: 6px;
    margin-bottom: 5px;
    position: relative;
    background: var(--pm-color);
    border-radius: 3px;
    z-index: 1;
    transform-origin: 4px 0px;
    transition: transform 0.5s cubic-bezier(0.77, 0.2, 0.05, 1.0),
      background 0.5s cubic-bezier(0.77, 0.2, 0.05, 1.0),
      opacity 0.55s ease;
  }

  #menuToggle span:first-child {
    transform-origin: 0% 0%;
  }

  #menuToggle span:nth-last-child(2) {
    transform-origin: 0% 100%;
  }

  #menuToggle input:checked~span {
    opacity: 1;
    transform: rotate(45deg) translate(-9px, -18px);
  }

  #menuToggle input:checked~span:nth-last-child(3) {
    opacity: 0;
    transform: rotate(0deg) scale(0.2, 0.2);
  }

  #menuToggle input:checked~span:nth-last-child(2) {
    transform: rotate(-45deg) translate(-5px, 16px);
  }

  #menuList {
    position: absolute;
    width: 100vw;
    top: -35px;
    right: 0;
    left: auto;
    z-index: 101;
    padding: 50px;
    background: var(--barva-pozadi);
    list-style-type: none;
    -webkit-font-smoothing: antialiased;
    transition: opacity 0.2s cubic-bezier(0.77, 0.2, 0.05, 1.0);
    display: grid;
    opacity: 0;
    gap: .8rem;
    border-bottom: 1px solid var(--pm-color);
  }

  #menuList li {
    font-size: 30px;
    line-height: 1;
  }

  #menuList a {
    text-decoration: none;
  }

  #menuToggle:has(input:checked)~#menuList {
    opacity: 1;
  }

  .mobile-lang {
    display: block;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    place-items: center;
  }

  .mobile-lang img {
    width: 30px;
  }

  .flag-and-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
}
