/* ============================================================
 * 本きもの松葉 サイト共通ヘッダー／フッター
 * 全ページで読み込まれる。クラスは hm- プレフィックスで JIN:R と衝突回避。
 * ============================================================ */

:root {
    --hm-main: #725589;
    --hm-main-dark: #5c4470;
    --hm-ink: #3a3340;
    --hm-line: #e7e0ee;
    --hm-bg-lavender: #f2edf7;
    --hm-bg-lavender-2: #e9e0f2;
    --hm-font-mincho: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
    --hm-font-sans: "Zen Kaku Gothic New", "Noto Sans JP", "Hiragino Kaku Gothic ProN", sans-serif;
}

/* ---------- ヘッダー ---------- */
.hm-header {
    position: sticky;
    top: 0;
    /* JIN:R は #mainContent に z-index:200 を付けるため、それより前面に出す */
    z-index: 1000;
    background: #fff;
    border-bottom: 1px solid var(--hm-line);
}
.hm-header__inner {
    display: flex;
    align-items: center;
    gap: 24px;
    max-width: 1240px;
    margin: 0 auto;
    padding: 12px 24px;
}
.hm-header__logo {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
}
.hm-header__logo img {
    display: block;
    width: auto;
    height: 46px;
}
.hm-header__nav {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 22px;
}
.hm-header__menu {
    display: flex;
    align-items: center;
    gap: 22px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.hm-header__menu-link,
.hm-header__menu-item > span {
    font-family: var(--hm-font-sans);
    font-size: 14px;
    line-height: 1.4;
    color: var(--hm-ink);
    text-decoration: none;
    white-space: nowrap;
    transition: color .2s;
}
.hm-header__menu-link:hover {
    color: var(--hm-main);
}
.hm-header__cta {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--hm-main);
    color: #fff;
    font-family: var(--hm-font-sans);
    font-size: 13px;
    letter-spacing: .04em;
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 4px;
    transition: background .2s;
}
.hm-header__cta:hover {
    background: var(--hm-main-dark);
}
.hm-header__cta-icon {
    width: 16px;
    height: 16px;
    background: currentColor;
    -webkit-mask: no-repeat center / contain;
    mask: no-repeat center / contain;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Cpath d='M3 9l9-6 9 6v11a1 1 0 0 1-1 1h-5v-7h-6v7H4a1 1 0 0 1-1-1z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Cpath d='M3 9l9-6 9 6v11a1 1 0 0 1-1 1h-5v-7h-6v7H4a1 1 0 0 1-1-1z'/%3E%3C/svg%3E");
}

/* PC 幅が狭いとき（SP 切り替えの 768px まで）もナビを見切れさせない。
 * 項目を縮められるようにして、入りきらない分だけ項目内で折り返す。
 * 4 文字以下の項目は折り返さず、長い項目は 2 行が同じくらいの長さになるよう割る。 */
@media (min-width: 769px) {
    .hm-header__nav,
    .hm-header__menu {
        min-width: 0;
    }
    .hm-header__menu {
        flex: 0 1 auto;
    }
    .hm-header__menu-link,
    .hm-header__menu-item > span {
        display: block;
        min-width: 4em;
        white-space: normal;
        text-wrap: balance;
        text-align: center;
    }
}
@media (min-width: 769px) and (max-width: 1000px) {
    .hm-header__inner {
        gap: 16px;
        padding: 10px 16px;
    }
    .hm-header__logo img {
        height: 38px;
    }
    .hm-header__nav,
    .hm-header__menu {
        gap: 14px;
    }
    .hm-header__menu-link,
    .hm-header__menu-item > span {
        font-size: 13px;
        line-height: 1.3;
    }
    .hm-header__cta {
        padding: 10px 12px;
        font-size: 12px;
    }
}

/* ハンバーガー（PC では非表示、SP で表示） */
.hm-header__toggle {
    display: none;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    margin-left: auto;
    padding: 10px;
    background: transparent;
    border: 0;
    cursor: pointer;
}
.hm-header__toggle-bar {
    display: block;
    width: 100%;
    height: 2px;
    margin: 5px 0;
    background: var(--hm-main);
    transition: transform .25s, opacity .25s;
}
.is-nav-open .hm-header__toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.is-nav-open .hm-header__toggle-bar:nth-child(2) { opacity: 0; }
.is-nav-open .hm-header__toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- フッター ---------- */
.hm-footer {
    position: relative;
    background: linear-gradient(180deg, var(--hm-bg-lavender) 0%, var(--hm-bg-lavender-2) 100%);
    font-family: var(--hm-font-sans);
    color: var(--hm-ink);
}
.hm-footer__inner {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    max-width: 1240px;
    margin: 0 auto;
    padding: 56px 24px 40px;
}
.hm-footer__brand {
    flex: 0 0 220px;
}
.hm-footer__logo img {
    display: block;
    width: auto;
    height: 46px;
}
.hm-footer__tagline {
    margin: 16px 0 20px;
    font-size: 13px;
    line-height: 1.8;
    color: var(--hm-main-dark);
}
.hm-footer__sns {
    display: flex;
    gap: 14px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.hm-footer__sns-link {
    display: inline-flex;
    color: var(--hm-main);
}
.hm-footer__sns-link img {
    display: block;
    width: 22px;
    height: 22px;
}
.hm-footer__columns {
    flex: 1 1 620px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px 20px;
}
.hm-footer__heading {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 700;
}
.hm-footer__heading-link {
    color: var(--hm-ink);
    text-decoration: none;
}
.hm-footer__heading-link:hover { color: var(--hm-main); }
.hm-footer__links {
    list-style: none;
    margin: 0;
    padding: 0;
}
.hm-footer__links li { margin-bottom: 8px; }
.hm-footer__link {
    font-size: 12.5px;
    color: #6b6472;
    text-decoration: none;
}
.hm-footer__link:hover { color: var(--hm-main); }

/* リンク未設定（url=null）の項目は非リンク表示 */
.hm-link-disabled {
    color: #9a93a2;
    cursor: default;
}

.hm-footer__bottom {
    background: var(--hm-main);
    color: #efe9f4;
}
.hm-footer__bottom-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 24px;
    max-width: 1240px;
    margin: 0 auto;
    padding: 16px 24px;
}
.hm-footer__bottom-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.hm-footer__bottom-link {
    font-size: 12px;
    color: #efe9f4;
    text-decoration: none;
}
.hm-footer__bottom-link:hover { text-decoration: underline; }
.hm-footer__bottom .hm-link-disabled { color: #cfc3dc; }
.hm-footer__copyright {
    margin: 0;
    font-size: 11.5px;
    color: #d9cee6;
}

/* PAGE TOP */
.hm-pagetop {
    position: absolute;
    right: 20px;
    bottom: 68px;
    width: 56px;
    height: 56px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border-radius: 50%;
    background: var(--hm-main);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(114, 85, 137, .35);
}
.hm-pagetop__arrow {
    width: 8px;
    height: 8px;
    border-top: 2px solid #fff;
    border-right: 2px solid #fff;
    transform: rotate(-45deg);
}
.hm-pagetop__label {
    font-size: 8px;
    line-height: 1.1;
    letter-spacing: .05em;
    text-align: center;
}

/* ---------- SP（768px 以下）---------- */
@media (max-width: 768px) {
    .hm-header__toggle { display: block; }
    .hm-header__nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: #fff;
        border-top: 1px solid var(--hm-line);
        box-shadow: 0 8px 16px rgba(0, 0, 0, .08);
        max-height: 0;
        overflow: hidden;
        transition: max-height .3s ease;
    }
    .is-nav-open .hm-header__nav {
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }
    .hm-header__menu {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        width: 100%;
    }
    .hm-header__menu-item { border-bottom: 1px solid var(--hm-line); }
    .hm-header__menu-link,
    .hm-header__menu-item > span {
        display: block;
        padding: 15px 24px;
        font-size: 15px;
    }
    .hm-header__cta {
        margin: 16px 24px 24px;
        justify-content: center;
        padding: 14px;
    }
    .hm-footer__inner { gap: 28px; padding: 40px 20px 32px; }
    .hm-footer__brand { flex-basis: 100%; }
    .hm-footer__columns { flex-basis: 100%; grid-template-columns: repeat(2, 1fr); }
    .hm-footer__bottom-inner { flex-direction: column; align-items: flex-start; }
    /* フッター内に完全に収める（負オフセットで前のセクションに重ねない） */
    .hm-pagetop { bottom: auto; top: 24px; right: 16px; }
}
