/* 旧フッター（レガシー対応） */
.footer {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: #ecf0f1;
    padding: 50px 20px 20px;
    margin-top: 60px;
}

/* 旧フッター用 */
.footer .footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}

/* 2段構成フッター上段用 */
.footer-upper .footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
    padding: 0 20px;
}

/* 2026-09-25 TC-766: フッターの見出しは h2（h1 の直後に h3 が来る飛び級を無くす）。h3 は旧フッター向けに残す */
.footer-section h2,
.footer-section h3 {
    color: #85c1e9;
    font-size: 18px;
    margin-bottom: 15px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
}

.footer-stats {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.footer-stat-item {
    /* 2026-09-25 TC-761: 暗い地の上の淡い地（0.1）をやめ、区切り線（不透明度 0.45）で箱を示す */
    background: transparent;
    border: 1px solid var(--km-on-dark-border, rgba(255, 255, 255, 0.45));
    padding: 8px 12px;
    border-radius: var(--km-radius-sm, 6px);
    display: flex;
    align-items: center;
    gap: 5px;
}

.footer-stat-icon {
    font-size: 18px;
}

.footer-stat-number {
    font-size: 14px;
    font-weight: bold;
    color: #85c1e9;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #bdc3c7;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
}

.footer-links a:hover {
    color: #3498db;
    padding-left: 5px;
}

.footer-description {
    font-size: 14px;
    line-height: 1.6;
    color: #bdc3c7;
}

.footer-update {
    margin-top: 15px;
    padding: 10px;
    /* 2026-09-25 TC-761: 淡い地（0.1）をやめ、区切り線＋左の帯で箱を示す */
    background: transparent;
    border: 1px solid var(--km-on-dark-border, rgba(255, 255, 255, 0.45));
    border-radius: var(--km-radius-sm, 6px);
    border-left: 3px solid #3498db;
    font-size: 14px;
}

.footer-bottom {
    border-top: 1px solid #34495e;
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-bottom p {
    margin: 0;
    color: #95a5a6;
    font-size: 14px;
}

.footer-tech {
    font-size: 14px;
    color: #7f8c8d;
}

/* 2段構成フッター用スタイル - 最優先 */
.site-footer {
    margin-top: 60px;
    background: none !important;
    padding: 0 !important;
    color: inherit;
    width: 100%;
    clear: both;
}

/* 他のフッターとの区別 */
footer.site-footer {
    display: block;
    position: relative;
}

/* 上段フッター */
.footer-upper {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 40px 0 20px;
}

/* 下段ブログエリア */
.footer-lower {
    background: #1a252f;
    color: #ecf0f1;
    padding: 30px 0;
    border-top: 1px solid #34495e;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.blog-footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 30px;
}

/* 新着記事エリア */
.recent-posts h2,
.recent-posts h3 {
    color: #3498db;
    margin-bottom: 20px;
    font-size: 18px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
}

.recent-posts-item {
    padding: 12px 0;
    border-bottom: 1px solid #34495e;
}

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

.post-title {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
    display: block;
    margin-bottom: 5px;
    line-height: 1.4;
}

.post-title:hover {
    color: #5dade2;
}

.post-date {
    color: #a9b4b5;
    font-size: 0.9em;
}

.blog-more {
    margin-top: 15px;
    text-align: center;
}

.blog-more-link {
    color: #3498db;
    text-decoration: none;
    font-weight: bold;
    padding: 8px 16px;
    border: 1px solid #3498db;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.blog-more-link:hover {
    background: #3498db;
    color: white;
}

/* カテゴリエリア */
.blog-categories h2,
.blog-categories h3 {
    color: #3498db;
    margin-bottom: 20px;
    font-size: 18px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
}

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

.category-links li {
    margin-bottom: 10px;
}

.category-links a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s ease;
    padding: 5px 0;
    display: block;
}

.category-links a:hover {
    color: #3498db;
    padding-left: 10px;
}

/* 検索エリア */
.blog-search h2,
.blog-search h3 {
    color: #3498db;
    margin-bottom: 20px;
    font-size: 18px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
}

.search-box {
    display: flex;
    gap: 6px; /* 入力欄とボタンを離し、どちらも角丸 8px（TC-768 2026-09-25） */
    margin-bottom: 15px;
}

.search-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #95a5a6; /* 暗い地 #2c3e50 の上で 4.3:1（TC-760 2026-09-25・前は #34495e＝1.1:1） */
    border-radius: 8px;
    background: #2c3e50;
    color: #ecf0f1;
    border-right: none;
}

.search-input::placeholder {
    color: #7f8c8d;
}

.search-button {
    padding: 10px 15px;
    background: #C2410C; /* トップの検索ボタンと同じ色（tokens の --km-cta・TC-768 2026-09-25・前は #2471a3） */
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.search-button:hover {
    background: #9A3412;
}

.popular-tags {
    margin-top: 15px;
}

.tag-label {
    color: #a9b4b5;
    font-size: 0.9em;
    margin-right: 10px;
}

.tag-item {
    display: inline-block;
    background: #34495e;
    color: #bdc3c7;
    padding: 4px 8px;
    margin: 2px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 0.85em;
    transition: all 0.3s ease;
}

.tag-item:hover {
    background: #3498db;
    color: white;
}

/* フッター最下段 */
.footer-bottom {
    background: #16202b;
    padding: 20px 0;
    border-top: 1px solid #34495e;
}

.footer-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #7f8c8d;
    font-size: 0.9em;
}

.footer-tech {
    color: #5d6d7e;
}

/* 2026-09-25 TC-660: 2段構成フッター（.footer-upper .footer-content）は上の指定が強く 768 以下でも2列のままだった＝640 以下で1列（仕様書 §5） */
@media (max-width: 640px) {
    .footer-upper .footer-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-stats {
        justify-content: center;
    }
    
    .blog-footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .search-input {
        border-radius: 8px;
        border-right: 1px solid #95a5a6;
        margin-bottom: 10px;
    }
    
    .search-button {
        border-radius: 4px;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

/* =============================================================
   タップ領域 44px（B案3日目 2026-09-11 design）
   ポータルとブログ（bridge-hooks.php で読み込み）の両フッターに効く。
   高さだけを確保し、色・文字は変えない。li の余白を詰めて一覧の高さの増加を抑える
   ============================================================= */
.footer-links li,
.category-links li {
    margin-bottom: 0;
}

.footer-links a,
.category-links a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding-top: 0;
    padding-bottom: 0;
}

.tag-item {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 12px;
    border-radius: var(--km-radius-pill, 999px);
}

.blog-more-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding-top: 0;
    padding-bottom: 0;
}

/* === 回5h: 共通フッターの検索欄（2026-09-12 design） ===
   SP 390px 実測：入力欄 37px・ボタン 39px → 44px、入力欄の案内文字 #7f8c8d（紺の背景に 3.16）→ #bdc3c7（5.1 以上）。
   .search-input はトップの検索窓でも使われているため、footer の中だけに限定する */
footer .search-box .search-input,
footer .search-box .search-button {
    min-height: 44px;
    box-sizing: border-box;
}
footer .search-box .search-input::placeholder {
    color: #bdc3c7;
}

/* =============================================================
   回29（2026-09-13 design）: フッターのタップ領域と記事検索ボタンの折り返し（追加のみ・色と文字は変えない）
   ① 新着記事の題名リンク（.post-title・blog-footer.js が描画）が 22px だった → 44px 以上を上下の余白で確保
   ② 記事検索ボタン（.search-button）が幅不足で「検／索」と2行に折れて 78px だった → 折り返し禁止・最小幅・44px
   ③ 記事検索の入力欄・「すべての記事を見る」も 44px
   ポータル（footer-template-v2.html）とブログ（bridge-hooks.php 経由）の両フッターに効く
   ============================================================= */
.recent-posts-item .post-title {
    display: flex;
    align-items: center;
    min-height: 44px;
}

.search-box .search-input {
    min-height: 44px;
}

.search-box .search-button {
    white-space: nowrap;
    min-width: 5em;
    min-height: 44px;
    flex-shrink: 0;
}

.blog-more .blog-more-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}
