/* ==========================================================================
   Hasakah Media Network - Modern UI, Glassmorphism & Smart Dark Mode Master CSS
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Noto+Kufi+Arabic:wght@100..900&display=swap');

:root {
    /* Main Font Family */
    --hmn-font-arabic: 'Noto Kufi Arabic', system-ui, -apple-system, sans-serif;
    
    /* Light Theme Color Palette */
    --hmn-bg-body: #f4f6fa;
    --hmn-bg-surface: #ffffff;
    --hmn-bg-card: #ffffff;
    --hmn-bg-header: #102f53;
    --hmn-bg-header-top: #0a223f;
    --hmn-bg-navbar: #173b66;
    --hmn-text-main: #0f172a;
    --hmn-text-muted: #64748b;
    --hmn-text-light: #94a3b8;
    --hmn-border: #e2e8f0;
    --hmn-border-subtle: #f1f5f9;
    
    /* Brand Accent Colors */
    --hmn-primary: #102f53;
    --hmn-primary-light: #1e4976;
    --hmn-secondary: #f97316;
    --hmn-accent-red: #e12729;
    --hmn-accent-gold: #d97706;
    --hmn-accent-green: #10b981;
    --hmn-accent-purple: #6366f1;
    --hmn-accent-cyan: #06b6d4;
    
    /* Glassmorphism & Shadows */
    --hmn-glass-bg: rgba(255, 255, 255, 0.85);
    --hmn-glass-card: rgba(255, 255, 255, 0.9);
    --hmn-glass-border: rgba(255, 255, 255, 0.3);
    --hmn-shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04);
    --hmn-shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
    --hmn-shadow-lg: 0 16px 36px rgba(15, 23, 42, 0.12);
    --hmn-shadow-glow: 0 0 20px rgba(249, 115, 22, 0.25);
    
    /* Border Radius */
    --hmn-radius-sm: 8px;
    --hmn-radius-md: 14px;
    --hmn-radius-lg: 20px;
    --hmn-radius-full: 9999px;
    
    /* Transitions */
    --hmn-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Smart Dark Mode Color Overrides */
[data-theme="dark"], body.dark-mode, body.dark-theme {
    --hmn-bg-body: #070d19;
    --hmn-bg-surface: #0f172a;
    --hmn-bg-card: #131e32;
    --hmn-bg-header: #0b1324;
    --hmn-bg-header-top: #060b16;
    --hmn-bg-navbar: #0f1b33;
    --hmn-text-main: #f8fafc;
    --hmn-text-muted: #94a3b8;
    --hmn-text-light: #64748b;
    --hmn-border: #1e293b;
    --hmn-border-subtle: #1e293b;
    
    --hmn-glass-bg: rgba(15, 23, 42, 0.85);
    --hmn-glass-card: rgba(19, 30, 50, 0.85);
    --hmn-glass-border: rgba(255, 255, 255, 0.08);
    --hmn-shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.3);
    --hmn-shadow-md: 0 8px 28px rgba(0, 0, 0, 0.45);
    --hmn-shadow-lg: 0 16px 45px rgba(0, 0, 0, 0.6);
    --hmn-shadow-glow: 0 0 25px rgba(249, 115, 22, 0.35);
}

/* --------------------------------------------------------------------------
   1. Base & Universal Typography
   -------------------------------------------------------------------------- */
html, body {
    direction: rtl;
    text-align: right;
    font-family: var(--hmn-font-arabic) !important;
    background-color: var(--hmn-bg-body) !important;
    color: var(--hmn-text-main) !important;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
.title, .entry-title {
    font-family: var(--hmn-font-arabic) !important;
    font-weight: 800 !important;
    color: var(--hmn-text-main);
    line-height: 1.45;
}

p, span, a, button, input, textarea, select {
    font-family: var(--hmn-font-arabic) !important;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--hmn-transition);
}

a:hover {
    color: var(--hmn-secondary);
}

/* Smooth Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--hmn-bg-body);
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 99px;
}
[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #334155;
}

/* --------------------------------------------------------------------------
   2. Header, Navigation & Mobile Offcanvas Drawer
   -------------------------------------------------------------------------- */
.header-custom-bg, .navbar-container {
    background: linear-gradient(135deg, var(--hmn-bg-header-top) 0%, var(--hmn-bg-header) 100%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transition: var(--hmn-transition);
}

.sticky-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    background: rgba(16, 47, 83, 0.92) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .sticky-header {
    background: rgba(11, 19, 36, 0.92) !important;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.4);
}

.header-search-input {
    background-color: rgba(255, 255, 255, 0.12) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    border-radius: var(--hmn-radius-md) !important;
    height: 46px;
    color: #ffffff !important;
    padding-right: 48px !important;
    font-size: 14px;
    backdrop-filter: blur(8px);
    transition: var(--hmn-transition);
}

.header-search-input:focus {
    background-color: rgba(255, 255, 255, 0.22) !important;
    border-color: var(--hmn-secondary) !important;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.25) !important;
}

.header-search-input::placeholder {
    color: rgba(255, 255, 255, 0.65) !important;
}

/* Nav Links Styling */
.nav-link-custom {
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 15px;
    font-weight: 700;
    padding: 12px 18px !important;
    border-radius: var(--hmn-radius-sm);
    transition: var(--hmn-transition);
}

.nav-link-custom:hover, .nav-link-active {
    color: #ffffff !important;
    background-color: rgba(249, 115, 22, 0.18) !important;
    border-bottom: 2px solid var(--hmn-secondary) !important;
}

/* Live Stream Button */
.btn-live {
    background: linear-gradient(135deg, #e12729 0%, #b91c1c 100%) !important;
    color: #ffffff !important;
    font-weight: 800;
    font-size: 13px;
    padding: 8px 16px;
    border-radius: var(--hmn-radius-full);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(225, 39, 41, 0.35);
    transition: var(--hmn-transition);
}

.btn-live:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(225, 39, 41, 0.5);
    color: #ffffff !important;
}

.btn-live .live-dot {
    width: 8px;
    height: 8px;
    background-color: #ffffff;
    border-radius: 50%;
    animation: hmnPulseDot 1.2s infinite ease-in-out;
}

/* Mobile Offcanvas Navigation Drawer */
.hmn-mobile-drawer {
    position: fixed;
    top: 0;
    right: -320px;
    width: 310px;
    height: 100vh;
    background-color: var(--hmn-bg-surface);
    z-index: 9999;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.25);
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.hmn-mobile-drawer.active {
    right: 0;
}

.hmn-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: var(--hmn-transition);
}

.hmn-drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

.hmn-drawer-header {
    padding: 20px;
    background: var(--hmn-primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hmn-drawer-header img {
    height: 48px;
    object-fit: contain;
}

.hmn-drawer-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #ffffff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
}

.hmn-drawer-body {
    padding: 20px;
    flex-grow: 1;
}

.hmn-drawer-menu {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
}

.hmn-drawer-menu li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    font-size: 15px;
    font-weight: 700;
    color: var(--hmn-text-main);
    border-bottom: 1px solid var(--hmn-border);
    border-radius: var(--hmn-radius-sm);
}

.hmn-drawer-menu li a:hover {
    background-color: rgba(249, 115, 22, 0.1);
    color: var(--hmn-secondary);
}

/* --------------------------------------------------------------------------
   3. Smart Dark Mode Switch Button & Visuals
   -------------------------------------------------------------------------- */
.dark-light-toggle, .hmn-theme-switch {
    background: rgba(255, 255, 255, 0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: var(--hmn-radius-full) !important;
    padding: 6px 14px !important;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #ffffff !important;
    font-size: 13px;
    font-weight: 700;
    backdrop-filter: blur(6px);
    transition: var(--hmn-transition);
}

.dark-light-toggle:hover, .hmn-theme-switch:hover {
    background: rgba(255, 255, 255, 0.28) !important;
    transform: scale(1.05);
}

.hmn-theme-icon {
    display: inline-block;
    font-size: 16px;
    transition: transform 0.4s ease;
}

[data-theme="dark"] .hmn-theme-icon {
    transform: rotate(360deg);
}

/* --------------------------------------------------------------------------
   4. Editorial Badges (الشارات التحريرية)
   -------------------------------------------------------------------------- */
.hmn-badge, .badge-tag, .tag-badge, .post-badge, .tags a {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 5px 14px !important;
    border-radius: var(--hmn-radius-full) !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    letter-spacing: 0 !important;
    line-height: 1.2 !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
    transition: var(--hmn-transition);
}

/* 1. عاجل - Urgent / Breaking News Badge */
.badge-breaking, .badge-urgent, .tag-urgent, [data-badge="urgent"], .bg-danger-tag {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4) !important;
}

.badge-breaking::before, .badge-urgent::before {
    content: '';
    width: 7px;
    height: 7px;
    background-color: #ffffff;
    border-radius: 50%;
    animation: hmnPulseDot 1.2s infinite ease-in-out;
}

/* 2. حصري - Exclusive Badge */
.badge-exclusive, .tag-exclusive, [data-badge="exclusive"] {
    background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35) !important;
}

/* 3. مباشر - Live Badge */
.badge-live, .tag-live, [data-badge="live"] {
    background: linear-gradient(135deg, #10b981 0%, #047857 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35) !important;
}

.badge-live::before {
    content: '';
    width: 7px;
    height: 7px;
    background-color: #ffffff;
    border-radius: 50%;
    animation: hmnPulseDot 1.2s infinite ease-in-out;
}

/* 4. مقال رأي - Opinion Badge */
.badge-opinion, .tag-opinion, [data-badge="opinion"] {
    background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35) !important;
}

/* 5. تغطية خاصة / ملف خاص */
.badge-special, .tag-special, [data-badge="special"] {
    background: linear-gradient(135deg, #06b6d4 0%, #0e7490 100%) !important;
    color: #ffffff !important;
}

@keyframes hmnPulseDot {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(1.5); }
    100% { opacity: 1; transform: scale(1); }
}

/* --------------------------------------------------------------------------
   5. News Cards (البطاقات الإخبارية) & Glassmorphism
   -------------------------------------------------------------------------- */
.hmn-post-card,
.tc-post-grid-default .item,
.tc-post-list-style2 .item,
.tc-post-overlay-style8 .item,
.hmn-single-paper,
.hmn-archive-wrap .hmn-post-card {
    background-color: var(--hmn-bg-card) !important;
    border: 1px solid var(--hmn-border) !important;
    border-radius: var(--hmn-radius-md) !important;
    box-shadow: var(--hmn-shadow-sm);
    transition: var(--hmn-transition);
    overflow: hidden;
}

.hmn-post-card:hover,
.tc-post-grid-default .item:hover,
.tc-post-list-style2 .item:hover {
    box-shadow: var(--hmn-shadow-md);
    border-color: rgba(249, 115, 22, 0.35) !important;
    transform: translateY(-4px);
}

.hmn-card-img,
.tc-post-grid-default .img,
.tc-post-overlay-style8 .img {
    position: relative;
    overflow: hidden;
    border-radius: var(--hmn-radius-md);
    background-color: #1e293b;
}

.hmn-card-img img,
.tc-post-grid-default .img img,
.tc-post-overlay-style8 .img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease-out;
}

.hmn-post-card:hover img,
.tc-post-grid-default .item:hover .img img,
.tc-post-overlay-style8 .item:hover .img img {
    transform: scale(1.06);
}

/* Card Titles & Excerpts */
.hmn-post-card h2, .hmn-post-card h3, .hmn-post-card h4, .hmn-post-card h5,
.tc-post-grid-default .item .content h4.title,
.tc-post-list-style2 .items .item .content h5.title {
    color: var(--hmn-text-main) !important;
    font-weight: 800 !important;
    font-size: 17px;
    line-height: 1.6;
    margin-bottom: 10px;
    transition: var(--hmn-transition);
}

.hmn-post-card:hover h2,
.hmn-post-card:hover h3,
.hmn-post-card:hover h4,
.tc-post-grid-default .item:hover .content h4.title {
    color: var(--hmn-secondary) !important;
}

.hmn-post-card p, .tc-post-grid-default .item .content p {
    color: var(--hmn-text-muted) !important;
    font-size: 13.5px;
    line-height: 1.8;
}

.hmn-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12.5px;
    color: var(--hmn-text-light);
    font-weight: 700;
    margin-top: 12px;
}

/* --------------------------------------------------------------------------
   6. Trending News Bar & Tag Cloud
   -------------------------------------------------------------------------- */
.hmn-tags-bar, .tc-breaking-news-style8, .trending-tags-wrapper {
    background-color: var(--hmn-bg-surface) !important;
    border: 1px solid var(--hmn-border) !important;
    border-radius: var(--hmn-radius-md) !important;
    padding: 10px 16px;
    box-shadow: var(--hmn-shadow-sm);
    margin-bottom: 20px;
}

.hmn-tags-bar a, .trending-tags-wrapper a {
    background-color: var(--hmn-bg-body) !important;
    color: var(--hmn-text-main) !important;
    border: 1px solid var(--hmn-border) !important;
    padding: 6px 14px !important;
    border-radius: var(--hmn-radius-full) !important;
    font-size: 12.5px !important;
    font-weight: 700 !important;
    transition: var(--hmn-transition);
}

.hmn-tags-bar a:hover, .trending-tags-wrapper a:hover {
    background-color: var(--hmn-secondary) !important;
    color: #ffffff !important;
    border-color: var(--hmn-secondary) !important;
    transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   7. Section Titles & Widgets
   -------------------------------------------------------------------------- */
.section-title-style8, .tc-widget-title {
    border-right: 4px solid var(--hmn-secondary);
    padding-right: 14px;
    margin-bottom: 22px;
}

.section-title-style8 h3, .tc-widget-title {
    font-size: 22px !important;
    font-weight: 900 !important;
    color: var(--hmn-text-main) !important;
}

/* --------------------------------------------------------------------------
   8. Full Responsiveness (100% Mobile, Tablet & Desktop)
   -------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
    .hmn-mobile-toggle {
        display: inline-flex !important;
    }
    
    .navbar-nav {
        display: none !important;
    }
    
    .hmn-tags-bar, .trending-tags-wrapper {
        overflow-x: auto;
        white-space: nowrap;
        display: flex;
        gap: 8px;
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch;
    }
    
    .hmn-tags-bar::-webkit-scrollbar {
        display: none;
    }
    
    .hmn-post-grid, .grid-3-col {
        grid-template-columns: repeat(1, 1fr) !important;
    }
    
    .hmn-single-head h1 {
        font-size: 26px !important;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .hmn-post-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (min-width: 992px) {
    .hmn-mobile-toggle {
        display: none !important;
    }
}
