Nevermind.Настроил CSS-код немного по-другому и нашел правильное решение.
.parent-menu {
overflow: hidden;
background-color: black;
}
.parent-menu > li{
padding: 10px;
padding-left: 16px;
padding-right: 16px;
float: left;
color: rgba(255,255,255,0.7);
border-right: 1px solid rgba(255,0,0,0.5);
}
.parent-menu > :first-child {
color: red;
padding-left: 18px;
padding-right: 18px;
border-left: 1px solid rgba(255,0,0,0.5);
}
.sub-menu li{
display: none;
position: absolute;
z-index:1;
}
.sub-menu {
display:block;
color: blue;
float: left;
text-align:left;
}
.sub-menu-caption:hover .sub-menu{
display: block;
position: absolute;
top: 30px;
left: 0px;
}
.sub-menu-caption:hover .sub-menu li{
display: block;
position: static;
background-color: black;
width: 100%;
border: 1px solid rgba(255,0,0,0.5);
border-top: 0;
font-style: italic;
font-size: 1em;
padding-top: 5px;
padding-bottom: 5px;
padding-left: 10px;
padding-right: 3px;
}
.sub-menu-caption:hover .sub-menu :last-child{
border-radius: 0px 0px 4px 4px;
}
.sub-menu-caption:hover .sub-menu :first-child{
padding-top: 12px;
}
.sub-menu-caption:hover .sub-menu li a:hover{
color: red;
}
#main-menu {
top: 0;
text-transform: uppercase;
position: sticky;
z-index:1;
margin-bottom: 30px;
}
article {
position: relative;
width: 90%;
margin: auto;
}
article.main-container > :first-child {
font-variant: small-caps;
}
.parent-menu a:link {
text-decoration: none;
font-weight: 400;
color: rgba(255,255,255,0.7);
}
.parent-menu a:visited {
text-decoration: none;
font-weight: 400;
color: rgba(255,255,255,0.7);
}
.parent-menu a:hover {
text-decoration: underline;
font-weight: 400;
color: rgba(255,255,255,0.7);
}
.parent-menu a:active {
text-decoration: none;
font-weight: 400;
color: rgba(255,255,255,0.7);
}
li.right-menu.upper-menu {
background-color: rgba(255,0,0,0.5);
float: right;
background-clip: padding-box;
}