/* app-shell.css — アプリのような骨格（2026-09-18 ①）
   出力: inc/app-shell.php（パンくず）・header.php（メニュー内の受付時間）
   動き: assets/js/app-shell.js（スクロールで上部バーを隠す・メニューを閉じる・フッターを畳む）
   色は tokens.css の変数（ダーク表示は変数側で切り替わる）。!important は使わない。
   ========================================================================== */

/* ── 現在地（パンくず）：全幅の細い帯。スマホは1行で横に流す ── */
.wn-crumbs {
    background-color: var(--c-paper, #fff);
    border-bottom: 1px solid var(--c-border-soft, #EDE9DD);
}
.wn-crumbs__inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 8px 20px;
}
.wn-crumbs .aioseo-breadcrumbs {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--c-text-mute, #4A5570);
    white-space: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
}
.wn-crumbs .aioseo-breadcrumbs::-webkit-scrollbar { display: none; }
.wn-crumbs .aioseo-breadcrumb { display: inline; }
body.wn-store .wn-crumbs a,
body.wn-store header.site-header .wn-crumbs a {
    color: var(--c-text-mute, #4A5570);
    text-decoration: none;
    font-weight: 600;
}
body.wn-store .wn-crumbs a:hover,
body.wn-store header.site-header .wn-crumbs a:hover {
    color: var(--c-accent-deep, #D45417);
    text-decoration: underline;
}
.wn-crumbs .aioseo-breadcrumb-separator {
    margin: 0 .45em;
    color: var(--c-text-dim, #8A93B1);
}

/* メニューの中の受付時間・表示切替はスマホだけ */
.wn-drawer-extra { display: none; }

/* ============================================================================
   スマホ・タブレット縦（メニューがハンバーガーになる幅）
   ========================================================================== */
@media (max-width: 900px) {
    /* 受付時間の帯はメニューの中へ移す */
    body.wn-store .wn-topbar { display: none; }

    /* 上部バー：高さ 56px で画面上に固定。下へスクロールすると隠れ、上へ戻すと出る */
    body.wn-store .site-header.wn-store-header { padding-top: 56px; }
    body.wn-store .wn-header-tier1 {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 9980;
        height: 56px;
        background-color: var(--c-paper, #fff);
        border-bottom: 1px solid var(--c-border-soft, #EDE9DD);
        transition: transform .22s ease;
        will-change: transform;
    }
    html.wn-shell-hide body.wn-store .wn-header-tier1 { transform: translateY(-100%); }
    body.wn-store .wn-header-tier1__inner {
        height: 56px;
        padding: 0 8px 0 16px;
        gap: 8px;
    }
    body.wn-store .wn-header__brand .wn-brand { gap: 8px; }
    body.wn-store .wn-header__brand .wn-brand__logo-img { height: 34px; }
    body.wn-store .wn-header__brand .wn-brand__wordmark-img { height: 24px; }
    /* ロゴ下の一文（直すまで、ぴったり伴走。）は 56px のバーに収まらないためスマホでは出さない */
    html body.wn-store .wn-header__brand .wn-brand--store .wn-brand__sub { display: none; }
    body.wn-store .wn-header__actions { gap: 2px; }
    body.wn-store .wn-header__actions > .wn-header__theme-toggle { display: none; } /* メニューの中へ */
    body.wn-store .wn-header__search-toggle,
    body.wn-store .wn-header__burger {
        width: 44px;
        height: 44px;
        border: 0;
        background: transparent;
        border-radius: 12px;
    }
    body.wn-store .wn-header__search-toggle:active,
    body.wn-store .wn-header__burger:active { background-color: var(--c-mist, #F6F9FE); }

    /* メニュー：上部バーの下に重なる一覧（本文は動かさない） */
    body.wn-store .wn-header-tier2 {
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        z-index: 9979;
        max-height: 0;
        overflow: hidden;
        background-color: var(--c-paper, #fff);
        border-bottom: 0;
        box-shadow: 0 16px 32px rgba(15, 22, 38, .18);
    }
    body.wn-store .wn-header-tier2.is-open {
        max-height: calc(100vh - 56px - 58px);
        max-height: calc(100dvh - 56px - 58px);
        overflow-y: auto;
        overscroll-behavior: contain;
        border-bottom: 1px solid var(--c-border, #E5E1D6);
    }
    body.wn-store .wn-header-tier2__inner { padding: 4px 0 12px; }
    body.wn-store .wn-header-tier2 .wn-primary-menu { padding: 0; }
    body.wn-store .wn-header-tier2 .wn-primary-menu > li + li { border-top: 1px solid var(--c-border-soft, #EDE9DD); }
    body.wn-store .wn-header-tier2 .wn-primary-menu a {
        display: flex;
        align-items: center;
        min-height: 52px;
        padding: 0 20px;
        font-size: 16px;
        font-weight: 700;
    }
    body.wn-store .wn-header-tier2 .wn-primary-menu a::after { display: none; }

    .wn-drawer-extra {
        display: block;
        margin: 8px 16px 0;
        padding: 14px 16px;
        border-radius: 12px;
        background-color: var(--c-mist, #F6F9FE);
    }
    .wn-drawer-extra__info {
        margin: 0 0 10px;
        font-size: 13px;
        line-height: 1.7;
        color: var(--c-text-mute, #4A5570);
    }
    .wn-drawer-extra__info strong { color: var(--c-text, #1B2547); }
    .wn-drawer-extra__theme {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        padding: 0 16px;
        border: 1px solid var(--c-border, #E5E1D6);
        border-radius: 10px;
        background-color: var(--c-paper, #fff);
        color: var(--c-text, #1B2547);
        font-size: 14px;
        font-weight: 700;
        cursor: pointer;
    }

    /* メニューを開いている間：本文を暗くして、裏のスクロールを止める */
    html.wn-menu-open body.wn-store { overflow: hidden; }
    html.wn-menu-open body.wn-store .site-container::after {
        content: "";
        position: fixed;
        inset: 56px 0 0 0;
        z-index: 9978;
        background-color: rgba(15, 22, 38, .38);
    }

    /* 固定ページの見出し帯：余白を詰める（131px → 約75px） */
    body.wn-store .header-hero--title h1,
    body.wn-store .header-hero--title .page__title {
        margin: 22px 0;
        font-size: 22px;
        line-height: 1.4;
    }

    /* パンくず：スマホは左右の余白をそろえる */
    .wn-crumbs__inner { padding: 7px 16px; }
}

/* 管理者としてログインしている時は WordPress のバーと重なるため、上部バーを固定しない */
@media (max-width: 900px) {
    body.admin-bar.wn-store .site-header.wn-store-header { padding-top: 0; }
    body.admin-bar.wn-store .wn-header-tier1 { position: static; transform: none; }
    body.admin-bar.wn-store .wn-header-tier2 { position: static; }
}

@media (prefers-reduced-motion: reduce) {
    body.wn-store .wn-header-tier1 { transition: none; }
}

/* ============================================================================
   フッター：スマホではリンクの束を閉じた状態で始める（JS が open を外す）
   ========================================================================== */
@media (max-width: 767px) {
    body.wn-store .site-footer__col > summary { min-height: 48px; display: flex; align-items: center; cursor: pointer; }
}
