/* 
    Theme: Modern Dark Blog
    Fonts: Montserrat (Headings), Roboto (Body)
*/

/* --- Variables and Base Styles --- */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@700&family=Roboto:wght@400;700&display=swap');

:root {
    --primary-color: #9b59b6; /* A vibrant purple */
    --primary-hover: #8e44ad;
    --background-color: #1a1a1a;
    --surface-color: #2b2b2b;
    --text-color: #e0e0e0;
    --text-muted: #a0a0a0;
    --border-color: #444444;
    --heading-font: 'Montserrat', sans-serif;
    --body-font: 'Roboto', sans-serif;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    --radius: 8px;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--body-font);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 {
    font-family: var(--heading-font);
    color: #ffffff;
    line-height: 1.3;
    font-weight: 700;
}

h1 { font-size: 2.8rem; margin-bottom: 1rem; }
h2 { font-size: 2.2rem; margin-bottom: 2rem; padding-bottom: 0.75rem; border-bottom: 2px solid var(--primary-color); }
h3 { font-size: 1.5rem; margin-bottom: 1rem; color: var(--text-color); }

p {
    margin-bottom: 1.2rem;
    color: var(--text-muted);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

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

/* --- Header & Navigation --- */
.main-header {
    background-color: rgba(43, 43, 43, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    font-family: var(--heading-font);
    font-size: 1.8rem;
    font-weight: 700;
    color: #ffffff;
    transition: color 0.2s;
}
.logo:hover {
    color: var(--primary-color);
}

.main-nav ul {
    list-style: none;
    display: flex;
}

.main-nav li {
    margin-left: 2.5rem;
}

.main-nav a {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-muted);
    padding: 0.5rem 0;
    position: relative;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.main-nav a:hover,
.main-nav a.active {
    color: #ffffff;
}

.main-nav a:hover::after,
.main-nav a.active::after {
    width: 100%;
}

/* --- Page Layout --- */
.page-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    padding: 3rem 1.5rem;
}

@media (min-width: 992px) {
    .page-wrapper {
        grid-template-columns: 3fr 1fr;
    }
}

/* --- Main Content & Articles --- */
.main-content article {
    margin-bottom: 2.5rem;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.article-card, .article-full {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.article-card {
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.article-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    border-color: var(--primary-color);
}

.article-card h3 {
    margin-bottom: 0.75rem;
}

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

.article-meta span {
    margin-right: 1rem;
}

.read-more {
    display: inline-block;
    font-weight: 700;
    margin-top: auto; /* Pushes the button to the bottom */
    align-self: flex-start;
}

/* --- Sidebar --- */
.sidebar .widget {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.sidebar .widget h3 {
    font-size: 1.3rem;
    color: #fff;
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar .widget p {
    font-size: 0.95rem;
}

.widget-list {
    list-style: none;
}

.widget-list li {
    margin-bottom: 0.5rem;
}

.widget-list a {
    text-decoration: none;
    color: var(--text-muted);
    transition: color 0.2s, padding-left 0.2s;
}

.widget-list a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

/* --- Footer --- */
.main-footer {
    background-color: var(--surface-color);
    color: var(--text-muted);
    padding: 2rem 0;
    margin-top: 2rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.main-footer .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.main-footer a {
    color: var(--text-color);
}
.main-footer a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.footer-links {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    h1 { font-size: 2.2rem; }
    h2 { font-size: 1.8rem; }

    .main-header .container {
        flex-direction: column;
        gap: 1rem;
    }

    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem 1rem;
    }
    
    .main-nav li {
        margin-left: 0;
    }

    .page-wrapper {
        padding: 1.5rem;
    }
}