/*  
Theme Name: Er. Rameshwar Singh Theme  
Theme URI: https://taknikigyan.com  
Author: Er. Rameshwar Singh  
Author URI: https://taknikigyan.com  
Description: An ultra-fast, lightweight, SEO-optimized universal custom theme built for TaknikiGyan.com.  
Version: 2.5.0  
License: GNU General Public License v2 or later  
Text Domain: ers-theme  
*/

/* ====================================================
   1. CSS Reset & Base Styles
==================================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box !important;
}

html, body {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100% !important;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.8;
    color: #1e293b;
    background-color: #f8fafc;
}

a {
    color: #0066cc;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #004499;
}

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

/* ====================================================
   2. Container & Layout (Desktop Standard 70:30 Lock)
==================================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box !important;
}

.site-content-wrapper,
.content-layout {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    gap: 30px !important;
    width: 100% !important;
    max-width: 1200px !important;
    margin: 25px auto !important;
    box-sizing: border-box !important;
}

/* मुख्य पोस्ट एरिया: 70% चौड़ाई */
#primary.site-main {
    flex: 1 1 0% !important;
    max-width: 850px !important;
    min-width: 0 !important;
}

/* साइडबार एरिया: 30% लॉक */
#secondary.widget-area,
.desktop-only-sidebar,
.sidebar-desktop-wrap {
    display: block !important;
    flex: 0 0 320px !important;
    width: 320px !important;
    max-width: 320px !important;
    min-width: 320px !important;
    box-sizing: border-box !important;
}

/* 🚫 साइडबार से पुराने सर्च बॉक्स को छिपाना */
.widget_search, 
.sidebar-widget .search-form,
#secondary .search-form {
    display: none !important;
}

/* होमपेज पर 2-कॉलम पोस्ट ग्रिड */
.posts-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 20px !important;
}

/* ====================================================
   🌟 3. UNBREAKABLE SHARP IMAGE ENGINE (OBJECT-FIT CONTAIN)
==================================================== */
.post-thumbnail img,
.perfect-post-img,
.single-post-thumbnail img,
.entry-content img {
    object-fit: contain !important;
    max-width: 100% !important;
    display: block !important;
    margin: 0 auto !important;
}

/* ====================================================
   4. Dynamic Header & Search Styling
==================================================== */
.site-header {
    background-color: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 12px 0;
}

.header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    flex-wrap: wrap;
    gap: 15px;
}

.site-branding {
    display: flex !important;
    align-items: center !important;
    gap: 15px !important;
}

.site-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.site-title a {
    color: #1a1a1a;
    text-decoration: none;
}

.site-description {
    font-size: 13px;
    color: #64748b;
    margin-top: 3px;
    margin-bottom: 0;
    line-height: 1.3;
}

/* ====================================================
   5. 3D FOLDER DROPDOWN MENU
==================================================== */
.main-navigation {
    display: flex;
    align-items: center;
    width: 100%;
    background: #004f6e;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    margin-top: 10px;
}

.ers-dropdown-menu {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 auto !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: center !important;
}

.ers-dropdown-menu li {
    position: relative !important;
}

.ers-dropdown-menu > li > a {
    color: #ffffff !important;
    text-decoration: none !important;
    padding: 12px 20px !important;
    font-weight: 800 !important;
    font-size: 14.5px !important;
    display: block !important;
    background: #003852 !important;
    border-right: 1px solid rgba(255, 255, 255, 0.1) !important;
    transition: background 0.2s ease, color 0.2s ease !important;
}

.ers-dropdown-menu > li > a:hover,
.ers-dropdown-menu > li.current-menu-item > a {
    background: #059669 !important;
    color: #ffffff !important;
}

.ers-dropdown-menu ul.sub-menu {
    display: none !important;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    background: #ffffff !important;
    list-style: none !important;
    padding: 10px 0 !important;
    margin: 0 !important;
    min-width: 280px !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25) !important;
    border-radius: 0 0 12px 12px !important;
    border: 1.5px solid #cbd5e1 !important;
    border-top: 4px solid #059669 !important;
    z-index: 9999 !important;
}

.ers-dropdown-menu li:hover > ul.sub-menu {
    display: block !important;
}

.ers-dropdown-menu ul.sub-menu a {
    color: #334155 !important;
    padding: 12px 18px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    background: transparent !important;
    border-bottom: 1px solid #f1f5f9 !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

.ers-dropdown-menu ul.sub-menu a::before {
    content: "📁" !important;
}

.ers-dropdown-menu ul.sub-menu a:hover {
    background: #ecfdf5 !important;
    color: #065f46 !important;
    padding-left: 22px !important;
    border-left: 4px solid #059669 !important;
}

/* ====================================================
   6. ARTICLE TYPOGRAPHY & 3D CARDS
==================================================== */
.single-post-card, .post-card {
    background: #ffffff !important;
    border-radius: 12px !important;
    border: 1px solid #cbd5e1 !important;
    padding: 24px !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05) !important;
    box-sizing: border-box !important;
}

.post-body {
    font-size: 18px !important;
    line-height: 1.9 !important;
    color: #1e293b !important;
}

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

.post-body h2 {
    font-size: 26px !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    margin: 40px 0 20px 0 !important;
    border-bottom: 3px solid #dc2626 !important;
    padding-bottom: 10px !important;
}

/* ====================================================
   7. MOBILE RESPONSIVE FIXES
==================================================== */
@media screen and (max-width: 768px) {
    html, body {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    .container {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    .content-layout {
        flex-direction: column !important;
        gap: 0 !important;
    }

    .posts-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }

    #secondary.widget-area,
    .desktop-only-sidebar {
        display: none !important;
        visibility: hidden !important;
        width: 0 !important;
        height: 0 !important;
    }
}
