/* リセットと基本設定 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Meiryo", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
    line-height: 1.6;
    background-color: #f5f5f5; /* 背景色 */
    color: #333;
}

a {
    text-decoration: none;
    color: inherit;
}

#wrapper {
    max-width: 1200px;
    margin: 0 auto;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* --- 1. ヘッダーエリア --- */
#header {
    background-color: #2c3e50; /* 暗めの背景色 */
    padding: 10px 20px;
    color: #fff;
    display: flex;
    flex-direction: column; /* モバイル優先で縦並び */
    align-items: center;
}

.site-title {
    font-size: 28px;
    margin-bottom: 10px;
}

.site-title a {
    color: #fff;
    font-weight: bold;
}

.main-nav {
    display: flex;
    width: 100%;
    max-width: 400px; /* ナビゲーションの幅を制限 */
    border-bottom: 2px solid #34495e;
}

.nav-item {
    flex-grow: 1;
    text-align: center;
    padding: 8px 15px;
    background-color: #34495e; /* 非アクティブタブの背景 */
    color: #ecf0f1;
    font-weight: bold;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    transition: background-color 0.2s;
    margin-right: 2px;
}

.nav-item:last-child {
    margin-right: 0;
}

.nav-item.active {
    background-color: #fff; /* アクティブタブの背景（本体背景と同色） */
    color: #2c3e50; /* アクティブタブの文字色 */
    border-bottom: 2px solid #fff; /* 下線が見えないように */
    margin-bottom: -2px; /* 線の重なりを調整 */
}

/* --- 2. コンテンツエリア（メインとサイドバー） --- */
#container {
    padding: 20px;
    display: flex;
    gap: 20px; /* カラム間の隙間 */
}

#main-content {
    flex: 3; /* メインコンテンツに多くの幅を割り当てる */
    min-width: 0; /* フレックスアイテムのサイズ計算を修正 */
}

#sidebar {
    flex: 1; /* サイドバーは固定的な幅 */
    min-width: 250px;
}

/* --- 記事リストのデザイン --- */
.article-list-section h2 {
    font-size: 20px;
    padding: 10px 0;
    margin-bottom: 15px;
    border-bottom: 3px solid #ddd;
    color: #2c3e50;
}

.article-list {
    list-style: none;
}

.article-item {
    border-bottom: 1px dashed #eee;
    padding: 10px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.article-link {
    display: flex;
    align-items: center;
    flex-grow: 1;
    overflow: hidden; /* タイトルが長すぎる場合の処理 */
}

.article-link:hover .article-title {
    color: #3498db; /* ホバー時のタイトル色変更 */
}

.article-title {
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 16px;
    color: #333;
    margin-right: 10px;
}

.source-site {
    flex-shrink: 0;
    color: #7f8c8d; /* サイト名の文字色 */
    font-size: 13px;
    margin-right: 15px;
}

.timestamp {
    flex-shrink: 0;
    color: #bdc3c7;
    font-size: 12px;
}

/* --- サイドバーのデザイン --- */
.sidebar-block {
    background-color: #f9f9f9;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid #eee;
    border-radius: 5px;
}

.sidebar-block h3 {
    font-size: 16px;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 2px solid #ddd;
    color: #2c3e50;
}

.sidebar-block ul {
    list-style: none;
}

.sidebar-block li {
    padding: 5px 0;
}

.sidebar-block a {
    color: #3498db;
}

/* --- フッターエリア --- */
#footer {
    text-align: center;
    padding: 15px 0;
    background-color: #ecf0f1;
    color: #7f8c8d;
    font-size: 14px;
}

/* --- レスポンシブ対応 (モバイル表示) --- */
@media (max-width: 768px) {
    #container {
        flex-direction: column; /* 縦に並べる */
        padding: 10px;
    }

    #sidebar {
        min-width: unset; /* 幅の制限を解除 */
    }

    #header {
        padding: 10px 10px;
    }

    .article-title {
        /* タイトルとサイト名をもう少し詰める */
        font-size: 15px;
        margin-right: 5px;
    }
    
    .source-site {
        margin-right: 10px;
    }
}