@import url(https://db.onlinewebfonts.com/c/32221d15ba89369a53aad4939b3b4d54?family=LiHei+Pro);

@font-face {
    font-family: "LiHei Pro";
    src: url("https://db.onlinewebfonts.com/t/32221d15ba89369a53aad4939b3b4d54.eot");
    src: url("https://db.onlinewebfonts.com/t/32221d15ba89369a53aad4939b3b4d54.eot?#iefix")format("embedded-opentype"),
    url("https://db.onlinewebfonts.com/t/32221d15ba89369a53aad4939b3b4d54.woff2")format("woff2"),
    url("https://db.onlinewebfonts.com/t/32221d15ba89369a53aad4939b3b4d54.woff")format("woff"),
    url("https://db.onlinewebfonts.com/t/32221d15ba89369a53aad4939b3b4d54.ttf")format("truetype"),
    url("https://db.onlinewebfonts.com/t/32221d15ba89369a53aad4939b3b4d54.svg#LiHei Pro")format("svg");
}

html,
body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

._tab {
    display: none;
}

@media (max-width: 1025px) {
    ._tab {
        display: block;
    }
}

header {
    position: absolute;
    top: 0;
    z-index: 999;
    width: 100%;
    background-color: transparent;
    font-family: "dnp-shuei-gothic-kin-std", sans-serif;
    transition: background-color .3s ease, box-shadow .3s ease;
}

.header-menu {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 20px 2%;
    min-height: 80px;
}


.header-logo a {
    width: fit-content;
    display: flex;
    align-items: center;
    height: 100%; /* 親要素の高さに合わせる */
}

.header-logo a img {
    display: block;
    width: 6vw;
    max-width: 100px;
    height: auto;
    object-fit: contain; /* アスペクト比を保ったまま表示 */
}

.header-nav.gnav._pc {
    display: flex;
    align-items: center;
    position: relative; /* バーの絶対配置の基準 */
    gap: 12px; /* 文字サイズに合わせて間隔を調整 */
}

.header-nav-item {
    position: relative;
    padding: 12px 16px; /* 文字サイズに合わせて padding を調整 */
    color: #333333;
    font-weight: 500;
    font-size: 1.5rem;
    line-height: 1.4; /* 行間を調整してバランスを改善 */
    border: 2px solid transparent;
    border-radius: 25px;
    box-sizing: border-box;
    transition: all .3s ease;
    white-space: nowrap; /* 文字が折り返さないように */
}

/* マウス追従用の角丸ボーダーバー */
.header-nav-bar {
    position: absolute;
    top: 0;
    left: var(--item-1-left, 0px);
    width: var(--item-1-width, 0px);
    height: 100%;
    border: 2px solid #21a4dc;
    border-radius: 25px;
    pointer-events: none;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    z-index: -1; /* テキストの後ろに表示 */
}

.header-nav.gnav._pc:hover .header-nav-bar {
    opacity: 1;
}

.header-btn {
    padding: 10px 18px; /* 線が見えるように適切な padding */
    border-radius: 30px;
    background-color: #21a3dc;
    color: #ffffff;
    font-weight: bold;
    font-size: 1.5rem; /* ナビゲーション項目と同じサイズに統一 */
    line-height: 1.4;
    box-sizing: border-box;
    transition: background-color .3s ease,color .3s ease,box-shadow .3s ease;
    white-space: nowrap;
}

.hamburger {
    display: none;
}

/* Desktop Hover（バー位置は header.js でホバー時に直接指定） */
@media (min-width: 1026px) {
    /* アクティブなページでもホバー時に同じスタイルを適用 */
    .header-nav .service .header-nav-item:hover,
    .header-nav .company .header-nav-item:hover,
    .header-nav .contact .header-nav-item:hover,
    .header-nav .news .header-nav-item:hover {
        border: 2px solid transparent; /* borderはバーで描画するため透明に */
    }

    .gnav-a-last .header-nav-item::after {
        display: none;
    }

    .header-btn:hover {
        box-shadow: 0 4px 12px rgba(0,0,0,.15);
        background-color: #bfe3f2;
        color: #222222;
    }
}

/* ==================================================
   Tablet (768〜1025px) - PCサイズに合わせたバランス
================================================== */
@media (max-width:1025px) and (min-width:768px) {
    .nav-overlay {
        display: none !important;
    }

    .header-menu {
        padding: 16px 2%;
        min-height: 72px;
    }

    .header-logo {
        font-size: 2.2rem;
        height: 36px;
        gap: 12px;
    }

    .header-logo a img {
        height: 36px;
    }

    .header-nav {
        margin-left: auto;
        gap: 10px;
    }

    .header-nav-item {
        padding: 10px 14px;
        font-size: 1.45rem;
        line-height: 1.4;
        box-sizing: border-box;
    }

    .header-btn {
        padding: 10px 16px;
        font-size: 1.45rem;
        line-height: 1.4;
        box-sizing: border-box;
    }

    .hamburger {
        display: none;
    }

    .header-nav.gnav._pc {
        flex-direction: row;
        opacity: 1;
        position: static;
        transform: none;
        width: auto;
        height: auto;
        padding: 0;
        box-shadow: none;
        background: none;
        pointer-events: auto;
    }

    .header-nav.gnav._pc li {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .header-nav-bar {
        display: none;
    }
}

/* ==================================================
   Mobile (〜767px)
================================================== */
@media (max-width:767px) {
    /* ロゴとハンバーガーを横並びに（ハンバーガーはfixedのため右に余白を確保） */
    .header-menu {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 4%;
        padding-right: 68px; /* ハンバーガー(40px) + right(20px) のスペース */
        min-height: 60px;
    }

    .header-logo {
        font-size: 1.8rem;
        height: 28px;
        gap: 10px;
    }

    .header-logo a img {
        width: 11vw;
    }

    /* Hamburger：右上に固定（スクロールしてもついてくる） */
    .hamburger {
        display: block;
        position: fixed;
        top: 8px;
        right: 20px;
        z-index: 2000;
        width: 40px;
        height: 40px;
        cursor: pointer;
        padding: 8px;
        box-sizing: border-box;
    }

    .hamburger span {
        position: absolute;
        left: 8px;
        width: 24px;
        height: 2px;
        background: #333333;
        transition: transform .3s ease, opacity .3s ease;
    }

    .hamburger span:nth-child(1) {
        top: 12px;
    }

    .hamburger span:nth-child(2) {
        top: 20px;
    }

    .hamburger span:nth-child(3) {
        top: 28px;
    }

    .hamburger.active span:nth-child(1) {
        top: 20px;
        transform: rotate(45deg);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        top: 20px;
        transform: rotate(-45deg);
    }

    /* SP メニュー：右からスライド（暗くしない） */
    .header-nav.gnav._pc {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        z-index: 1999;
        width: 85%;
        max-width: 300px;
        padding: 72px 24px 32px;
        background: #ffffff;
        box-shadow: -4px 0 24px rgba(0,0,0,.15);
        transform: translateX(100%);
        transition: transform .35s cubic-bezier(.22,1,.36,1);
        overflow-y: auto;
        pointer-events: none;
        list-style: none;
        margin: 0;
    }

    .header-nav.gnav._pc.active {
        transform: translateX(0);
        pointer-events: auto;
    }

    /* オーバーレイ：ヘッダー(999)より下にし、メニュー内のリンクがクリックできるようにする */
    .nav-overlay {
        position: fixed;
        inset: 0;
        z-index: 998;
        background: transparent;
        opacity: 0;
        pointer-events: none;
        transition: opacity .35s ease;
    }

    .nav-overlay.is-open {
        opacity: 1;
        pointer-events: auto;
    }

    .header-nav.gnav._pc .gnav-a {
        border-bottom: 1px solid #eee;
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .header-nav.gnav._pc .gnav-a:last-of-type {
        border-bottom: none;
    }

    .header-nav.gnav._pc .header-nav-item {
        display: block;
        font-size: 1.5rem;
        padding: 16px 0;
        line-height: 1.5;
        color: #333333;
        text-align: center;
        text-decoration: none;
        width: 100%;
        box-sizing: border-box;
    }

    .header-nav.gnav._pc .header-btn {
        font-size: 1.5rem;
        padding: 14px 24px;
        text-align: center;
        border-radius: 30px;
        background-color: #21a3dc;
        color: #ffffff;
    }

    .header-nav-bar {
        display: none;
    }

    .header-nav.gnav._pc li {
        opacity: 1;
        transform: none;
    }
}

