/* リセット */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

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

/* ヘッダー */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 32px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.tagline {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 20px;
}

.header-nav {
    margin-top: 20px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.header-nav a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.2);
    transition: background 0.3s;
}

.header-nav a:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* メインコンテンツ */
main {
    padding: 40px 0;
    min-height: calc(100vh - 300px);
}

/* ヒーローセクション */
.hero {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 20px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.hero h2 {
    font-size: 28px;
    color: #1f2937;
    margin-bottom: 10px;
}

.hero p {
    font-size: 16px;
    color: #6b7280;
    margin-bottom: 30px;
}

/* 検索ボックス */
.search-container {
    max-width: 600px;
    margin: 0 auto;
}

.search-input {
    width: 100%;
    padding: 16px 20px;
    font-size: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    outline: none;
    transition: border-color 0.3s;
}

.search-input:focus {
    border-color: #667eea;
}

/* フィルターボタン */
.filter-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    padding: 10px 24px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 24px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    transition: all 0.3s;
}

.filter-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.filter-btn.active {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

/* ニュースコンテナ */
.news-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

/* ニュースカード - 高さを固定 */
.news-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    
    /* ↓↓↓ 検索ボタン位置固定のための追加 ↓↓↓ */
    display: flex;
    flex-direction: column;
    height: 220px;  /* カードの高さを固定 */
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

/* ニュースカードヘッダー */
.news-card-header {
    flex-grow: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* メタ情報 */
.news-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.news-date {
    font-size: 13px;
    color: #9ca3af;
}

/* カテゴリーバッジ */
.news-category {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    margin-bottom: 12px;
}

/* タイトル - 長い場合は省略 */
.news-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.4;
    margin: 12px 0 0 0;
    
    /* ↓↓↓ タイトル省略のための追加 ↓↓↓ */
    display: -webkit-box;
    -webkit-line-clamp: 4;  /* 最大4行まで表示 */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ニュースカードフッター - 下部に固定 */
.news-card-footer {
    margin-top: auto;  /* 自動的に下に配置 */
    padding-top: 8px;
}

/* ニュースリンク */
.news-link {
    display: inline-block;
    padding: 10px 20px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.3s;
    text-align: center;
}

.news-link:hover {
    background: #5568d3;
}

/* さらに読み込むボタン */
.load-more-container {
    text-align: center;
    margin: 40px 0;
}

.load-more-btn {
    padding: 14px 32px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
}

.load-more-btn:hover {
    background: #5568d3;
}

/* 検索結果なし */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
    font-size: 16px;
}

/* フッター */
footer {
    background: #1f2937;
    color: white;
    padding: 40px 0;
    margin-top: 60px;
}

footer p {
    margin-bottom: 10px;
}

.footer-note {
    font-size: 14px;
    opacity: 0.8;
}

.footer-links {
    margin-top: 20px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    color: white;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.footer-links a:hover {
    opacity: 1;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    header h1 {
        font-size: 24px;
    }
    
    .hero h2 {
        font-size: 22px;
    }
    
    .news-container {
        grid-template-columns: 1fr;
    }
    
    .filter-buttons {
        justify-content: flex-start;
    }
    
    .header-nav {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    header {
        padding: 30px 0;
    }
    
    .news-card {
        height: 260px;  /* スマホではやや高めに */
    }
}
