/*
 Theme Name:   Twenty Twenty-five Child
 Template:     twentytwentyfive
*/

/* =========================================
   【完全版】ひとり親支援ナビ 全体整形CSS
   （既存デザイン＋新規整形＋最上段配置の統合）
========================================= */

/* --- 1. ベース設定（共通の色・フォント・行間） --- */
:root {
    --primary-color: #F26D21; /* ウォームオレンジ */
    --secondary-color: #FFC107; /* ヒマワリイエロー */
    --text-color: #333333;
    --bg-color: #FFFDF7; /* アイボリー背景 */
    --base-font-size: 16px;
    --base-line-height: 1.8;
}

body {
    font-size: var(--base-font-size);
    line-height: var(--base-line-height);
    color: var(--text-color);
    background-color: var(--bg-color);
    -webkit-font-smoothing: antialiased;
}

/* --- 2. タイポグラフィ（見出し・文字サイズ・余白）の統一 --- */
h1, h2, h3, p {
    margin-top: 0;
    margin-bottom: 1.5rem; /* 下側の余白を統一してリズムを生む */
}

/* H1（ヒーローキャッチコピー） */
h1.has-text-align-center {
    font-size: 2rem !important; /* スマホ向けサイズ */
    line-height: 1.4 !important;
    font-weight: 700;
    margin-bottom: 2rem !important;
}

@media (min-width: 600px) {
    h1.has-text-align-center {
        font-size: 2.5rem !important; /* PC向けサイズ */
    }
}

/* H2（見出し） */
h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

/* 段落文字 */
p {
    font-size: 1rem;
}

/* --- 3. ボタンデザイン（「目的からさがす」）の統一 --- */
.wp-block-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px; /* ボタン同士の間隔 */
    margin-bottom: 2rem !important;
}

.wp-block-button__link {
    font-size: 1rem !important;
    font-weight: 500 !important;
    padding: 12px 24px !important;
    border-radius: 30px !important; /* 美しい丸みのある角丸 */
    transition: all 0.3s ease;
    text-decoration: none !important;
}

/* オレンジ色のボタン */
.wp-block-button__link.has-background {
    background-color: var(--primary-color) !important;
    color: #ffffff !important;
}

/* ボタンのホバー効果（ふわっと浮いて少し明るくする） */
.wp-block-button__link:hover {
    opacity: 0.85;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* --- 4. アコーディオン（市町村リスト）の整理とグリッドレイアウト --- */
details {
    margin-bottom: 1.5rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #fff;
    overflow: hidden;
}

summary {
    font-weight: 600;
    padding: 15px 20px;
    cursor: pointer;
    background-color: #f9f9f9;
    list-style: none; /* デフォルトの矢印を消す（後で追加） */
    position: relative;
}

/* summaryの右側にカスタム矢印を追加 */
summary::after {
    content: '+';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    color: #888;
}

details[open] summary::after {
    content: '−';
}

/* 市町村リスト（カテゴリーリスト）の中身 */
details ul {
    margin: 0;
    padding: 20px;
    list-style: none;
    border-top: 1px solid #ddd;
    display: grid; /* グリッドレイアウト適用 */
    grid-template-columns: repeat(1, 1fr); /* スマホ（デフォルト）は1列 */
    gap: 10px 20px; /* 上下左右の間隔 */
}

/* PC（600px以上）では市町村を2列に並べる */
@media (min-width: 600px) {
    details ul {
        grid-template-columns: repeat(2, 1fr);
    }
}

details ul li {
    font-size: 0.95rem;
}

details ul li a {
    text-decoration: none;
    color: #555;
    display: block;
    padding: 5px 0;
}

details ul li a:hover {
    color: var(--primary-color);
}

/* --- 5. ヘッダー/ロゴの調整 --- */
.wp-block-site-logo img {
    max-width: 100%;
    height: auto;
}

/* --- 6. 既存デザインの保存と Specific（具体的）な調整 --- */

/* グリッドの枠組み（既存） */
.wp-block-post-template,
.search-results .site-main,
.archive .site-main {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 30px !important;
    align-items: stretch !important;
}

/* カード本体のデザイン（既存） */
.wp-block-post,
.type-post {
    display: flex !important;
    flex-direction: column !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    padding: 20px !important;
    background-color: #ffffff !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05) !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    height: auto !important;
    transition: all 0.3s ease !important;
    position: relative !important; /* ★追加：カード全体をリンク化するための基準点 */
}

/* マウスホバー時のアクション（既存） */
.wp-block-post:hover,
.type-post:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1) !important;
    border-color: #3182ce !important;
}

/* タイトルや日付の文字調整（既存） - 全体ルールより優先させる */
.wp-block-post-title a,
.entry-title a {
    text-decoration: none !important;
    color: #2d3748 !important;
    font-size: 1.25rem !important;
    font-weight: bold !important;
    line-height: 1.4 !important;
}

/* ★追加：タイトルのリンクを透明なシートとしてカード全体に広げる魔法 */
.wp-block-post-title a::after,
.entry-title a::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; /* 透明なシートを一番手前に持ってくる */
}

.wp-block-post-date,
.wp-block-post-terms {
    font-size: 0.85em !important;
    margin-top: 5px !important;
    margin-bottom: 10px !important;
}

/* 中身（抜粋）をバネのように伸ばして、下の余白を埋める（既存） */
.wp-block-post-content,
.wp-block-post-excerpt,
.entry-summary,
.entry-content {
    flex-grow: 1 !important;
    overflow-wrap: break-word !important;
    word-break: break-all !important;
}

/* 一覧画面の「ブログ」というタイトルを消す（保険・既存） */
.wp-block-query-title,
header.page-header h1.page-title {
    display: none !important;
}

/* VK Filter Searchフォーム（既存） */
.vkfs {
    background: #f8fafc !important;
    padding: 30px !important;
    border-radius: 12px !important;
    border: 1px solid #e2e8f0 !important;
    margin-bottom: 40px !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02) !important;
}

/* 検索ボタン（既存） - 全体ルールより優先させ、青く角を尖らせた形にする */
.vkfs button[type="submit"],
.vkfs input[type="submit"],
.vkfs .vk_filter_search_submit {
    background-color: #3182ce !important;
    color: #ffffff !important;
    font-weight: bold !important;
    border-radius: 8px !important; /* 角丸を抑える */
    padding: 15px 30px !important;
    width: 100% !important;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    font-size: 1.1em !important;
    appearance: none !important; /* テーマの標準デザインをリセット */
}

/* 検索ボタンにマウスを乗せた時の動き（既存） */
.vkfs button[type="submit"]:hover,
.vkfs input[type="submit"]:hover,
.vkfs .vk_filter_search_submit:hover {
    background-color: #2b6cb0 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 6px rgba(49, 130, 206, 0.3) !important;
}

/* 記事詳細ページの「支援制度表」のデザイン（既存） */

/* 表全体の枠組み（既存） */
.entry-content table,
.wp-block-post-content table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin-top: 30px !important;
    margin-bottom: 30px !important;
    background-color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05) !important;
    border-radius: 8px !important;
    overflow: hidden !important; /* 角丸を効かせる */
    border-style: hidden !important; /* 外側の二重線を消す */
}

/* 左側の「見出し（項目名）」（既存） - 検索ボタンと同じ青色 */
.entry-content th,
.wp-block-post-content th {
    background-color: #3182ce !important;
    color: #ffffff !important;
    font-weight: bold !important;
    padding: 15px 20px !important;
    text-align: left !important;
    border-bottom: 1px solid #2b6cb0 !important;
    border-right: 1px solid #2b6cb0 !important;
    width: 25% !important; /* 幅を固定 */
    white-space: nowrap !important; /* 改行を防ぐ */
}

/* 右側の「内容」（既存） */
.entry-content td,
.wp-block-post-content td {
    padding: 15px 20px !important;
    border-bottom: 1px solid #e2e8f0 !important;
    color: #333333 !important;
    line-height: 1.6 !important;
}

/* 最後の行の下線を消してスッキリ（既存） */
.entry-content tr:last-child th,
.wp-block-post-content tr:last-child th,
.entry-content tr:last-child td,
.wp-block-post-content tr:last-child td {
    border-bottom: none !important;
}

/* ? スマホ対応：具体的要素のメディアクエリ（既存） */
@media (max-width: 768px) {
    .entry-content th,
    .wp-block-post-content th {
        width: auto !important;
        white-space: normal !important;
    }
}

/* --- 7. ヒーローエリアを最上段に配置する調整 --- */

/* 不要なデフォルトヘッダー領域を完全に非表示にして隙間を消す */
header.wp-block-template-part {
    display: none !important;
}

/* メインコンテンツ上部のテーマ標準の余白を強制的にゼロにする */
main.wp-block-group {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* ヒーローエリア（カバーブロック）自体の上の隙間もゼロにする */
main.wp-block-group > .wp-block-group {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* ==========================================
   ひとり親支援ナビ：カスタム検索フォーム＆結果一覧
   ========================================== */

/* 検索と結果エリアの横幅をピシッと合わせるための大枠 */
.hitorioya-portal-wrapper {
    max-width: 840px; 
    margin: 60px auto 0;
    width: 100%;
    box-sizing: border-box;
}

/* 検索フォームのデザイン */
.custom-search-box {
    background: #f8fafc; padding: 30px; border-radius: 12px;
    border: 1px solid #e2e8f0; margin-bottom: 40px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    box-sizing: border-box; width: 100%;
}
.custom-search-box label.section-title { font-weight: bold; display: block; margin-bottom: 10px; color: #333; }
.custom-search-box select {
    width: 100%; padding: 12px; border-radius: 8px; border: 1px solid #cbd5e1; font-size: 1rem; margin-bottom: 25px; background-color: #fff;
    box-sizing: border-box;
}
.custom-search-box select optgroup { font-weight: bold; color: var(--primary-color, #F26D21); }
.custom-search-box select option { color: #333; }

/* 目的ボタンのデザイン */
.purpose-radios { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 25px; }
.purpose-radios input[type="radio"] { display: none; }
.purpose-radios label.radio-btn {
    background: #fff; border: 1px solid #cbd5e1; padding: 10px 20px;
    border-radius: 30px; cursor: pointer; transition: all 0.2s ease; font-weight: normal; color: #555;
}
.purpose-radios input[type="radio"]:checked + label.radio-btn {
    background: #F26D21; color: #fff; border-color: #F26D21;
    box-shadow: 0 4px 10px rgba(242,109,33,0.3); font-weight: bold;
}

/* 検索実行ボタン */
.custom-search-submit {
    background-color: #3182ce; color: #fff; font-weight: bold; border-radius: 8px;
    padding: 15px 30px; width: 100%; border: none; cursor: pointer; font-size: 1.1em; transition: all 0.3s ease;
    box-sizing: border-box;
}
.custom-search-submit:hover { background-color: #2b6cb0; transform: translateY(-2px); }

/* 結果エリアのデザイン */
.custom-results-area { margin-top: 50px; width: 100%; box-sizing: border-box; }
.tag-group-title {
    margin-top: 3rem; margin-bottom: 1.5rem; padding-bottom: 10px;
    border-bottom: 2px solid #F26D21; font-size: 1.5rem; font-weight: bold; color: #333;
    width: 100%; box-sizing: border-box;
}

/* カードを並べる枠 */
.custom-results-area ul.wp-block-post-template {
    padding: 0 !important; margin: 0 !important; list-style: none !important;
    display: grid !important; gap: 20px !important;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
    width: 100%; box-sizing: border-box;
}

/* カード内のタグラベルと日付のデザイン */
.custom-card-tags { margin-bottom: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.custom-tag-label {
    padding: 4px 12px; border-radius: 20px; font-size: 0.75rem; font-weight: bold; letter-spacing: 0.5px;
}

/* 既存の3ジャンル色 */
.tag-color-teate { background-color: #fff3cd; color: #b45309; } 
.tag-color-iryo { background-color: #dbeafe; color: #1e3a8a; } 
.tag-color-shugyo { background-color: #dcfce7; color: #166534; } 

/* ▼ 新しい3ジャンルの色を追加 ▼ */
.tag-color-waribiki { background-color: #fce7f3; color: #be185d; } /* ピンク系：割引・減免 */
.tag-color-sumai { background-color: #fef08a; color: #854d0e; } /* イエロー系：住まい・生活 */
.tag-color-soudan { background-color: #e0e7ff; color: #3730a3; } /* インディゴ系：相談・養育費 */

/* その他のデフォルト色 */
.tag-color-default { background-color: #e2e8f0; color: #475569; } 

/* 公式更新日のデザイン */
.custom-update-date {
    font-size: 0.85em; color: #F26D21; margin-bottom: 10px; font-weight: bold;
}

/* ==========================================
   トップページ：ヒーローエリアの高さ調整
   ========================================== */
.home .wp-block-cover {
    min-height: 280px !important; /* デフォルトの430pxから大幅に縮小 */
    padding-top: 20px !important;
    padding-bottom: 20px !important;
}

/* （おまけ）中のロゴ画像も少しだけスリムにしてバランスを取る */
.home .wp-block-cover .wp-block-image img {
    max-width: 400px !important; 
    height: auto !important;
    margin-bottom: 10px !important;
}

.home .wp-block-cover h1 {
    margin-bottom: 0 !important;
}

/* ==========================================
   キャッチコピーの文字サイズと改行の最適化
   ========================================== */

/* スマホ画面（幅767px以下）の調整 */
@media (max-width: 767px) {
    .home .wp-block-cover h1 {
        /* スマホの画面幅に綺麗に2行で収まるように文字サイズを微調整 */
        font-size: 1.6rem !important; 
        line-height: 1.5 !important;
    }
}

/* PC画面（幅768px以上）の調整【強力版】 */
@media (min-width: 768px) {
    .home .wp-block-cover h1 br {
        display: none !important;
    }
    .home .wp-block-cover h1 {
        max-width: 100% !important; /* WordPressの横幅制限を強制解除 */
        width: 100% !important;
        white-space: nowrap !important; /* 絶対に1行にする魔法 */
    }
}

/* トップページのデフォルトタイトル「支援制度をさがす」を完全に非表示にする */
.home > .wp-site-blocks > main > .wp-block-group > h1.wp-block-post-title {
    display: none !important;
}

/* ==========================================
   フッターの中央揃えとメニューの美しい横並び化
   ========================================== */

/* フッター内の文字をすべて中央揃えにする */
footer.wp-block-template-part {
    text-align: center;
    padding: 40px 20px !important;
}

/* 箇条書き（リスト）の黒丸を消して、横並びの中央揃えにする */
footer.wp-block-template-part ul.wp-block-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px; /* リンクとリンクの間の隙間 */
    list-style: none; 
    padding: 0;
    margin: 30px 0;
}

/* フッターリンクの文字色とホバー（マウスを乗せた時の）アクション */
footer.wp-block-template-part ul.wp-block-list li a {
    text-decoration: none !important;
    color: #555 !important;
    font-weight: 500;
    transition: color 0.3s ease;
}

footer.wp-block-template-part ul.wp-block-list li a:hover {
    color: var(--primary-color, #F26D21) !important;
}