body {
    background-color: gainsboro;
    color: RGBA(20, 20, 20);
}

header {
    position: sticky;
    top: 0;
}

header,
main,
footer {
    width: 80%;
    background-color: whitesmoke;
    margin: auto;
    border-radius: 8px;
    padding: 30px;
}

main {
    height: 7000px;
}

header ul {
    /* display: grid; */
    /* grid-template-columns: repeat(5, 1fr); */
    /* list-style: none;
    padding-left: 0; */
}

footer ul {
    /* display: grid; */
    /* grid-template-columns: repeat(3, 1fr); */
    list-style: none;
    padding-left: 0;
    font-size: small;
}


.nav>* {
    text-align: center;
}

/* 以下、ハンバーガーメニュー用スタイル */
.menu-icon {
    width: 40px;
    height: 30px;
    position: fixed;
    /* ← fixedにして常に右上固定 */
    top: 20px;
    left: 20px;
    cursor: pointer;
    z-index: 3;
    display: inline-block;
}

.menu-icon span {
    display: block;
    height: 4px;
    margin: 6px 0;
    background: #333;
    border-radius: 2px;
    transition: 0.4s;
}

/* ハンバーガーがXに変形 */
#menu-toggle:checked+.menu-icon span:nth-child(1) {
    transform: translateY(10px) rotate(45deg);
    background-color: gainsboro;
}

#menu-toggle:checked+.menu-icon span:nth-child(2) {
    opacity: 0;
}

#menu-toggle:checked+.menu-icon span:nth-child(3) {
    transform: translateY(-10px) rotate(-45deg);
    background-color: gainsboro;
}

/* オーバーレイ背景 */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: 0.4s;
    z-index: 1;
}

#menu-toggle:checked~.overlay {
    opacity: 1;
    pointer-events: auto;
}

/* メニュー本体（右から出す） */
.menu {
    position: fixed;
    top: 0;
    left: -250px;
    /* ← 初期位置を右へ */
    width: 250px;
    height: 100%;
    background: rgb(41, 41, 41);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.2);
    transition: left 0.5s ease;
    z-index: 2;
}

#menu-toggle:checked~.menu {
    /* ← 開いたときは右0へ */
    left: 0;
}

.menu ul {
    list-style: none;
    padding: 60px 20px;
}

.menu li {
    margin: 20px 0;
}

.menu a {
    text-decoration: none;
    color: gainsboro;
    font-size: 1.2rem;
    transition: color 0.3s;
}

.menu a:hover {
    color: #007bff;
}