/**
 * SWELL 標準テンプレート（投稿記事・アーカイブ等）用
 * 自社ヘッダー / フッターとの共存調整
 *
 * 注意: SWELL は body_class() を <body> ではなく #body_wrap に出力する。
 *   <body>
 *     #wpadminbar（ログイン時）
 *     .nhm-site-chrome__header   ← 自社ヘッダー（wp_body_open）
 *     #body_wrap.nhm-site-chrome ← SWELL 本体（#header / #fix_header / #sp_menu / #footer を含む）
 *     .nhm-site-chrome__footer   ← 自社フッター（wp_footer）
 */

/* ---------- SWELL 側のヘッダー / フッターを隠す ---------- */
.nhm-site-chrome #header,
.nhm-site-chrome .l-header,
.nhm-site-chrome #fix_header,
.nhm-site-chrome .l-fixHeader,
.nhm-site-chrome #sp_menu,
.nhm-site-chrome .p-spMenu,
.nhm-site-chrome #footer,
.nhm-site-chrome .l-footer,
body:has(> #body_wrap.nhm-site-chrome) > #sp_menu,
body:has(> #body_wrap.nhm-site-chrome) > .p-spMenu,
body:has(> #body_wrap.nhm-site-chrome) > #fix_header {
    display: none !important;
}

/* ---------- 固定ヘッダーぶんの余白 ---------- */
#body_wrap.nhm-site-chrome {
    padding-top: var(--header-height, 110px) !important;
}

/* wp-addon.css の body{overflow-x:hidden} は SWELL の追従サイドバー / 目次（sticky）を壊すため clip に */
body:has(> #body_wrap.nhm-site-chrome) {
    overflow-x: clip !important;
    padding-top: 0 !important;
}

.nhm-site-chrome__header .header {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10002;
    margin: 0;
}

/* ログイン中（管理バーあり） */
#wpadminbar ~ .nhm-site-chrome__header .header {
    top: 32px;
}

@media screen and (max-width: 782px) {
    #wpadminbar ~ .nhm-site-chrome__header .header {
        top: 46px;
    }
}

/* SWELL の a / ul / button スタイルが漏れないようにリセット */
.nhm-site-chrome__header a,
.nhm-site-chrome__footer a {
    text-decoration: none;
    box-shadow: none;
}

.nhm-site-chrome__header .logo-link img {
    margin: 0;
    max-width: none;
}

.nhm-site-chrome__header .hamburger-btn,
.nhm-site-chrome__header .mobile-drawer button {
    font: inherit;
    line-height: 1;
    box-shadow: none;
}

.nhm-site-chrome__header .mobile-drawer ul,
.nhm-site-chrome__footer ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* モバイルドロワー：未オープン時は確実に隠す */
.nhm-site-chrome__header .mobile-drawer:not(.active) {
    display: none !important;
}

/* ---------- 自社フッター ---------- */
.nhm-site-chrome__footer {
    position: relative;
    z-index: 1;
}

.nhm-site-chrome__footer .footer p,
.nhm-site-chrome__footer .footer h2 {
    margin-top: 0;
}

/* SWELL の「ページトップへ」ボタンを前面へ */
.nhm-site-chrome .p-fixBtnWrap {
    z-index: 10000;
}
