@charset "UTF-8";

html {
    scroll-padding-top: 100px !important;
}

/* ＝＝＝ ヘッダー全体の固定設定 ＝＝＝ */
.header {
    position: sticky; /* fixed から sticky に変更しました */
    top: 0;
    left: 0;
    width: 100%; /* 画面幅いっぱいに広げる */
    background: #fff;
    border-bottom: 2px solid #e0e0e0;
    z-index: 1000;
    transition: all 0.3s ease;
    font-family: "游明朝", YuMincho, serif;

    /* ＝＝＝ 通常時のGridレイアウト ＝＝＝ */
    .header-inner {
        @media screen and (min-width:783px) {
            display: grid;
            grid-template-columns: auto 1fr 140px; /* 左:ロゴ、中央:可変、右:ボタン */
            grid-template-rows: auto auto;         /* 上段:連絡先、下段:ナビ */
        }
        @media screen and (max-width:782px) {
            display: flex;
            align-items: center;
            padding: 5px 5px 5px 10px;
        }
    }

    /* 1. ロゴ */
    .header-logo {
        @media screen and (min-width:783px) {
            grid-column: 1 / 2;
            grid-row: 1 / 3;
            display: flex;
            align-items: center;
            padding: 10px 20px; /* 画面左端からの余白 */
        }
        a{
            display: block;
        }
        img {
            transition: 0.3s ease;
            @media screen and (max-width:782px) {
                width: 150px;
            }
        }
    }

    /* 2. 連絡先エリア */
    .contact-info {
        grid-column: 2 / 3;
        grid-row: 1 / 2;
        justify-self: end;
        align-self: end;
        padding: 15px 30px 5px 0;
        text-align: right;

        @media screen and (max-width:782px) {
            margin-left: auto;
            margin-right: 0;
            padding: 0;
            align-self: auto;
        }

        .contact-info-top {
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: 15px;

            @media screen and (max-width:782px) {
                align-items: start;
                gap: 5px;
            }

            .tel {
                @media screen and (max-width:782px) {
                    width: 30px;
                    height: 30px;
                }
                span{
                    font-size: 32px;
                    font-weight: bold;
                    color: #000;
                    text-decoration: none;

                    @media screen and (max-width:782px) {
                        display: none;
                    }
                }

                &::before{
                    content: '';
                    display: inline-block;
                    margin-right: 5px;
                    width: 30px;
                    height: 30px;
                    background-image: url('/wp-content/themes/jetpress/images/tel-icon.png');
                    background-size: cover;
                    transform: translateY(2px);
                    @media screen and (max-width:782px) {
                        transform: none;
                    }
                }
            }

            img {
                height: 30px;
                vertical-align: middle;
            }

            a:last-child{
                @media screen and (max-width:782px) {
                    display: none;
                }
            }
        }

        .contact-info-bottom {
            font-size: 14px;
            color: #333;
            margin-top: 5px;
            @media screen and (max-width:782px) {
                display: none;
            }
        }
    }

    /* 3. ナビゲーション（通常時は大きく表示） */
    .global-navigation {
        grid-column: 2 / 3;
        grid-row: 2 / 3;
        justify-self: end;
        align-self: center;
        padding: 10px 30px 10px 0;
        transition: all 0.3s ease;

        @media screen and (max-width:782px) {
            padding: 60px 40px 20px;
            max-width: 500px;
            width: 80%;
            height: 100vh;
            background: #E2D7C1;
            border-radius: 20px 0 0 20px;
            position: fixed;
            top: 0;
            right: -100%;
            z-index: 100;

            &::after{
                content: '';
                display: block;
                width: 122px;
                height: 202px;
                aspect-ratio: 3/5;
                width: 50%;
                height: auto;
                background-image: url('/wp-content/themes/jetpress/images/right-branch_1.png');
                background-size: cover;
                position: absolute;
                bottom: 40px;
                right: 0;
            }
        }

        .navigation-list {
            display: flex;
            list-style: none;
            margin: 0;
            padding: 0;
            gap: 0;

            @media screen and (max-width:782px) {
                flex-direction: column;
            }

            li {
                position: relative;
                padding: 0 10px;
                transition: padding 0.3s ease;

                @media screen and (min-width:783px) {
                    /* 区切り線（縦棒） */
                    &:not(:last-child)::after {
                        content: "|";
                        font-size: 28px;
                        position: absolute;
                        right: -2px;
                    }
                }
                @media screen and (max-width:782px) {
                    padding: 0;
                    border-bottom: 2px dotted #a9a09c;
                }
            }

            a {
                text-decoration: none;
                color: #000;
                font-size: 28px;
                font-weight: bold;
                transition: font-size 0.3s ease;

                @media screen and (max-width:782px) {
                    display: block;
                    margin: 0;
                    padding: 10px 5px;
                    color: #534741;
                    font-size: 20px;
                    font-weight: 500;
                    font-family: auto;
                }
            }
        }

        .sp-contact-lists{
            display: none;
            @media screen and (max-width:782px) {
                display: grid;
                grid-template-columns: repeat(3,1fr);
                grid-template-columns: repeat(2,1fr);
                gap: 5px;
                margin: 20px 0;
                width: 130px;
                width: 86px;

                li{
                    width: 40px;
                    height: 40px;
                    /* background: red; */
                    background-size: cover;

                    &:first-child{
                        background-image: url('/wp-content/themes/jetpress/images/tel-icon.png');
                    }
                    /* &:nth-child(2){
                        background-image: url('/wp-content/themes/jetpress/images/line-icon.png');
                    } */
                    &:last-child{
                        background-image: url('/wp-content/themes/jetpress/images/mail-icon.png');
                    }
                    a{
                        display: block;
                        height: 100%;
                    }
                }
            }
        }
    }

    /* 4. お問い合わせボタン */
    .btn-contact {
        grid-column: 3 / 4;
        grid-row: 1 / 3;
        background-color: #c0ca33;
        color: #fff;
        text-decoration: none;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        transition: all 0.3s ease;
        @media screen and (max-width:782px) {
            margin-left: 5px;
            margin-right: 5px;
            width: 30px;
            height: 30px;
            background: #000;
            border-radius: 50%;
        }

        .mail-icon {
            font-size: 48px;
            margin-bottom: 5px;
            @media screen and (max-width:782px) {
                padding-left: 1px;
                margin-bottom: 0;
                font-size: 22px;
            }
        }

        .btn-text {
            font-size: 16px;
            font-weight: bold;
            @media screen and (max-width:782px) {
                display: none;
            }
        }
    }

    #panel-toggle-button{
        display: block;
        width: 52px;
        height: 52px;
        position: relative;
        z-index: 200;

        @media screen and (min-width:783px) {
            display: none;
        }

        span{
            display: block;
            position: absolute;
            width: 40px;
            height: 2px;
            background: #000;
            right: 6px;
            transition: all .3s;

            &:first-child{
                top: 14px;
            }
            &:nth-child(2){
                width: 30px;
                top: 24px;
            }
            &:last-child{
                width: 20px;
                top: 34px;
            }
        }
    }

    .overlay{
        display: block;
        background: rgba(0,0,0,.7);
        width: 100%;
        height: 100%;
        position: fixed;
        top: 0;
        left: 0;
        z-index: 0;
        opacity: 0;
        pointer-events: none;
        transition: all .3s;

        @media screen and (min-width:783px) {
            display: none;
        }
   }

    /* ＝＝＝ スクロール後の変化 (.is-shrunk) ＝＝＝ */
    &.is-shrunk {

        /* ロゴを少し小さくする */
        .header-logo img {
            width: 200px;
            @media screen and (max-width:782px) {
                width: 150px;
            }
        }

        .contact-info {
            padding-top: 0;
        }

        @media screen and (min-width:783px) {
            /* ナビゲーションが空いた右下の空間（3カラム目）まで伸びる */
            .global-navigation {
                grid-column: 2 / 4;
                padding-right: 0;
    
                /* スクロール時はナビゲーションを少し縮めてスッキリ収める */
                .navigation-list {
                    li {
                        padding: 0 15px; /* 余白を縮小 */
    
                        &:not(:last-child)::after {
                            font-size: 18px;
                            top: 50%; /* 縦ズレする場合は translateY などで調整 */
                            transform: translateY(-50%);
                        }
                    }
                    a {
                        font-size: 18px; /* 文字サイズを縮小 */
                    }
                }
            }
        }

        /* ボタンが「1行目のみ」に縮む */
        .btn-contact {
            grid-row: 1 / 2;
            gap: 8px;

            .mail-icon {
                font-size: 36px;
                margin-bottom: 0;
                @media screen and (max-width:782px) {
                    padding-left: 1px;
                    font-size: 22px;
                }
            }
        }
    }
}

.panel-open{
    #header{
        #panel-toggle-button{
            span{
                &:first-child{
                    top: 24px;
                    rotate: 45deg;
                }
                &:nth-child(2){
                    opacity: 0;
                }
                &:last-child{
                    width: 40px;
                    top: 24px;
                    rotate: -45deg;
                }
            }
        }
       .header-inner{
            .global-navigation{
                right: 0;
            }
       }
       .overlay{
            opacity: 1;
       }
    }
}