/* General Styles */

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f9f9f9;
    color: #333;
}

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

h1 {
    font-size: 32px;
    margin-bottom: 20px;
}

/* Sidebar Styles */

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

.sidebar {
    width: 250px;
    margin-right: 20px;
    flex-shrink: 0; /* Prevent the sidebar from shrinking */
}

.sidebar header {
    margin-bottom: 20px;
}

.sidebar h2 {
    font-size: 24px;
    margin: 10px 0;
}

.sidebar p {
    font-size: 14px;
    line-height: 1.5;
}

.links {
    margin-top: 20px;
    display: flex;
    gap: 10px; /* Space between the links */
    flex-wrap: wrap; /* Allow wrapping if the container is too small */
}

.links a {
    text-decoration: none;
    color: #007bff;
}

.links a:hover {
    text-decoration: underline;
}

/* Content Styles */

.content {
    flex: 1;
    min-width: 0; /* Prevent the content from overflowing */
}

.article-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: background-color 0.3s, transform 0.3s;
}

.article-link:hover .article {
    background-color: #f0f0f0;
}

.article {
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
    padding: 15px;
    border-radius: 5px;
    transition: box-shadow 0.3s;
}

.article:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.article-date {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.article h2 {
    font-size: 24px;
    margin: 10px 0;
}

.article p {
    font-size: 16px;
    color: #666;
    margin: 5px 0; /* Reduce the space between paragraphs */
}

/* Article Page Specific Styles */

.article-header {
    margin-bottom: 20px;
    text-align: center;
}

.header-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.back-link {
    text-decoration: none;
    color: #007bff;
}

.back-link:hover {
    text-decoration: underline;
}

.article-content {
    margin-top: 20px;
}

.article-content p {
    margin-bottom: 20px;
}

.article-content h2 {
    margin-top: 40px;
    margin-bottom: 20px;
}

.example-img {
    width: 100%;
    border: 1px solid #ccc;
    border-radius: 5px;
}

/* Code Fragment Styles */
.code-fragment {
    margin: 20px 0;
    padding: 10px;
    overflow-x: auto; /* Ensure long code lines can scroll */
}

.code-fragment pre {
    margin: 0;
    white-space: pre-wrap; /* Allow breaking lines to avoid horizontal scrolling */
    word-wrap: break-word; /* Break long words */
    border-radius: 8px;
}

.code-fragment code {
    font-family: Consolas, 'Courier New', monospace;
    font-size: 14px;
    color: #333;
}

/* Responsive Design */

@media (max-width: 768px) {
    .container {
        flex-direction: column; /* Stack sidebar and content vertically */
        padding: 10px;
    }

    .home-container {
        flex-direction: column; /* Stack sidebar and content vertically */
        padding: 10px;
    }

    .sidebar {
        width: 100%;
        margin-bottom: 20px; /* Add space below the sidebar */
        margin-right: 0; /* Reset right margin */
    }

    .content h1 {
        font-size: 28px;
    }

    .article h2 {
        font-size: 20px;
    }

    .article p {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .links {
        align-items: center;
        gap: 10px;
    }

    .links a {
        padding: 0;
        margin: 0;
    }

    .content h1 {
        font-size: 24px;
    }

    .article h2 {
        font-size: 18px;
    }

    .article p {
        font-size: 12px;
    }
}
