/***********************************
    common.css  WordPress作成ページおよびHTML作成ページに共通なCSS（ヘッダー、フッター含む）
    wp.css  WordPressで作成しているページにのみ必要なCSSを記述
>>  top.css  topページにのみ必要なCSSを記述
   *********************************/


/* Custom Slider Style */
        #top-slider-container {
            position: relative;
            width: 100%;
            margin-bottom: 20px;
        }
        #top-slider-wrapper {
            position: relative;
            width: 100%;
            overflow: hidden;
        }
        #top-slider {
            display: flex;
            transition: transform 0.5s ease-in-out;
            width: 100%;
            padding: 0;
            margin: 0;
            list-style: none;
        }
        #top-slider li {
            position: relative;
            flex: 0 0 100%;
            width: 100%;
            background-color: #f2eee4;
        }
        /* デフォルト（SP用）スタイル：縦4横3の比率 */
        #top-slider li img {
            width: 100%;
            aspect-ratio: 3 / 4; /* 横3:縦4 */
            object-fit: cover;
            display: block;
        }
        #top-slider .button {
            position: absolute;
            bottom: 8%;
            left: 50%;
            transform: translateX(-50%);
            margin-left: 0; /* 元のCSSのネガティブマージンをリセット */
            width: 200px; /* ボタン幅を固定して中央寄せしやすくする */
            z-index: 10;
            text-align: center;
        }
        
        /* slider dots */
        .slider-dots {
            position: relative;
            bottom: auto;
            left: auto;
            transform: none;
            width: 100%;
            padding: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 8px;
            line-height: 0;
            z-index: 15;
            list-style: none;
            margin: 10px 0 0;
        }
        .slider-dots li {
            width: 10px;
            height: 10px;
            background-color: #007a45;
            border-radius: 50%;
            opacity: 0.4;
            cursor: pointer;
            transition: opacity 0.3s;
        }
        .slider-dots li.active {
            opacity: 1;
        }
        
        .slider-prev, .slider-next {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            z-index: 10;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            background: none;
            border: none;
            cursor: pointer;
            color: #007A46;
        }
        .slider-prev { left: 10px; }
        .slider-next { right: 10px; }
        .slider-prev::before, .slider-next::before {
            font-family: "Font Awesome 6 Free";
            font-weight: 900;
            font-size: 35px;
        }
        .slider-prev::before { content: "\f104"; }
        .slider-next::before { content: "\f105"; }

@media screen and (min-width: 960px) {
  #top-slider li picture img {
    /* 画像本来のサイズ（width属性や元ファイルの幅）を超えて拡大させない */
    width: auto; 
    
    /* 親要素を突き抜けないようにしつつ、中央に寄せる */
    display: block;
    margin-left: auto;
    margin-right: auto;
    
    /* もし全体に「width: 100%」がかかっている場合は、ここで打ち消す */
    max-width: 100%; 
  }
}


/****ニュース部分****/
        .top-news {
                padding: 40px 25px 40px 25px;
        }
        @media (min-width: 960px) {
            .top-news {
            padding: 30px 25px 60px 25px;
            }
        }

        .top-news h2 {
            background-color: #f2eee4;
            margin-bottom: 20px;
            margin-top: 0;
            padding: 5px 0;
            text-align: center;
        }

        /* ニュースカードのレイアウト変更 (スマホで左右並び) */
        .top-news li {
            display: flex; /* blockからflexに変更 */
            align-items: flex-start; /* 上端を揃える */
            margin-bottom: 25px;
            padding-bottom: 15px;
            width: 100%;
            gap: 15px; /* 画像と文章の間の余白 */
            border-bottom: 1px dashed #d9d9d9;
        }
        /*
        .top-news li:last-child {
            border-bottom: none;
        }*/
        p.top-news-img {
            flex: 0 0 130px; /* 画像の幅を100pxから130px（約30%増）に変更 */
            margin-bottom: 0;
            margin-top: 0;
        }
        .top-news-img a {
            display: block;
            border: 1px solid #007a45;
        }
        .top-news-img img {
            width: 100%;
            height: auto;
            aspect-ratio: 16/9; /* PC・スマホ共通で16:9に設定 */
            object-fit: cover;
            display: block;
        }
        .top-news-txt {
            flex: 1; /* 残りの幅を文章に */
            padding-left: 0;
            position: relative;
        }
        p.top-news-category {
            background-color: #e5f1ec;
            border: 1px solid #d0d0d0;
            border-radius: 5px;
            display: inline-block;
            font-size: 1.1rem; /* 少し小さく */
            margin-bottom: 5px;
            padding: 5px 5px;
            margin-top: 0px; /* 1pxのボーダーと合わせる */
            line-height: 1; /* 行間の余白を排除 */
            vertical-align: top; /* 上端揃えを強化 */
        }
        p.top-news-title {
            margin-bottom: 5px;
            text-align: left;
            margin-top: 0;
            line-height: 1.3;
        }
        .top-news-title a {
            color: #4595d1;
            font-size: 1.5rem;
            font-weight: bold;
            text-decoration: none;
        }
        .top-news-info {
            display: block; /* tableからblockへ */
            width: 100%;
        }
        p.top-news-date {
            color: #007a45;
            display: block;
            font-size: 1.2rem;
            font-weight: bold;
            padding-left: 0;
            text-align: left; /* 左寄せ */
        }
        
        /* ニュース「もっと見る」ボタン用 */
        .top-news .button {
            width: 200px; /* サイズ短縮 */
            margin: 0 auto;
            text-align: center;
        }

        /* ニュースタブスタイル */
        .news-tabs {
            display: flex;
            justify-content: center;
            margin-bottom: 20px;
            border-bottom: 2px solid #007A46;
        }
        .news-tabs li {
            padding: 7px 20px;
            cursor: pointer;
            font-weight: bold;
            color: #007A46;
            background: #f9fafb;
            border-radius: 5px 5px 0 0;
            margin: 0 2px;
            border: 1px solid #ddd;
            border-bottom: none;
        }
        .news-tabs li.active {
            background: #007A46;
            color: #fff;
        }
        /* ニュースリストのフィルタリング用 */
        .news-list li.hidden {
            display: none !important; /* display:flex; がJSで付与される可能性があるため強制 */
        }

        .top-sponsorship {
            background-color: #f2eee4;
            padding: 28px 0px 25px 0;
            text-align: center;
        }
        @media (min-width: 960px){
        .top-sponsorship {
            padding: 28px 25px 25px;
        }
        }
        .top-sponsorship .container {
            padding: 0 25px;
        }
        .top-sponsorship h2 {
            margin-bottom: 4px; /* 修正: 余白を半分に (元13px) */
        }
        .top-sponsorship h3 {
            margin-bottom: 5px;
            margin-top: 0px;
        }
        .top-sponsorship h4 {
            background-color: #fff;
            border-radius: 10px;
            margin-bottom: 15px;
            padding: 10px 0;
            position: relative;
        }
        .top-sponsorship h4:after {
            content: '';
            border: 5px solid transparent;
            border-top: 10px solid #fff;
            position: absolute;
            bottom: -15px;
            left: 50%;
            margin-left: -5px;
        }
        .top-sponsorship p {
            line-height: 1.7;
                text-align: justify;
        }
        /* SPデフォルト */
        .top-sponsorship-mv {
            margin: 0 auto 15px;
            max-width: 337px;
            position: relative;
            left: -6px;
        }
        .top-sponsorship-mv img {
            height: auto;
            width: 100%;
        }
        
        /* Sponsorship Row (デフォルトSP用設定) */
        .sponsorship-row {
            display: flex;
            flex-direction: column-reverse; /* SP: 画像をテキストの上に */
            gap: 15px;
            margin-bottom: 15px;
        }
        .sponsorship-content {
            width: 100%;
        }
        .sponsorship-image {
            width: 100%;
        }
        .sponsorship-image img {
            width: 80%;
            height: auto;
            margin: 0 auto 0px;
            border-radius: 8px;
            display: block;
        }

        .top-sponsorship-list {
            margin-bottom: 18px;
        }
        .top-sponsorship-list li {
            border-bottom: 1px dashed #dfd6c1;
            display: table;
            margin-bottom: 10px;
            padding-bottom: 10px;
            width: 100%;
        }
        .top-sponsorship-list li .img {
            display: table-cell;
            width: 110px;
            vertical-align: top;
        }
        .top-sponsorship-list li .img img {
            height: auto;
            max-width: 110px;
            width: 100%;
        }
        .top-sponsorship-list li div {
            display: table-cell;
            padding-left: 15px;
            text-align: left;
            vertical-align: top;
        }
        .top-sponsorship-list li h5 {
            max-width: 197px;
            padding: 5px 0;
        }
        .top-sponsorship-list li h5 img {
            height: auto;
            width: 100%;
        }
        .top-sponsorship-list li .txt {
            line-height: 1.5;
            margin-bottom: 5px;
            margin-top: 10px;
        }

        /* 修正: About Section Wrapper (全幅背景用) */
        .top-about-wrapper {
            background-color: #fff;
            padding: 30px 0;
        }
        
        .top-about {
            /* margin: 30px 25px; 削除 */
            padding: 0 25px; /* SP用パディング */
            text-align: center;
        }
        .top-about h2 {
            margin-bottom: 0px;
            /* 追加：スマホ版でもNoto Sansを適用 */
            font-family: 'Noto Sans JP', sans-serif;
            font-weight: 700;
            font-size: 2.5rem;
            color: #00703C;
        }
        .top-about h3 {
            margin-bottom: 20px;
        }
        /* SPデフォルトの画像コンテナ */
        .top-about-images {
            margin-bottom: 25px; 
            text-align: center;
        }
        .top-about-images img {
            width: 100%; 
            height: auto; 
            max-width: 325px; 
            display: block; 
            margin: 0 auto;
        }
        .top-about-images img.pc-only-img {
            display: none; 
        }

        .top-activities {
            /* 背景画像を変更 */
            background: url('https://www.childfund.or.jp/_img/top/top_activities_bg01.jpg') no-repeat;
            background-size: cover;
            padding: 36px 0;
            text-align: center;
        }
        @media (max-width: 374px) {
            .top-activities {
                padding: 9.6%;
            }
        }
        @media (min-width: 960px) {
            .top-activities {
                padding: 36px;
            }
        }
        .top-activities h2 {
            margin-bottom: 17px;
            /* 追加: 共通スタイル */
            color: #fff;
            font-family: 'Noto Sans JP', sans-serif;
            font-weight: 700;
            font-size: 2.5rem;
        }
        .top-activities p.lead {
            color: #fff;
            line-height: 1.7;
            margin-bottom: 17px;
        }
        .top-activities dl {
            max-width: 300px;
            margin: 0 auto;
        }
        .top-activities dt {
            background-color: #007a45;
            border-radius: 10px 10px 0 0;
            padding: 10px 0 5px;
            /* 追加：スマホ版共通スタイル */
            color: #fff;
            font-family: 'Noto Sans JP', sans-serif;
            font-weight: 700;
            font-size: 1.7rem;
        }
        @media (min-width: 960px) {
            .top-activities dt {
                font-size: 1.1rem;
            }            
        }
        
        /* 活動国見出しの背景色指定 (PC/SP共通) */
        /* 修正前: .top-activities dt:last-of-type { ... } */
        /* これだと全てのボックスのdtに効いてしまうため、クラス指定に変更 */
        .activity-box.wide dt {
            background-color: #7ab800; 
        }
        
        .top-activities dd {
            background-color: #fff;
            border-radius: 0 0 10px 10px;
            margin-bottom: 15px;
            padding: 17px 10px 20px;
        }
        .top-activities dd .txt {
            line-height: 1.7;
            margin-bottom: 17px;
        }
        .top-activities dd .img {
            margin-bottom: 17px;
        }
        .top-activities dd ul {
            text-align: center;
        }
        .top-activities dd li {
            display: inline-block;
            margin-right: 1.0em;
        }
        .top-activities dd li:last-child {
            margin-right: 0;
        }
        .top-activities dd li a {
            color: #4595d1;
            font-weight: bold;
        }


                /* --- 960px以上 (PCレイアウト) --- */
        @media (min-width: 960px) {
            .wrap-contents.fixed-page {
                width: 100%;
            }
            .article_content {
                max-width: 960px;
                margin: 0 auto;
            }

            /* Slider PC Customization */
            #top-slider-container {
                max-width: 100%; /* 画面幅いっぱい */
                margin: 0 auto 40px;
            }
            /* PCでは固定高さ、アスペクト比指定なし（リセット） */
            #top-slider li img {
                height: 490px; /* 高さ固定 */
                width: 100%;
                aspect-ratio: auto; /* SPの比率を解除 */
                object-fit: cover; /* トリミング */
            }

            /* News 3-column Grid */
            .top-news {
                max-width: 960px;
                margin: 0 auto;
            }
            /* ニュースタイトルサイズ調整 */
/* .top-news-title a {
                font-size: 1rem; 
                line-height: 1.5;
            }*/
            .news-list {
                display: flex;
                flex-wrap: wrap;
                justify-content: flex-start;
                gap: 30px;
            }
            .news-list li {
                display: block; /* PCでは縦並びに戻す */
                width: calc((100% - 60px) / 3);
                margin-bottom: 0px;
                border-bottom: none;
            }
            p.top-news-img {
                width: 100%;
                flex: none; /* スマホのflex設定を解除 */
                margin-bottom: 10px;
            }
            .top-news-img img {
                aspect-ratio: 16/9; /* PCでは16:9に戻す */
            }
            .top-news-txt {
                flex: none; /* スマホのflex設定を解除 */
            }
            p.top-news-title a {
                font-size: 1.6rem; /* PCサイズに戻す */
                line-height: 1.5;
            }
            .top-news-info {
                display: table; /* PCでは元のレイアウトに戻す場合 */
            }
            p.top-news-date {
                display: table-cell;
                text-align: right;
                padding-left: 1.2em;
            }
            /* Hiddenクラスがついたときはdisplay:noneを優先 */
            .news-list li.hidden {
                display: none !important;
            }
            
            /* ニュースタブ設定 */
            .news-tabs {
                width: 100%;
                margin: 0 auto 20px;
                justify-content: center;
            }
            
            .news-tabs li {
                /* 修正: paddingを減らしてタブの長さを短くする (20%短縮イメージ: 20px -> 16px程度だが、視覚効果優先で少し狭める) */
                padding: 10px 16px; 
            }
            
            /* タブの余白調整 */
            .news-tabs li:first-child {
                margin-right: 10px; /* 「Pick up」の右側に余白 */
                margin-left: 0px;
            }
            .news-tabs li:last-child {
                margin-left: 10px; /* 「すべて」の左側に余白 */
                margin-right: 0px;
            }

            /* Sponsorship 2-column Layout */
            .top-sponsorship {
                /* 背景色を全幅にするため、元のpaddingをリセットし、上下パディングのみ残す */
                padding-left: 0;
                padding-right: 0;
                padding-top: 40px;
                padding-bottom: 40px;
            }
            /* 中のコンテナの幅を800pxに制限 */
            .top-sponsorship .container {
                max-width: 800px;
                margin: 0 auto;
            }
            
            /* 修正: PC版で見出し画像を大きく表示 (scaleを使用) */
            .top-sponsorship h2 img,
            .top-sponsorship h3 img {
                transform: scale(1.3);
                transform-origin: center bottom;
/* margin-bottom: 5px;*/
            }
            
            .sponsorship-row {
                display: flex;
                flex-direction: row-reverse; /* 修正: コンテンツと画像を左右逆（画像左・テキスト右）に */
                justify-content: space-between;
                align-items: center;
                margin-bottom: 20px;
            }
            .sponsorship-content {
                width: 55%;
                text-align: left;
            }
            /* 画像コンテナの幅を調整 */
            .sponsorship-image {
                width: 40%;
            }
            /* 画像自体を20%小さくする (width: 80%) */
            .sponsorship-image img {
                width: 90%;
                height: auto;
                border-radius: 8px;
                margin: 0 auto; /* 中央配置 */
                display: block;
            }
            
            .button-short {
                width: 200px;
            }

            /* Sponsorship List 2-column */
            .top-sponsorship-list {
                display: flex;
                justify-content: space-between;
                flex-wrap: wrap;
                gap: 20px;
            }
            .top-sponsorship-list li {
                width: calc(50% - 10px);
                border-bottom: 1px dashed #dfd6c1; /* 枠線は維持 */
            }

            /* About Section (全幅白背景対応) */
            .top-about-wrapper {
                padding: 40px 0;
            }
            .top-about {
                max-width: 960px;
                margin: 0 auto; /* ラッパー内で中央寄せ */
                padding: 0; /* SP用パディングリセット */
            }
            .top-about-images {
                display: flex;
                justify-content: center;
                gap: 20px;
                padding-left: 50px;
                padding-right: 50px;
            }
            .top-about-images img {
                max-width: 100%; /* 親に合わせて伸縮 */
                width: 300px; /* PCでの基本サイズ */
                height: 200px;
                object-fit: cover;
            }
            .top-about-images img.pc-only-img {
                display: block; /* PCでは表示 */
            }

            /* Activities Layout (Grid/Box) */
            .top-activities {
                max-width: 100%;
                padding-left: 0;
                padding-right: 0;
                padding-top: 60px;
                padding-bottom: 60px;
            }
            .top-activities dl {
                max-width: 960px;
                margin: 0 auto; /* 中央寄せ */
                display: grid; /* Gridに変更 */
                grid-template-columns: 1fr 1fr; /* 2列 */
                gap: 20px;
            }
            /* Activity Box Style */
            .activity-box {
                background: #fff;
                border-radius: 10px;
                overflow: hidden;
                width: auto; /* 幅制限解除 */
                display: flex;
                flex-direction: column;
            }
            
            /* グリッド配置の指定 */
            .activity-box:nth-of-type(1) {
                grid-column: 1 / 2;
                grid-row: 1 / 3; /* 左列で縦長 */
            }
            .activity-box:nth-of-type(2) {
                grid-column: 2 / 3;
                grid-row: 1 / 2; /* 右列上 */
            }
            .activity-box:nth-of-type(3) {
                grid-column: 2 / 3;
                grid-row: 2 / 3; /* 右列下 */
            }
            /* Activity Box Wide (活動国) の調整 */
            .activity-box.wide {
                grid-column: 1 / 3; /* 全幅エリア */
                grid-row: 3 / 4;
                
                width: 600px; /* 幅を短く */
                margin: 20px auto 0; /* 左右センター */
                
                flex-direction: row;
                align-items: stretch;
                padding: 0;
                justify-self: center;
            }
            
            /* DT/DD Reset for Grid */
            .top-activities dt {
                border-radius: 0;
                padding: 15px 0;
                font-size: 1.1em;
                background-color: #007a45; /* 背景色指定 */
                color: #fff;
            }
            .top-activities dd {
                border-radius: 0;
                margin-bottom: 0;
                padding: 20px;
                flex-grow: 1; 
                display: flex;
                flex-direction: column;
                justify-content: space-between;
            }
            
            /* 活動国(Wide)のスタイル調整 */
            .activity-box.wide dt {
                width: 30%;
                background-color: #7ab800; /* 修正: #7ab800に変更 */
                color: #fff;
                padding: 0;
                display: flex;
                align-items: center;
                justify-content: center;
                font-weight: bold;
            }
            .activity-box.wide dd {
                width: 70%;
                background: none;
                padding: 20px;
                display: flex;
                align-items: center;
            }
            .activity-box.wide ul {
                display: flex;
                justify-content: flex-start;
                gap: 20px;
            }
        }
