/* --- Global Styles & Variables (from main site for consistency) --- */
:root {
    --primary-color: #007bff;
    --primary-hover: #0056b3;
    --background-color: #0a0a0a;
    --surface-color: #1a1a1a;
    --text-color: #f0f2f5;
    --text-muted: #adb5bd;
    --border-color: #343a40;
    --font-sans: 'Inter', sans-serif;
    --font-mono: 'Source Code Pro', monospace;
}

body {
    font-family: var(--font-sans);
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    line-height: 1.6;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; margin-top: 2.5rem; margin-bottom: 1rem; }
h1 { font-size: 2.8rem; border-bottom: 1px solid var(--border-color); padding-bottom: 1rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
p, ul, ol, pre { margin-bottom: 1rem; }
code { font-family: var(--font-mono); background-color: var(--surface-color); padding: 2px 5px; border-radius: 4px; }
hr { border: 0; border-top: 1px solid var(--border-color); margin: 4rem 0;}

/* --- Buttons (from main site) --- */
.btn { display: inline-block; padding: 0.75rem 1.5rem; border-radius: 6px; font-weight: 600; text-decoration: none; text-align: center; transition: all 0.2s ease; border: 1px solid transparent; }
.btn-primary { background-color: var(--primary-color); color: #fff; }
.btn-primary:hover { background-color: var(--primary-hover); color: #fff; }

/* --- Header & Footer (from main site) --- */
.main-header { padding: 1.5rem 0; border-bottom: 1px solid var(--border-color); }
.main-header .container { display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 1.5rem; font-weight: 700; color: var(--text-color); text-decoration: none; }
.main-nav a { margin: 0 1rem; color: var(--text-muted); font-weight: 600; text-decoration: none; }
.main-nav a:hover { color: var(--text-color); }
.main-footer { padding: 2rem 0; text-align: center; color: var(--text-muted); border-top: 1px solid var(--border-color); margin-top: 4rem; }

/* --- Code Blocks (from main site) --- */
.code-block-container { margin: 1.5rem 0; background-color: #000; border-radius: 8px; padding: 1.5rem; border: 1px solid var(--border-color); }
.code-block-container pre { margin: 0; }
.code-block-container code { font-family: var(--font-mono); font-size: 0.9rem; color: #dcdfe4; white-space: pre-wrap; background: none; padding: 0; }


/* --- Blog Listing Page Specific --- */
.blog-listing-container h1 {
    margin-top: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: none;
}
.blog-subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
    display: block;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 2rem;
}

.blog-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.blog-card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease;
}

.blog-card:hover {
    transform: translateY(-5px);
}

.blog-card-thumbnail {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.blog-card-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.blog-card-category {
    display: inline-block;
    background-color: var(--primary-color);
    color: #fff;
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.blog-card h2 {
    font-size: 1.4rem;
    margin-top: 0;
    margin-bottom: 0.75rem;
}

.blog-card h2 a {
    color: var(--text-color);
    text-decoration: none;
}

.blog-card h2 a:hover {
    color: var(--primary-color);
}

.blog-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    flex-grow: 1;
}

.blog-card-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
}

/* --- Individual Blog Post Styling --- */
.blog-post-container {
    padding: 2rem 0;
}

.blog-post-header {
    text-align: center;
    margin-bottom: 3rem;
}

.blog-post-header h1 {
    font-size: 3rem;
    margin-bottom: 0.75rem;
    border-bottom: none;
    padding-bottom: 0;
}

.blog-post-meta {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.blog-post-image {
    width: 100%;
    max-height: 450px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 2.5rem;
    border: 1px solid var(--border-color);
}

.blog-post-content {
    max-width: 800px;
    margin: 0 auto;
}

.blog-post-content p {
    margin-bottom: 1.25rem;
    font-size: 1.05rem;
}

.blog-post-content ul, .blog-post-content ol {
    margin-left: 1.5rem;
    margin-bottom: 1.25rem;
}

.blog-post-content li {
    margin-bottom: 0.5rem;
}

.blog-post-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .blog-listing-container h1 {
        font-size: 2.2rem;
    }
    .blog-subtitle {
        font-size: 1rem;
    }
    .blog-posts-grid {
        grid-template-columns: 1fr;
    }
    .blog-post-header h1 {
        font-size: 2.2rem;
    }
    .blog-post-image {
        max-height: 300px;
    }
}


/* --- Add these rules to your blog's CSS file --- */

/* This rule uses Flexbox to align your navigation links horizontally */
.main-nav {
    display: flex;
    align-items: center;
}

/* This adds the smooth color transition back to the links on hover */
.main-nav a {
    transition: color 0.2s ease;
}


/* --- Pure CSS Dropdown Menu --- */
/* These rules are required for the dropdown to function and look correct */
.dropdown {
    position: relative;
    display: inline-block;
    padding-bottom: 1rem; /* Creates a "bridge" for the cursor */
    margin-bottom: -1rem;  /* Prevents padding from adding extra space */
}

.dropdown-toggle {
    cursor: pointer;
    background: none;
    border: none;
    font-size: 1rem; /* Inherits from .main-nav a */
    font-family: inherit;
    padding: 0;
    margin: 0 1rem;
    color: var(--text-muted);
    font-weight: 600;
}

.dropdown-toggle:hover,
.dropdown:hover .dropdown-toggle {
    color: var(--text-color);
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--surface-color);
    min-width: 160px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
    z-index: 1000;
    padding: 0.5rem 0;
}

.dropdown-menu a {
    padding: 0.75rem 1.5rem;
    display: block;
    text-align: left;
    margin: 0; /* Overrides the margin from .main-nav a */
}

.dropdown-menu a:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
}

/* This is the magic that shows the menu on hover */
.dropdown:hover .dropdown-menu {
    display: block;
}