/* コマンド */
.hidden{
    visibility: hidden;
}

/* 全体 */

body{
    margin: 0;
    overscroll-behavior: none;
}

header{
    display: grid;
    grid-template-columns: 1fr 50px;
    background: #eee;
}
header h1{
    grid-row: 1;
    grid-column: 1/3;
    margin: 0;
}
.header-logo-l{
    max-width: 200px;
    max-height: 80px;
}
.header-logo-s{
    max-width: 200px;
    max-height: 80px;
}

.hamburger{
    display: none;
    grid-row: 1/2;
    grid-column: 2/3;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 100;
    margin: 5px;
    cursor: pointer;
}
.ham-line{
    position: absolute;
    width: 30px;
    height: 2px;
    background: #000;
    box-shadow: 3px 3px 4px #000;
    transform: scale(var(--scale)) translateY(var(--translate)) rotate(var(--rotate));
    transition: .5s;
    --scale: 1;
    --translate: 0;
    --rotate: 0;
}
.ham-line.open-x{
    height: 1.41px;
    transform: scale(var(--scale-x)) translateY(var(--translate-x)) rotate(var(--rotate-x));
}
.ham-line:nth-child(1){
    --translate: -.7em;
}
.ham-line:nth-child(3){
    --translate: .7em;
}
.open-x .ham-line:nth-child(1){
    --scale: 1.4;
    --translate: 0;
    --rotate: 45deg;
    box-shadow: 4.4px 0px 4px #000;
}
.open-x .ham-line:nth-child(2){
    --scale: 0,1;
}
.open-x .ham-line:nth-child(3){
    --scale: 1.4;
    --translate: 0;
    --rotate: -45deg;
    box-shadow: 0px 4.4px 4px #000;
}

.carousel{
    display: flex;
    justify-content: center;
    background: #000;
}
.carousel-area{
    position: relative;
    grid-auto-flow: column;
    aspect-ratio: 3/2;
    width: clamp(300px,70vw,600px);
    overflow: hidden;
    background: #ccc;
}
.carousel img{
    position: absolute;
    inset: 0;
    width: 100%;
    background: #888;
    translate: -100%;
    transition: .5s;
}
.carousel img.active{
    translate: 0;
    z-index: 1;
}
.carousel img.next{
    translate: 100%;
    z-index: -1;
}

nav{
    display: grid;
    grid-auto-flow: column;
    height: 2.5em;
    font-size: 1.2em;
}
nav .nav-link{
    display:flex;
    align-items: center;
    justify-content: center;
    background: #ccc;
    text-shadow: 0 0 red;
    border: outset 2px;
    cursor: pointer;
}
.nav-head{
    display: none;
}
nav .nav-link:hover{
    background: #aaa;
    text-shadow: 2px 2px #66f;
    transition: .3s;
}


main{
    display: grid;
    max-width: 600px;
    margin: 0 auto;
    padding:0 30px;
}
main .news{
    display: grid;
    gap: 20px;
    padding: 20px;
    background: #eee;
    border: double #ccc 10px;
    border-radius: 10px;
}
.news-link{
    cursor: pointer;
}
.news-title{
    font-weight: bold;
}
.news-title time{
    font-size: .7em;
    margin-right: 1em;
}
.news-about{
    color: blue;
}
.news-link:hover{
    text-shadow: #fad 0px 0px 10px;
    transition: .2s;
}
.news-link:hover .news-about{
    text-decoration: underline;
}
.news-showall{
    text-align: center;
    font-weight: bold;
    font-size: 1.1em;
    cursor: pointer;
}
.news-showall:hover{
    text-decoration: underline;
}

article{
    margin-bottom: 50px;
}

footer{
    padding: 50px;
    text-align: center;
    background: #ccc;
}

.alert{
    display: none;
    justify-content: center;
    align-items: center;
    position: fixed;
    inset: 0;
    background: rgba(1,1,1,.3);
    z-index: 100;
}
.alert-modal{
    display: grid;
    justify-items: center;
    background: #fff;
    border: solid #000 5px;
    padding: 1em;
}
.alert.active{
    display: grid;
}
.alert-modal button{
    cursor: pointer;
}

/* スマホ対応(ハンバーガーメニュー) */
@media screen and (max-width: 500px) {
    body:has(.open-x){
        overflow: hidden;
    }
    .hamburger{
        display: flex;
    }

    #nav-wrap{
        display: none; /* ハンバーガーメニューを消しておく */
        position: fixed;
        inset: 0;
        z-index: 10;
        background: rgba(200,200,200,.8);
    }
    #nav-wrap.open{
        display: block;
    }
    nav{
        grid-auto-flow: row;
        justify-items: center;
        gap: .5em;
        height: unset;
        padding: .5em;
    }
    nav .nav-link{
        display: flex;
        width: clamp(200px,70vw,300px);
        height: 2em;
        border: none;
        background: rgba(0,0,100,.6);
        color: #fff;
        box-shadow: 1px 1px #fff;
        animation: slide-in .5s calc(var(--delay) * .2s + .4s) both;
    }
    @keyframes slide-in {
        from{
            translate: 100vw;
        }
    }
    nav .nav-link:hover{
        scale: 1.01;
        filter: brightness(120%);
        box-shadow: 5px 3px #fff;
        transition: .3s;
    }
    .nav-head{
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding-bottom: 12px;
        background: #eee;
        animation: fade-in .5s;
    }
    @keyframes fade-in{
        from{
            translate: 0 20px;
            opacity: 0;
        }
    }

    main .news{
        padding: 0;
        gap: 0;
    }
    .news-link{
        padding: 5px;
        border: solid 2px #ccc;
    }
    .news-about{
        color: blue;
    }
    .news-about:hover{
        text-decoration: underline;
    }
}
