/* ==========================================================================
   CSS Variables for Theming (Day/Night)
   ========================================================================== */
:root {
    /* Light Theme (Default) */
    --bg-color: #ffffff;
    --text-color: #333333;
    --text-light: #666666;
    --border-color: #e0e0e0;
    --primary-color: #d32f2f; /* A subtle classic red for magazine feel */
    --hover-bg: #f5f5f5;
    --footer-bg: #fafafa;
    --nav-bg: #ffffff;
    --shadow: 0 2px 4px rgba(0,0,0,0.05);
}

[data-theme="dark"] {
    /* Dark Theme */
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --text-light: #aaaaaa;
    --border-color: #333333;
    --primary-color: #ff5252;
    --hover-bg: #1e1e1e;
    --footer-bg: #0d0d0d;
    --nav-bg: #121212;
    --shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* ==========================================================================
   Base Styles
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Noto Sans Gurmukhi', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
    font-size: 18px;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

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

ul {
    list-style: none;
}

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

button {
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    font-size: 1.2rem;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.magazine-header {
    border-bottom: 1px solid var(--border-color);
    background: var(--nav-bg);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

.logo-container .logo {
    display: inline-block;
}

.logo-container img {
    max-height: 70px;
}

.logo-container h2 {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.5px;
}

.actions-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.theme-toggle {
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s;
}
.theme-toggle:hover {
    background: var(--hover-bg);
}

.mobile-menu-toggle {
    display: none;
    padding: 8px;
}

.main-nav {
    border-top: 1px solid var(--border-color);
}

.nav-menu {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 15px 0;
}

.nav-item {
    position: relative;
    font-weight: 600;
    font-size: 1.1rem;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-item.has-dropdown .dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--nav-bg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease-in-out;
    z-index: 10;
    padding: 10px 0;
    border-radius: 4px;
}

.nav-item.has-dropdown:hover .dropdown {
    opacity: 1;
    visibility: visible;
    top: calc(100% + 5px);
}

.dropdown li {
    padding: 8px 20px;
}

.dropdown li a {
    display: block;
    font-weight: 400;
}

.dropdown li:hover {
    background: var(--hover-bg);
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */
.main-wrapper {
    min-height: calc(100vh - 300px);
    padding: 40px 0;
}

.content-header {
    text-align: center;
    margin-bottom: 40px;
}

.content-header h1 {
    font-size: 2.4rem;
    margin-bottom: 10px;
}

/* Post Grid */
.magazine-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

.post-card {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

.post-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.post-thumb {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid var(--border-color);
}

.post-content {
    padding: 20px;
}

.post-meta {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 10px;
    display: flex;
    gap: 15px;
}

.post-title {
    font-size: 1.4rem;
    margin-bottom: 15px;
    line-height: 1.4;
}

.post-excerpt {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Single Post Content */
.single-post-wrapper {
    margin: 0 auto;
}

.single-post-image {
    width: 100%;
    max-height: 450px;
    object-fit: cover;
    margin-bottom: 30px;
    border-radius: 8px;
}

.single-post-body {
    font-size: 1.1rem;
    line-height: 1.8;
}

.single-post-body p {
    margin-bottom: 25px;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.magazine-footer {
    background: var(--footer-bg);
    border-top: 1px solid var(--border-color);
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-top {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 30px;
}

.footer-logo {
    max-height: 50px;
    margin-bottom: 15px;
}

.brand-info h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.about-desc {
    color: var(--text-light);
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    font-size: 1.2rem;
    color: var(--text-light);
}

.social-links a:hover {
    color: var(--primary-color);
}

.footer-widget h4 {
    margin-bottom: 20px;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-nav li {
    margin-bottom: 10px;
}

.footer-nav a {
    color: var(--text-light);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    color: var(--text-light);
    font-size: 0.9rem;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    .nav-menu {
        display: none;
        flex-direction: column;
        gap: 0;
        padding: 0;
    }
    
    .main-nav.nav-open .nav-menu {
        display: flex;
    }
    
    .nav-item {
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav-item > a {
        padding: 15px;
        justify-content: space-between;
    }
    
    .nav-item.has-dropdown .dropdown {
        position: static;
        box-shadow: none;
        border: none;
        border-top: 1px solid var(--border-color);
        width: 100%;
        transform: none;
        display: none;
        opacity: 1;
        visibility: visible;
        background: var(--hover-bg);
    }
    
    .nav-item.has-dropdown.dropdown-open .dropdown {
        display: block;
    }
    
    .footer-top {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .single-post-wrapper {
        padding: 0 15px;
    }
}
