/*
Theme Name: Mahasarav Modern
Theme URI: https://www.mahasarav.com
Author: Mahasarav
Description: A lightweight, high-performance Classic WordPress theme replicating the Newspaper layout.
Version: 1.1.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
tags: newspaper, magazine, classic-theme, fast
*/

:root {
    --primary: var(--wp--preset--color--primary, #4db2ec);
    --dark: #222222;
    --text: #111111;
    --bg-gray: #f2f2f2;
    --white: #ffffff;
    --border: #eeeeee;
    --container-width: 1068px;
    --font-main: var(--wp--preset--font-family--primary, "Open Sans", sans-serif);
}

/* 1. Reset & Base */
* {
    box-sizing: border-box;
}

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

img {
    max-width: 100%;
    height: auto;
    display: block;
}

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

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

.td-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* 2. Header */
.site-header {
    background: var(--white);
}

.top-bar {
    background: var(--dark);
    color: var(--white);
    font-size: 13px;
    padding: 8px 0;
}

.top-bar .td-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-navigation {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 15px;
}

.branding-section {
    padding: 30px 0;
}

.branding-section .td-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area h1 {
    margin: 0;
    font-size: 40px;
}

.main-navigation-wrapper {
    background: var(--dark);
    border-bottom: 3px solid var(--primary);
}

.main-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

.main-menu a {
    color: var(--white);
    padding: 15px 20px;
    display: block;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 14px;
}

.main-menu a:hover {
    background: var(--primary);
}

/* 3. Layout Grid */
.main-grid {
    display: flex;
    gap: 40px;
    padding-top: 40px;
}

.content-area {
    flex: 2;
}

.sidebar-area {
    flex: 1;
}

/* 4. Modules & Loops */
.td-module-item {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
}

.td-thumb-fix {
    flex-shrink: 0;
    width: 200px;
}

.td-thumb-fix img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.entry-title {
    margin: 0 0 10px;
    font-size: 20px;
    font-weight: 700;
}

.td-module-meta {
    font-size: 12px;
    color: #888;
    margin-bottom: 10px;
}

.td-module-meta span:not(:last-child)::after {
    content: '-';
    margin: 0 5px;
}

/* 5. Headings & Blocks */
h2,
h4 {
    text-transform: uppercase;
    margin-top: 0;
}

/* Newspaper Style Headings */
.wp-block-heading,
h2.entry-title,
.widget-title,
h4 {
    display: inline-block;
}

.widget-title,
h4 {
    background: var(--dark);
    color: var(--white);
    padding: 8px 15px;
    font-size: 16px;
    margin-bottom: 0;
}

/* Decorative line below headers */
.content-area h2::after,
.sidebar-area .widget-title::after,
h4::after {
    display: none;
    /* Cleaned up previous implementation */
}

.sidebar-area section.widget,
.content-area .article-list {
    border-top: 2px solid var(--dark);
    padding-top: 25px;
}

/* 6. Single Post */
.single .entry-header {
    margin-bottom: 25px;
}

.single .entry-title {
    font-size: 32px;
    font-weight: 800;
}

.single .post-featured-image {
    margin-bottom: 30px;
}

.single .entry-content {
    font-size: 16px;
    line-height: 1.8;
}

/* 7. Footer */
.site-footer {
    background: var(--white);
    padding: 40px 0;
    border-top: 1px solid var(--border);
    margin-top: 50px;
    text-align: center;
}

.footer-menu {
    list-style: none;
    padding: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
    font-size: 13px;
}

/* 8. Mobile Optimizations */
@media (max-width: 767px) {
    .td-container {
        padding: 0 15px;
    }

    .branding-section .td-container,
    .top-bar .td-container {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .main-grid {
        flex-direction: column;
    }

    .td-module-item {
        flex-direction: column;
    }

    .td-thumb-fix {
        width: 100%;
    }

    .main-menu {
        flex-direction: column;
        align-items: center;
    }

    .logo-area h1 {
        font-size: 30px;
    }
}