nav[role=main] {
    transform: translateX(0);
    transition: 250ms ease-in;
    background-color: var(--color-light-light);
    padding-top: 2rem;

    width: 0;
    height: 100%;
    position: absolute;
    visibility: hidden;
    z-index: 1;
}

nav[role=main] h1 {
    margin: 0 0 2rem 0;
    display: block;
    width: 14rem;
    opacity: 0;
    transition: all 400ms;
}

nav[role=main] a {
    color: var(--color-black);
    text-decoration: none;
    padding: 0 2rem;
    display: inline-block;
}

nav[role=main] h1 a:hover {
    text-decoration: underline;
}

nav[role=main] ul li a {
    display: block;
}

nav[role=main] ul li a:hover {
    background-image: var(--image-hover);
}

nav[role=main] ul {
    list-style: none;
    margin: 0;
    padding: 0;
    opacity: 0;
    transition: all 400ms;
}

nav[role=main] ul li {
    margin: 0;
    cursor: pointer;
    line-height: 2.5rem;
    width: 14rem;
}

label[for="checkbox"] {
    cursor: pointer;
    display: inline-block;
    position: absolute;
    top: 3.7rem;
    left: calc(100% - 1.5rem - 2rem);
    z-index: 3;
	font-size: 0.7rem;
	width: 2.2em;
	height: 2em;
	transform: translate(-50%, -50%);
    transition: 0.5s ease;
}

label[for="checkbox"] .line {
	display: block;
    height: 0.4em;
    background: var(--color-black);
    transition: 0.4s ease;
}

label[for="checkbox"] .line:not(:first-child) {
    margin-top: 0.4em;
}

#checkbox:checked + label[for="checkbox"] {
    transform: translate(-50%, -50%) rotatey(180deg);
}

#checkbox:checked + label[for="checkbox"] .line {
	transform: rotatey(180deg) rotatex(360deg);
}

#checkbox:checked + label[for="checkbox"] .line:first-child {
	transform: rotate(-45deg);
	margin-top: 0.8em;
}

#checkbox:checked + label[for="checkbox"] .line:nth-child(2) {
	opacity: 0;
}

#checkbox:checked + label[for="checkbox"] .line:last-child {
	margin-top: -1.2em;
    transform: rotate(45deg);
}

#checkbox {
    display: none;
}

#checkbox ~ nav[role=main] {
    visibility: hidden;
}

#checkbox:checked ~ nav[role=main] h1, 
#checkbox:checked ~ nav[role=main] ul, 
#checkbox:checked ~ nav[role=main] {
    width: 100%;
    animation: sidebarAnim 500ms;
    visibility: visible;
    opacity: 1;
}

@keyframes sidebarAnim {
  0% {
    opacity: 0;
    transform: translateX(-100%);
    visibility: hidden;
  }
  50% {
  }
  100% {
    opacity: 1;
    transform: translateX(0);
    visibility: visible;
  }
}

@media only screen and (min-width: 1000px) {
    nav[role=main] {
        width: 14rem;
        position: static;
        transition: all 0s ease 0s;
        transform: initial;
        height: initial;
    }

    nav[role=main] a {
        display: block;
    }

    label[for="checkbox"] {
        display: none;
    }

    #checkbox ~ nav[role=main] h1,
    #checkbox ~ nav[role=main] ul,
    #checkbox ~ nav[role=main] {
        width: 14rem;
        visibility: visible;
        opacity: 1;
    }
}

nav[role=main] h1 svg,
nav[role=main] h1 svg.green {
    width: 1.5rem;
    height: 1.5rem;
    float: left;
    padding: 0.75rem 0.5rem 0.5rem 0;
    fill: var(--color-black);
}

nav[role=main] h1 svg.red {
    fill: red;
}

nav[role=main] h1 svg.green {
    fill: var(--color-green-dark);
}
