@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 {
    color: #333333;
    background-color: #FFFFFF;
    font-family: ヒラギノ角ゴ Pro W3,Hiragino Kaku Gothic Pro,メイリオ,Meiryo,Osaka,ＭＳ Ｐゴシック,MS PGothic,sans-serif
}

/* 基本的なスペーシングリセット */
.wp-block-spacer,
.entry-header,
p,
ul {
    margin-bottom: 0 !important;
}

p {
    text-align: left;
    line-height: 1.8;
}

/* ===== 2. 動的目次のスタイリング ===== */
.dynamic-toc {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-left: 4px solid #007cba;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.dynamic-toc h3 {
    margin: 0 0 15px 0;
    font-size: 1.2em;
    color: #333;
    display: flex;
    align-items: center;
}

.dynamic-toc #dynamic-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dynamic-toc #dynamic-toc-list li {
    margin: 8px 0;
}

.dynamic-toc #dynamic-toc-list a {
    display: block;
    padding: 8px 12px;
    text-decoration: none;
    color: #333;
    border-radius: 4px;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.dynamic-toc #dynamic-toc-list a:hover {
    background-color: #e3f2fd;
    border-left-color: #2196f3;
    transform: translateX(5px);
}

.dynamic-toc #dynamic-toc-list a.active {
    background-color: rgba(0, 124, 186, 0.1);
    color: #007cba;
    font-weight: bold;
    border-left-color: #007cba;
}

.dynamic-toc .toc-sub-list {
    list-style: none;
    padding-left: 20px;
    margin-top: 5px;
}

.dynamic-toc .toc-sub-list a {
    font-size: 0.9em;
    padding: 5px 10px;
}

.toc-toggle:hover {
    background-color: #f0f0f0;
    border-radius: 3px;
    padding: 2px 4px;
}

/* ===== 3. リンクスタイル ===== */
a {
    color: #0077BB;
    text-decoration: none;
}

a:hover {
    color: #005588;
    text-decoration: underline;
}

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

/* ===== 4. メインコンテンツエリア ===== */
.main-content, 
.post-content .main-content, 
.single-post .main-content, 
.entry-content .main-content {
    max-width: 100%;
    line-height: 1.8;
    color: #333;
    margin: 0 auto;
}

/* ===== 5. 記事ヘッダー ===== */
.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;
}

/* ===== 6. 見出しスタイル（統合・最適化版）===== */
h1 {
    color: #004488;
    margin: 2em 0 0.8em 0;
    border-bottom: 2px solid #004488;
    padding-bottom: 5px;
    text-align: center;
}

/* h2スタイル - 統合版 */
.main-content h2, 
.post-content h2, 
.single-post h2, 
.entry-content h2, 
.content-section h2 {
    color: #2E86C1;
    font-size: 1.8rem;
    font-weight: 700;
    margin: 2rem 0 1.5rem 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;
}

/* h3スタイル - 統合版 */
.main-content h3, 
.post-content h3, 
.single-post h3, 
.entry-content h3, 
.content-section h3 {
    color: #28B463;
    font-size: 1.4rem;
    font-weight: 600;
    margin: 2rem 0 1rem 0;
    padding: 10px 0 10px 15px;
    border-left: 3px solid #28B463;
    background: linear-gradient(90deg, #E9F7EF 0%, transparent 100%);
    position: relative;
    z-index: 1;
}

/* h4スタイル - 統合版 */
.main-content h4, 
.post-content h4, 
.single-post h4, 
.entry-content h4, 
.content-section h4 {
    color: #E67E22;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 10px 0;
    padding: 8px 0 8px 12px;
    border-left: 2px solid #E67E22;
    position: relative;
    z-index: 1;
}

/* h5, h6 */
h5, h6 {
    color: #333333;
    margin: 1.2em 0 0.5em 0;
}

/* 疑似要素の完全リセット（簡略化版）*/
.main-content h2::before, .main-content h2::after,
.main-content h3::before, .main-content h3::after,
.main-content h4::before, .main-content h4::after,
.post-content h2::before, .post-content h2::after,
.post-content h3::before, .post-content h3::after,
.post-content h4::before, .post-content h4::after,
.single-post h2::before, .single-post h2::after,
.single-post h3::before, .single-post h3::after,
.single-post h4::before, .single-post h4::after,
.entry-content h2::before, .entry-content h2::after,
.entry-content h3::before, .entry-content h3::after,
.entry-content h4::before, .entry-content h4::after {
    content: none !important;
    display: none !important;
}

/* 見出し内span要素のスタイル調整 */
.main-content h2 span, .main-content h3 span, .main-content h4 span,
.post-content h2 span, .post-content h3 span, .post-content h4 span,
.single-post h2 span, .single-post h3 span, .single-post h4 span,
.entry-content h2 span, .entry-content h3 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;
}

/* ===== 7. テキスト装飾 ===== */
strong, b {
    font-weight: bold;
}

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;
    color: inherit;
    padding: 0;
    border-radius: 0;
}

/* ===== 8. リスト ===== */
ul, ol {
    color: #333333;
    margin-left: 5px;
    margin-bottom: 1em;
}

ul li, ol li {
    line-height: 1.8;
}

/* ===== 9. ハイライト・ボックス要素 ===== */
.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;
}

/* ===== 10. セクション・コンテンツエリア ===== */
.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;
}

.intro-section {
    background: linear-gradient(135deg, #E9F7EF 0%, #F0F4F8 100%);
    border-radius: 15px;
    padding: 2rem;
    margin: 2rem 0;
}

.lead-text {
    font-size: 1.2rem;
    font-weight: 500;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    color: #2C3E50;
}

.info-box {
    background: linear-gradient(135deg, #F0F4F8 0%, #E6F2FA 100%);
    border-radius: 10px;
    border-left: 5px solid #8E44AD;
    padding: 25px;
}

.conclusion {
    background: linear-gradient(135deg, #F0F4F8 0%, #E6F2FA 100%);
    padding: 30px;
    border-radius: 10px;
    margin: 40px 0;
    border: 2px solid #ced6ee;
    text-align: center;
    font-size: 16px;
    line-height: 1.8;
}

/* ===== 11. カード系コンポーネント ===== */
.reform-summary, .strategy-container, .comparison-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.reform-card, .strategy-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 #BDC3C7;
}

.reform-card:hover, .strategy-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px 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;
}

/* ===== 12. タイムライン ===== */
.timeline-container {
    margin: 30px 0;
    position: relative;
}

.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;
}

/* ===== 13. テーブル ===== */
.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;
}

/* ===== 14. 画像・モーダル ===== */
.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);
}

.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);
}

/* ===== 15. 記事フッター ===== */
.article-footer {
    background: #F0F4F8;
    padding: 2rem 0;
    margin-top: 3rem;
    border-top: 3px solid #E6F2FA;
}

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

.final-note {
    background: #FFF5E5;
    border: 2px solid #FFB366;
    border-radius: 10px;
    padding: 1.5rem;
    margin: 2rem 0;
}

.final-note p {
    margin: 0;
    font-weight: 500;
    color: #2C3E50;
}

/* ===== 16. レスポンシブデザイン ===== */
@media (max-width: 768px) {
    .dynamic-toc {
        margin: 15px -10px;
        padding: 15px;
        border-radius: 0;
    }
    
    .dynamic-toc #dynamic-toc-list a {
        padding: 10px 8px;
        font-size: 0.95em;
    }
    
    .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;
    }
    
    .main-content h2 {
        font-size: 1.5rem;
        padding-left: 15px;
    }
    
    .main-content h3 {
        font-size: 1.3rem;
        padding-left: 12px;
    }
    
    .main-content h4 {
        font-size: 1.1rem;
        padding-left: 10px;
    }
    
    .modal-image {
        max-width: 90vw;
        max-height: 80vh;
    }
    
    .modal-close {
        top: -50px;
        font-size: 25px;
        width: 35px;
        height: 35px;
    }
}

@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;
    }
}

/* ===== 17. 印刷用スタイル ===== */
@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;
    }
    
    .dynamic-toc {
        position: static;
        page-break-after: always;
    }
}
/* --- 18. カテゴリー別設定 --- */
/* 年金制度 */
.category-pension-tag {
    display: inline-block;
    background: #2e5d8c;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* 医療・介護保険制度 */
.category-medical-tag {
    display: inline-block;
    background: #0a4424;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* 税制改正と給付金 */
.category-taxreform-tag {
    display: inline-block;
    background: #6b4259;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* 資産形成・運用に影響する改正 */
.category-assetformation-tag {
    display: inline-block;
    background: #e6e896;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* ライフイベントと制度改正 */
.category-lifeevents-tag {
    display: inline-block;
    background: #f89469;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
}
