@charset "UTF-8";

/*!
Theme Name: Cocoon Child
Description: Cocoon専用の子テーマ
Theme URI: https://wp-cocoon.com/
Author: わいひら
Author URI: https://nelog.jp/
Template:    cocoon-master
Version:     1.1.3
*/

/************************************
** 子テーマ用のスタイルを書く - マージ済み最終版
************************************/

/* --- 1. 基本となる配色 --- */
body {
    /* フォントはCocoonのデフォルトに任せるか、必要であれば指定 */
    /* font-family: "Hiragino Kaku Gothic ProN", "メイリオ", Meiryo, sans-serif; */
    color: #333333; /* 基本のテキスト色 */
    background-color: #FFFFFF; /* 基本の背景色（Cocoonのデフォルトに合わせる） */
}

.wp-block-spacer {
    margin-bottom: 0 !important;
}

/* 既存のスタイルと新しい記事ヘッダーのpaddingを調整 */
/* 新しい記事ヘッダーのpaddingが優先されるため、ここではp, ulのみに適用 */
.entry-header,
p,
ul {
    margin-bottom: 0 !important;

}

/* マーカー */
.marker {
    background: linear-gradient(transparent 60%, #ff6 60%);
}

/* リンク */
a {
    color: #0077BB; /* リンク色 */
    text-decoration: none; /* デフォルトの下線なし */
}

a:hover {
    color: #005588; /* ホバー時のリンク色 */
    text-decoration: underline; /* ホバー時下線あり */
}

/* --- 2. 記事コンテンツのベーススタイル (新しいCSSから) --- */
.main-content,
.post-content .main-content,
.single-post .main-content,
.entry-content .main-content {
    max-width: 100%;
    line-height: 1.8;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans CJK JP", "ヒラギノ角ゴ ProN W3", "Hiragino Kaku Gothic ProN", "游ゴシック", YuGothic, "メイリオ", Meiryo, sans-serif;
    color: #333;
    margin: 0 auto;
}

/* --- 3. 記事ヘッダー (新しいCSSから) --- */
.article-header {
    background: linear-gradient(135deg, #E6F2FA 0%, #F0F4F8 100%);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.article-date {
    color: #7F8C8D;
    font-size: 14px;
}

.article-category {
    background: #2E86C1;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
}

/* --- 4. 見出しの配色とスタイル (新しいCSSを優先) --- */
/* h1は既存のCocoon子テーマのスタイルを維持 */
h1 {
    color: #004488; /* H1色 */
    margin-top: 2em; /* 上の余白を調整 */
    margin-bottom: 0.8em; /* 下の余白を調整 */
    border-bottom: 2px solid #004488; /* H1の下線（任意） */
    padding-bottom: 5px; /* 下線とテキストの間隔 */
}

/* h2, h3, h4は記事コンテンツ内のものに対して新しいスタイルを適用 */
.main-content h2,
.post-content h2,
.single-post h2,
.entry-content h2 {
    color: #2E86C1;
    font-size: 24px;
    font-weight: bold;
    margin: 40px 0 20px 0;
    padding: 15px 0 15px 20px; /* 左ボーダーとテキストの間隔を調整済み */
    border-left: 5px solid #2E86C1;
    background: linear-gradient(90deg, #E6F2FA 0%, transparent 100%);
    border-radius: 5px;
    position: relative;
    z-index: 1; /* テキストを疑似要素より手前に */
}

.main-content h3,
.post-content h3,
.single-post h3,
.entry-content h3 {
    color: #28B463;
    font-size: 20px;
    font-weight: bold;
    margin: 30px 0 15px 0;
    padding: 10px 0 10px 15px; /* 左ボーダーとテキストの間隔を調整済み */
    border-left: 3px solid #28B463;
    background: linear-gradient(90deg, #E9F7EF 0%, transparent 100%);
    position: relative;
    z-index: 1; /* テキストを疑似要素より手前に */
}

.main-content h4,
.post-content h4,
.single-post h4,
.entry-content h4 {
    color: #E67E22;
    font-size: 18px;
    font-weight: bold;
    margin: 0 0 10px 0;
    padding: 8px 0 8px 12px; /* 左ボーダーとテキストの間隔を調整済み */
    border-left: 2px solid #E67E22;
    position: relative;
    z-index: 1; /* テキストを疑似要素より手前に */
}

/* h5, h6は既存のCocoon子テーマのスタイルを維持 */
h5, h6 {
    color: #333333; /* H4以降は基本のテキスト色 */
    margin-top: 1.2em;
    margin-bottom: 0.5em;
}

/* 疑似要素の完全リセット - より強力なセレクタで他の疑似要素を無効化 */
.main-content h2:before,
.main-content h2:after,
.post-content h2:before,
.post-content h2:after,
.single-post h2:before,
.single-post h2:after,
.entry-content h2:before,
.entry-content h2:after,
.main-content h3:before,
.main-content h3:after,
.post-content h3:before,
.post-content h3:after,
.single-post h3:before,
.single-post h3:after,
.entry-content h3:before,
.entry-content h3:after,
.main-content h4:before,
.main-content h4:after,
.post-content h4:before,
.post-content h4:after,
.single-post h4:before,
.single-post h4:after,
.entry-content h4:after,
.entry-content h4:before {
    content: none !important;
    display: none !important;
    visibility: hidden !important;
    position: absolute !important; /*念のため*/
    left: -9999px !important; /*念のため*/
    width: 0 !important; /*念のため*/
    height: 0 !important; /*念のため*/
}

/* span要素内の疑似要素もリセット */
.main-content h2 span:before,
.main-content h2 span:after,
.post-content h2 span:before,
.post-content h2 span:after,
.single-post h2 span:before,
.single-post h2 span:after,
.entry-content h2 span:before,
.entry-content h2 span:after,
.main-content h3 span:before,
.main-content h3 span:after,
.post-content h3 span:before,
.post-content h3 span:after,
.single-post h3 span:before,
.single-post h3 span:after,
.entry-content h3 span:before,
.entry-content h3 span:after,
.main-content h4 span:before,
.main-content h4 span:after,
.post-content h4 span:before,
.post-content h4 span:after,
.single-post h4 span:before,
.single-post h4 span:after,
.entry-content h4 span:before,
.entry-content h4 span:after {
    content: none !important;
    display: none !important;
    visibility: hidden !important;
    position: absolute !important;
    left: -9999px !important;
    width: 0 !important;
    height: 0 !important;
}

/* 全ての見出し内要素の疑似要素リセット (より広範にカバー) */
.main-content h2 *:before,
.main-content h2 *:after,
.post-content h2 *:before,
.post-content h2 *:after,
.single-post h2 *:before,
.single-post h2 *:after,
.entry-content h2 *:before,
.entry-content h2 *:after,
.main-content h3 *:before,
.main-content h3 *:after,
.post-content h3 *:before,
.post-content h3 *:after,
.single-post h3 *:before,
.single-post h3 *:after,
.entry-content h3 *:before,
.entry-content h3 *:after,
.main-content h4 *:before,
.main-content h4 *:after,
.post-content h4 *:before,
.post-content h4 *:after,
.single-post h4 *:before,
.single-post h4 *:after,
.entry-content h4 *:before,
.entry-content h4 *:after {
    content: none !important;
    display: none !important;
    visibility: hidden !important;
    position: absolute !important;
    left: -9999px !important;
    width: 0 !important;
    height: 0 !important;
}


/* 見出し内span要素のスタイル調整 (新しいCSSから) */
.main-content h2 span,
.post-content h2 span,
.single-post h2 span,
.entry-content h2 span,
.main-content h3 span,
.post-content h3 span,
.single-post h3 span,
.entry-content h3 span,
.main-content h4 span,
.post-content h4 span,
.single-post h4 span,
.entry-content h4 span {
    position: relative;
    z-index: 2; /* テキストコンテンツが疑似要素より手前に来るように */
    display: inline;
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    font-size: inherit;
    color: inherit;
    font-weight: inherit;
}

/* --- 5. 強調・引用などの配色 (既存と新しいものを統合) --- */
/* 強調テキスト */
strong, b {
    font-weight: bold; /* 基本は太字のみ。色を付ける場合はここに追加 */
    /* color: #004488; */ /* 必要であれば強調色を追加 */
}

/* 引用 */
blockquote {
    color: #555555; /* 引用テキスト色 */
    background-color: #F0F8FF; /* 引用背景色 */
    border-left: 5px solid #0088CC; /* 左ボーダー */
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 3px; /* 角を少し丸くする */
}

/* コード（インライン） */
code {
    background-color: #F7F7F7; /* コード背景色 */
    color: #C7254E; /* コード色 */
    padding: 2px 5px;
    border-radius: 4px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace; /* コード用のフォント */
    font-size: 0.9em; /* 少し小さめに */
}

/* コードブロック */
pre {
    background-color: #F7F7F7; /* コードブロック背景色 */
    color: #C7254E; /* コードブロック色 */
    padding: 15px;
    margin: 20px 0;
    border-radius: 5px;
    overflow-x: auto; /* 横に長いコードをスクロール可能にする */
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
    font-size: 0.9em;
    line-height: 1.6;
}

pre code {
    background-color: transparent; /* pre内のcodeは背景色なしに */
    color: inherit; /* pre内のcodeは親（pre）の色を継承 */
    padding: 0;
    border-radius: 0;
}

/* リスト */
ul, ol {
    color: #333333; /* リストのテキスト色 */
    margin-left: 20px; /* 左のインデント */
    margin-bottom: 1em;
}

ul li, ol li {
    line-height: 1.8; /* 行の高さ */
}



/* --- 7. ワンポイントカラー (既存と新しいものを統合) --- */
.highlight-green {
    color: #28A745;
    font-weight: bold;
}

.highlight-red {
    color: #DC3545;
    font-weight: bold;
}

.warning-box {
    background-color: #FFF3CD; /* 薄い黄色の背景 */
    border: 1px solid #FFC107; /* 黄色のボーダー */
    color: #856404; /* 濃い黄色のテキスト */
    padding: 15px;
    margin: 20px 0;
    border-radius: 5px;
}

.button-primary {
    display: inline-block;
    background-color: #0077BB; /* リンク色と同じ青 */
    color: #FFFFFF;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    transition: background-color 0.3s ease; /* ホバー時のアニメーション */
}

.button-primary:hover {
    background-color: #005588;
}

/* --- 8. 記事コンテンツ内の新しいセクションスタイル (新しいCSSから) --- */

/* ハイライトボックス */
.highlight-box {
    padding: 25px;
    border-radius: 10px;
    margin: 25px 0;
    border-left: 5px solid;
}

.highlight-box.intro {
    background: linear-gradient(135deg, #E6F2FA 0%, #F0F4F8 100%);
    border-left-color: #2E86C1;
}

/* 改革サマリーカード */
.reform-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.reform-card {
    background: #F9F9F9;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border-top: 4px solid;
}

.reform-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.15);
}

.reform-card .reform-category {
    font-size: 12px;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 15px;
    display: inline-block;
    margin-bottom: 10px;
}

.reform-category.survivor {
    background: #FFF5E5;
    color: #E67E22;
}

.reform-category.pension {
    background: #E9F7EF;
    color: #28B463;
}

/* 比較テーブル */
.comparison-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin: 30px 0;
}

.comparison-table {
    background: #F9F9F9;
    border-radius: 10px;
    padding: 20px;
    overflow-x: auto;
}

.comparison-table table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.comparison-table th,
.comparison-table td {
    padding: 12px;
    text-align: center;
    border: 1px solid #E6F2FA;
}

.comparison-table th {
    background: #2E86C1;
    color: white;
    font-weight: bold;
}

.highlight-row {
    background: #E9F7EF;
    font-weight: bold;
}

.increase-row {
    background: #FFF5E5;
    color: #E67E22;
    font-weight: bold;
}

/* タイムライン */
.timeline-container {
    margin: 30px 0;
    position: relative;
    /* 新しいtimeline-itemがflexを使うため、このコンテナのpadding-leftは不要 */
}

.timeline-item {
    display: flex;
    align-items: center;
    margin: 20px 0;
    padding: 20px;
    background: #F9F9F9;
    border-radius: 10px;
    border-left: 4px solid #BDC3C7;
    transition: all 0.3s ease;
}

.timeline-item.current {
    border-left-color: #28B463;
    background: #E9F7EF;
}

.timeline-item.future {
    border-left-color: #E67E22;
    background: #FFF5E5;
}

.timeline-year {
    font-weight: bold;
    font-size: 18px;
    color: #2E86C1;
    min-width: 120px;
}

.timeline-content {
    flex: 1;
    margin-left: 20px;
}

/* 情報ボックス */
.info-box,
.impact-analysis,
.strategy-container {
    margin: 30px 0;
}

.info-box {
    background: linear-gradient(135deg, #F0F4F8 0%, #E6F2FA 100%);
    border-radius: 10px;
    border-left: 5px solid #8E44AD;
    padding: 25px; /* ここにpaddingを追加して、内容が見えるように */
}

/* インパクト分析 */
.impact-analysis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.impact-item {
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid;
}

.impact-item.positive {
    background: #E9F7EF;
    border-left-color: #28B463;
}

.impact-item.attention {
    background: #FFF5E5;
    border-left-color: #E67E22;
}

/* ストラテジーカード */
.strategy-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.strategy-card {
    background: #F9F9F9;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border-top: 4px solid;
    transition: all 0.3s ease;
}

.strategy-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.strategy-card.immediate {
    border-top-color: #E74C3C;
}

.strategy-card.planning {
    border-top-color: #3498DB;
}

.strategy-card.family {
    border-top-color: #9B59B6;
}

/* チェックリスト */
.plan-checklist,
.summary-points {
    margin: 30px 0;
}

.checklist-item,
.point-card {
    background: #F9F9F9;
    padding: 20px;
    margin: 15px 0;
    border-radius: 10px;
    border-left: 4px solid #2E86C1;
}

.point-card.increase {
    border-left-color: #28B463;
    background: #E9F7EF;
}

.point-card.work {
    border-left-color: #3498DB;
    background: #E6F2FA;
}

.point-card.future {
    border-left-color: #8E44AD;
    background: #F0F4F8;
}

/* --- 9. 画像スタイル (既存と新しいものを統合) --- */
/* ショートコードで埋め込まれたコンテンツ全体を親要素に収める (既存) */
.entry-content img,
.article img {
  max-width: 100%;
  height: auto;
}

.clickable-image,
.full-screen-image {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    margin: 20px auto; /* 中央寄せ */
    cursor: pointer;
    transition: all 0.3s ease;
    display: block; /* 画像をブロック要素にする */
}

.clickable-image:hover,
.full-screen-image:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

/* --- 10. モーダルスタイル (新しいCSSを優先) --- */
.image-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.image-modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.modal-content {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
    margin: auto;
}

.modal-image {
    width: 100%;
    height: auto;
    max-width: 95vw;
    max-height: 85vh; /* スマホでの見切れ対策 */
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    background: rgba(0,0,0,0.5);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.1);
}

/* --- 11. テーブルをレスポンシブに対応 (既存) --- */
.entry-content table,
.article table {
  width: 100%;
  max-width: 100%;
  overflow-x: auto; /* 横スクロール可能に */
  display: block; /* テーブルをブロック要素として扱う */
}

/* 固定幅コンテナの修正 (既存) */
.entry-content div,
.article div {
  max-width: 100%;
}

/* --- 12. 記事フッター関連 (新しいCSSから) --- */
.conclusion {
    background: linear-gradient(135deg, #F0F4F8 0%, #E6F2FA 100%);
    padding: 30px;
    border-radius: 10px;
    margin: 40px 0;
    border: 2px solid #E6F2FA;
    text-align: center;
    font-size: 16px;
    line-height: 1.8;
}

.article-footer {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px solid #E6F2FA;
}

.disclaimer {
    background: #F9F9F9;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    font-size: 14px;
    color: #7F8C8D;
}

.related-links ul {
    list-style: none;
    padding: 0;
}

.related-links li {
    margin: 10px 0;
}

.related-links a {
    color: #2E86C1;
    text-decoration: none;
    transition: all 0.3s ease;
}

.related-links a:hover {
    color: #1B4F72;
    text-decoration: underline;
}


/************************************
** レスポンシブデザイン用のメディアクエリ
************************************/
/* 768px以下 (新しいCSSの内容を優先・統合) */
@media (max-width: 768px) {
    .main-content {
        padding: 15px;
    }

    .article-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .comparison-container,
    .reform-summary,
    .strategy-container {
        grid-template-columns: 1fr;
    }

    .timeline-item {
        flex-direction: column;
        text-align: center;
    }

    .timeline-year {
        margin-bottom: 10px;
        min-width: auto;
    }

    .timeline-content {
        margin-left: 0;
    }

    #table-of-contents-container {
        position: static;
        margin: 20px 0;
    }

    .main-content h2 {
        font-size: 20px;
        padding-left: 15px;
    }

    .main-content h3 {
        font-size: 18px;
        padding-left: 12px;
    }

    .main-content h4 {
        font-size: 16px;
        padding-left: 10px;
    }

    .modal-image {
        max-width: 90vw;
        max-height: 80vh;
    }

    .modal-close {
        top: -50px;
        font-size: 25px;
        width: 35px;
        height: 35px;
    }
}

/* 480px以下 (新しいCSSの内容を優先・統合) */
@media (max-width: 480px) {
    .comparison-table {
        font-size: 14px;
    }

    .comparison-table th,
    .comparison-table td {
        padding: 8px;
    }

    .strategy-card,
    .reform-card {
        padding: 20px;
    }

    .modal-content {
        padding: 10px;
    }

    .modal-image {
        max-width: 95vw;
        max-height: 75vh;
    }
}

/* 印刷用スタイル (新しいCSSから追加) */
@media print {
    .main-content {
        max-width: none;
        font-size: 12px;
        line-height: 1.4;
    }

    .image-modal {
        display: none !important;
    }

    .clickable-image,
    .full-screen-image {
        max-width: 100%;
        page-break-inside: avoid;
    }

    .strategy-container,
    .reform-summary {
        grid-template-columns: 1fr;
    }

    #table-of-contents-container {
        position: static;
        page-break-after: always;
    }
}