/**
 * SODA BEAUTÉ - SWELL親テーマ オーバーライド v2
 * 強化ポイント:
 *  - 100vw フルブリード技（どんな外側コンテナの中でも突き抜けて画面端まで広がる）
 *  - SWELLヘッダーナビをブランドカラーに統一
 *  - モバイルハンバーガーメニュー対応
 *  - ブロック間の余白除去
 *  - サイドバー/パンくず/ページタイトルの非表示
 */

/* ============================================================
 * 1) sb-page の main自体を 100vw にする（根本解決）
 *    親のSWELL .l-content や .l-wrapper が max-width を持っていても突破
 * ============================================================ */
main.sb-page,
main#main_content.sb-page {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
    padding: 0 !important;
    background: var(--sb-bg, #f8fcff);
    box-sizing: border-box;
    overflow-x: hidden;
}

/* SWELLの .l-mainContent__inner / l-container の制約を打ち消し */
.sb-page .l-mainContent__inner,
.sb-page > .l-mainContent__inner,
body.page .sb-page .l-mainContent__inner,
.sb-page .l-container {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

.sb-page .post_content,
.sb-page .sb-content {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* ============================================================
 * 2) body (= page-template-*) 単位でもコンテンツ領域を強制フル幅
 * ============================================================ */
body.page-template-page-top,
body.page-template-page-product,
body.page-template-page-cases,
body.page-template-page-concept,
body.page-template-page-contact,
body.page-template-page-company {
    overflow-x: hidden;
}

body.page-template-page-top .l-content,
body.page-template-page-top .l-wrapper,
body.page-template-page-top .l-container,
body.page-template-page-top .l-contentWrap,
body.page-template-page-product .l-content,
body.page-template-page-product .l-wrapper,
body.page-template-page-product .l-container,
body.page-template-page-product .l-contentWrap,
body.page-template-page-cases .l-content,
body.page-template-page-cases .l-wrapper,
body.page-template-page-cases .l-container,
body.page-template-page-cases .l-contentWrap,
body.page-template-page-concept .l-content,
body.page-template-page-concept .l-wrapper,
body.page-template-page-concept .l-container,
body.page-template-page-concept .l-contentWrap,
body.page-template-page-contact .l-content,
body.page-template-page-contact .l-wrapper,
body.page-template-page-contact .l-container,
body.page-template-page-contact .l-contentWrap,
body.page-template-page-company .l-content,
body.page-template-page-company .l-wrapper,
body.page-template-page-company .l-container,
body.page-template-page-company .l-contentWrap {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* ============================================================
 * 3) ブロック間の余白を除去（セクションが分離して見える問題）
 * ============================================================ */
.sb-page .sb-content > *,
.sb-page .sb-content > .wp-block-html,
.sb-page .sb-content > .wp-block-group,
.sb-page .sb-content > section,
.sb-page .sb-content > div {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}
.sb-page .sb-content > * + * { margin-top: 0 !important; }
.sb-page .wp-block-html { margin: 0 !important; }

/* ============================================================
 * 4) SWELLのページ装飾を sb-page で非表示
 * ============================================================ */
.sb-page .c-pageTitle,
.sb-page .p-breadcrumb,
.sb-page .p-breadList,
.sb-page .c-pankuzu,
.sb-page .p-articleThumb,
body.page-template-page-top .l-sidebar,
body.page-template-page-product .l-sidebar,
body.page-template-page-cases .l-sidebar,
body.page-template-page-concept .l-sidebar,
body.page-template-page-contact .l-sidebar,
body.page-template-page-company .l-sidebar {
    display: none !important;
}

/* ============================================================
 * 5) ヘッダー・グローバルナビをブランドカラーで上書き
 * ============================================================ */
/* ヘッダー全体 */
.l-header {
    background: rgba(255, 255, 255, 0.96) !important;
    backdrop-filter: saturate(140%) blur(8px);
    -webkit-backdrop-filter: saturate(140%) blur(8px);
    box-shadow: 0 1px 0 rgba(31, 110, 140, 0.08) !important;
    border-bottom: none !important;
}

/* サイト名（テキストロゴ） */
.l-header .c-headLogo a,
.l-header .c-siteTitle a {
    color: var(--sb-blue-700, #1f6e8c) !important;
    font-family: "Cormorant Garamond", "Noto Serif JP", serif !important;
    font-style: italic;
    font-weight: 500;
    font-size: 1.6rem !important;
    letter-spacing: 0.18em;
    text-decoration: none !important;
}

/* グローバルナビ リンク */
#header_nav_wrap .p-spNav__menu a,
.l-header .c-gnav > li > a,
.l-header .p-gnav a,
.l-header nav a {
    color: var(--sb-text, #1c2b34) !important;
    font-family: "Noto Sans JP", sans-serif !important;
    font-weight: 500 !important;
    font-size: 0.88rem !important;
    letter-spacing: 0.1em !important;
    text-decoration: none !important;
    transition: color .2s ease;
    padding: 0 1rem !important;
}

/* ホバー/アクティブ */
.l-header .c-gnav > li > a:hover,
.l-header .p-gnav a:hover,
.l-header nav a:hover,
.l-header .c-gnav > li.current-menu-item > a,
.l-header .p-gnav li.current-menu-item > a {
    color: var(--sb-blue-500, #2f9bc6) !important;
}

/* ナビアンダーライン（ブランドアクセント） */
.l-header .c-gnav > li > a::after,
.l-header .p-gnav > ul > li > a::after {
    content: "";
    display: block;
    height: 2px;
    width: 0;
    background: var(--sb-blue-500, #2f9bc6);
    transition: width .25s ease;
    margin-top: 4px;
}
.l-header .c-gnav > li > a:hover::after,
.l-header .c-gnav > li.current-menu-item > a::after,
.l-header .p-gnav > ul > li > a:hover::after,
.l-header .p-gnav > ul > li.current-menu-item > a::after {
    width: 100%;
}

/* モバイル ハンバーガー */
.l-header .p-humBtn,
.l-header .c-iconBtn--hum,
.l-header button.-hum {
    color: var(--sb-blue-700, #1f6e8c) !important;
}
.l-header .p-humBtn__bars span,
.l-header .p-humBtn span {
    background: var(--sb-blue-700, #1f6e8c) !important;
}

/* モバイル展開メニュー */
.p-spMenu,
.p-spNav,
.p-slideMenu {
    background: #fff !important;
}
.p-spMenu a,
.p-spNav a,
.p-slideMenu a {
    color: var(--sb-text, #1c2b34) !important;
    font-family: "Noto Sans JP", sans-serif !important;
    border-bottom: 1px solid rgba(31, 110, 140, 0.08) !important;
}

/* ============================================================
 * 6) sb-page__head（下層ページの共通ヒーロー帯）
 * ============================================================ */
.sb-page__head {
    padding: 6rem 1.5rem 3rem;
    text-align: center;
    background: linear-gradient(180deg,
        rgba(234, 246, 252, 0.6) 0%,
        rgba(248, 252, 255, 0) 100%);
    width: 100%;
}
.sb-page__head .sb-eyebrow {
    display: inline-block;
    color: var(--sb-blue-700, #1f6e8c);
    font-family: "Cormorant Garamond", serif;
    font-style: italic;
    font-size: 0.95rem;
    letter-spacing: 0.28em;
    margin-bottom: 0.8rem;
}
.sb-page__head .sb-section__title {
    font-family: "Cormorant Garamond", "Noto Serif JP", serif;
    font-weight: 500;
    font-size: clamp(1.9rem, 4vw, 3rem);
    line-height: 1.35;
    color: var(--sb-text, #1c2b34);
    margin: 0 0 1rem;
}
.sb-page__head .sb-section__sub {
    max-width: 720px;
    margin: 0 auto;
    color: var(--sb-text-soft, #5a6b75);
    font-size: 1rem;
    line-height: 1.9;
}

/* ============================================================
 * 7) フォント統一（sb-page内のみ）
 * ============================================================ */
.sb-page, .sb-page * {
    font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic UI", sans-serif;
}
.sb-page h1, .sb-page h2, .sb-page h3,
.sb-page .sb-hero__title, .sb-page .sb-section__title {
    font-family: "Cormorant Garamond", "Noto Serif JP", "Hiragino Mincho ProN", serif;
}
.sb-page .sb-eyebrow,
.sb-page .sb-hero__brand {
    font-family: "Cormorant Garamond", serif;
}

/* ============================================================
 * 8) ボタン上書き
 * ============================================================ */
.sb-page .sb-btn,
.sb-page a.sb-btn {
    background: linear-gradient(135deg, var(--sb-blue-500, #2f9bc6) 0%, var(--sb-blue-700, #1f6e8c) 100%) !important;
    color: #fff !important;
    border: none !important;
}
.sb-page .sb-btn--ghost,
.sb-page a.sb-btn--ghost {
    background: transparent !important;
    color: var(--sb-blue-700, #1f6e8c) !important;
    border: 1px solid rgba(31, 110, 140, 0.4) !important;
}
.sb-page .sb-btn--gold,
.sb-page a.sb-btn--gold {
    background: linear-gradient(135deg, var(--sb-gold, #b9a574) 0%, #9a8a5e 100%) !important;
    color: #fff !important;
}

/* ============================================================
 * 9) レスポンシブ
 * ============================================================ */
@media (max-width: 782px) {
    .sb-page__head { padding: 4rem 1.25rem 2rem; }
    .sb-page__head .sb-section__title {
        font-size: clamp(1.5rem, 6vw, 2.2rem);
    }
    .l-header .c-headLogo a,
    .l-header .c-siteTitle a {
        font-size: 1.3rem !important;
    }
}

/* ============================================================
 * 10) サイトキャッチフレーズ（.l-header 直下に .sb-catch-bar として配置）
 *     旧方式ではロゴ内に入れていたが、SWELL の SP レイアウトと衝突するため
 *     ヘッダー全体の「下端の帯」として独立配置する方式に変更。
 *     これでヘッダーが自然に縦に伸び、本文と絶対に被らない。
 * ============================================================ */
.l-header.sb-header-has-catch {
    display: flex !important;
    flex-direction: column !important;
}

.l-header .sb-catch-bar {
    display: block;
    width: 100%;
    text-align: center;
    padding: 4px 16px 6px;
    background: rgba(234, 246, 252, 0.45);
    border-top: 1px solid rgba(31, 110, 140, 0.08);
    box-sizing: border-box;
}

.l-header .sb-catchphrase {
    display: inline-block;
    font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic UI", sans-serif;
    font-size: 11px;
    line-height: 1.4;
    color: var(--sb-blue-700, #1f6e8c);
    font-weight: 500;
    letter-spacing: 0.15em;
    opacity: 0.95;
    word-break: keep-all;
    overflow-wrap: anywhere;
}

/* SP: 少し小さめ・余白タイト */
@media (max-width: 782px) {
    .l-header .sb-catch-bar {
        padding: 3px 12px 4px;
        background: rgba(234, 246, 252, 0.55);
    }
    .l-header .sb-catchphrase {
        font-size: 10px;
        letter-spacing: 0.08em;
        line-height: 1.3;
    }
}

/* 狭幅画面: さらに小さく */
@media (max-width: 420px) {
    .l-header .sb-catchphrase {
        font-size: 9px;
        letter-spacing: 0.04em;
    }
}

/* ============================================================
 * 12) SPスワイプ/スクロール引っかかり対策
 *     - 横オーバーフロー完全封鎖（iOS Safariの100vw問題対応）
 *     - backdrop-filter blur をSPでは無効化（描画負荷軽減）
 *     - overscroll-behavior で境界ジャンプ抑止
 * ============================================================ */
html, body {
    overflow-x: clip;
    overscroll-behavior-x: none;
}
@supports not (overflow-x: clip) {
    html, body {
        overflow-x: hidden;
    }
}

@media (max-width: 782px) {
    /* SPではblur OFF（iOSでのスクロールカクつきの主因） */
    .l-header {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
    /* 100vw ハックを SP では無効化（iOSで1pxの横スクロール発生を防ぐ） */
    main.sb-page,
    main#main_content.sb-page {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    /* 触れて動かない要素を明示 */
    body, main {
        touch-action: pan-y;
    }
}


/* ============================================================
 * 11) HEROタイトル（H1）のSP改行制御
 *     - word-break: keep-all で日本語の語中改行を抑止
 *     - overflow-wrap: anywhere はオーバーフロー時の安全策
 *     - <wbr> タグで許容される改行位置をヒント
 * ============================================================ */
.sb-hero .sb-hero__title,
.sb-page .sb-hero__title {
    word-break: keep-all;
    overflow-wrap: anywhere;
    line-break: strict;
    line-height: 1.4;
}

/* アクセントのspanも keep-all を継承 */
.sb-hero .sb-hero__title .accent {
    word-break: keep-all;
}

@media (max-width: 782px) {
    .sb-hero .sb-hero__title {
        font-size: clamp(1.35rem, 5.6vw, 1.95rem) !important;
        line-height: 1.5;
        letter-spacing: 0.02em;
        padding: 0 0.5rem;
    }
}

@media (max-width: 420px) {
    .sb-hero .sb-hero__title {
        font-size: clamp(1.2rem, 6vw, 1.7rem) !important;
    }
}


/* ============================================================
 * 13) お知らせリスト (.sb-news-list) / 新着記事カード (.sb-blog-list)
 * ============================================================ */

/* --- お知らせリスト（帯型） --- */
.sb-news-list {
    list-style: none;
    padding: 0;
    margin: 0;
    border-top: 1px solid rgba(31, 110, 140, 0.12);
}
.sb-news-list__item {
    border-bottom: 1px solid rgba(31, 110, 140, 0.12);
}
.sb-news-list__link {
    display: grid;
    grid-template-columns: 110px 1fr auto;
    gap: 1.2rem;
    align-items: center;
    padding: 1rem 0.5rem;
    text-decoration: none !important;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}
.sb-news-list__link:hover {
    background-color: rgba(234, 246, 252, 0.4);
}
.sb-news-list__date {
    font-family: "Cormorant Garamond", "Noto Serif JP", serif;
    font-size: 0.95rem;
    color: var(--sb-blue-700, #1f6e8c);
    letter-spacing: 0.08em;
    font-style: italic;
    font-weight: 500;
}
.sb-news-list__title {
    color: #1c2b34;
    font-size: 0.96rem;
    line-height: 1.6;
    font-weight: 500;
    word-break: keep-all;
    overflow-wrap: anywhere;
}
.sb-news-list__arrow {
    color: var(--sb-blue-500, #2f9bc6);
    font-size: 1.1rem;
    line-height: 1;
}
.sb-news-list__more {
    text-align: center;
    margin: 1.8rem 0 0;
}
.sb-news-list__empty {
    padding: 2rem 0;
}

@media (max-width: 782px) {
    .sb-news-list__link {
        grid-template-columns: 90px 1fr auto;
        gap: 0.8rem;
        padding: 0.85rem 0.3rem;
    }
    .sb-news-list__date { font-size: 0.86rem; }
    .sb-news-list__title { font-size: 0.88rem; line-height: 1.55; }
    .sb-news-list__arrow { font-size: 0.95rem; }
}

/* --- ブログカード（3カラム） --- */
.sb-blog-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}
.sb-blog-card {
    display: block;
    text-decoration: none !important;
    color: inherit;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(31, 110, 140, 0.08);
    box-shadow: 0 4px 16px rgba(31, 110, 140, 0.06);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.sb-blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 36px rgba(31, 110, 140, 0.14);
}
.sb-blog-card__thumb {
    aspect-ratio: 16/10;
    background-color: #eaf6fc;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
.sb-blog-card__body {
    padding: 1.4rem 1.4rem 1.6rem;
}
.sb-blog-card__date {
    display: block;
    font-family: "Cormorant Garamond", "Noto Serif JP", serif;
    font-size: 0.85rem;
    color: var(--sb-blue-700, #1f6e8c);
    letter-spacing: 0.08em;
    font-style: italic;
    margin-bottom: 0.6rem;
}
.sb-blog-card__title {
    font-family: "Noto Sans JP", sans-serif !important;
    font-weight: 500;
    font-size: 1.05rem;
    line-height: 1.55;
    color: #1c2b34;
    margin: 0 0 0.7rem;
}
.sb-blog-card__excerpt {
    font-size: 0.86rem;
    line-height: 1.8;
    color: #5a6b75;
    margin: 0;
}
.sb-blog-list__more {
    text-align: center;
    margin: 2.5rem 0 0;
}
.sb-blog-list__empty {
    padding: 2rem 0;
}

@media (max-width: 1024px) {
    .sb-blog-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}
@media (max-width: 640px) {
    .sb-blog-list {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }
}
