/*
Theme Name: Custom Magazine Theme
Author: Tech With Saiful Companion
Description: Fully combined and optimized CSS for header ad layout, inline search menu, pagination, and related posts carousel slider.
Version: 1.3
Text Domain: custom-magazine
*/

/* ==========================================================================
   ১. গ্লোবাল এবং রিসেট স্টাইল (Reset & Global Styles)
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #ffffff;
    color: #333;
    line-height: 1.5;
}

a {
    color: #27ae60;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   ২. টপ বার সেকশন (Top Bar Section)
   ========================================================================== */
.top-bar {
    border-bottom: 1px solid #eee;
    font-size: 13px;
    padding: 8px 0;
    color: #666;
}

.top-bar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.top-links span {
    margin-right: 15px;
}

/* ==========================================================================
   ৩. মেইন হেডার: লোগো ও বিজ্ঞাপনের স্থান (Fixed Table Layout)
   ========================================================================== */
.site-header {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
}

.header-grid-container {
    display: table;
    width: 100%;
    table-layout: fixed; /* কলামের সাইজ লক রাখার জন্য */
}

.site-branding {
    display: table-cell;
    vertical-align: middle;
    width: 35%;
    text-align: left;
}

.site-logo-text {
    font-size: 32px;
    font-weight: bold;
    color: #333;
    margin: 0;
}

.site-logo-text span {
    color: #27ae60;
}

/* বিজ্ঞাপনের জায়গা ডানে ফিক্সড রাখার জন্য */
.header-ad-spot {
    display: table-cell;
    vertical-align: middle;
    width: 65%;
    text-align: right;
}

.header-ad-placeholder {
    background-color: #f5f5f5;
    border: 1px dashed #cccccc;
    color: #777777;
    padding: 20px;
    font-size: 13px;
    font-weight: bold;
    width: 100%;
    max-width: 728px;
    min-height: 90px;
    display: inline-block;
    text-align: center;
    box-sizing: border-box;
    text-transform: uppercase;
    border-radius: 4px;
}

/* ==========================================================================
   ৪. ১-লাইন মেনু বার এবং সার্চ বক্স (Fixed Flex Layout)
   ========================================================================== */
.main-navigation {
    background-color: #1e5631; /* গাঢ় সবুজ রঙের বার */
    color: #fff;
    padding: 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.nav-flex-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap; /* কোনো অবস্থাতেই ২ লাইনে যাবে না */
}

.menu-left-part {
    flex: 1;
}

/* ওয়ার্ডপ্রেস ডাইনামিক মেনু লিস্ট স্টাইলিং */
.nav-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: block;
}

.nav-menu-list li {
    display: inline-block;
    margin: 0;
    padding: 0;
}

.nav-menu-list a {
    display: block;
    padding: 15px 20px;
    color: #fff;
    font-weight: bold;
    font-size: 14px;
    text-transform: uppercase;
    text-decoration: none;
    transition: background-color 0.2s;
}

.nav-menu-list a:hover {
    background-color: #143d22;
}

/* সার্চ বক্স এক লাইনে ডানে সেট করার জন্য */
.menu-search-part {
    display: block;
    padding-left: 20px;
}

.menu-search-part form {
    margin: 0;
    padding: 0;
}

.menu-search-part input[type="search"] {
    padding: 6px 12px;
    border: 1px solid #143d22;
    border-radius: 4px;
    font-size: 13px;
    width: 200px;
    background-color: #ffffff;
    color: #333;
    outline: none;
}

/* ==========================================================================
   ৫. ব্লগ বডি কনটেন্ট এবং সাইডবার (Main Content & Sidebar)
   ========================================================================== */
.main-content-wrap {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

.layout-table {
    display: table;
    width: 100%;
    table-layout: fixed;
}

.content-area {
    display: table-cell;
    width: 70%;
    padding-right: 30px;
    vertical-align: top;
}

.sidebar-area {
    display: table-cell;
    width: 30%;
    vertical-align: top;
    background-color: #fcfcfc;
    border: 1px solid #f0f0f0;
    padding: 20px;
}

.section-heading {
    font-size: 14px;
    text-transform: uppercase;
    color: #333;
    border-bottom: 2px solid #333;
    padding-bottom: 5px;
    margin-bottom: 25px;
    font-weight: bold;
}

/* ==========================================================================
   ৬. রিসেন্ট পোস্ট রো লেআউট (Post Feed Rows)
   ========================================================================== */
.magazine-post-row {
    display: table;
    width: 100%;
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid #eee;
}

.magazine-thumb-cell {
    display: table-cell;
    width: 220px;
    vertical-align: top;
}

.magazine-thumb-cell img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
    border: 1px solid #eee;
}

.magazine-content-cell {
    display: table-cell;
    vertical-align: top;
    padding-left: 20px;
}

.entry-title {
    margin: 0 0 8px 0;
    font-size: 19px;
    font-weight: bold;
    line-height: 1.3;
}

.entry-title a {
    color: #111;
}

.entry-title a:hover {
    color: #27ae60;
    text-decoration: none;
}

.entry-meta {
    font-size: 12px;
    color: #888;
    margin-bottom: 10px;
}

.entry-meta span {
    color: #27ae60;
}

.entry-excerpt {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    margin: 0;
}

/* ==========================================================================
   ৭. সাইডবার উইজেট এবং ফুটার (Sidebar & Footer)
   ========================================================================== */
.widget {
    margin-bottom: 30px;
}

.widget-title {
    font-size: 13px;
    text-transform: uppercase;
    background-color: #333;
    color: #fff;
    padding: 8px 12px;
    margin-top: 0;
    margin-bottom: 15px;
}

.mini-post-item {
    display: table;
    width: 100%;
    margin-bottom: 15px;
}

.mini-thumb-cell {
    display: table-cell;
    width: 65px;
    vertical-align: top;
}

.mini-thumb-cell img {
    width: 100%;
    height: 50px;
    object-fit: cover;
}

.mini-content-cell {
    display: table-cell;
    vertical-align: top;
    padding-left: 10px;
}

.mini-title {
    font-size: 13px;
    margin: 0 0 4px 0;
    font-weight: bold;
}

.mini-title a {
    color: #222;
}

.mini-date {
    font-size: 11px;
    color: #999;
}

.ad-banner-widget {
    background-color: #fff2cc;
    border: 1px dashed #e6b800;
    padding: 30px 15px;
    text-align: center;
    color: #b48600;
    font-weight: bold;
}

.site-footer {
    background-color: #222;
    color: #bbb;
    padding: 25px 0;
    text-align: center;
    font-size: 13px;
    border-top: 4px solid #1e5631;
}

/* ==========================================================================
   ৮. কাস্টম পেজিনেশন স্টাইল - Capture.JPG (Custom Pagination Styles)
   ========================================================================== */
.pagination-wrap {
    margin-top: 40px;
    margin-bottom: 20px;
    text-align: center;
}

.pagination-wrap .nav-links {
    display: inline-flex;
    gap: 8px;
    align-items: center;
}

/* সাধারণ পেজ নম্বর ও বাটনের বেসিক ডিজাইন */
.pagination-wrap .page-numbers {
    display: inline-block;
    padding: 10px 16px;
    font-size: 15px;
    font-weight: bold;
    color: #333333;
    background-color: #ffffff;
    border: 1px solid #dddddd;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s ease;
    min-width: 40px;
    text-align: center;
}

/* মাউস হোভার করলে সাধারণ বাটনের স্টাইল */
.pagination-wrap a.page-numbers:hover {
    background-color: #f5f5f5;
    border-color: #bbbbbb;
    color: #000000;
    text-decoration: none;
}

/* ১ নম্বর বা কারেন্ট/অ্যাক্টিভ পেজ (লাল বক্স) */
.pagination-wrap .page-numbers.current {
    background-color: #bd0000;
    border-color: #bd0000;
    color: #ffffff;
}

/* Next এবং Prev টেক্সট বাটন (কালো বক্স) */
.pagination-wrap .page-numbers.next,
.pagination-wrap .page-numbers.prev {
    background-color: #0b0c10;
    border-color: #0b0c10;
    color: #ffffff;
    padding: 10px 20px;
}

/* Next/Prev বাটনে হোভার করলে স্টাইল */
.pagination-wrap .page-numbers.next:hover,
.pagination-wrap .page-numbers.prev:hover {
    background-color: #22252a;
    border-color: #22252a;
    color: #ffffff;
}

/* স্ক্রিন রিডার টেক্সট লুকানোর জন্য */
.pagination-wrap .screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

/* ==========================================================================
   ৯. রিলেটেড পোস্ট ক্যারোসেল স্লাইডার - rr.JPG (Related Posts Carousel)
   ========================================================================== */
.single-post-title {
    font-size: 28px;
    font-weight: bold;
    color: #111;
    margin-top: 10px;
    margin-bottom: 10px;
    line-height: 1.3;
}

.related-posts-section {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px solid #eeeeee;
    position: relative;
}

.related-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.related-section-title {
    font-size: 16px;
    text-transform: uppercase;
    color: #111;
    border-left: 4px solid #bd0000; /* লাল লেফট বর্ডার */
    padding-left: 10px;
    margin: 0;
    font-weight: bold;
}

/* লাল স্লাইডার অ্যারো বাটন স্টাইলিং */
.carousel-arrows {
    display: flex;
    gap: 5px;
}

.arrow-btn {
    background-color: #bd0000;
    color: #ffffff;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    outline: none;
}

.arrow-btn:hover {
    background-color: #8a0000;
}

/* স্লাইডার কন্টেইনার */
.related-carousel-container {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

.related-carousel-container::-webkit-scrollbar {
    display: none;
}

/* প্রতিটি কার্ড একসাথে ৪টি করে দেখানোর নিখুঁত ক্যালকুলেশন */
.related-post-card-carousel {
    flex: 0 0 calc(25% - 11.25px);
    box-sizing: border-box;
}

.related-thumb-link img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
    border-radius: 4px;
    border: 1px solid #eee;
    margin-bottom: 8px;
    transition: opacity 0.2s;
}

.related-thumb-link img:hover {
    opacity: 0.85;
}

.related-post-title {
    font-size: 13px;
    font-weight: bold;
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-post-title a {
    color: #222;
}

.related-post-title a:hover {
    color: #bd0000;
}

/* কমেন্ট ফর্ম স্টাইলিং */
.comments-section-wrap {
    margin-top: 40px;
    background: #fdfdfd;
    padding: 25px;
    border: 1px solid #eee;
    border-radius: 4px;
}

#respond h3 { font-size: 18px; margin-bottom: 15px; }
#commentform input[type="text"], #commentform textarea {
    width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 4px; margin-bottom: 15px; font-size: 14px;
}
#commentform input[type="submit"] {
    background-color: #1e5631; color: white; border: none; padding: 10px 20px; font-weight: bold; cursor: pointer; border-radius: 4px; text-transform: uppercase;
}
#commentform input[type="submit"]:hover { background-color: #143d22; }

/* ==========================================================================
   ১০. মোবাইল এবং ট্যাবলেট রেসপন্সিভ ওভাররাইড (Mobile Responsive)
   ========================================================================== */
@media screen and (max-width: 992px) {
    .header-grid-container, 
    .site-branding, 
    .header-ad-spot {
        display: block !important;
        width: 100% !important;
        text-align: center !important;
        padding: 0;
    }
    
    .site-branding {
        margin-bottom: 15px;
    }
    
    .header-ad-placeholder {
        max-width: 100%;
    }
    
    .nav-flex-container {
        display: block !important;
        text-align: center;
    }
    
    .nav-menu-list li {
        display: block;
        border-bottom: 1px solid #143d22;
    }
    
    .menu-search-part {
        padding: 12px 20px;
    }
    
    .menu-search-part input[type="search"] {
        width: 100%;
        max-width: 280px;
    }

    .related-post-card-carousel {
        flex: 0 0 calc(50% - 7.5px); /* ট্যাবলেটে ২টি করে দেখাবে */
    }
}

@media screen and (max-width: 768px) {
    .content-area, 
    .sidebar-area, 
    .magazine-thumb-cell, 
    .magazine-content-cell {
        display: block !important;
        width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    .magazine-thumb-cell img {
        height: auto;
        margin-bottom: 15px;
    }
}

@media screen and (max-width: 576px) {
    .related-post-card-carousel {
        flex: 0 0 85%; /* মোবাইলে ১টি পুরো এবং আরেকটি স্লাইড স্লাইটলি শো করবে */
    }
}