@charset "utf-8";

.pc-only {
    display: none;
}

.sp-only {
    display: block;
}

/* ========================
   ヘッダーレイアウト
======================== */

.header {
    width: 100%;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    z-index: 1001;
    will-change: transform;
    /* GPU加速 */
    backface-visibility: hidden;
    /* ちらつき防止 */
    /* iOSのSafari用の追加設定 */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    -webkit-perspective: 1000;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.header__content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md);
}

/* ロゴエリア */
.header__logo a {
    display: flex;
    align-items: center;
    gap: 6px;
}

.header__logo img {
    width: 114px;
}

.header__logo-text {
    font-weight: normal;
    font-size: 10px;
    color: var(--text-color);
}

.header__logo-title-main {
    display: flex;
}

.header__logo-title-sub {
    margin-left: 1em;
}

.header__logo-office-name {
    margin-top: 4px;
}

@media screen and (min-width: 768px) {
    .header__content {
        padding: var(--space-sm) var(--space-sm) 0;
    }
}

/* ========================
   SP：メニュートグルボタン
======================== */
.header__menu-toggle {
    /* 固定幅と高さを設定して、位置ズレを防止 */
    width: 48px;
    /* 例として44px */
    height: 48px;
    /* 例として44px */
    background: var(--primary-green);
    border: none;
    border-radius: 4px;
    padding: 6px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* 中央に配置 */
    gap: 4px;
    color: white;
    font-weight: 500;
    font-size: var(--font-sm);
    position: relative;
    /* 子要素の絶対配置の基準に */
}

/* ハンバーガー3本線 */
.header__hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -90%);
    /* 親要素の中心に配置 */
}

.header__hamburger-line {
    width: 28px;
    height: 2px;
    background: white;
    transition: all 0.3s ease;
}

/* アクティブ時：バツ印 */
.header__menu-toggle.active .header__hamburger-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.header__menu-toggle.active .header__hamburger-line:nth-child(2) {
    opacity: 0;
}

.header__menu-toggle.active .header__hamburger-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.header__menu-text {
    position: absolute;
    /* ボタン内で絶対配置 */
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}

/* SP：ハンバーガーメニュー（オーバーレイ） */
.mobile-menu-overlay {
    width: 100%;
    padding: 44px 8%;
    background-color: var(--primary-green);
    position: fixed;
    top: 72px;
    /* JavaScriptで動的に調整 */
    right: -100%;
    height: 100vh;
    /* JavaScriptで動的に調整 */
    transition: right 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
    /* 全体をスクロール可能にする */
    -webkit-overflow-scrolling: touch;
    overflow-scrolling: touch;
}

/* アクティブ時：左から表示 */
.mobile-menu-overlay.active {
    right: 0;
}

/* メニュー表示時のbodyスクロール無効化 */
body.menu-open {
    overflow: hidden;
    /* position: fixed; */
    width: 100%;
    height: 100%;
    /* top: 0; */
    overflow-x: hidden;
    visibility: visible;
}

/* メニュー表示時のhtmlスクロール無効化 */
/* html.menu-open {
    overflow: hidden;
} */

.mobile-nav-menu .page_item:first-of-type {
    margin-top: 0;
}

/* SPのサブメニューをドロップダウン形式に変更 */
.mobile-nav-menu .sub-menu {
    display: none !important;
    /* 初期は非表示 */
    position: static !important;
    background: transparent !important;
    box-shadow: none !important;
    min-width: auto !important;
    margin-left: 20px;
    margin-top: 10px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

/* アクティブ時に表示 */
.mobile-nav-menu .menu-item.active .sub-menu {
    display: block !important;
    max-height: 100%;
    /* 適切な高さに調整 */
}

.mobile-nav-menu .sub-menu li {
    border-bottom: none !important;
}

.mobile-nav-menu .sub-menu a {
    padding-left: 1em;
    font-size: 14px !important;
    word-break: auto-phrase;
}

.mobile-nav-menu .sub-menu a:hover {
    background-color: transparent !important;
    color: #fff !important;
}

.mobile-nav-menu a {
    position: relative;
    display: inline-block;
    width: 100%;
    padding-top: 6px;
    padding-left: 1.4em;
    padding-bottom: 6px;
    font-weight: 700;
    font-size: var(--space-lg);
    color: #fff;
}

.mobile-nav-menu a::after,
.mobile-nav-menu .menu-item-has-children>a::after {
    content: '';
    width: 8px;
    height: 8px;
    border: 0;
    border-top: solid 2px #fff;
    border-right: solid 2px #fff;
    position: absolute;
    top: 50%;
    left: 0;
    transform: rotate(45deg) translateY(-50%);
}

.mobile-nav-menu .sub-menu a::after {
    content: '-';
    width: auto;
    height: auto;
    border: none;
    transform: translateY(-50%);
}

.mobile-cta {
    display: flex;
    flex-direction: column;
    margin-top: var(--space-xl);
    margin-bottom: 44px;
}

.mobile-cta .btn:last-of-type {
    margin-top: var(--space-lg);
}

.cta-icon {
    position: relative;
    display: inline-block;
    margin-right: var(--space-sm);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    background-color: #fff;
}

.cta-icon img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: inline-block;
    width: 18px;
}

@media screen and (min-width: 768px) {
    .sp-only {
        display: none;
    }

    .pc-only {
        display: block;
    }

    .header__container {
        max-width: 1200px;
        margin: 0 auto;
    }

    .header__logo a {
        gap: clamp(6px, calc(5.05vw - 32.784px), 40px);
    }

    .header__logo img {
        width: clamp(114px, 14vw, 220px);
    }

    .header__logo-text {
        font-size: var(--font-xs);
    }

    .header__logo-main-title {
        display: flex;
    }

    .header__contact-label {
        display: flex;
        justify-content: center;
        align-items: center;
        font-weight: 700;
        font-size: var(--font-xs);
        color: var(--text-color);
    }

    .header__contact-label::before,
    .header__contact-label::after {
        content: "";
        background-color: var(--secondary-orange);
        height: 2px;
        width: 18px;
    }

    .header__contact-label::before {
        margin-right: 5px;
        transform: rotate(60deg);
    }

    .header__contact-label::after {
        margin-left: 5px;
        transform: rotate(-60deg);
    }

    .header__actions .btn {
        justify-content: center;
        margin-top: 4px;
        width: 25vw;
        max-width: 240px;
        font-size: var(--font-lg);
    }

    .header__actions .btn::before {
        content: '';
        display: inline-block;
        width: 24px;
        height: 19px;
        margin-right: 0.4em;
        background-image: url(../images/icon_mail-white.png);
        background-size: contain;
    }

    /* ドロップダウンメニュー対応 */
    .nav-menu {
        display: flex;
        justify-content: center;
        text-align: center;
        gap: var(--space-sm);
        position: relative;
    }

    .nav-menu li {
        position: relative;
    }

    .nav-menu li a,
    .sub-menu li a {
        display: inline-block;
        padding: var(--space-sm);
        font-size: var(--font-sm);
        font-weight: 700;
        color: var(--text-color);
        word-break: auto-phrase;
        transition: color 0.3s ease;
    }

    .nav-menu li a:hover,
    .sub-menu li a:hover {
        color: var(--primary-green);
    }

    .nav-menu li:hover .sub-menu {
        display: block;
    }

    .sub-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        background: #fff;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        min-width: 300px;
        z-index: 1000;
    }

    .sub-menu li {
        border-bottom: 1px solid #eee;
    }

    .sub-menu a {
        display: block;
        padding: 12px 16px;
        color: var(--text-color);
        text-align: left;
        transition: background-color 0.2s ease;
        width: 100%;
    }

    .sub-menu a:hover {
        background-color: #f8f9fa;
        color: var(--primary-green);
    }
}