/*
Theme Name: GeneratePress Child 11
Template: generatepress
Version: 1.1 - Fixed Dark Mode Compatibility
*/

@import url(../generatepress/style.css);

:root {
    --color-bg-light: #f0f2f5;
    --color-card-bg: #fff;
    --color-widget-bg: #fff;
    --color-text: #050505;
    --color-border: #dddfe2;
    --color-primary: #1877f2;
}

/* FIXED: Support for both html.dark and body.dark */
html.dark,
body.dark,
.dark-mode {
    --color-bg-light: #18191a;
    --color-card-bg: #242526;
    --color-widget-bg: #242526;
    --color-text: #e4e6eb;
    --color-border: #3e4042;
    --color-primary: #2d88ff;
}

#page,
.site,
body,
html {
    background-color: var(--color-bg-light) !important;
    color: var(--color-text);
}

body,
html {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* FIXED: Remove !important to prevent conflicts */
body {
    padding-top: 60px;
}

/* FIXED: Make sure this doesn't conflict with custom header */
.site-header {
    position: fixed;
    top: 0;
    width: 100%;
    height: 60px;
    z-index: 9999;
    background-color: var(--color-card-bg);
    border-bottom: 1px solid var(--color-border);
}

/* Hide default GeneratePress header if custom header exists */
body:has(#site-header) .site-header {
    display: none;
}

/* পেজ এবং সিংগেল পোস্টের জন্য কমপ্যাক্ট প্যাডিং */
.single .site-content,
.page .site-content {
    padding-left: 5px;
    padding-right: 5px;
}

.grid-container {
    display: flex;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 5px; /* 10px থেকে 5px */
}

/* সিংগেল পোস্ট এবং পেজে আরও কম প্যাডিং */
.single .grid-container,
.page .grid-container {
    max-width: 100%;
    padding: 0 3px; /* আরও কম প্যাডিং */
}

#primary {
    flex: 1;
    min-width: 0;
}

.sidebar {
    width: 300px;
    flex-shrink: 0;
    position: sticky;
    margin-top: -5px;
    height: fit-content;
}

@media (min-width: 769px) {
    .sidebar {
        margin-right: 0px;
    }
}

.sidebar .widget {
    background-color: var(--color-widget-bg);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
}

.inside-article {
    background-color: var(--color-card-bg) !important;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 15px; /* 20px থেকে 15px */
    margin-bottom: 15px; /* 20px থেকে 15px */
}

/* সিংগেল পোস্ট এবং পেজে আরও কম প্যাডিং */
.single .inside-article,
.page .inside-article {
    padding: 5px; /* আরও কম */
    margin-bottom: 10px; /* আরও কম */
}

/* FIXED: Remove these !important declarations to prevent conflicts */
#page,
.anas-main-wrap,
.footer-widgets .widget,
.site,
.site-content,
.site-footer *,
.site-footer .widget,
.site-footer .widget-title,
body {
    background: 0 0;
}

.site-footer {
    background-color: var(--color-card-bg);
}

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

a:hover {
    opacity: .8;
}

@media (max-width: 768px) {
    .grid-container {
        flex-direction: column;
        gap: 10px; /* 15px থেকে 10px */
    }
    
    .sidebar {
        width: 100%;
        position: static;
        margin-top: 0;
        flex-shrink: 1;
        margin-right: 0;
    }
    
    /* মোবাইলে আরও কম প্যাডিং */
    .single .site-content,
    .page .site-content {
        padding-left: 3px;
        padding-right: 3px;
    }
    
    .single .grid-container,
    .page .grid-container {
        padding: 0 2px;
    }
    
    .single .inside-article,
    .page .inside-article {
        padding: 5px;
        margin-bottom: 8px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .grid-container {
        gap: 15px;
    }
    
    .sidebar {
        width: 280px;
    }
    
    /* ট্যাবলেটেও কম প্যাডিং */
    .single .grid-container,
    .page .grid-container {
        padding: 0 5px;
    }
    
    .single .inside-article,
    .page .inside-article {
        padding: 12px;
        margin-bottom: 12px;
    }
}

html {
    background: 0 0/36px 36px fixed #f8fbff;
    background-image: linear-gradient(rgba(185, 205, 255, .09) .6px, transparent .6px), linear-gradient(90deg, rgba(185, 205, 255, .09) .6px, transparent .6px);
}

/* FIXED: Support for both html.dark and body.dark */
html.dark,
body.dark,
.dark-mode html,
.dark-mode body {
    background: 0 0/36px 36px fixed #18191a;
    background-image: linear-gradient(rgba(100, 140, 220, .06) .6px, transparent .6px), linear-gradient(90deg, rgba(100, 140, 220, .06) .6px, transparent .6px);
}

.anas-pagination {
    text-align: center;
    margin: 3rem 0 2rem;
    clear: both;
}

.anas-pagination .nav-links {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: nowrap;
    white-space: nowrap;
    padding: 0;
    list-style: none;
}

.anas-pagination .page-numbers {
    min-width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--color-text);
    background: var(--color-card-bg);
    border: 1.8px solid var(--color-border);
    border-radius: 16px;
    text-decoration: none;
    transition: .3s;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .08);
    flex-shrink: 0;
}

.anas-pagination .page-numbers:hover {
    box-shadow: 0 12px 28px rgba(0, 0, 0, .15);
    border-color: var(--color-primary);
}

.anas-pagination .page-numbers.current {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
    box-shadow: 0 10px 28px rgba(24, 119, 242, .4);
    font-weight: 800;
}

.anas-pagination .next,
.anas-pagination .prev {
    font-weight: 700;
    min-width: 110px;
    border-radius: 18px;
}

.anas-pagination .page-numbers:not(.prev):not(.next):not(.current) {
    display: none !important;
}

.anas-pagination .page-numbers.current+.page-numbers+.page-numbers:not(.next),
.anas-pagination .page-numbers.current+.page-numbers:not(.next),
.anas-pagination .page-numbers.current~.page-numbers:not(.next):nth-child(-n+2),
.anas-pagination .page-numbers.current~.page-numbers:not(.next)~.page-numbers:not(.next):nth-child(-n+1) {
    display: flex !important;
}

@media (max-width: 768px) {
    .anas-pagination .page-numbers {
        min-width: 48px;
        height: 48px;
        font-size: 1rem;
    }
    
    .anas-pagination .next,
    .anas-pagination .prev {
        min-width: 95px;
        font-size: .92rem;
    }
}

/* খুব ছোট ডিভাইসে */
@media (max-width: 480px) {
    .single .site-content,
    .page .site-content {
        padding-left: 2px;
        padding-right: 2px;
    }
    
    .single .grid-container,
    .page .grid-container {
        padding: 0 1px;
    }
    
    .single .inside-article,
    .page .inside-article {
        padding: 6px;
        margin-bottom: 6px;
    }
}

.archive .anas-post-image-wrap img {
    width: 100%;
    height: auto;
    object-fit: contain;
    max-height: 320px;
}

/* ==================== DARK MODE COMPATIBILITY FIXES ==================== */

/* Ensure dark mode works with both html and body selectors */
html.dark .inside-article,
body.dark .inside-article {
    background-color: var(--color-card-bg);
    border-color: var(--color-border);
}

html.dark .sidebar .widget,
body.dark .sidebar .widget {
    background-color: var(--color-widget-bg);
    border-color: var(--color-border);
}

html.dark .site-footer,
body.dark .site-footer {
    background-color: var(--color-card-bg);
}

/* Fix for custom header compatibility */
#site-header ~ .site-content {
    margin-top: 60px;
}

/* Ensure GeneratePress default header is hidden when custom header is present */
#site-header + .site-header,
#site-header ~ .site-header {
    display: none;
}

/* ==================== PERFORMANCE OPTIMIZATIONS ==================== */

/* Remove unnecessary !important tags */
.inside-article {
    background-color: var(--color-card-bg);
}

/* Reduce CSS specificity */
.site-footer {
    background-color: var(--color-card-bg);
}

/* ==================== RESPONSIVE FIXES ==================== */

@media (max-width: 767px) {
    /* Mobile header height fix */
    body {
        padding-top: 56px; /* Custom header height */
    }
    
    /* Hide default header completely on mobile */
    .site-header {
        display: none;
    }
}

/* Print styles */
@media print {
    .site-header,
    #site-header {
        display: none;
    }
    
    body {
        padding-top: 0;
    }
}

/* Add this to the VERY END of your style.css file */
body .anas-reaction-btn.comment-btn {
    background: transparent !important;
}
body .anas-reaction-btn.comment-btn:hover {
    background: var(--color-bg-light) !important;
}


/* Pagespeed Fixes */
.site-footer, .site-info { background: #000 !important; color: #fff !important; }
.site-footer a, .site-info a { color: #8ab4f8 !important; text-decoration: underline !important; }
.site-footer p, .site-info p { color: #ccc !important; }
.wp-block-latest-comments a { color: #1a73e8 !important; font-weight: 600 !important; }
.anas-reaction-btn.comment-btn { background: #1a73e8 !important; color: white !important; }