/*
Theme Name: RST Barta
Theme URI: https://networknewsbd.com/
Author: RST Multimedia
Author URI: https://rjtanjid24.github.io/me/
Description: A professional, responsive, and independent WordPress newspaper theme built with Bootstrap.
Version: 1.1.0
Text Domain: rst-barta
*/

/* ==========================================================================
   1. GLOBAL TYPOGRAPHY & VARIABLES
   ========================================================================== */
@font-face {
    font-family: 'SolaimanLipi';
    src: url('./assets/fonts/SolaimanLipi.ttf') format('truetype');
    font-weight: normal; 
    font-style: normal; 
    font-display: swap;
}

:root {
    --bg-color: #ffffff;
    --text-color: #333333;
    --border-color: #e5e7eb;
    --top-bg: #ffffff;
    --ticker-bg: #f4f4f4;
    --menu-bg: #006dae; 
    --menu-text: #ffffff;
    --social-bg: #ffffff;
    --bs-font-sans-serif: 'SolaimanLipi', Arial, sans-serif;
    --bs-body-font-family: 'SolaimanLipi', Arial, sans-serif;
}

body.dark-mode {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --border-color: #333333;
    --top-bg: #1e1e1e;
    --ticker-bg: #2a2a2a;
    --menu-bg: #0b2b42; 
    --social-bg: #2a2a2a;
}

body { 
    background-color: var(--bg-color); 
    color: var(--text-color); 
    transition: 0.3s; 
    font-family: 'SolaimanLipi', Arial, sans-serif; 
}

h1, h2, h3, h4, h5, h6, p, a, span, li, div, input, button, textarea, select { 
    font-family: 'SolaimanLipi', Arial, sans-serif; 
}


/* ==========================================================================
   2. GLOBAL UTILITIES & HELPERS
   ========================================================================== */

/* Dynamic Theme Colors */
.rst-heading-color { color: var(--text-color); transition: 0.3s; }
.rst-text-color { color: var(--text-color) !important; transition: 0.3s; }
.rst-bg-light { background-color: var(--ticker-bg); transition: 0.3s; }
.rst-border-color { border-color: var(--border-color) !important; }
hr.rst-border-color { opacity: 1; border-color: var(--border-color) !important; }

/* Interactive Hovers & Transitions */
.rst-scale-hover { transition: transform 0.4s ease; }
a:hover .rst-scale-hover { transform: scale(1.05); }

.rst-hover-red { transition: color 0.2s; }
.rst-hover-red:hover { color: #d90429 !important; }

.rst-title-link { color: var(--text-color); transition: color 0.2s ease-in-out; font-size: clamp(1.1rem, 2vw, 1.4rem); line-height: 1.4; }
.rst-title-link:hover { color: #d90429; }

/* Global UI Elements */
.rst-toast-notification { 
    display: none; position: fixed; top: 20px; right: 20px; background: #28a745; 
    color: #fff; padding: 12px 25px; border-radius: 5px; z-index: 9999; 
    font-weight: bold; box-shadow: 0 4px 12px rgba(0,0,0,0.15); 
    animation: fadeInOut 2.5s forwards; 
}
@keyframes fadeInOut { 
    0% { opacity: 0; transform: translateY(-20px); } 
    10% { opacity: 1; transform: translateY(0); } 
    90% { opacity: 1; transform: translateY(0); } 
    100% { opacity: 0; transform: translateY(-20px); } 
}


/* ==========================================================================
   3. HEADER, NAVIGATION & TICKER
   ========================================================================== */
.rst-main-header { padding: 25px 0; background-color: var(--top-bg); border-bottom: 1px solid var(--border-color); }
.rst-header-date { font-size: 1rem; color: var(--text-color); font-weight: 500; }
.rst-site-logo img { max-height: 65px; width: auto; object-fit: contain; }

/* Header Utilities */
.rst-left-utilities a, .rst-left-utilities .rst-hamburger-btn-desktop { 
    color: #555; text-decoration: none; transition: color 0.2s; cursor: pointer; font-size: 1.1rem; 
}
.rst-left-utilities a:hover, .rst-left-utilities .rst-hamburger-btn-desktop:hover { color: #d90429; }

body.dark-mode .rst-left-utilities a, body.dark-mode .rst-left-utilities .rst-hamburger-btn-desktop { color: #aaa; }
body.dark-mode .rst-left-utilities a:hover, body.dark-mode .rst-left-utilities .rst-hamburger-btn-desktop:hover { color: #d90429; }

/* Buttons & Socials */
.social-circle { 
    width: 32px; height: 32px; border-radius: 50%; background-color: var(--social-bg); 
    display: inline-flex; align-items: center; justify-content: center; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.08); transition: transform 0.2s ease; 
    text-decoration: none; border: 1px solid var(--border-color); 
}
.social-circle:hover { transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0,0,0,0.12); }

.rst-action-btn { 
    background-color: #f5f5f5; border: 1px solid #e0e0e0; color: #333; 
    padding: 5px 14px; border-radius: 4px; font-size: 0.9rem; font-weight: 600; 
    text-decoration: none; transition: 0.2s; 
}
.rst-action-btn:hover { background-color: #e9e9e9; color: #d90429; border-color: #ccc; }
.rst-btn-red { background-color: #d90429; color: #fff; border-color: #d90429; }
.rst-btn-red:hover { background-color: #b91c1c; color: #fff; border-color: #b91c1c; }

body.dark-mode .rst-action-btn:not(.rst-btn-red) { background-color: #2a2a2a; border-color: #444; color: #eee; }
body.dark-mode .rst-action-btn:not(.rst-btn-red):hover { background-color: #333; color: #fff; }
body.dark-mode .btn-outline-dark { border-color: #444; color: #e0e0e0; }
body.dark-mode .btn-outline-dark:hover { background-color: #d90429; border-color: #d90429; color: #fff; }

/* Sticky Navigation */
.rst-nav-wrapper { background-color: var(--menu-bg); z-index: 1040; width: 100%; transition: background-color 0.3s; }
.rst-sticky-fixed { 
    position: fixed !important; top: 0; left: 0; width: 100%; 
    z-index: 1050 !important; box-shadow: 0 4px 12px rgba(0,0,0,0.15); 
    animation: smoothScrollDown 0.3s ease-in-out; 
}
@keyframes smoothScrollDown { 0% { transform: translateY(-100%); } 100% { transform: translateY(0); } }

.rst-menu-container { display: flex; align-items: center; justify-content: center; width: 100%; }
.rst-home-fixed { 
    color: var(--menu-text); padding: 12px 20px; display: inline-flex; 
    align-items: center; transition: 0.3s; font-size: 1.2rem; 
    border-right: 1px solid rgba(255,255,255,0.1); border-left: 1px solid rgba(255,255,255,0.1); 
}
.rst-home-fixed:hover { background-color: rgba(0,0,0,0.15); color: #fff; }

/* Primary Menu */
.rst-primary-menu { display: flex; flex-wrap: wrap; list-style: none; padding: 0; margin: 0; }
.rst-primary-menu li { position: relative; }
.rst-primary-menu li a { 
    color: var(--menu-text) !important; font-size: 1.05rem; font-weight: 600; 
    padding: 12px 18px; display: block; text-decoration: none; transition: background-color 0.2s ease; 
}
.rst-primary-menu li a:hover, .rst-primary-menu li.current-menu-item > a { background-color: rgba(0,0,0,0.15); }

.rst-primary-menu li ul.sub-menu { 
    display: none; position: absolute; top: 100%; left: 0; background-color: var(--top-bg); 
    min-width: 200px; box-shadow: 0 8px 16px rgba(0,0,0,0.1); z-index: 1000; 
    padding: 0; list-style: none; border: 1px solid var(--border-color); 
}
@media (min-width: 992px) { .rst-primary-menu li:hover > ul.sub-menu { display: block; } }
.rst-primary-menu li ul.sub-menu li a { color: var(--text-color) !important; padding: 10px 20px; border-bottom: 1px solid var(--border-color); font-weight: 500; }
.rst-primary-menu li ul.sub-menu li a:hover { background-color: var(--ticker-bg); color: #d90429 !important; padding-left: 25px; }

/* Mobile Menu Specifics */
.rst-mobile-toggle { display: none; background: transparent; border: none; color: #fff; font-size: 1.5rem; padding: 10px 20px; cursor: pointer; }
.rst-mobile-header { display: none; background-color: var(--menu-bg); padding: 10px 15px; color: #fff; align-items: center; justify-content: space-between; }
.rst-mobile-date { font-size: 11px; color: #e0e0e0; margin-top: 2px; text-align: center; }
.rst-mobile-icons a { color: #fff; font-size: 1.2rem; margin-left: 15px; text-decoration: none; }
.rst-hamburger-btn { font-size: 1.5rem; color: #fff; cursor: pointer; background: none; border: none; padding: 0; }

/* Offcanvas Mega Drawer */
.rst-offcanvas-drawer {
    position: fixed; top: 0; left: -320px; width: 300px; height: 100vh;
    background-color: var(--bg-color); z-index: 1060; transition: left 0.3s ease;
    box-shadow: 2px 0 15px rgba(0,0,0,0.15); display: flex; flex-direction: column;
}
.rst-offcanvas-drawer.open { left: 0; }
.rst-drawer-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 1055; display: none; }
.rst-drawer-overlay.active { display: block; }
.rst-drawer-header { padding: 15px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; background: var(--top-bg); }
.rst-drawer-close { font-size: 1.5rem; color: var(--text-color); cursor: pointer; transition: 0.2s; }
.rst-drawer-close:hover { color: #d90429; }
.rst-drawer-body { overflow-y: auto; flex-grow: 1; }
.rst-drawer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 15px; border-bottom: 1px solid var(--border-color); }
.rst-drawer-actions .btn { font-size: 13px; font-weight: 600; padding: 6px 10px; }
.rst-mobile-menu-list { list-style: none; padding: 15px; margin: 0; display: flex; flex-wrap: wrap; gap: 10px 0; }
.rst-mobile-menu-list li { width: 50%; }
.rst-mobile-menu-list li a { color: var(--text-color); text-decoration: none; font-size: 15px; font-weight: 600; display: flex; align-items: center; transition: 0.2s; }
.rst-mobile-menu-list li a:hover { color: #d90429; }
.rst-mobile-menu-list li a::before { content: "•"; color: #006dae; font-size: 20px; margin-right: 8px; line-height: 1; }
.rst-drawer-social { padding: 20px 15px; border-top: 1px solid var(--border-color); background: var(--top-bg); }

/* Search Overlay */
.rst-search-form-wrapper { 
    position: absolute; top: 100%; left: 0; width: 100%; background: var(--top-bg); 
    padding: 15px; border-bottom: 1px solid var(--border-color); z-index: 1050; 
    display: none; box-shadow: 0 4px 6px rgba(0,0,0,0.1); 
}
.rst-search-form-wrapper.active { display: block; animation: slideDown 0.2s ease; }

/* Ticker */
.rst-ticker-section { background-color: var(--ticker-bg); border-bottom: 1px solid var(--border-color); overflow: hidden; }
.rst-ticker-label { 
    font-weight: 600; padding: 8px 15px 8px 0; border-right: 1px solid #ccc; 
    margin-right: 15px; white-space: nowrap; z-index: 10; position: relative; 
    background: var(--ticker-bg); color: var(--text-color); font-size: 1rem; 
}
.rst-ticker-wrap { width: 100%; overflow: hidden; display: flex; align-items: center; position: relative; }

/* The animation starts immediately at 0 */
.rst-ticker-move { display: inline-block; white-space: nowrap; animation: ticker 40s linear infinite; }

/* Moved hover to the wrap so the ticker stops even if the mouse is in the empty space between links */
.rst-ticker-wrap:hover .rst-ticker-move { animation-play-state: paused; }

.rst-ticker-move a { 
    color: var(--text-color); text-decoration: none; margin-right: 35px; 
    font-size: 0.95rem; display: inline-block; 
}
.rst-ticker-move a:hover { color: #d90429; }

/* Seamless loop keyframes (starts immediately, resets at exactly 50%) */
@keyframes ticker { 
    0% { transform: translateX(0); } 
    100% { transform: translateX(-50%); } 
}

/* Header Media Queries */
@media (max-width: 991px) {
    .rst-site-header.d-none { display: none !important; }
    .rst-mobile-header { display: flex; }
    .rst-main-header .row { text-align: center; }
    .rst-main-header .col-md-4 { margin-bottom: 20px; justify-content: center !important; }
    .rst-left-utilities, .rst-social-circles { justify-content: center; }
    .rst-mobile-toggle { display: block; margin-left: auto; }
    .rst-menu-collapse { display: none; width: 100%; background: var(--menu-bg); }
    .rst-menu-collapse.active { display: block; }
    .rst-primary-menu { flex-direction: column; }
    .rst-primary-menu li a { border-bottom: 1px solid rgba(255,255,255,0.1); }
    .rst-primary-menu li ul.sub-menu { position: relative; box-shadow: none; border: none; background-color: rgba(0,0,0,0.1); }
    .rst-primary-menu li ul.sub-menu li a { color: #fff !important; }
}


/* ==========================================================================
   4. COMPONENTS: PAGINATION, WIDGETS & BUTTONS
   ========================================================================== */

/* Pagination */
.rst-pagination .nav-links, .rst-pagination-wrapper .nav-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.rst-pagination .page-numbers, .rst-pagination-wrapper .page-numbers { 
    display: inline-flex; align-items: center; justify-content: center; 
    min-width: 40px; height: 40px; padding: 0 15px; background: var(--bg-color); 
    border: 1px solid var(--border-color); color: var(--text-color); 
    text-decoration: none; border-radius: 4px; transition: all 0.3s ease; 
    font-weight: 600; font-size: 0.95rem; margin: 0 2px;
}
.rst-pagination .page-numbers:hover, .rst-pagination-wrapper .page-numbers:hover { background: var(--ticker-bg); color: #d90429; border-color: #d90429; }
.rst-pagination .page-numbers.current, .rst-pagination-wrapper .page-numbers.current { background: #d90429; color: #fff; border-color: #d90429; pointer-events: none; }
.rst-pagination .page-numbers.dots, .rst-pagination-wrapper .page-numbers.dots { background: transparent; border: none; pointer-events: none; }

/* Sidebar Tabs & Widgets */
.rst-tab-header-bg { background-color: #f8f9fa; transition: 0.3s; }
.rst-tab-body-bg { background-color: #ffffff; transition: 0.3s; }
.rst-sidebar-link { color: var(--text-color); transition: color 0.2s; }
.rst-sidebar-link:hover { color: #d90429; }

.rst-sidebar-tabs-widget .nav-pills .nav-link { color: var(--text-color); transition: 0.3s; }
.rst-sidebar-tabs-widget .nav-pills .nav-link.active { background-color: var(--menu-bg); color: var(--menu-text); }
.rst-sidebar-tabs-widget .nav-pills .nav-link:not(.active):hover { color: #d90429; }

.rst-archive-select { background-color: var(--bg-color); color: var(--text-color); transition: 0.3s; }
.rst-archive-select:focus { border-color: #d90429; box-shadow: 0 0 0 0.25rem rgba(217, 4, 41, 0.25); }

/* Numbered List for Sidebar */
.list-number { 
    width: 22px; height: 22px; border-radius: 50%; 
    display: flex; align-items: center; justify-content: center; 
    font-size: 12px; margin-right: 10px; flex-shrink: 0; font-weight: bold; 
}

/* Sidebar Dark Mode */
body.dark-mode .rst-tab-header-bg { background-color: #1e1e1e; }
body.dark-mode .rst-tab-body-bg { background-color: #121212; }
body.dark-mode .rst-sidebar-tabs-widget .nav-pills .nav-link.active { background-color: #0b2b42; color: #fff; }

/* Social Share Buttons */
.rst-share-btn { 
    width: 34px; height: 34px; border-radius: 4px; display: inline-flex; 
    align-items: center; justify-content: center; color: white !important; 
    text-decoration: none; transition: 0.3s; cursor: pointer; font-size: 0.95rem; 
}
.rst-share-btn:hover { transform: translateY(-3px); opacity: 0.9; box-shadow: 0 4px 8px rgba(0,0,0,0.15); }
.btn-fb { background: #1877F2; } 
.btn-tw { background: #000000; } 
.btn-wa { background: #25D366; } 
.btn-messenger { background: #0084FF; } 
.btn-copy { background: #6c757d; } 
.btn-print { background: #495057; }
.btn-photocard { background: #004085; }

/* Font Resizer Buttons */
.rst-font-resizer button { font-weight: bold; border: none; background: transparent; }
.rst-font-resizer button:hover { color: #d90429 !important; }

/* Quick Link Buttons (About Page) */
.rst-quick-links .btn { transition: transform 0.2s, box-shadow 0.2s; }
.rst-quick-links .btn:hover { transform: translateY(-2px); box-shadow: 0 6px 12px rgba(0,0,0,0.15) !important; }


/* ==========================================================================
   5. PAGE LAYOUTS
   ========================================================================== */

/* Home Page / Matrices */
.rst-cat-header-wrap { border-bottom: 2px solid var(--menu-bg); position: relative; }
.rst-cat-badge { background-color: var(--menu-bg); color: var(--menu-text); border-top-left-radius: 4px; border-top-right-radius: 4px; font-size: 1.1rem; }
.rst-opinion-thumb { border: 2px solid var(--menu-bg); }

/* Single Post & Static Pages */
.rst-author-link { color: var(--text-color); transition: 0.2s; }
.rst-author-link:hover { color: #d90429; }
.rst-cat-underline { color: var(--menu-bg); font-size: 1.1rem; border-bottom: 2px solid #d90429; padding-bottom: 2px; }

.rst-article-body p { margin-bottom: 20px; }
.rst-article-body img { max-width: 100%; height: auto; border-radius: 6px; margin: 15px 0; }
.rst-article-body ul, .rst-article-body ol { margin-bottom: 20px; padding-left: 20px; }
.rst-article-body li { margin-bottom: 8px; }

/* Archive & Search Listings */
.rst-archive-header-wrap { border-bottom: 2px solid var(--menu-bg); }
.rst-archive-badge { background-color: var(--menu-bg); color: var(--menu-text); font-size: 1.4rem; border-radius: 4px 4px 0 0; }
.rst-archive-list-title { font-size: 1.4rem; line-height: 1.4; }

/* Contact & Icon Boxes (About Page) */
.rst-icon-box { background-color: #ffffff; transition: 0.3s; }

/* Legal & Policy Page */
.rst-legal-card { border-radius: 16px; transition: 0.3s; }
.rst-last-updated {
    display: inline-flex; align-items: center; padding: 6px 16px;
    background-color: #fff1f2; color: #d90429; border-radius: 50px;
    font-size: 0.95rem; font-weight: 600; border: 1px solid #fecaca;
}
.rst-legal-content h2 {
    font-weight: 800; color: var(--menu-bg); font-size: 1.6rem;
    margin-top: 3rem; margin-bottom: 1.5rem; border-bottom: 2px solid var(--border-color); padding-bottom: 10px;
}
.rst-legal-content h3 {
    font-weight: 700; color: var(--text-color); font-size: 1.3rem;
    margin-top: 2rem; margin-bottom: 1rem; display: flex; align-items: center;
}
.rst-legal-content h3::before {
    content: ''; display: inline-block; width: 6px; height: 22px;
    background-color: #d90429; margin-right: 12px; border-radius: 4px;
}
.rst-warning-box {
    background-color: #fff5f5; border: 1px solid #fed7d7;
    border-left: 5px solid #d90429; border-radius: 8px; padding: 20px; margin: 30px 0;
}
.rst-policy-contact {
    background: linear-gradient(135deg, #111827 0%, #1f2937 100%); border-radius: 12px; 
    padding: 30px; color: #fff; margin-top: 40px; text-align: center;
}
.rst-mail-link {
    color: #fff; text-decoration: none; font-weight: bold; font-size: 1.2rem; 
    transition: 0.3s; border-bottom: 2px solid rgba(255,255,255,0.3); padding-bottom: 2px;
}
.rst-mail-link:hover { color: #d90429; border-color: #d90429; }

/* Page Layout Dark Mode Overrides */
body.dark-mode .rst-article-body { color: #e0e0e0 !important; }
body.dark-mode .rst-breadcrumb a.text-muted { color: #aaa !important; }
body.dark-mode .rst-breadcrumb a.text-muted:hover { color: #d90429 !important; }

body.dark-mode .rst-archive-card h3 a { color: #e0e0e0 !important; }
body.dark-mode .rst-archive-card h3 a:hover { color: #d90429 !important; }

body.dark-mode .rst-icon-box { background-color: #2a2a2a; }
body.dark-mode .rst-last-updated { background-color: #2a1111; border-color: #4a1c1c; }
body.dark-mode .rst-warning-box { background-color: #2a1111; border-color: #4a1c1c; }
body.dark-mode .rst-policy-contact { background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%); border: 1px solid #333; }

/* Responsive Image / Fallback Support */
body.dark-mode .rst-no-thumb { background-color: var(--ticker-bg) !important; color: #555 !important; }

@media (max-width: 767px) {
    .rst-archive-list-title { font-size: 1.1rem !important; line-height: 1.3 !important; }
    .rst-archive-card img, .rst-archive-card .rst-bg-light { height: 90px !important; }
}


/* ==========================================================================
   6. FOOTER STYLES
   ========================================================================== */

/* Perfect Ratio Logo Formatting */
.rst-footer-logo img {
    width: auto; max-width: 100%; height: auto; max-height: 70px;
    object-fit: contain; display: block; margin: 0 auto;
}

.rst-editor-info p, .rst-address-text p { margin-bottom: 0; }

/* Headings & Accent Underline */
.rst-footer-heading {
    position: relative; padding-bottom: 8px; border-bottom: 1px solid var(--border-color); 
    font-weight: 700; font-size: 1.1rem;
}
.rst-footer-heading::after {
    content: ''; position: absolute; left: 0; bottom: -1px; 
    width: 35px; height: 2px; background-color: #d90429; 
}

/* Useful Links List Styling */
.rst-footer-links { padding-left: 0; list-style: none; }
.rst-footer-links li { position: relative; padding-left: 20px; margin-bottom: 8px; }
.rst-footer-links li::before {
    content: "\00BB"; position: absolute; left: 0; top: 0px;
    color: #d90429; font-weight: 900; font-size: 1.1rem; line-height: 1.2;
}
.rst-footer-links a { color: var(--text-color); text-decoration: none; font-size: 0.95rem; transition: color 0.2s; }
.rst-footer-links a:hover { color: #d90429; }

/* Floating Actions (Back to Top) */
.rst-floating-actions { position: fixed; bottom: 20px; right: 20px; z-index: 999; }
.rst-back-to-top {
    width: 40px; height: 40px; border-radius: 6px; 
    text-decoration: none; transition: background-color 0.3s ease;
}
.rst-back-to-top:hover { background-color: #d90429 !important; }