/* サイドバースタイル */
.main-container {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.content-area {
    flex: 1 1 65%;
    min-width: 0;
}

.sidebar {
    flex: 1 1 25%;
    min-width: 250px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-top: 2rem;
}

.widget {
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
}

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

.widget h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    border-left: 4px solid var(--accent-color);
    padding-left: 0.8rem;
}

.widget-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget-content li {
    margin-bottom: 0.5rem;
    padding-left: 0.5rem;
}

.widget-content a {
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
}

.widget-content a:hover,
.widget-content a:focus {
    color: var(--accent-color);
    text-decoration: underline;
}

.search-form {
    display: flex;
    gap: 0.5rem;
}

.search-form input[type="text"] {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

.search-form button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.search-form button:hover {
    background-color: var(--accent-color);
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    background-color: var(--light-bg);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: var(--transition);
}

.tag:hover {
    background-color: var(--accent-color);
    color: white;
}

/* ダークモード対応 */
body.dark-mode .sidebar {
    background-color: rgba(33, 33, 33, 0.9);
}

body.dark-mode .widget h3 {
    color: #e0e0e0;
}

body.dark-mode .widget-content a {
    color: #e0e0e0;
}

body.dark-mode .tag {
    background-color: #333;
    color: #e0e0e0;
}

/* ハイコントラストモード対応 */
body.high-contrast .sidebar {
    background-color: #000;
    border: 2px solid #ffff00;
}

body.high-contrast .widget h3 {
    color: #ffff00;
    border-left-color: #ffff00;
}

body.high-contrast .widget-content a {
    color: #ffffff;
    text-decoration: underline;
}

body.high-contrast .tag {
    background-color: #000;
    color: #ffffff;
    border: 1px solid #ffffff;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
    }
    
    .content-area,
    .sidebar {
        flex: 1 1 100%;
    }
    
    .sidebar {
        margin-top: 2rem;
    }
}
