/* ==========================================================================
   1. CSS VARIABLES & THEME (Dark Mode Magazine)
   ========================================================================== */
:root {
    --bg-dark: #0a0a0a;
    --bg-card: #151515;
    --text-main: #e0e0e0;
    --text-muted: #999999;
    --accent-blue: #3498db;
    --accent-hover: #2980b9;
    --border-color: #222222;
    --pure-white: #ffffff;
    --pure-black: #000000;
}

/* ==========================================================================
   2. BASE RESET & GLOBAL STYLES
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-dark) !important;
    color: var(--text-main) !important;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

a:hover {
    color: var(--accent-hover);
}

h1, h2, h3, h4, h5, h6, strong {
    color: var(--pure-white);
}

/* ==========================================================================
   3. HEADER & NAVIGATION
   ========================================================================== */
.site-header {
    background-color: var(--pure-black);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--pure-white);
    letter-spacing: 1px;
    display: flex;
    align-items: center;
}

.logo img {
    max-height: 40px;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

.main-nav a {
    color: var(--text-main);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.main-nav a:hover {
    color: var(--accent-blue);
}

.user-actions .btn-nav {
    padding: 0.5rem 1.2rem;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.btn-login {
    border: 1px solid var(--accent-blue);
    color: var(--accent-blue);
}

.btn-login:hover {
    background: var(--accent-blue);
    color: var(--pure-white);
}

.btn-dashboard {
    background: var(--accent-blue);
    color: var(--pure-white);
}

.btn-dashboard:hover {
    background: var(--accent-hover);
}

/* ==========================================================================
   4. ARTICLE GRIDS & CARDS (Homepage & Categories)
   ========================================================================== */
.main-content-wrapper {
    flex: 1; /* Pushes footer to the bottom */
}

/* Forcing Dark Mode on Inline Styles */
.article-card {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.5) !important;
    border-color: #333 !important;
}

.article-content p {
    color: var(--text-muted) !important;
}

.home-header, .category-header {
    border-bottom: 2px solid var(--border-color) !important;
}

.article-meta {
    border-top: 1px solid var(--border-color) !important;
    color: var(--text-muted) !important;
}

/* ==========================================================================
   5. SINGLE ARTICLE VIEW
   ========================================================================== */
.article-header h1 {
    font-size: 3rem !important;
}

.article-header p {
    color: var(--text-muted) !important;
}

.article-body {
    color: var(--text-main) !important;
    font-size: 1.2rem !important;
}

/* Format content injected by TinyMCE */
.article-body p { margin-bottom: 1.5rem; }
.article-body h2 { margin: 2.5rem 0 1rem 0; font-size: 2rem; border-bottom: 1px solid var(--border-color); padding-bottom: 0.5rem; }
.article-body h3 { margin: 2rem 0 1rem 0; font-size: 1.5rem; }
.article-body img { max-width: 100%; height: auto; border-radius: 4px; margin: 2rem 0; }
.article-body ul, .article-body ol { margin-bottom: 1.5rem; padding-left: 2rem; }
.article-body li { margin-bottom: 0.5rem; }
.article-body blockquote {
    border-left: 4px solid var(--accent-blue);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--text-muted);
    font-size: 1.3rem;
}

/* ==========================================================================
   6. FOOTER
   ========================================================================== */
.site-footer {
    background-color: var(--pure-black);
    border-top: 1px solid var(--border-color);
    padding: 4rem 2rem 1.5rem 2rem;
    margin-top: 4rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-section h2 {
    color: var(--pure-white);
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.footer-section h3 {
    color: var(--pure-white);
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    text-transform: uppercase;
}

.brand-section p {
    color: var(--text-muted);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.8rem;
}

.footer-section ul a {
    color: var(--text-muted);
}

.footer-section ul a:hover {
    color: var(--accent-blue);
    padding-left: 5px;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ==========================================================================
   7. RESPONSIVE DESIGN (Mobile & Tablets)
   ========================================================================== */
@media (max-width: 900px) {
    .footer-container {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .article-header h1 {
        font-size: 2rem !important;
    }
    
    .footer-container {
        grid-template-columns: 1fr;
    }
}