/* ==============================================
   レイアウト用CSS - 2カラムレイアウト実装
   ============================================== */

/* CSS変数定義 */
:root {
    --main-content-width: 65%;
    --sidebar-width: 35%;
    --container-max-width: 1200px;
    --grid-gap: 30px;
    --primary-color: #333;
    --background-color: #f5f9ff;
    --border-color: #dee2e6;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

/* ===============================
   メインレイアウト構造
   =============================== */
   
/* コンテンツラッパー - 2カラムグリッド */
.content-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--grid-gap);
    margin-top: 30px;
    align-items: start;
}

/* メインコンテンツエリア */
.main-content {
    background-color: rgba(255, 255, 255, 0.3);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px var(--shadow-color);
}

/* サイドバーエリア */
.sidebar {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px var(--shadow-color);
    
    /* スクロールボックスを削除し、縦長表示に */
    /* position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto; */
}

/* サイドバーウィジェット共通スタイル */
.widget {
    margin-bottom: 35px;
    padding: 25px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.widget:last-child {
    margin-bottom: 0;
}

.widget h3 {
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
    color: var(--primary-color);
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.widget h3 i {
    font-size: 1rem;
}

/* ===============================
   フィルターと検索（統合）
   =============================== */
.filter-search-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    background-color: transparent;
    padding: 12px 0;
}

.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.filter-tags .tag {
    display: inline-block;
    padding: 6px 14px;
    background-color: rgba(255, 255, 255, 0.85);
    border-radius: 16px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid rgba(0, 0, 0, 0.1);
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.filter-tags .tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* カテゴリ別の色（不透明） */
.filter-tags .tag.active {
    background-color: #333;
    color: white;
    border-color: #111;
}

.filter-tags .tag.ai {
    background-color: #3498db;
    color: white;
    border-color: #2980b9;
}
.filter-tags .tag.ai:hover,
.filter-tags .tag.ai.active {
    background-color: #2980b9;
    color: white;
    border-color: #1a5276;
}

.filter-tags .tag.tools {
    background-color: #e64a19;
    color: white;
    border-color: #bf360c;
}
.filter-tags .tag.tools:hover,
.filter-tags .tag.tools.active {
    background-color: #bf360c;
    color: white;
    border-color: #8d2609;
}

.filter-tags .tag.learning {
    background-color: #9c27b0;
    color: white;
    border-color: #7b1fa2;
}
.filter-tags .tag.learning:hover,
.filter-tags .tag.learning.active {
    background-color: #7b1fa2;
    color: white;
    border-color: #4a148c;
}

.filter-tags .tag.blog {
    background-color: #4caf50;
    color: white;
    border-color: #388e3c;
}
.filter-tags .tag.blog:hover,
.filter-tags .tag.blog.active {
    background-color: #388e3c;
    color: white;
    border-color: #1b5e20;
}

/* 検索ボックス（コンパクト） */
.search-box {
    display: flex;
    align-items: center;
    background-color: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 6px 14px;
    min-width: 180px;
    max-width: 250px;
    transition: box-shadow 0.3s ease;
}

.search-box:focus-within {
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.search-box i {
    color: #6c757d;
    margin-right: 8px;
    font-size: 0.85rem;
}

.search-box input {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    font-size: 0.85rem;
    color: var(--primary-color);
    width: 100%;
}

.search-box input::placeholder {
    color: #adb5bd;
}

/* ===============================
   記事リストセクション
   =============================== */
.article-list {
    /* 記事カードのスタイルは既存のものを流用 */
}

/* ===============================
   レスポンシブデザイン
   =============================== */
   
/* タブレット (768px - 1199px) */
@media (min-width: 768px) and (max-width: 1199px) {
    .content-wrapper {
        grid-template-columns: 60% 40%;
        gap: 20px;
    }
    
    .widget {
        padding: 15px;
    }
}

/* モバイル (767px以下) */
@media (max-width: 767px) {
    .content-wrapper {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0;
        margin: 0;
        max-width: 100%;
    }
    
    /* モバイルではサイドバーのスティッキーを解除 */
    .sidebar {
        position: static;
        max-height: none;
        margin-top: 30px;
    }
    
    .main-content,
    .sidebar {
        padding: 15px;
    }
    
    .widget {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .widget h3 {
        font-size: 1.1rem;
    }
    
    /* フィルターと検索のモバイル対応 */
    .filter-search-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 10px;
    }
    
    .filter-tags {
        justify-content: center;
    }
    
    .filter-tags .tag {
        padding: 5px 10px;
        font-size: 0.8rem;
    }
    
    .search-box {
        max-width: 100%;
        min-width: auto;
        margin-top: 8px;
    }
}

/* ===============================
   アニメーション
   =============================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.widget {
    animation: fadeIn 0.6s ease-out;
}

/* ===============================
   スクロールバーカスタマイズ
   =============================== */
/* サイドバーのスクロールを削除したため、このセクションは不要 */
/*
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #555;
}
*/
