/* Global styles for the developer blog.
   These variables and selectors aim to provide a minimal, readable and accessible design. */
:root {
    --primary-color: #0078d4;
    --background-color: #fdfdfd;
    --text-color: #2b2b2b;
    --nav-bg-color: #ffffff;
    --nav-text-color: #2b2b2b;
    --nav-hover-bg: var(--primary-color);
    --nav-hover-text: #ffffff;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
    line-height: 1.2;
}

p {
    margin-top: 0;
    margin-bottom: 1rem;
}

/* Navigation styles */
.navbar {
    background-color: var(--nav-bg-color);
    border-bottom: 1px solid #e6e6e6;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
}

.site-title {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--primary-color);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-color);
    cursor: pointer;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 1rem;
    margin: 0;
    padding: 0;
}

.nav-links li a {
    color: var(--nav-text-color);
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    display: block;
}

.nav-links li a.active,
.nav-links li a:hover {
    background-color: var(--primary-color);
    color: var(--nav-hover-text);
}

@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        right: 0;
        background-color: var(--nav-bg-color);
        flex-direction: column;
        width: 200px;
        padding: 0.5rem 1rem;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        display: none;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links li a {
        padding: 0.5rem;
    }
}

/* Layout styles */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 1rem;
}

.content {
    min-height: calc(100vh - 220px);
}

.footer {
    background-color: var(--nav-bg-color);
    border-top: 1px solid #e6e6e6;
    text-align: center;
    padding: 1rem;
    font-size: 0.875rem;
    margin-top: 2rem;
    color: var(--text-color);
}

/* Post preview styles */
.posts-preview {
    margin-top: 2rem;
}

.post-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: box-shadow 0.3s ease;
    background-color: #ffffff;
}

.post-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.post-card h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.post-card a {
    color: var(--primary-color);
    font-weight: 600;
}

.post-card a:hover {
    text-decoration: underline;
}