/* 新しいトップページ専用スタイル */

/* 横スクロール防止のグローバル設定 */
body.home {
    overflow-x: hidden;
    max-width: 100vw;
}

/* 日本語テキストの改行制御 */
body.home {
    word-break: normal;
    overflow-wrap: anywhere;
    line-break: auto;
    text-wrap: pretty;
    hanging-punctuation: allow-end;
}

body.home p, 
body.home div, 
body.home span {
    word-break: normal;
    overflow-wrap: anywhere;
    text-wrap: pretty;
    hyphens: auto;
}

/* 長い単語のみ改行を許可 */
body.home .catch-description,
body.home .section-description {
    word-break: normal;
    overflow-wrap: anywhere;
    line-height: 1.8;
    text-wrap: pretty;
}

/* リスト項目の改行制御 */
body.home .feature-list li,
body.home .advantage-list li,
body.home .mandatory-content li {
    word-break: normal;
    overflow-wrap: anywhere;
    text-wrap: pretty;
    line-height: 1.6;
}

/* ボタンテキストは改行禁止 - 全ボタンに適用（最高優先度で設定） */
.btn-primary,
.btn-secondary,
.notice-btn,
.urgent-btn,
.mainimg-btn a,
#mainimg .mainimg-btn a,
#mainimg ul.mainimg-btn li a,
.btn a,
body.home .btn-primary,
body.home .btn-secondary,
body.home .notice-btn,
body.home .urgent-btn,
main .btn a,
section .btn-primary,
section .btn-secondary,
div .btn-primary,
div .btn-secondary {
    white-space: nowrap !important;
    word-break: keep-all !important;
    overflow-wrap: normal !important;
    text-wrap: none !important;
    text-align: center !important;
    line-height: 1.2 !important;
}

/* 見出しの改行制御 */
body.home h1, 
body.home h3, 
body.home h4 {
    word-break: normal;
    overflow-wrap: anywhere;
    line-height: 1.4;
    text-wrap: balance;
}

/* h2は改行を控えめに - 全h2に適用（最高優先度で設定） */
h2,
main h2,
body.home h2,
section h2,
div h2,
.main-contents h2,
h2 .uline,
main h2 .uline,
body.home h2 .uline {
    white-space: nowrap !important;
    word-break: keep-all !important;
    overflow-wrap: normal !important;
    text-wrap: none !important;
    line-height: 1.4 !important;
    flex-wrap: nowrap !important;
}

/* 住所・連絡先の改行制御 */
body.home .address,
body.home .contact-detail {
    word-break: normal;
    overflow-wrap: anywhere;
    line-height: 1.5;
    text-wrap: pretty;
}

/* FAQ質問文の改行制御 */
body.home .openclose-parts {
    word-break: normal;
    overflow-wrap: anywhere;
    line-height: 1.5;
    text-wrap: pretty;
}

/* 価格表示の改行制御 */
body.home .price-item h4,
body.home .price,
body.home .price-note {
    word-break: normal;
    overflow-wrap: anywhere;
    text-wrap: pretty;
}
}

/* タグ要素の改行禁止 */
body.home .tag {
    white-space: nowrap;
    word-break: keep-all;
}

/* メインスライドボタンの調整（3つのボタン対応） */
#mainimg .mainimg-btn {
    gap: 15px !important; /* ボタン間のスペースを少し狭く */
    flex-wrap: wrap; /* 必要に応じて折り返し */
    justify-content: center;
}

/* セクション統一スタイル */
body.home .main-contents section {
    padding: 50px 0 !important;
    margin: 0 auto !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    width: 100% !important;
    max-width: 1200px !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    padding-left: 30px !important;
    padding-right: 30px !important;
}

/* セクション間の区切り線 */
body.home .main-contents section + section {
    margin-top: 0 !important;
    border-top: 2px solid #e9ecef !important;
}

/* セクション見出しの統一 */
body.home .main-contents section h2 {
    text-align: left !important;
    margin-bottom: 30px !important;
    padding-bottom: 20px !important;
    position: relative !important;
}

/* セクション説明文の統一 */
body.home .main-contents section .section-description {
    text-align: left !important;
    max-width: 100% !important;
    margin: 0 0 40px 0 !important;
    font-size: 1.1rem !important;
    line-height: 1.8 !important;
    color: #555 !important;
}

/* 各セクションの個別背景色設定 - 控えめな背景色 */
/* 1. 緊急告知 - 重要な告知のため薄い赤系で強調 */
body.home .urgent-notice {
    background: linear-gradient(135deg, #fff8f6 0%, #ffebe6 100%) !important;
    border: 1px solid #ffcdd2 !important;
    padding: 20px !important;
    margin: 0 auto 40px auto !important;
    max-width: 90% !important;
    border-radius: 8px !important;
    box-sizing: border-box !important;
}

/* 2. メインキャッチ - 白背景 */
body.home .main-catch {
    background: #ffffff !important;
}

/* 3. 主要サービス - 白背景 */
body.home #services {
    background: #ffffff !important;
}

/* 4. 初回相談無料 - 顧客誘導のため薄い緑系で強調 */
body.home .consultation-section {
    background: linear-gradient(135deg, #f9fff9 0%, #f1f8e9 100%) !important;
    border: 1px solid #dcedc8 !important;
}

/* 5. 地域密着 - 白背景 */
body.home .area-info {
    background: #ffffff !important;
}

/* 6. 相続登記義務化 - 重要な法務情報のため薄い黄系で強調 */
body.home .inheritance-mandatory {
    background: linear-gradient(135deg, #fffef7 0%, #fff9c4 100%) !important;
    border: 1px solid #ffecb3 !important;
}

/* 7. よくある質問 - 白背景 */
body.home .main-contents section:last-child {
    background: #ffffff !important;
}

/* レスポンシブ対応 - 小さい画面では縦並び */
@media screen and (max-width: 900px) {
    #mainimg .mainimg-btn {
        gap: 10px !important;
    }
    
    #mainimg .mainimg-btn a {
        font-size: 0.9rem;
        padding: 8px 20px !important;
    }
    
    /* セクションのパディング調整 */
    body.home .main-contents section {
        padding: 40px 20px !important;
        margin: 0 auto !important;
        max-width: 100% !important;
    }
}

/* 700px以下での3つボタン対応 - トップページ */
@media screen and (max-width: 700px) {
    body.home #mainimg .mainimg-btn {
        bottom: -150px !important; /* トップページではボタンと下要素の距離を詰める */
        height: auto !important; /* 自動の高さに変更 */
        padding: 8px 0 !important; /* 左右のパディングをなくして中央揃えを確実に */
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        width: 100% !important;
        box-sizing: border-box !important;
        gap: 5px !important; /* ボタン間のスペースを詰める */
        left: 0 !important; /* 左端から配置 */
        right: 0 !important; /* 右端から配置 */
    }
    
    /* 700px以下での3つボタン対応 - その他のページ */
    body:not(.home) #mainimg .mainimg-btn {
        bottom: -200px !important; /* 画像から十分に離れた位置に配置 */
        height: auto !important; /* 自動の高さに変更 */
        padding: 8px 0 !important; /* 左右のパディングをなくして中央揃えを確実に */
        margin-bottom: 40px !important; /* 下の項目との間にスペースを追加 */
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        width: 100% !important;
        box-sizing: border-box !important;
        gap: 5px !important; /* ボタン間のスペースを詰める */
        left: 0 !important; /* 左端から配置 */
        right: 0 !important; /* 右端から配置 */
    }
    
    body.home #mainimg .mainimg-btn a,
    body:not(.home) #mainimg .mainimg-btn a {
        margin: 0 auto !important; /* 左右自動マージンで中央配置 */
        width: calc(100vw - 80px) !important; /* 画面幅から十分な余白を引く */
        max-width: calc(100vw - 80px) !important; /* 確実にはみ出しを防ぐ */
        box-sizing: border-box !important;
        text-align: center !important;
        display: block !important;
        padding: 12px 20px !important; /* パディングも統一 */
    }
    
    /* コンテンツ領域の上マージンを調整 - トップページ */
    body.home #contents {
        margin-top: 80px !important; /* トップページでは距離を詰める */
    }
    
    /* コンテンツ領域の上マージンを調整 - その他のページ */
    body:not(.home) #contents {
        margin-top: 40px !important; /* より多くのマージンを確保 */
    }
    
    /* メインコンテンツ - トップページ */
    body.home .main-contents {
        margin-top: 20px !important; /* 距離を詰める */
    }
    
    /* メインコンテンツ - その他のページ */
    body:not(.home) .main-contents {
        margin-top: 20px !important; /* 他のページでは適度な余白を確保 */
        padding-top: 5px !important; /* 適度なパディング */
    }
    
    /* 相続登記ページと家族信託ページの特別対応 */
    body.souzoku .main-contents,
    body.kazokushintaku .main-contents {
        margin-top: 80px !important; /* さらに多くのマージンを追加 */
        padding-top: 60px !important; /* より多くのパディング */
    }
    
    /* ヒーローセクション（相続登記・家族信託）の上マージン */
    body.souzoku .hero-section,
    body.kazokushintaku .hero-section {
        margin-top: 40px !important; /* より多くの間隔を確保 */
    }
    
    /* 全ページでヒーローセクションがある場合の追加スペース確保 */
    body:not(.home) .hero-section {
        margin-top: 20px !important;
        padding-top: 40px !important;
    }
    
    /* 任意のページでsectionが直接続く場合の保護 */
    body:not(.home) main > section:first-child,
    body:not(.home) .main-contents > section:first-child {
        margin-top: 40px !important;
        padding-top: 40px !important;
    }
}

/* iPhone専用のボタン中央揃え調整 */
@media screen and (max-width: 480px) {
    body.home #mainimg .mainimg-btn,
    body:not(.home) #mainimg .mainimg-btn {
        padding: 8px 0 !important; /* 左右のパディングをなくして中央揃えを確実に */
        gap: 4px !important; /* ボタン間のスペースをさらに詰める */
    }
    
    body.home #mainimg .mainimg-btn a,
    body:not(.home) #mainimg .mainimg-btn a {
        font-size: 16px !important; /* フォントサイズを調整 */
        padding: 12px 20px !important; /* パディングを調整 */
        width: calc(100vw - 60px) !important; /* 画面幅から十分な余白を引く */
        max-width: calc(100vw - 60px) !important; /* 確実にはみ出しを防ぐ */
        min-height: 44px !important; /* iOSのタッチ領域推奨サイズ */
        margin: 0 auto !important; /* 左右自動マージンで中央配置 */
    }
}

/* FAQの開閉UI改善 */
body.home .openclose-parts {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px 20px;
    margin: 10px 0;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    font-weight: 500;
    color: #333;
}

body.home .openclose-parts:hover {
    background: #e9ecef;
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

/* 開閉アイコンを追加 */
body.home .openclose-parts::after {
    content: "▼";
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

/* 開いている状態のアイコン */
body.home .openclose-parts.active::after {
    transform: translateY(-50%) rotate(180deg);
}

/* FAQ回答部分のスタイル */
body.home .openclose-parts + div {
    background: #fff;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 20px;
    margin-bottom: 15px;
}

/* サイドメニューの文字折り返し防止 */
.submenu a {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* サブメニュー項目の左寄せ */
.submenu li li a {
    padding-left: 1rem !important; /* 2remから1remに減らして左寄せ */
    text-align: left;
}

/* サブメニューの幅を少し広げる・左側配置 */
@media screen and (min-width:900px) {
    /* サブコンテンツの幅と順序 - より強い指定で上書き */
    .sub-contents,
    .sub-contents:nth-child(2),
    .sub-contents:nth-child(3),
    main.column .sub-contents {
        width: 250px !important; /* 210pxから250pxに拡張 */
        order: -1 !important; /* 最初に表示（左側） */
    }
    
    /* メインコンテンツの順序も強制的に変更 */
    .main-contents {
        order: 10 !important; /* 確実に右側に表示 */
    }
    
    /* ホームページのmain-contentsの幅調整 */
    body.home main.column .main-contents {
        flex: 1;
        min-width: 0;
        overflow-x: hidden;
    }
    
    /* 相続登記ページ専用の修正 */
    body.souzoku .sub-contents {
        order: -1 !important; /* 最初に表示（左側） */
    }
    
    body.souzoku .main-contents {
        order: 10 !important; /* 確実に右側に表示 */
    }
}

/* メインコンテンツレイアウト - トップページのみに適用 */
body.home .main-contents {
    padding: 0;
    margin: 0;
    max-width: 100%;
    overflow-x: hidden; /* 横スクロールを防止 */
    box-sizing: border-box;
    width: 100%;
}

/* 全体的なコンテナの横幅制御 */
body.home #container,
body.home #contents {
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* メインカラムの横幅制御 */
body.home main.column {
    max-width: 100%;
    overflow-x: hidden;
}

/* セクション要素の横幅制御 */
body.home .main-contents section {
    max-width: 100%;
    box-sizing: border-box;
}

/* グリッド要素の制御 */
body.home .features-grid,
body.home .price-grid,
body.home .consultation-methods,
body.home .mandatory-grid {
    max-width: 100%;
    box-sizing: border-box;
}

/* フレックス要素の制御 */
body.home .notice-inner,
body.home .consultation-info,
body.home .area-content {
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* 個別アイテムの制御 */
body.home .feature-item,
body.home .price-item,
body.home .method-item,
body.home .mandatory-item {
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

/* _ServiceIndex.cshtml の list-grid1 の幅制御 */
body.home .list-grid1 {
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

body.home .list-grid1 .list {
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* 画像サイズの統一 */
body.home .list-grid1 .list figure {
    margin: -1rem -1rem 0.5rem -1rem;
    height: 240px;
    overflow: hidden;
    flex-shrink: 0;
}

body.home .list-grid1 .list figure img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* テキストエリアの調整 */
body.home .list-grid1 .list .text {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
    margin-bottom: 10px;
}

body.home .list-grid1 .list .text h4 {
    margin: 0 0 10px 0;
    font-size: 1.1rem;
    color: var(--primary-color);
    font-weight: 600;
}

body.home .list-grid1 .list .text p {
    margin: 0;
    flex: 1;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #666;
}

/* ボタンエリアの調整 */
body.home .list-grid1 .list .btn {
    margin-top: auto;
    flex-shrink: 0;
}

body.home .list-grid1 .list .btn a {
    display: block;
    text-decoration: none;
    background: var(--primary-color);
    color: white;
    padding: 8px 15px;
    text-align: center;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-top: 0;
}

body.home .list-grid1 .list .btn a:hover {
    background: #5a8f1c;
    transform: translateY(-1px);
}

/* PC表示でのlist-grid1の調整 */
@media screen and (min-width: 800px) {
    body.home .list-grid1 {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 15px;
    }
    
    /* PCでの画像サイズ調整 */
    body.home .list-grid1 .list figure {
        height: 220px;
    }
}

/* 画面が狭い場合の調整 */
@media screen and (max-width: 1200px) {
    body.home .list-grid1 {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 10px;
    }
}

/* 非常に狭い画面での調整 */
@media screen and (max-width: 900px) {
    body.home .list-grid1 {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 8px;
    }
    
    body.home .list-grid1 .list figure {
        height: 180px;
    }
    
    body.home .list-grid1 .list .text h4 {
        font-size: 1rem;
    }
    
    body.home .list-grid1 .list .text p {
        font-size: 0.8rem;
    }
}

/* モバイル表示での調整 */
@media screen and (max-width: 600px) {
    body.home .list-grid1 {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    body.home .list-grid1 .list {
        margin-bottom: 15px;
    }
    
    body.home .list-grid1 .list figure {
        height: 250px;
    }
    
    body.home .list-grid1 .list .text {
        padding: 15px 0;
    }
    
    body.home .list-grid1 .list .btn a {
        padding: 12px 20px;
        font-size: 1rem;
    }
}

body.home .main-contents section {
    padding: 40px 0;
    margin-bottom: 0;
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
    overflow-x: hidden;
}

body.home .main-contents section + section {
    margin-top: 0;
    border-top: 1px solid #f0f0f0;
}

/* 緊急通知バー - トップページ専用 */
body.home .urgent-notice {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 2px solid #ffc107;
    padding: 20px var(--global-space);
    margin: 0 calc(-1 * var(--global-space)) 0 calc(-1 * var(--global-space));
    word-break: normal;
    overflow-wrap: anywhere;
    text-wrap: pretty;
    max-width: none;
    box-sizing: border-box;
}

body.home .notice-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    margin: 0;
    gap: 20px;
    text-align: center;
    width: 100%;
}

body.home .notice-icon {
    font-size: 2rem;
    color: #dc3545;
    flex-shrink: 0;
}

body.home .notice-content {
    flex: 1;
    text-align: center;
}

body.home .notice-content h3 {
    color: #721c24;
    margin: 0 0 5px 0;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
}

body.home .notice-content p {
    margin: 0;
    color: #856404;
    font-size: 0.9rem;
    text-align: center;
}

body.home .notice-btn {
    background: #dc3545;
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.3s ease;
}

body.home .notice-btn:hover {
    background: #c82333;
    transform: translateY(-2px);
}

/* メインキャッチ - トップページ専用 */
body.home .main-catch {
    text-align: left;
}

body.home .main-catch h1 {
    margin-bottom: 20px;
}

body.home .catch-description {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #555;
    max-width: 800px;
    margin: 0 auto 40px auto;
}

/* 特徴グリッド - トップページ専用 */
body.home .features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 40px 0;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

body.home .feature-item {
    background: white;
    padding: 25px 15px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s ease;
}

body.home .feature-item:hover {
    transform: translateY(-5px);
}

body.home .feature-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    display: block;
}

body.home .feature-item h3 {
    color: var(--primary-color);
    margin: 0 0 10px 0;
    font-size: 1.1rem;
}

body.home .feature-item p {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
}

/* お問い合わせボタン - トップページ専用 */
body.home .contact-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

body.home .btn-primary, body.home .btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 15px 30px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
}

body.home .btn-primary {
    background: var(--primary-color);
    color: white;
}

body.home .btn-primary:hover {
    background: #5a8f1c;
    transform: translateY(-2px);
}

body.home .btn-secondary {
    background: #f8f9fa;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

body.home .btn-secondary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* セクション共通 - トップページ専用 */
body.home .section-description {
    text-align: left;
    font-size: 1.1rem;
    line-height: 1.8;
    color: #555;
    max-width: 800px;
    margin: 0 0 30px 0;
}

/* 料金情報 - トップページ専用 */
body.home .price-info {
    margin-top: 40px;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 10px;
}

body.home .price-info h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    text-align: center;
}

body.home .price-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

body.home .price-item {
    background: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border: 2px solid #e0e0e0;
}

body.home .price-item h4 {
    color: #333;
    margin-bottom: 10px;
}

body.home .price {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 5px;
}

body.home .price-note {
    font-size: 0.8rem;
    color: #666;
}

body.home .price-notice {
    background: #e8f5e8;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

/* 相談方法 - トップページ専用 */
body.home .consultation-info {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-top: 30px;
}

body.home .consultation-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

body.home .method-item {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s ease;
}

body.home .method-item:hover {
    transform: translateY(-5px);
}

body.home .method-item .method-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    display: block;
}

body.home .method-item h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

body.home .contact-detail {
    margin-top: 10px;
    font-weight: 500;
    color: #333;
}

body.home .consultation-features {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    margin-top: 20px;
    border: 1px solid #dee2e6;
}

body.home .consultation-features h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

body.home .feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

body.home .feature-list li {
    padding: 12px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #e9ecef;
    font-size: 1rem;
}

body.home .feature-list li:last-child {
    border-bottom: none;
}

body.home .feature-list i {
    color: var(--primary-color);
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

/* 地域・アクセス情報 */
body.home .area-content {
    display: grid;
    grid-template-columns: 1fr minmax(300px, 350px);
    gap: 40px;
    margin-top: 30px;
    align-items: start;
    max-width: 100%;
    padding: 0 20px;
    box-sizing: border-box;
}

body.home .area-info {
    padding: 40px 20px;
    max-width: 100%;
    box-sizing: border-box;
}

body.home .area-info h3,
body.home .area-right h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.3rem;
}

body.home .area-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
}

body.home .tag {
    background: #e3f2fd;
    color: #1976d2;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

body.home .tag:hover {
    background: #1976d2;
    color: white;
    transform: translateY(-2px);
}

body.home .advantage-list {
    list-style: none;
    padding: 0;
}

body.home .advantage-list li {
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    position: relative;
    padding-left: 25px;
    font-size: 1.05rem;
}

body.home .advantage-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

body.home .office-info {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 10px;
    min-height: auto;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

body.home .area-left {
    flex: 1;
    min-width: 0;
}

body.home .area-right {
    flex: 0 1 350px;
    max-width: 350px;
    min-width: 280px;
}

body.home .address {
    font-weight: bold;
    margin-bottom: 25px;
    color: var(--primary-color);
    font-size: 1.1rem;
    line-height: 1.6;
}

body.home .access-detail {
    margin-top: 15px;
}

body.home .access-detail p {
    margin-bottom: 15px;
    line-height: 1.6;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

body.home .access-detail p:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

body.home .access-detail strong {
    display: block;
    color: var(--primary-color);
    margin-bottom: 5px;
    font-size: 1rem;
}

/* 義務化対応 */
body.home .mandatory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

body.home .mandatory-item {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-left: 4px solid var(--primary-color);
}

body.home .mandatory-item h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

body.home .mandatory-content ul {
    list-style: none;
    padding: 0;
}

body.home .mandatory-content li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

body.home .urgent-cta {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    margin-top: 30px;
}

body.home .urgent-btn {
    background: #dc3545;
    color: white;
    padding: 12px 30px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    margin-top: 10px;
}

body.home .urgent-btn:hover {
    background: #c82333;
    transform: translateY(-2px);
}

/* レスポンシブ対応 */
@media screen and (max-width: 768px) {
    /* モバイルでの改行制御を緩和 */
    body.home {
        word-break: normal;
        overflow-wrap: anywhere;
        text-wrap: pretty;
    }
    
    /* モバイルでのセクションパディング調整 */
    body.home .main-contents section {
        padding: 30px 15px !important;
    }
    
    /* モバイルでのボタンテキスト調整 - 高優先度 */
    .btn-primary,
    .btn-secondary,
    .notice-btn,
    .urgent-btn,
    .mainimg-btn a,
    #mainimg .mainimg-btn a,
    #mainimg ul.mainimg-btn li a,
    .btn a,
    body.home .btn-primary,
    body.home .btn-secondary,
    body.home .notice-btn,
    body.home .urgent-btn,
    main .btn a,
    section .btn-primary,
    section .btn-secondary,
    div .btn-primary,
    div .btn-secondary {
        white-space: nowrap !important;
        word-break: keep-all !important;
        overflow-wrap: normal !important;
        text-wrap: none !important;
        text-align: center !important;
        line-height: 1.3 !important;
    }
    
    /* モバイルでarea-contentのパディングを調整 */
    body.home .area-content {
        padding: 0 10px;
    }
    
    body.home .urgent-notice {
        margin: 0 auto 30px auto !important;
        max-width: 95% !important;
        padding: 15px !important;
    }
    
    body.home .notice-inner {
        flex-direction: column;
        text-align: center;
        gap: 15px;
        overflow-x: hidden;
        width: 100%;
        padding: 0;
        box-sizing: border-box;
        justify-content: center;
        align-items: center;
    }
    
    body.home .notice-content {
        text-align: center;
        width: 100%;
    }
    
    body.home .features-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    body.home .consultation-info,
    body.home .area-content {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    body.home .area-right {
        min-width: 100%;
        max-width: 100%;
        flex: 1 1 100%;
    }
    
    body.home .office-info {
        margin-top: 20px;
    }
    
    body.home .consultation-methods {
        grid-template-columns: 1fr;
    }
    
    body.home .price-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    body.home .mandatory-grid {
        grid-template-columns: 1fr;
    }
    
    /* モバイルでのボタンテキスト調整 - ボタンは常に改行禁止 */
    body.home .btn-primary,
    body.home .btn-secondary,
    .btn-primary,
    .btn-secondary,
    .notice-btn,
    .urgent-btn,
    main .btn a,
    .btn a {
        white-space: nowrap !important;
        word-break: keep-all !important;
        overflow-wrap: normal !important;
        text-wrap: none !important;
        text-align: center !important;
        line-height: 1.3 !important;
    }
}

@media screen and (max-width: 480px) {
    /* 小さな画面での改行をさらに緩和 */
    body.home p,
    body.home div,
    body.home span {
        word-break: normal;
        overflow-wrap: anywhere;
        text-wrap: pretty;
    }
    
    body.home .contact-buttons {
        flex-direction: column;
        align-items: center;
        gap: 12px;
        margin-top: 30px;
    }
    
    .btn-primary, 
    .btn-secondary,
    .notice-btn,
    .urgent-btn,
    .mainimg-btn a,
    #mainimg .mainimg-btn a,
    #mainimg ul.mainimg-btn li a,
    .btn a,
    body.home .btn-primary, 
    body.home .btn-secondary,
    body.home .notice-btn,
    body.home .urgent-btn,
    main .btn a,
    section .btn-primary,
    section .btn-secondary,
    div .btn-primary,
    div .btn-secondary {
        width: 100%;
        max-width: 320px;
        min-height: 50px;
        justify-content: center;
        white-space: nowrap !important;
        word-break: keep-all !important;
        overflow-wrap: normal !important;
        text-wrap: none !important;
        padding: 16px 24px;
        font-size: 16px;
        line-height: 1.3 !important;
        text-align: center !important;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    /* 特定の長いテキストの調整 */
    body.home .catch-description,
    body.home .section-description {
        font-size: 1rem;
        line-height: 1.7;
    }
    
    /* FAQ質問文の調整 */
    body.home .openclose-parts {
        font-size: 0.95rem;
        line-height: 1.4;
        padding: 12px 15px;
    }
}

/* 最終的な改行制御 - 最高優先度で全媒体対応 */
/* ボタンの改行を絶対に阻止する最終ルール */
a.btn-primary,
a.btn-secondary,
.btn-primary,
.btn-secondary,
.notice-btn,
.urgent-btn,
.mainimg-btn a,
#mainimg .mainimg-btn a,
#mainimg ul.mainimg-btn li a,
.btn a,
body .btn-primary,
body .btn-secondary,
body .notice-btn,
body .urgent-btn,
main .btn a,
section .btn-primary,
section .btn-secondary,
div .btn-primary,
div .btn-secondary,
* .btn-primary,
* .btn-secondary {
    white-space: nowrap !important;
    word-break: keep-all !important;
    overflow-wrap: normal !important;
    text-wrap: none !important;
    text-align: center !important;
    line-height: 1.3 !important;
}

/* H2見出しの改行制御 - Windows環境での見切れ防止 */
h2,
main h2,
section h2,
div h2,
.main-contents h2,
h2 .uline,
main h2 .uline,
h2 span,
main h2 span,
* h2,
* h2 .uline,
* h2 span {
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
    text-wrap: balance !important;
    line-height: 1.4 !important;
    flex-wrap: wrap !important;
    max-width: 100% !important;
    overflow: visible !important;
}

/* 全メディアクエリ下でのボタンと見出し強制設定 */
@media screen and (max-width: 1200px) {
    .btn-primary, .btn-secondary, .notice-btn, .urgent-btn,
    .mainimg-btn a, #mainimg .mainimg-btn a, .btn a {
        white-space: nowrap !important;
        word-break: keep-all !important;
        overflow-wrap: normal !important;
        text-wrap: none !important;
    }
    
    h2, main h2, h2 .uline, main h2 .uline {
        white-space: normal !important;
        word-break: normal !important;
        overflow-wrap: break-word !important;
        text-wrap: balance !important;
    }
}

@media screen and (max-width: 768px) {
    .btn-primary, .btn-secondary, .notice-btn, .urgent-btn,
    .mainimg-btn a, #mainimg .mainimg-btn a, .btn a {
        white-space: nowrap !important;
        word-break: keep-all !important;
        overflow-wrap: normal !important;
        text-wrap: none !important;
    }
    
    h2, main h2, h2 .uline, main h2 .uline {
        white-space: normal !important;
        word-break: normal !important;
        overflow-wrap: break-word !important;
        text-wrap: balance !important;
    }
}

@media screen and (max-width: 480px) {
    .btn-primary, .btn-secondary, .notice-btn, .urgent-btn,
    .mainimg-btn a, #mainimg .mainimg-btn a, .btn a {
        white-space: nowrap !important;
        word-break: keep-all !important;
        overflow-wrap: normal !important;
        text-wrap: none !important;
    }
    
    /* スマホでh2要素の改行を許可 */
    h2, main h2, h2 .uline, main h2 .uline {
        white-space: normal !important;
        word-break: normal !important;
        overflow-wrap: break-word !important;
        text-wrap: wrap !important;
        line-height: 1.3 !important;
    }
}

/* 不動産登記ページ専用背景色スタイル */
.urgent-notice {
    background: linear-gradient(135deg, #ff6b6b, #ff8e53) !important;
    color: white !important;
    padding: 20px !important;
    border-radius: 8px !important;
    margin: 20px 0 !important;
    text-align: center !important;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1) !important;
    border: none !important;
}

/* 相続登記ページ専用のurgent-notice - コントラスト改善 */
body.souzoku .urgent-notice {
    background: linear-gradient(135deg, #dc3545, #c82333) !important;
    color: white !important;
    padding: 20px !important;
    border-radius: 8px !important;
    margin: 10px 0 20px 0 !important;
    text-align: center !important;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1) !important;
    border: 2px solid #fff !important;
    font-weight: 600 !important;
}

/* 相続登記ページのヒーローセクション - 画像との距離調整 */
body.souzoku .hero-section {
    margin-bottom: 30px !important;
    padding-bottom: 20px !important;
    margin-top: 0 !important;
    padding-top: 10px !important;
}

body.souzoku .hero-content {
    margin-bottom: 15px !important;
}

/* 相続登記ページの基礎知識セクションとの距離調整 */
body.souzoku #Souzoku {
    margin-top: 20px !important;
    padding-top: 10px !important;
}

/* 相続登記ページのヒーローセクション フォント色修正 */
body.souzoku .hero-content h1 {
    color: #333 !important;
    text-shadow: 1px 1px 2px rgba(255,255,255,0.8) !important;
    font-weight: 700 !important;
}

body.souzoku .hero-subtitle {
    color: #555 !important;
    text-shadow: 1px 1px 2px rgba(255,255,255,0.8) !important;
    font-weight: 600 !important;
}

/* 相続登記ページのCTAセクション間隔調整 */
body.souzoku .cta-section {
    margin-top: 20px !important;
}

/* スマホUIでのCTAセクション間隔調整 */
@media (max-width: 768px) {
    body.souzoku .hero-section {
        margin-top: 0 !important;
        padding-top: 5px !important;
        margin-bottom: 15px !important;
    }
    
    body.souzoku .cta-section {
        margin-top: 10px !important;
        padding-top: 15px !important;
    }
    
    body.souzoku #Souzoku {
        margin-bottom: 10px !important;
        margin-top: 10px !important;
    }
}

/* 費用セクション */
.price-info {
    background: #f8f9fa !important;
    padding: 30px !important;
    border-radius: 8px !important;
    margin: 30px 0 !important;
    border-left: 5px solid var(--primary-color) !important;
}

.price-notice {
    background: #e7f3ff !important;
    padding: 15px !important;
    border-radius: 5px !important;
    border: 1px solid #cce7ff !important;
    color: #0066cc !important;
    text-align: center !important;
    margin-top: 20px !important;
}

/* 料金例セクション */
.fee-examples-section {
    background: #f0f8ff !important;
    padding: 30px !important;
    border-radius: 8px !important;
    margin: 30px 0 !important;
    border: 1px solid #cce7ff !important;
}

.fee-example-card {
    background: white !important;
    border-radius: 8px !important;
    padding: 20px !important;
    margin-bottom: 20px !important;
    border: 1px solid #e0e0e0 !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05) !important;
}

/* FAQセクション */
.faq-section {
    background: #f9f9f9 !important;
    padding: 30px !important;
    border-radius: 8px !important;
    margin: 30px 0 !important;
}

.faq-item {
    background: white !important;
    padding: 20px !important;
    border-radius: 5px !important;
    margin-bottom: 15px !important;
    border-left: 4px solid var(--primary-color) !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05) !important;
}

/* 手続きの流れセクション */
.procedure-section {
    background: #fff !important;
    padding: 30px !important;
    border-radius: 8px !important;
    margin: 30px 0 !important;
    border: 1px solid #e0e0e0 !important;
}

.flow-step {
    background: #f8f9fa !important;
    padding: 20px !important;
    border-radius: 5px !important;
    margin-bottom: 15px !important;
    border-left: 4px solid var(--primary-color) !important;
}

/* 事例セクション */
.case-study {
    background: #fff !important;
    padding: 25px !important;
    border-radius: 8px !important;
    margin-bottom: 20px !important;
    border: 1px solid #e0e0e0 !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05) !important;
}

/* 用語解説セクション */
.terminology {
    background: #f8f9fa !important;
    padding: 30px !important;
    border-radius: 8px !important;
    margin: 30px 0 !important;
}

.term-explanation {
    background: white !important;
    padding: 20px !important;
    border-radius: 5px !important;
    margin: 15px 0 !important;
    border-left: 4px solid var(--primary-color) !important;
}

/* 法改正情報セクション */
.law-reform {
    background: #fff8e1 !important;
    padding: 30px !important;
    border-radius: 8px !important;
    margin: 30px 0 !important;
    border: 1px solid #ffcc02 !important;
}

.reform-detail {
    background: white !important;
    padding: 20px !important;
    border-radius: 5px !important;
    margin-bottom: 20px !important;
    border-left: 4px solid #ff9800 !important;
}

/* 相談セクション */
.consultation-section {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef) !important;
    padding: 40px !important;
    border-radius: 10px !important;
    margin: 40px 0 !important;
    text-align: center !important;
}

.method-item {
    background: white !important;
    padding: 20px !important;
    border-radius: 8px !important;
    margin: 15px !important;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1) !important;
    transition: transform 0.3s ease !important;
}

.method-item:hover {
    transform: translateY(-2px) !important;
}

/* ホームページ相談セクション修正 */
.consultation-info {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 30px !important;
    margin-top: 30px !important;
}

.consultation-methods {
    display: flex !important;
    flex-direction: column !important;
    gap: 15px !important;
    flex: 1 !important;
    min-width: 300px !important;
}

.method-item {
    text-align: center !important;
    padding: 20px !important;
    background: #f8f9fa !important;
    border-radius: 8px !important;
    border: 1px solid #e0e0e0 !important;
}

.consultation-features {
    flex: 0 0 300px !important;
    background: #e7f3ff !important;
    padding: 20px !important;
    border-radius: 8px !important;
    border: 1px solid #cce7ff !important;
    margin-left: 10px !important;
}

.feature-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 10px 0 0 0 !important;
}

.feature-list li {
    padding: 8px 0 !important;
    border-bottom: 1px solid #ddd !important;
}

.feature-list li:last-child {
    border-bottom: none !important;
}

/* モバイル対応 */
@media (max-width: 768px) {
    .consultation-info {
        flex-direction: column !important;
    }
    
    .consultation-methods {
        flex-direction: column !important;
    }
    
    .consultation-features {
        flex: none !important;
        margin-left: 0 !important;
        margin-top: 20px !important;
        text-align: center !important;
        margin-right: 0 !important;
    }
    
    .consultation-features h3 {
        text-align: center !important;
    }
    
    .feature-list {
        text-align: left !important;
        display: inline-block !important;
        width: auto !important;
        max-width: 100% !important;
    }
}