@import url('https://fonts.maateen.me/solaiman-lipi/font.css');

/* Reset and Base Styles */
:root {
    /* News Portal Premium Color Palette */
    --primary-color: #0b1c3d;
    /* Authoritative Deep Navy */
    --primary-light: #162a5c;
    --accent-color: #cc0000;
    /* Classic News Red */
    --accent-hover: #a30000;
    --secondary-color: #f1f5f9;
    /* Crisp White Slate */
    --text-dark: #1a1a1a;
    --text-light: #4a4a4a;
    --text-muted: #757575;
    --white: #ffffff;

    /* Clean Shadows (No app-glow) */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 2px 4px -1px rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.06);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -1px rgb(0 0 0 / 0.06);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -2px rgb(0 0 0 / 0.05);

    --transition: all 0.2s ease-in-out;
    --transition-fast: all 0.15s ease-in-out;
    --container-width: 1240px;

    /* Professional Typography for Bengali News */
    --font-heading: 'SolaimanLipi', 'Noto Sans Bengali', Arial, sans-serif;
    --font-body: 'Noto Sans Bengali', 'SolaimanLipi', Arial, sans-serif;

    /* Dense UI Borders */
    --border-radius-sm: 2px;
    --border-radius: 4px;
    --border-radius-lg: 6px;
}

/* 1. THE ULTIMATE RESET */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* 2. THE STRICT NO-OVERFLOW ZONE */
html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden !important;
    position: relative;
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--text-dark);
    background-color: #f8fafc;
    /* Slate 50 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography Enhancements */
h1,
h2,
h3,
h4,
h5,
h6,
.news-title {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.3;
}

/* Force news content to perfectly match the headline font, overriding Summernote inline styles */
.article-body,
.article-body * {
    font-family: var(--font-body) !important;
    font-size: 1.1rem;
    line-height: 1.8;
}

body.dropdown-open {
    overflow: hidden;
}

/* On desktop the burger opens a floating panel - no need to lock scroll */
@media (min-width: 769px) {
    body.dropdown-open {
        overflow: auto;
    }
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }
}

/* Header Styles */
.top-bar {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 8px 0;
    font-size: 0.85rem;
    width: 100%;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar .social-icons {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.top-bar .social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.top-bar .social-icons a.admin-login-btn {
    width: auto;
    height: auto;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    background: rgba(245, 229, 5, 0.932) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    margin-left: 10px;
    gap: 6px;
    color: black !important;
    text-decoration: none;
}

.top-bar .social-icons a.admin-login-btn:hover {
    background: var(--white) !important;
    color: var(--primary-color) !important;
    transform: translateY(-2px);
    border-color: var(--white) !important;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 15px;
    background: var(--white);
    width: 100%;
}

.logo h1 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--primary-color);
    font-weight: 900;
}

.logo span {
    color: var(--accent-color);
}

.search-bar {
    display: flex;
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 5px;
    width: 100%;
    max-width: 350px;
    box-shadow: var(--shadow-sm);
    border: 1px solid #e2e8f0;
    transition: var(--transition);
}

.search-bar:focus-within {
    box-shadow: var(--shadow-md);
    border-color: var(--accent-color);
}

.search-bar form {
    display: flex;
    width: 100%;
}

.search-bar input {
    border: none;
    background: transparent;
    padding: 10px 15px;
    width: 100%;
    outline: none;
    font-family: var(--font-body);
    font-size: 0.95rem;
}

.search-bar button {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 0 20px;
    cursor: pointer;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    font-weight: 600;
}

.search-bar button:hover {
    background: var(--accent-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

/* Desktop: Hide Mobile Elements */
.site-menu-btn {
    display: none;
}

.mobile-parent-link {
    display: none !important;
}

/* Navigation Base */
.main-nav {
    background: var(--primary-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
    width: 100%;
    border-bottom: 2px solid var(--accent-color);
}

.main-nav ul {
    display: flex;
    justify-content: flex-start;
}

/* Base Dropdown CSS for Desktop */
.main-nav ul li.dropdown {
    position: relative;
}

.main-nav ul li.dropdown>a {
    cursor: pointer;
}

.main-nav ul li.dropdown .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--primary-color);
    min-width: 220px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    z-index: 99999;
    padding: 0;
    margin: 0;
    border-radius: 0 0 4px 4px;
}

@media (min-width: 769px) {
    .main-nav ul li.dropdown:hover .dropdown-menu {
        display: block !important;
    }
}

.main-nav ul li.dropdown .dropdown-menu.show {
    display: block !important;
}

.main-nav ul li.dropdown .dropdown-menu li {
    width: 100%;
    display: block;
}

.main-nav ul li.dropdown .dropdown-menu li a {
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: block;
    width: 100%;
    white-space: nowrap;
    border-bottom-color: rgba(255, 255, 255, 0.05) !important;
}

.main-nav ul li.dropdown .dropdown-menu li a:hover {
    background: var(--accent-color);
    border-bottom-color: var(--accent-color) !important;
}

.main-nav a {
    display: block;
    color: var(--white);
    padding: 15px 20px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 18px;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
}

#nav-list a {
    font-size: 18px;
}

.main-nav a:hover,
.main-nav a.active {
    background: rgba(255, 255, 255, 0.1);
    border-bottom-color: var(--accent-color);
}

/* News Ticker */
.news-ticker {
    display: flex;
    align-items: center;
    background: var(--primary-color);
    color: var(--white);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    overflow: hidden;
    width: 100%;
}

.ticker-label {
    background: var(--accent-color);
    padding: 10px 20px;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
    z-index: 2;
    flex-shrink: 0;
}

.ticker-content {
    flex: 1;
    overflow: hidden;
    position: relative;
    height: 40px;
    min-width: 0;
}

.ticker-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    position: absolute;
    white-space: nowrap;
    animation: ticker linear infinite;
    animation-duration: 30s;
    line-height: 40px;
}

.ticker-list:hover {
    animation-play-state: paused;
}

.ticker-list li {
    padding: 0 30px;
    position: relative;
}

.ticker-list li::after {
    content: "•";
    position: absolute;
    right: 0;
    color: var(--accent-color);
}

.ticker-list li:last-child::after {
    display: none;
}

.ticker-list a {
    color: var(--white);
    transition: var(--transition);
}

.ticker-list a:hover {
    color: var(--accent-color);
}

@keyframes ticker {
    0% {
        transform: translateX(100%);
    }

    100% {
        transform: translateX(-100%);
    }
}

/* Main Layout Grid */
.main-content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-top: 30px;
    margin-bottom: 50px;
    width: 100%;
}

.hero-section,
.latest-news {
    min-width: 0;
    width: 100%;
}

.sidebar {
    min-width: 0;
    width: 100%;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    width: 100%;
}

/* Hero Section */
.hero-article {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    background: var(--white);
    width: 100%;
    transition: var(--transition);
    border: 1px solid #e2e8f0;
}

.hero-article:hover {
    box-shadow: var(--shadow-md);
}

.hero-image-wrapper {
    position: relative;
    height: 400px;
    width: 100%;
    overflow: hidden;
}

.hero-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.hero-article:hover .hero-image-wrapper img {
    transform: scale(1.05);
}

.category-tag {
    position: absolute;
    top: 20px;
    left: 20px;
    background: var(--accent-color);
    color: var(--white);
    padding: 4px 10px;
    border-radius: var(--border-radius-sm);
    font-size: 0.85rem;
    font-weight: 700;
    z-index: 10;
}

.hero-content {
    padding: 25px;
}

.hero-content h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    margin-bottom: 15px;
    line-height: 1.3;
}

.hero-content h2 a:hover {
    color: var(--accent-color);
}

.hero-content .summary {
    color: var(--text-light);
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.meta-info {
    font-size: 0.9rem;
    color: #95a5a6;
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

/* Sidebar Widgets */
.sidebar-widget {
    background: var(--white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    width: 100%;
    overflow: hidden;
}

.sidebar-widget h3 {
    font-family: var(--font-heading);
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
    position: relative;
}

.sidebar-widget h3::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: var(--accent-color);
}

.trending-list li {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--secondary-color);
}

.trending-list li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.trending-list .rank {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--secondary-color);
    margin-right: 15px;
    line-height: 1;
    -webkit-text-stroke: 1px var(--text-light);
    flex-shrink: 0;
}

.sidebar-item-content {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    min-width: 0;
}

.sidebar-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.trending-list a {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.trending-list a:hover {
    color: var(--accent-color);
}

.newsletter-form input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.newsletter-form button {
    width: 100%;
    padding: 10px;
    background: var(--accent-color);
    color: var(--white);
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
}

.newsletter-form button:hover {
    background: #c0392b;
}

/* Latest News Cards */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 10px;
    width: 100%;
    flex-wrap: wrap;
}

.section-header h3 {
    font-family: var(--font-heading);
}

.section-header .view-all {
    font-size: 0.9rem;
    color: var(--accent-color);
    font-weight: 600;
}

.news-card {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    width: 100%;
    border: 1px solid #e2e8f0;
}

.news-card:hover {
    box-shadow: var(--shadow-md);
}

.card-image {
    position: relative;
    height: 240px;
    flex-shrink: 0;
    width: 100%;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.news-card:hover .card-image img {
    transform: scale(1.05);
}

.card-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-content h4 {
    font-family: var(--font-heading);
    margin-bottom: 10px;
    font-size: 1.1rem;
    line-height: 1.4;
    overflow: hidden;
    flex-shrink: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
}

.card-content h4 a:hover {
    color: var(--accent-color);
}

.card-content .time {
    font-size: 0.8rem;
    color: #95a5a6;
    margin-bottom: auto;
}

/* =====================================================
   YUGANTER-STYLE FOOTER  (complete rewrite)
   ===================================================== */

.main-footer {
    background: #ffffff;
    color: var(--text-dark);
    padding: 0;
    margin-top: 40px;
    border-top: 1px solid #e0e0e0;
    width: 100%;
    overflow: hidden;
}

/* ── TOP BAR: logo-left / social-right ── */
.footer-top-bar {
    background: #ffffff;
    border-bottom: 1px solid #e5e5e5;
    padding: 18px 0;
}

.footer-top-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

/* Brand / Logo area */
.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.footer-logo-link {
    text-decoration: none;
    display: inline-block;
    margin-bottom: 4px;
}

.footer-logo-img {
    max-height: 56px;
    width: auto;
    display: block;
}

.footer-logo-text {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 900;
    color: var(--primary-color);
    letter-spacing: -1px;
    line-height: 1;
}

.footer-logo-text span {
    color: var(--accent-color);
}

.footer-tagline {
    font-size: 0.88rem;
    color: #555;
    margin: 0;
    font-family: var(--font-body);
}

.footer-copy-small {
    font-size: 0.78rem;
    color: #888;
    margin: 0;
    font-family: var(--font-body);
}

/* Follow us section */
.footer-follow {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.footer-follow-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #444;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: var(--font-body);
}

.footer-social-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 0.9rem;
    color: #fff !important;
    transition: transform 0.2s ease, opacity 0.2s ease;
    text-decoration: none;
    flex-shrink: 0;
}

.footer-social-icon:hover {
    transform: translateY(-3px);
    opacity: 0.85;
}

/* ── BOTTOM NAV BAR: page links ── */
.footer-nav-bar {
    background: #f5f5f5;
    padding: 10px 0;
    border-top: 1px solid #e0e0e0;
}

.footer-nav-inner {
    display: flex;
    align-items: center;
}

.footer-nav-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
}

.footer-nav-link {
    font-size: 0.88rem;
    color: #444;
    font-family: var(--font-body);
    font-weight: 500;
    padding: 4px 10px;
    text-decoration: none;
    transition: color 0.2s ease;
    white-space: nowrap;
    border-radius: 3px;
}

.footer-nav-link:hover,
.footer-nav-link:focus {
    color: var(--accent-color);
    text-decoration: none;
}

.footer-nav-sep {
    color: #bbb;
    font-size: 0.85rem;
    user-select: none;
    flex-shrink: 0;
}

/* ── Static page links separator in main navbar ── */
.static-page-nav-item:first-of-type {
    border-left: 1px solid rgba(255,255,255,0.25);
    margin-left: 5px;
    padding-left: 5px;
}

@media (min-width: 769px) {
    .static-page-nav-item:first-of-type {
        border-left-color: rgba(0,0,0,0.15);
    }
}

/* Utility classes kept for backward compat */
.footer-bottom {
    text-align: center;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding-top: 16px;
    font-size: 0.85rem;
    color: #666;
}

.read-more-btn {
    display: inline-block;
    margin-top: 15px;
    padding: 8px 16px;
    background-color: var(--secondary-color);
    color: var(--text-dark);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--transition);
    text-decoration: none;
    border: 1px solid #e0e0e0;
}

.read-more-btn:hover {
    background-color: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

/* ── Responsive footer ── */
@media (max-width: 640px) {
    .footer-top-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .footer-follow {
        align-items: flex-start;
    }

    .footer-nav-links {
        gap: 2px;
    }

    .footer-nav-link {
        font-size: 0.82rem;
        padding: 4px 6px;
    }
}

/* Login Page Styles */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 40px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.login-btn {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.3s;
}

.login-btn:hover {
    background: var(--accent-color);
}

.error-msg {
    color: red;
    text-align: center;
    margin-bottom: 15px;
}

/* =========================================
   BRAND COLORS FOR ALL SOCIAL ICONS
   ========================================= */
.social-fb {
    background-color: #1877F2 !important;
    color: #ffffff !important;
    border: none !important;
}

.social-x {
    background-color: #000000 !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.social-ig {
    background-color: #E1306C !important;
    color: #ffffff !important;
    border: none !important;
}

.social-yt {
    background-color: #FF0000 !important;
    color: #ffffff !important;
    border: none !important;
}

.social-in {
    background-color: #0077B5 !important;
    color: #ffffff !important;
    border: none !important;
}

.social-fb:hover,
.social-x:hover,
.social-ig:hover,
.social-yt:hover,
.social-in:hover {
    opacity: 0.85 !important;
    transform: translateY(-3px) !important;
}

/* =========================================
   SUMMERNOTE & ARTICLE IMAGE FIX
   ========================================= */
/* The global img { display: block; } breaks Summernote's resizing and floating. */
.note-editor img,
.article-body img {
    display: inline-block !important;
}

/* Ensure the popover doesn't get hidden behind other elements */
.note-popover {
    z-index: 10050 !important;
}

/* Fix Summernote fullscreen mode transparent background */
.note-editor.note-frame.note-frame.fullscreen {
    background-color: #ffffff !important;
    z-index: 99999 !important;
}

.note-editor.note-frame.fullscreen .note-editable {
    background-color: #ffffff !important;
}

/* =========================================
   TABLET RESPONSIVENESS (Max Width: 992px)
   ========================================= */
@media (max-width: 992px) {
    .main-content-grid {
        display: flex;
        flex-direction: column;
        gap: 30px;
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* =========================================
   MOBILE PHONE RESPONSIVENESS (Max Width: 768px)
   ========================================= */
@media (max-width: 768px) {

    .top-bar .container {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .header-content {
        flex-direction: column;
        align-items: center;
        padding-bottom: 15px;
        width: 100%;
        overflow: hidden;
    }

    .logo {
        width: 100%;
        /* margin-bottom: 15px; */
        text-align: center;
    }

    .search-bar {
        width: 100%;
        max-width: 100%;
    }

    .hero-image-wrapper {
        height: 250px;
    }

    .mobile-parent-link {
        display: block !important;
        border-bottom: 2px solid rgba(255, 255, 255, 0.1) !important;
        background: rgba(0, 0, 0, 0.1) !important;
    }

    .mobile-nav-container {
        display: flex !important;
        flex-direction: column;
        padding: 0 !important;
        width: 100%;
    }

    .site-menu-btn {
        display: block !important;
        align-self: flex-start;
        background: var(--accent-color);
        color: white;
        border: none;
        padding: 13px 20px;
        font-size: 1.2rem;
        cursor: pointer;
        border-radius: 0;
        width: 16%;
        text-align: left;
    }

    .main-nav {
        display: block !important;
        position: static !important;
        background: var(--primary-color);
        width: 100%;
    }

    /* Keep hidden until active class is applied */
    .main-nav ul#nav-list {
        display: none !important;
        flex-direction: column !important;
        width: 100%;
        margin: 0;
    }

    .main-nav.active ul#nav-list {
        display: flex !important;
    }

    .main-nav ul#nav-list li {
        width: 100% !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    }

    .main-nav a {
        text-align: left;
        padding: 12px 20px !important;
        font-size: 16px !important;
        white-space: normal !important;
        border-bottom: none !important;
        display: block !important;
    }

    /* FORCE hide the menu on mobile UNLESS the .show class is added via JS */
    .main-nav ul li.dropdown .dropdown-menu {
        display: none !important;
        position: static !important;
        box-shadow: none !important;
        background: rgba(0, 0, 0, 0.1) !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    .main-nav ul li.dropdown .dropdown-menu.show {
        display: block !important;
    }

    .main-nav ul li.dropdown .dropdown-menu li a {
        padding-left: 40px !important;
    }

    .main-content-grid {
        display: flex;
        flex-direction: column;
        gap: 20px;
        width: 100%;
        margin-top: 20px;
    }

    .news-grid {
        display: flex;
        flex-direction: column;
        gap: 15px;
        width: 100%;
    }

    .sidebar-widget {
        width: 100%;
        padding: 15px;
        box-sizing: border-box;
    }

    /* ---------------------------------------------------
       ADMIN DASHBOARD & LOGIN MOBILE FIXES 
       --------------------------------------------------- */

    .login-container {
        margin: 40px 15px;
        padding: 20px;
        width: auto;
    }

    /* THE CRITICAL FLEXBOX OVERRIDE FOR ADMIN CONTAINER */
    .dashboard-container {
        display: flex;
        flex-direction: column;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        /* Forces Flexbox to shrink to phone size */
    }

    .sidebar-admin {
        width: 100%;
        min-height: auto;
        border-right: none;
        border-bottom: 2px solid var(--secondary-color);
    }

    /* LOCKING DOWN THE MAIN ADMIN AREA */
    .main-admin {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        /* Forces Flexbox to shrink to phone size */
        padding: 15px;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    /* Forcing all inner cards to shrink */
    .settings-container,
    .form-card,
    .admin-header {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        /* Prevents inside contents from pushing out */
        padding: 15px;
        box-sizing: border-box;
        overflow: hidden;
    }

    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    /* TABLE FIX: Force tables to scroll sideways if they are too wide */
    .news-table,
    table {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .news-table th,
    .news-table td {
        white-space: nowrap;
        /* Stops table cells from getting too skinny */
    }

    /* Ensure forms stay inside the screen */
    .form-group {
        width: 100%;
        max-width: 100%;
    }

    .form-group input,
    .form-group select,
    .form-group textarea,
    input[type="text"],
    input[type="file"],
    .form-control {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        /* Crucial for inputs on mobile */
    }
}

/* =========================================
   EXTRA SMALL PHONES (Max Width: 480px)
   ========================================= */
@media (max-width: 480px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .hero-content h2 {
        font-size: 1.5rem;
    }

    .top-bar .social-icons {
        justify-content: center;
    }
}

/* =========================================
   Category Layout: Big and Small News Card Style
   ========================================= */
.all-categories-news {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    width: 100%;
}

.category-news-block {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

.featured-news-card {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
}

.featured-news-card:hover {
    box-shadow: var(--shadow-md);
}

.featured-news-card .card-image {
    height: 220px;
    position: relative;
    overflow: hidden;
}

.featured-news-card .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.featured-news-card:hover .card-image img {
    transform: scale(1.05);
}

.featured-news-card .card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.featured-news-card .card-content h4 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    line-height: 1.3;
    margin-bottom: 12px;
    font-weight: 700;
}

.featured-news-card .card-content .summary {
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.5;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.featured-news-card .card-content .time {
    font-size: 0.8rem;
    color: #95a5a6;
    margin-top: auto;
}

.sub-news-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sub-news-item {
    display: flex;
    gap: 15px;
    background: transparent;
    border-radius: 0;
    padding: 0 0 12px 0;
    box-shadow: none;
    border: none;
    border-bottom: 1px dashed #e2e8f0;
    transition: var(--transition);
    align-items: center;
}

.sub-news-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.sub-news-item:hover {
    box-shadow: none;
}

.sub-news-item .sub-image-wrapper {
    width: 100px;
    height: 75px;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}

.sub-news-item .sub-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.sub-news-item:hover .sub-image-wrapper img {
    transform: scale(1.05);
}

.sub-news-item .sub-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
    min-width: 0;
}

.sub-news-item .sub-content h5 {
    font-family: var(--font-heading);
    font-size: 1rem;
    line-height: 1.4;
    margin-bottom: 8px;
    font-weight: 700;
    color: var(--primary-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sub-news-item .sub-content h5 a:hover {
    color: var(--accent-color);
}

.sub-news-item .sub-content .time {
    font-size: 0.8rem;
    color: #95a5a6;
}

@media (max-width: 992px) {
    .all-categories-news {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .featured-news-card .card-image {
        height: 180px;
    }
    
    .featured-news-card .card-content h4 {
        font-size: 1.15rem;
    }
    
    .sub-news-item .sub-image-wrapper {
        width: 80px;
        height: 65px;
    }
    
    .sub-news-item .sub-content h5 {
        font-size: 0.9rem;
    }

    .list-img-wrapper {
        width: 90px;
        height: 70px;
    }
}

/* =====================================================================
   PREMIUM NEWS PORTAL OVERHAUL (3-COLUMN TOP & VARIED CATEGORIES)
   ===================================================================== */

/* 1. Homepage Top 3-Column Layout */
.top-stories-layout {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 25px;
    margin-top: 25px;
    margin-bottom: 40px;
    width: 100%;
}

.lead-story-col {
    min-width: 0;
}

.lead-article {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid #e2e8f0;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.lead-article:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.lead-image-wrapper {
    position: relative;
    height: 380px;
    overflow: hidden;
    background-color: #f1f5f9;
}

.lead-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.lead-article:hover .lead-image-wrapper img {
    transform: scale(1.03);
}

.lead-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.lead-content h2 {
    font-size: 1.85rem;
    margin-bottom: 12px;
    font-weight: 800;
    line-height: 1.3;
}

.lead-content h2 a {
    color: var(--primary-color);
}

.lead-content h2 a:hover {
    color: var(--accent-color);
}

.lead-content .summary {
    color: var(--text-light);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

.lead-content .meta-info {
    margin-top: auto;
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    gap: 15px;
}

.lead-content .meta-info i {
    color: var(--accent-color);
}

/* 2. Middle Column: Secondary Stories */
.secondary-stories-col {
    border-right: 1px solid #e2e8f0;
    padding-right: 20px;
    min-width: 0;
}

.section-title-accent {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
}

.section-title-accent::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 50px;
    height: 2px;
    background: var(--accent-color);
}

.secondary-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.secondary-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f1f5f9;
}

.secondary-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.secondary-img-wrapper {
    position: relative;
    height: 120px;
    border-radius: var(--border-radius);
    overflow: hidden;
    background-color: #f1f5f9;
}

.secondary-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.secondary-item:hover .secondary-img-wrapper img {
    transform: scale(1.05);
}

.category-tag-mini {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--accent-color);
    color: var(--white);
    padding: 2px 6px;
    border-radius: var(--border-radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 5;
}

.secondary-content h4 {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.secondary-content h4 a {
    color: var(--text-dark);
    transition: color 0.2s ease;
}

.secondary-content h4 a:hover {
    color: var(--accent-color);
}

.secondary-content .time {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
    display: inline-block;
}

/* 3. Right Column: Sidebar Override */
.sidebar-col {
    min-width: 0;
}

.sidebar-col .sidebar-widget {
    background: var(--white);
    padding: 20px;
    border-radius: var(--border-radius-lg);
    border: 1px solid #e2e8f0;
    box-shadow: var(--shadow-sm);
    margin-bottom: 25px;
}

.sidebar-col .sidebar-widget h3 {
    font-size: 1.25rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 8px;
    margin-bottom: 15px;
    position: relative;
}

.sidebar-col .sidebar-widget h3::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--accent-color);
}

/* 4. Full Width Category Layouts */
.all-categories-news {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    width: 100%;
}

.latest-news-section {
    min-width: 0;
    width: 100%;
    background: var(--white);
    padding: 24px;
    border-radius: var(--border-radius-lg);
    border: 1px solid #e2e8f0;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.latest-news-section .section-header {
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.latest-news-section .section-header h3 {
    font-size: 1.35rem;
    color: var(--primary-color);
    font-weight: 800;
    position: relative;
}

.latest-news-section .section-header h3::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 0;
    width: 60px;
    height: 2px;
    background: var(--accent-color);
}

.latest-news-section .section-header .view-all {
    color: var(--accent-color);
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.latest-news-section .section-header .view-all:hover {
    color: var(--accent-hover);
    transform: translateX(3px);
}

/* Style B: 3-Column Grid Block */
.category-grid-block {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    width: 100%;
}

.grid-news-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.grid-card-image {
    position: relative;
    height: 120px;
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 10px;
    background-color: #f1f5f9;
}

.grid-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.grid-news-card:hover .grid-card-image img {
    transform: scale(1.05);
}

.grid-card-content h4 {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.grid-card-content h4 a {
    color: var(--text-dark);
}

.grid-card-content h4 a:hover {
    color: var(--accent-color);
}

.grid-card-content .time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Style C: Thumbnail List Block */
.category-list-block {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.list-news-item {
    display: flex;
    gap: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #e2e8f0;
}

.list-news-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.list-img-wrapper {
    width: 120px;
    height: 90px;
    border-radius: var(--border-radius);
    overflow: hidden;
    flex-shrink: 0;
    background-color: #f1f5f9;
}

.list-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.list-news-item:hover .list-img-wrapper img {
    transform: scale(1.05);
}

.list-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
    min-width: 0;
}

.list-content h4 {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.list-content h4 a {
    color: var(--text-dark);
}

.list-content h4 a:hover {
    color: var(--accent-color);
}

.list-content .summary {
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 6px;
}

.list-content .time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* 5. Overhauling Layout Responsiveness */
@media (max-width: 992px) {
    .top-stories-layout {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .secondary-stories-col {
        border-right: none;
        padding-right: 0;
        border-bottom: 1px solid #e2e8f0;
        padding-bottom: 25px;
    }

    /* Show secondary stories as a horizontal row on tablet */
    .secondary-list {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }

    .secondary-item {
        border-bottom: none;
        padding-bottom: 0;
    }
    
    .lead-image-wrapper {
        height: 340px;
    }

    .all-categories-news {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .top-stories-layout {
        gap: 16px;
        margin-top: 16px;
        margin-bottom: 24px;
    }
    
    .lead-image-wrapper {
        height: 220px;
    }
    
    .lead-content {
        padding: 14px;
    }
    
    .lead-content h2 {
        font-size: 1.3rem;
        margin-bottom: 8px;
    }

    .lead-content .summary {
        font-size: 0.9rem;
        margin-bottom: 12px;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    /* Secondary stories: 2 columns on phone */
    .secondary-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .secondary-item {
        border-bottom: none;
        padding-bottom: 0;
    }

    .secondary-img-wrapper {
        height: 100px;
    }

    .section-title-accent {
        font-size: 1.1rem;
    }
    
    .category-grid-block {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .grid-card-image {
        height: 120px;
    }

    .grid-card-content h4 {
        font-size: 0.85rem;
    }
    
    .latest-news-section {
        padding: 14px;
    }

    .latest-news-section .section-header h3 {
        font-size: 1.1rem;
    }

    .all-categories-news {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Sidebar col on mobile: horizontal list */
    .sidebar-col .trending-list li {
        margin-bottom: 10px;
        padding-bottom: 10px;
    }

    .sidebar-thumbnail {
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 480px) {
    .top-stories-layout {
        gap: 12px;
        margin-top: 12px;
    }

    .lead-image-wrapper {
        height: 200px;
    }

    .lead-content h2 {
        font-size: 1.15rem;
    }

    /* Single column secondary on tiny phones */
    .secondary-list {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .secondary-item {
        display: flex;
        flex-direction: row;
        gap: 10px;
        align-items: flex-start;
        border-bottom: 1px solid #f1f5f9;
        padding-bottom: 10px;
    }

    .secondary-item:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    .secondary-img-wrapper {
        width: 90px;
        height: 70px;
        flex-shrink: 0;
    }

    .secondary-content {
        flex: 1;
        min-width: 0;
    }

    .category-grid-block {
        grid-template-columns: 1fr;
    }

    .grid-card-image {
        height: 160px;
    }

    .list-img-wrapper {
        width: 80px;
        height: 65px;
    }
}

/* =====================================================================
   ARTICLE PAGE - MOBILE OVERRIDES
   (Overrides inline styles on article.php with !important)
   ===================================================================== */

/* Give the main content area some top breathing room */
main.container {
    padding-top: 20px;
    padding-bottom: 40px;
}

@media (max-width: 768px) {
    main.container {
        padding-top: 12px;
        padding-bottom: 24px;
    }

    /* Article body padding override */
    article.hero-section {
        padding: 20px !important;
    }

    /* Article h1 title */
    article.hero-section h1 {
        font-size: 1.5rem !important;
        margin: 10px 0 15px !important;
        line-height: 1.35 !important;
    }

    /* Author/share row: stack on mobile */
    .author-share-block {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
    }

    .share-options {
        gap: 10px !important;
        flex-wrap: wrap !important;
    }

    /* Font size control buttons */
    .font-size-controls {
        margin-left: 0 !important;
    }

    /* Breadcrumbs */
    .breadcrumbs {
        font-size: 0.82rem !important;
        word-break: break-word;
    }
}

@media (max-width: 480px) {
    article.hero-section {
        padding: 14px !important;
    }

    article.hero-section h1 {
        font-size: 1.25rem !important;
    }

    .meta-info {
        gap: 8px !important;
        font-size: 0.82rem !important;
    }
}

/* =====================================================================
   FOOTER - MOBILE FIXES
   ===================================================================== */
@media (max-width: 768px) {
    .main-footer {
        padding: 40px 0 16px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .footer-col h3 {
        font-size: 1.4rem;
    }

    .footer-col .social-icons {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }
}

/* =====================================================================
   GENERAL MOBILE POLISH
   ===================================================================== */

/* Main content top margin */
@media (max-width: 768px) {
    .main-content-grid {
        margin-top: 16px;
        margin-bottom: 30px;
    }

    /* Section headers */
    .section-header {
        margin-bottom: 14px;
    }

    /* Sidebar on mobile: always full width */
    .sidebar {
        width: 100%;
    }
}

/* Responsive padding overrides for content/static pages on mobile */
@media (max-width: 768px) {
    .hero-section,
    .contact-container,
    .content-container {
        padding: 20px !important;
    }
}
@media (max-width: 480px) {
    .hero-section,
    .contact-container,
    .content-container {
        padding: 15px !important;
    }
}
