/*
* 2025年給付金と減税比較記事用スタイルシート
* ファイル名: style.css
* 作成日: 2025-06-15
* 対象ページ: 101.php
* 機能: インタラクティブ要素、モーダル、レスポンシブデザイン
*/

/* ==========================================================================
   基本設定・リセット
   ========================================================================== */

* {
    box-sizing: border-box;
}

/* WordPressテーマとの互換性を保つためのセレクタ */
.main-content,
.post-content .main-content,
.single-post .main-content,
.entry-content .main-content {
    line-height: 1.8;
    color: #2C3E50;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================================================
   記事ヘッダー
   ========================================================================== */

.article-header {
    background: linear-gradient(135deg, #E6F2FA 0%, #F0F4F8 100%);
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.header-content {
    text-align: center;
}

.category-tag {
    display: inline-block;
    background: #2E8B57;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.article-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 1rem 0;
    color: #2C3E50;
    line-height: 1.3;
}

.article-meta {
    display: flex;
    justify-content: center;
    gap: 2rem;
    font-size: 0.9rem;
    color: #666;
    margin-top: 1rem;
}

/* ==========================================================================
   目次機能
   ========================================================================== */

.toc-container {
    background: #F9F9F9;
    border: 2px solid #E6F2FA;
    border-radius: 10px;
    margin: 2rem 0;
    padding: 1.5rem;
}

.toc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #E6F2FA;
}

.toc-header h2 {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
    color: #2C3E50;
}

.toc-toggle {
    background: #2E8B57;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toc-toggle:hover {
    background: #247A4A;
    transform: scale(1.05);
}

.toggle-icon {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.toc-container.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    transition: all 0.3s ease;
}

.toc-container.collapsed .toc-list {
    display: none;
}

.toc-list li {
    margin: 0.5rem 0;
    padding-left: 1rem;
    position: relative;
}

.toc-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.8rem;
    width: 6px;
    height: 6px;
    background: #2E8B57;
    border-radius: 50%;
}

.toc-list a {
    color: #2C3E50;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.toc-list a:hover {
    color: #2E8B57;
}

.toc-list .toc-h3 {
    padding-left: 1.5rem;
    font-size: 0.95rem;
}

.toc-list .toc-h4 {
    padding-left: 2.5rem;
    font-size: 0.9rem;
    color: #666;
}



/* ==========================================================================
   インタラクティブ給付金カード
   ========================================================================== */

.benefit-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
    padding: 1rem;
    background: #F0F4F8;
    border-radius: 15px;
}

.benefit-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

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

.benefit-card.basic-benefit {
    border-color: #2E8B57;
}

.benefit-card.basic-benefit:hover {
    background: linear-gradient(135deg, #E9F7EF, #F0F9F2);
}

.benefit-card.tax-exempt-benefit {
    border-color: #4682B4;
}

.benefit-card.tax-exempt-benefit:hover {
    background: linear-gradient(135deg, #E6F2FA, #F0F7FD);
}

.benefit-card.child-benefit {
    border-color: #FF6B6B;
}

.benefit-card.child-benefit:hover {
    background: linear-gradient(135deg, #FFE5E5, #FFF0F0);
}

.benefit-card h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #2C3E50;
}

.benefit-card .amount {
    font-size: 2rem;
    font-weight: 700;
    margin: 0.5rem 0;
    color: #2E8B57;
}

.benefit-card .target {
    font-size: 1rem;
    font-weight: 600;
    margin: 0.5rem 0;
    color: #4682B4;
}

.benefit-card .details {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.5rem;
}

/* ==========================================================================
   ハイライトボックス・警告ボックス
   ========================================================================== */

.highlight-box,
.warning-box {
    padding: 1.5rem;
    border-radius: 10px;
    margin: 1.5rem 0;
    border-left: 5px solid;
}

.highlight-box {
    background: #E9F7EF;
    border-left-color: #2E8B57;
}

.warning-box {
    background: #FFF5E5;
    border-left-color: #FF8C00;
}

.highlight-box h4,
.warning-box h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.highlight-box ul,
.warning-box ul {
    margin: 0;
    padding-left: 1.5rem;
}

.highlight-box li,
.warning-box li {
    margin: 0.5rem 0;
}

/* ==========================================================================
   減税オプションカード
   ========================================================================== */

.tax-reduction-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.option-card {
    background: white;
    border: 2px solid #E6F2FA;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.option-card:hover {
    border-color: #4682B4;
    box-shadow: 0 6px 20px rgba(70, 130, 180, 0.15);
    transform: translateY(-3px);
}

.option-card h4 {
    color: #4682B4;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
}

/* ==========================================================================
   計算ツール
   ========================================================================== */

.calculator-container {
    background: linear-gradient(135deg, #F0F4F8, #E6F2FA);
    border: 2px solid #4682B4;
    border-radius: 15px;
    padding: 2rem;
    margin: 2rem 0;
}

.calculator-container h4 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #2C3E50;
    font-size: 1.3rem;
    font-weight: 600;
}

.calc-inputs {
    display: flex;
    gap: 1rem;
    align-items: end;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #2C3E50;
}

.input-group select {
    padding: 0.8rem;
    border: 2px solid #E6F2FA;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    min-width: 200px;
}

.calc-button {
    background: #2E8B57;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.calc-button:hover {
    background: #247A4A;
    transform: scale(1.05);
}

.calc-result {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0;
    border-bottom: 1px solid #E6F2FA;
}

.result-item:last-child {
    border-bottom: none;
}

.result-item.total {
    background: #E9F7EF;
    margin: 1rem -1.5rem -1.5rem -1.5rem;
    padding: 1rem 1.5rem;
    border-radius: 0 0 10px 10px;
    font-weight: 700;
    font-size: 1.1rem;
}

.result-label {
    font-weight: 600;
    color: #2C3E50;
}

.result-value {
    font-weight: 700;
    color: #2E8B57;
    font-size: 1.1rem;
}

/* ==========================================================================
   推奨ボックス
   ========================================================================== */

.recommendation-box {
    padding: 1.5rem;
    border-radius: 12px;
    margin: 1.5rem 0;
    border: 2px solid;
}

.benefit-recommend {
    background: linear-gradient(135deg, #E9F7EF, #F0F9F2);
    border-color: #2E8B57;
}

.tax-recommend {
    background: linear-gradient(135deg, #E6F2FA, #F0F7FD);
    border-color: #4682B4;
}

.recommendation-box h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.recommendation-box ul {
    margin: 0;
    padding-left: 1.5rem;
}

.recommendation-box li {
    margin: 0.8rem 0;
    line-height: 1.6;
    text-align: left;
}

/* ==========================================================================
   画像・メディア
   ========================================================================== */

.overview-image-container,
.simulation-image-container,
.comparison-image-container,
.impact-image-container {
    text-align: center;
    margin: 2rem 0;
}

.overview-image-container img,
.simulation-image-container img,
.comparison-image-container img,
.impact-image-container img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.clickable-image {
    cursor: pointer;
    transition: all 0.3s ease;
}

.clickable-image:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.full-screen-image {
    cursor: pointer;
    transition: all 0.3s ease;
}

.full-screen-image:hover {
    opacity: 0.9;
    transform: scale(1.01);
}

/* ==========================================================================
   モーダル機能
   ========================================================================== */

.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.modal-content img {
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
}

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

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}



/* ==========================================================================
   レスポンシブデザイン
   ========================================================================== */

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    .article-title {
        font-size: 1.8rem;
        line-height: 1.4;
    }

    .article-meta {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
    }

    .benefit-cards-container {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0.5rem;
    }

    .tax-reduction-options {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .calc-inputs {
        flex-direction: column;
        align-items: stretch;
    }

    .input-group select {
        min-width: auto;
        width: 100%;
    }

    .modal-content {
        max-width: 95vw;
        max-height: 85vh;
        margin: 20px;
    }

    .modal-close {
        top: -50px;
        right: 10px;
    }

    .content-section h2 {
        font-size: 1.5rem;
        padding-left: 0.8rem;
    }

    .content-section h3 {
        font-size: 1.2rem;
        padding-left: 0.6rem;
    }

    .toc-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .article-title {
        font-size: 1.5rem;
    }

    .lead-text {
        font-size: 1.1rem;
    }

    .benefit-card {
        padding: 1rem;
    }

    .benefit-card .amount {
        font-size: 1.6rem;
    }

    .calculator-container {
        padding: 1.5rem;
    }

    .calc-result {
        padding: 1rem;
    }

    .result-item.total {
        margin: 1rem -1rem -1.5rem -1rem;
        padding: 1rem;
    }
}



/* 高解像度ディスプレイ対応 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .clickable-image,
    .full-screen-image {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* ダークモード対応（将来的な拡張） */
@media (prefers-color-scheme: dark) {
    /* ダークモード時のスタイルは必要に応じて追加 */
}

/* アクセシビリティ対応 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 印刷用スタイル */
@media print {
    .toc-toggle,
    .calc-button,
    .modal,
    .modal-close {
        display: none !important;
    }

    .benefit-card,
    .option-card,
    .recommendation-box {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .clickable-image,
    .full-screen-image {
        cursor: default;
    }
}
