/* Project: Global News Portal 
   Theme: Professional Red & Blue 
*/

:root {
    --red: #d32f2f;
    --blue: #0d47a1;
    --dark: #222;
    --light: #f4f7f6;
    --white: #ffffff;
    --border: #eeeeee;
    --green-border: #008000;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body { 
    background: var(--light); 
    font-family: 'SolaimanLipi', Arial, sans-serif; 
    color: var(--dark); 
    line-height: 1.6; 
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }

/* সব ছবি ও আইফ্রেম যেন স্ক্রিনের বাইরে না যায় */
img, iframe, video { max-width: 100%; height: auto; display: block; }

.container { max-width: 1300px; width: 95%; margin: 0 auto; }

/* =========================================
   ১. হেডার সেকশন
========================================= */
.main-header { background: var(--white); box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.header-top { display: flex; justify-content: space-between; align-items: center; padding: 15px 0; }
.text-logo { font-size: 2.2rem; font-weight: 900; color: var(--blue); margin: 0; }
.text-logo span { color: var(--red); }
.logo-area img { max-height: 65px; }

.info-bar { display: flex; gap: 15px; font-size: 0.85rem; color: #666; }
.info-bar span { display: flex; align-items: center; gap: 5px; }
.info-bar i { color: var(--red); }

.ad-header-area, .mid-ad, .footer-ad-area, .full-width-ad-row { text-align: center; margin: 20px auto; clear: both; width: 100%; }
.ad-slot-wrapper img { display: inline-block; border: 1px solid #ddd; padding: 2px; background: #fff; max-width: 100%; margin: 0 auto; }

/* =========================================
   ২. নেভিগেশন ও সাব-মেনু
========================================= */
.navbar { background: var(--white); border-top: 1px solid var(--border); border-bottom: 3px solid var(--red); position: sticky; top: 0; z-index: 1000; }
.nav-links { display: flex; justify-content: center; }
.nav-links li { position: relative; }
.nav-links li a { display: block; padding: 15px 18px; font-weight: bold; color: #444; }
.nav-links li a:hover { color: var(--red); background: #f9f9f9; }

.dropdown { display: none; position: absolute; top: 100%; left: 0; background: var(--white); min-width: 200px; box-shadow: 0 5px 15px rgba(0,0,0,0.1); border-top: 2px solid var(--red); z-index: 999; }
.dropdown li { width: 100%; border-bottom: 1px solid #f5f5f5; }
.dropdown li a { padding: 12px 20px; font-size: 0.9rem; font-weight: normal; }
.has-dropdown:hover .dropdown { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* =========================================
   ৩. নিউজ টিঙ্কার (শিরোনাম)
========================================= */
.ticker-box { display: flex; background: var(--white); border: 1px solid #ddd; height: 42px; margin: 15px auto; overflow: hidden; border-radius: 4px; }
.ticker-label { background: var(--red); color: #fff; padding: 0 20px; font-weight: bold; display: flex; align-items: center; z-index: 10; }
.ticker-wrap { flex: 1; overflow: hidden; display: flex; align-items: center; }
.ticker-move { white-space: nowrap; animation: ticker-move 40s linear infinite; }
.ticker-move a { margin-right: 40px; font-weight: bold; font-size: 0.95rem; }
.ticker-move:hover { animation-play-state: paused; }
@keyframes ticker-move { 0% { transform: translateX(100%); } 100% { transform: translateX(-100%); } }

/* =========================================
   ৪. হিরো গ্রিড (স্লাইডার, ব্রেকিং, ফেসবুক)
========================================= */
.hero-grid { display: grid; grid-template-columns: 2fr 1.2fr 1fr; gap: 15px; margin-bottom: 30px; height: 420px; }
.slider-box { border-radius: 8px; overflow: hidden; position: relative; background: #000; }
.mySwiper { width: 100%; height: 100%; }
.swiper-slide { display: flex; justify-content: center; align-items: center; position: relative; }
.slide-bg-blur { position: absolute; width: 100%; height: 100%; background-size: cover; background-position: center; filter: blur(15px); opacity: 0.6; z-index: 1; }
.slide-main-img { position: relative; z-index: 2; max-height: 100%; object-fit: contain; }
.slide-text { position: absolute; bottom: 0; left: 0; width: 100%; padding: 40px 20px 20px; background: linear-gradient(transparent, rgba(0,0,0,0.9)); color: #fff; z-index: 3; }
.cat-badge { background: var(--red); padding: 3px 8px; font-size: 0.7rem; border-radius: 3px; }
.slide-text h2 { font-size: 1.35rem; margin-top: 10px; }
.live-breaking, .facebook-widget { background: #fff; border: 1px solid #ddd; border-radius: 8px; overflow: hidden; }
.box-head { background: var(--red); color: #fff; padding: 12px; font-weight: bold; text-align: center; }
.fb-bg { background: #3b5998; }
.box-body { padding: 10px; height: calc(100% - 45px); overflow-y: auto; }

/* =========================================
   ৫. ক্যাটাগরি গ্রিড (Solid CSS Grid)
========================================= */
.cat-grid-wrapper { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 20px; 
    margin-bottom: 20px; 
    align-items: start; /* বক্সগুলো অযথাই লম্বা হবে না */
}

.cat-box { 
    background: #fff; 
    border: 1px solid #ddd; 
    border-radius: 6px; 
    overflow: hidden; 
    display: flex; 
    flex-direction: column;
    height: auto; 
}

.cat-title { background: #f8f8f8; padding: 10px 15px; border-bottom: 2px solid var(--dark); display: flex; justify-content: space-between; align-items: center; font-weight: bold; }
.cat-title span { color: var(--red); font-size: 1.1rem; }
.cat-title a { font-size: 0.75rem; color: #777; }
.cat-body { padding: 15px; flex: 1; }

.featured-cat-post { margin-bottom: 15px; border-bottom: 1px solid #eee; padding-bottom: 10px; }
.featured-cat-post img { width: 100%; height: 180px; object-fit: cover; border-radius: 4px; transition: 0.3s; }
.featured-cat-post img:hover { opacity: 0.9; }
.featured-cat-post h3 { font-size: 1.05rem; margin: 10px 0; line-height: 1.4; font-weight: bold; }
.featured-cat-post p { font-size: 0.85rem; color: #555; height: 3.6em; overflow: hidden; text-align: justify; }

.grid-cat-posts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.small-grid-post { display: flex; flex-direction: column; gap: 5px; }
.small-grid-post img { width: 100%; height: 85px; object-fit: cover; border-radius: 4px; }
.small-grid-post h4 { font-size: 0.8rem; margin: 0; font-weight: bold; height: 3.8em; overflow: hidden; line-height: 1.3; color: #333; }
.small-grid-post h4:hover { color: var(--red); }

/* =========================================
   ৬. ফুটার সেকশন
========================================= */
.site-footer { background: var(--white); margin-top: 50px; border-top: 2px solid var(--green-border); border-bottom: 2px solid var(--green-border); padding: 0 0 20px 0; color: var(--dark); }
.footer-top-menu { display: flex; justify-content: flex-start; gap: 15px; padding: 15px 0; border-bottom: 1px solid var(--green-border); margin-bottom: 25px; }
.footer-top-menu a { border: 1px solid var(--dark); padding: 8px 20px; font-size: 0.95rem; font-weight: bold; color: var(--dark); background: #f9f9f9; }
.footer-top-menu a:hover { background: var(--red); color: var(--white); border-color: var(--red); }

.footer-main-grid { display: grid; grid-template-columns: 1.2fr 1fr 1.2fr; gap: 20px; align-items: start; text-align: center; padding-bottom: 20px; }
.footer-col-left { border-right: 1px solid var(--green-border); padding-right: 15px; font-size: 0.95rem; line-height: 1.8; text-align: left; }
.footer-col-middle { display: flex; flex-direction: column; justify-content: center; align-items: center; height: 100%; }
.footer-col-middle h1 { font-size: 2.5rem; margin: 0; font-family: 'Arial Black', sans-serif; color: #000; letter-spacing: -1px; }
.footer-col-middle p { font-size: 1rem; color: red; font-weight: bold; margin-top: 5px; }
.footer-col-right { border-left: 1px solid var(--green-border); padding-left: 15px; font-size: 0.95rem; line-height: 1.8; text-align: left; }

.footer-bottom-bar { border-top: 1px solid var(--green-border); padding-top: 20px; margin-top: 10px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 15px; }
.footer-copyright { font-size: 0.85rem; color: #444; }
.footer-dev { font-size: 0.85rem; font-weight: bold; color: #666; }
.footer-social { display: flex; gap: 15px; font-size: 1.2rem; }
.footer-social a.fb { color: #3b5998; }
.footer-social a.yt { color: #ff0000; }
.footer-social a.ig { color: #e4405f; }


/* ===================================================
   ৭. Mobile Responsive & Fluid Layout
=================================================== */

/* --- ট্যাবলেট (Max Width: 900px) --- 
   (আগে 1100px ছিল, তাই মোবাইলের ডেস্কটপ মোডে ৯৮০px পেয়ে ২ কলাম হয়ে যেত। এখন ৯০০px করায় ডেস্কটপ মোডে ৩ কলামই পাবে।) 
*/
@media (max-width: 900px) {
    .hero-grid { grid-template-columns: 1fr 1fr; height: auto; }
    .slider-box { height: 400px; grid-column: span 2; }
    
    /* ট্যাবলেটে ২ কলাম */
    .cat-grid-wrapper { grid-template-columns: repeat(2, 1fr); }
    
    .single-layout, .cat-page-wrapper { display: flex; flex-direction: column; }
}

/* --- মোবাইল স্ক্রিন (Max Width: 768px) --- */
@media (max-width: 768px) {
    /* হেডার ও মেনু */
    .header-top { flex-direction: column; text-align: center; gap: 15px; }
    .info-bar { flex-direction: column; align-items: center; gap: 5px; }
    .nav-links { justify-content: flex-start; overflow-x: auto; white-space: nowrap; padding-bottom: 5px; -webkit-overflow-scrolling: touch; }
    .nav-links::-webkit-scrollbar { height: 4px; }
    .nav-links::-webkit-scrollbar-thumb { background: var(--red); border-radius: 10px; }

    /* হিরো ও ক্যাটাগরি গ্রিড */
    .hero-grid { grid-template-columns: 1fr; }
    .slider-box { height: 300px; grid-column: span 1; }
    .live-breaking { height: auto; padding-bottom: 15px; }
    .facebook-widget, .facebook-widget iframe { width: 100%; height: auto; }
    
    /* মোবাইলে ১ কলাম */
    .cat-grid-wrapper { grid-template-columns: 1fr; gap: 15px; }
    .grid-cat-posts { grid-template-columns: 1fr 1fr; }

    /* সিঙ্গল নিউজ পেজ */
    .post-container { padding: 15px; }
    .post-title { font-size: 1.6rem; }
    .news-content-area { font-size: 1.1rem; line-height: 1.6; }
    .share-bar { flex-direction: column; gap: 8px; }
    .share-bar a, .share-bar button { width: 100%; text-align: center; justify-content: center; }

    /* ই-পেপার মোডাল */
    .modal-content { width: 96%; margin: 5% auto; }
    #epaper-capture-area { padding: 15px; }
    .ep-columns { column-count: 1; }
    #ep-title { font-size: 1.5rem; }
    .ep-date-bar { flex-direction: column; text-align: center; gap: 5px; }

    /* ফুটার ফিক্স (1 কলাম, সেন্টার্ড) */
    .footer-main-grid { grid-template-columns: 1fr; gap: 25px; }
    .footer-col-left, .footer-col-right { border-right: none; border-left: none; padding: 0 10px 20px 10px; text-align: center; }
    .footer-col-left { border-bottom: 1px dashed var(--green-border); }
    .footer-col-middle { padding-bottom: 20px; border-bottom: 1px dashed var(--green-border); }
    .footer-col-middle h1 { font-size: 2rem; }
    .footer-col-middle img { max-height: 55px; margin: 0 auto; }
    .footer-top-menu { flex-direction: column; gap: 10px; align-items: center; }
    .footer-top-menu a { width: 100%; text-align: center; padding: 10px; }
    .footer-bottom-bar { flex-direction: column; gap: 15px; text-align: center; justify-content: center; }
    .footer-social { justify-content: center; width: 100%; }
}

/* --- ছোট মোবাইল (থাম্বনেইল ফিক্স) --- */
@media (max-width: 480px) {
    .grid-cat-posts { grid-template-columns: 1fr; gap: 15px; }
    
    .small-grid-post { 
        flex-direction: row; 
        align-items: flex-start; 
        gap: 12px; 
        border-bottom: 1px solid #eee; 
        padding-bottom: 12px; 
    }
    .small-grid-post:last-child { border-bottom: none; padding-bottom: 0; }
    
    /* থাম্বনেইল ফিক্স: ইমেজ এবং লিংক ট্যাগ ফিক্সড সাইজ করা হলো */
    .small-grid-post > a {
        display: block;
        flex-shrink: 0;
        width: 110px;
        height: 75px;
    }
    
    .small-grid-post img { 
        width: 100%; 
        height: 100%; 
        object-fit: cover; 
        border-radius: 4px; 
    }
    
    .small-grid-post h4 { 
        height: auto; 
        font-size: 0.95rem; 
        line-height: 1.4; 
        margin-top: -3px; 
    }
}

/* ===================================================
   ফেসবুক ফ্রেম (Iframe) রেসপনসিভ ফিক্স
   =================================================== */
.facebook-widget, .sidebar-widget {
    width: 100%;
    overflow: hidden !important;
    display: flex;
    flex-direction: column;
    align-items: center; /* ফ্রেমটি যেকোনো স্ক্রিনে একদম মাঝখানে থাকবে */
    justify-content: flex-start;
}

.facebook-widget iframe, .sidebar-widget iframe {
    width: 100% !important;
    max-width: 100% !important; /* ফেসবুক প্লাগইনের সর্বোচ্চ সাইজ */
    min-height: 100% !important; /* আপনার দেওয়া হাইট অনুযায়ী */
    border: none !important;
    margin: 0 auto !important; 
    display: block !important;
}

/* মোবাইলের জন্য এক্সট্রা ফিক্স */
@media (max-width: 768px) {
    .facebook-widget iframe, .sidebar-widget iframe {
        width: 100vw !important; /* মোবাইলে ফুল স্ক্রিন চওড়া হবে */
        max-width: 100% !important;
    }
}