/* ===================================================
   header.css - サイトヘッダー・ナビゲーション・ドロワー
   =================================================== */

/* ---------------------------------------------------
   サイトヘッダー共通
   --------------------------------------------------- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: var(--color-white);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.10);
}

/* コンテンツが固定ヘッダーの下に隠れないよう余白を確保 */
#site-content {
    padding-top: 113px; /* header-top(60px) + header-nav(53px) */
}

/* ---------------------------------------------------
   ヘッダートップ（ロゴ + 電話番号 + CTA）
   --------------------------------------------------- */
.header-top {
    border-bottom: 1px solid var(--color-border);
}

.header-top__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    gap: 16px;
}

/* ロゴ */
.header-logo a {
    display: flex;
    align-items: center;
    height: 100%;
}

.header-logo img {
    height: 36px;
    width: auto;
    object-fit: contain;
}

/* 右側エリア */
.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* 電話番号 */
.header-phone {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-decoration: none;
    color: var(--color-text);
    line-height: 1.2;
    transition: color var(--transition);
}

.header-phone:hover {
    color: var(--color-primary);
}

.header-phone__label {
    font-size: 1.0rem;
    color: var(--color-text-muted);
    letter-spacing: 0.02em;
}

.header-phone__number {
    font-size: 2.0rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--color-primary);
}

/* CTAボタン */
.header-cta {
    flex-shrink: 0;
}

/* ハンバーガーボタン（SP専用） */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    flex-shrink: 0;
}

.hamburger__bar {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--color-text);
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

/* ---------------------------------------------------
   PCナビゲーション
   --------------------------------------------------- */
.header-nav {
    background-color: var(--color-white);
}

.header-nav .container {
    display: flex;
    align-items: stretch;
}

/* wp_nav_menu が生成する ul */
.header-nav #global-nav {
    display: flex;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.header-nav #global-nav > li {
    position: relative;
}

.header-nav #global-nav > li > a {
    display: flex;
    align-items: center;
    padding: 0 18px;
    height: 52px;
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--color-text);
    text-decoration: none;
    white-space: nowrap;
    transition: color var(--transition);
    position: relative;
}

.header-nav #global-nav > li > a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 18px;
    right: 18px;
    height: 2px;
    background-color: var(--color-primary);
    transform: scaleX(0);
    transition: transform var(--transition);
}

.header-nav #global-nav > li > a:hover,
.header-nav #global-nav > li.current-menu-item > a,
.header-nav #global-nav > li.current-menu-ancestor > a {
    color: var(--color-primary);
}

.header-nav #global-nav > li > a:hover::after,
.header-nav #global-nav > li.current-menu-item > a::after,
.header-nav #global-nav > li.current-menu-ancestor > a::after {
    transform: scaleX(1);
}

/* ドロップダウン（第2階層・3列グリッド） */
.header-nav #global-nav > li > .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 540px;        /* 3列 × 180px */
    max-width: calc(100vw - 32px);
    background-color: var(--color-white);
    box-shadow: var(--shadow);
    border-top: 2px solid var(--color-primary);
    border-radius: 0 0 var(--radius) var(--radius);
    list-style: none;
    padding: 8px;
    z-index: 100;
}

.header-nav #global-nav > li:hover > .sub-menu {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}

.header-nav #global-nav > li > .sub-menu li a {
    display: block;
    padding: 9px 14px;
    font-size: 1.4rem;
    color: var(--color-text);
    text-decoration: none;
    white-space: normal;
    word-break: break-all;
    line-height: 1.5;
    border-radius: var(--radius-sm);
    transition: background-color var(--transition), color var(--transition);
}

.header-nav #global-nav > li > .sub-menu li a:hover {
    background-color: var(--color-bg-sub);
    color: var(--color-primary);
}

/* ---------------------------------------------------
   ドロワーオーバーレイ
   --------------------------------------------------- */
.drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1100;
    cursor: pointer;
}

.drawer-overlay.is-open {
    display: block;
}

/* ---------------------------------------------------
   SPドロワー
   --------------------------------------------------- */
.drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: min(320px, 85vw);
    height: 100%;
    background-color: var(--color-white);
    z-index: 1200;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.drawer.is-open {
    transform: translateX(0);
}

/* ドロワーヘッダー */
.drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}

.drawer__logo img {
    height: 30px;
    width: auto;
    object-fit: contain;
}

/* 閉じるボタン */
.drawer__close {
    position: relative;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
}

.drawer__close span {
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 2px;
    background-color: var(--color-text);
    border-radius: 2px;
}

.drawer__close span:first-child {
    transform: translate(-50%, -50%) rotate(45deg);
}

.drawer__close span:last-child {
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* ドロワーナビ */
.drawer__nav {
    flex: 1;
    padding: 8px 0;
}

.drawer__nav #drawer-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.drawer__nav #drawer-nav li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--color-text);
    text-decoration: none;
    border-bottom: 1px solid var(--color-border);
    transition: background-color var(--transition), color var(--transition);
}

.drawer__nav #drawer-nav li a:hover,
.drawer__nav #drawer-nav li.current-menu-item > a {
    background-color: var(--color-bg-sub);
    color: var(--color-primary);
}

/* ドロワー内サブメニュー */
.drawer__nav #drawer-nav .sub-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    background-color: var(--color-bg-sub);
    display: none;
}

.drawer__nav #drawer-nav li.drawer-sub-open > .sub-menu {
    display: block;
}

.drawer__nav #drawer-nav .sub-menu li a {
    padding: 12px 24px 12px 36px;
    font-size: 1.4rem;
    font-weight: 400;
    color: var(--color-text-light);
}

/* サブメニュー開閉矢印 */
.drawer__nav #drawer-nav li.menu-item-has-children > a::after {
    content: '›';
    font-size: 1.6rem;
    color: var(--color-text-muted);
    transition: transform var(--transition);
}

.drawer__nav #drawer-nav li.drawer-sub-open > a::after {
    transform: rotate(90deg);
}

/* ドロワー連絡先エリア */
.drawer__contact {
    padding: 20px;
    border-top: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-shrink: 0;
}

.drawer__phone {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--color-text);
}

.drawer__phone-label {
    font-size: 1.1rem;
    color: var(--color-text-muted);
}

.drawer__phone-number {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: 0.05em;
}

.drawer__contact .btn {
    width: 100%;
    text-align: center;
}

/* ---------------------------------------------------
   レスポンシブ
   --------------------------------------------------- */
@media (max-width: 768px) {
    #site-content {
        padding-top: 60px; /* モバイル: header-top のみ */
    }

    .header-right {
        display: none; /* 電話・CTAは非表示 */
    }

    .hamburger {
        display: flex;
    }

    .header-nav {
        display: none; /* PCナビ非表示 */
    }
}
