/* =============================================================
   SAMAJER NEWS — LIGHT / DARK THEME
   Light is the default (no attribute needed).
   Dark activates via <html data-theme="dark">
   Higher-specificity selectors so they always win.
   ============================================================= */

/* ── Base variables (homepage.css uses its own set) ─────────── */
html[data-theme="dark"]{
  --bg:#131318; --bg-white:#181820; --bg-soft:#202028;
  --text:#e6e6ee; --text-muted:#a9a9b6; --text-light:#8f8fa0;
  --nav-bg:#181820; --nav-text:#e6e6ee;
  --border:#2b2b36; --shadow-sm:0 1px 2px rgba(0,0,0,.4);
  --shadow-md:0 4px 12px rgba(0,0,0,.5); --shadow-lg:0 12px 34px rgba(0,0,0,.6);
  color-scheme:dark;
}

/* homepage.css :root overrides */
html[data-theme="dark"]{
  --acc:#e64c3f; --acc2:#c0392b; --txt:#e6e6ee; --txt2:#a9a9b6;
  --bdr:#2b2b36; --wht:#1a1a22; --bg:#121217; --shd:0 4px 14px rgba(0,0,0,.5);
}

/* ── Global surfaces ────────────────────────────────────────── */
html[data-theme="dark"] body.site-front{
  background:var(--bg); color:var(--text);
}
html[data-theme="dark"] body,
html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select,
html[data-theme="dark"] button{color:var(--text)}
html[data-theme="dark"] ::placeholder{color:#77778a}
html[data-theme="dark"] a{color:var(--acc);}
html[data-theme="dark"] h1,html[data-theme="dark"] h2,html[data-theme="dark"] h3,
html[data-theme="dark"] h4,html[data-theme="dark"] h5{color:var(--text)}
html[data-theme="dark"] .container{color:var(--text)}

/* ── HEADER (inline styles in header.ejs, hardcoded light) ──── */
html[data-theme="dark"] .main-header{background:#181820}
html[data-theme="dark"] .header-news-tile{border-left-color:#292934}
html[data-theme="dark"] .header-tile-title{color:#e6e6ee}
html[data-theme="dark"] .header-tile-img{background:#23232c}
html[data-theme="dark"] .main-nav{background:rgba(22,22,29,.94);border-bottom-color:#2b2b36}
html[data-theme="dark"] .nav-list li a{color:#e2e2ea}
html[data-theme="dark"] .nav-list li a.active{color:#ff6a5c;background:linear-gradient(0deg,rgba(230,76,63,.16),rgba(230,76,63,0))}
html[data-theme="dark"] .nav-search-btn{background:#22222b;border-color:#33333f;color:#d5d5de}
html[data-theme="dark"] .nav-search-btn:hover{background:#26262f;color:#ff6a5c}
html[data-theme="dark"] .nav-search-btn i{color:#9a9aa8}
html[data-theme="dark"] .nav-search-box{background:#1a1a22;border-color:#2b2b36}
html[data-theme="dark"] .nav-search-box form{background:#22222b;border-color:#33333f}
html[data-theme="dark"] .nav-search-box input{color:#e6e6ee}
html[data-theme="dark"] .search-suggestions{background:#1a1a22;border-color:#2b2b36}
html[data-theme="dark"] .suggestion-item{color:#d9d9e2;border-bottom-color:#26262f}
html[data-theme="dark"] .suggestion-item:hover{background:#24242d}
html[data-theme="dark"] .lang-switcher{background:#22222b;border-color:#33333f}
html[data-theme="dark"] .lang-btn{color:#9a9aa8}
html[data-theme="dark"] .nav-login-btn{background:#1a1a22;border-color:#33333f;color:#d5d5de}
html[data-theme="dark"] .nav-login-btn:hover{background:#24242d}
html[data-theme="dark"] .nav-user-name{color:#e6e6ee}
html[data-theme="dark"] .nav-list{background:#181820;border-top-color:#2b2b36}
html[data-theme="dark"] .nav-list li a{border-bottom-color:#26262f;color:#e6e6ee}
html[data-theme="dark"] .newsletter-bar{background:linear-gradient(100deg,#1c1c25,#241c1b);border-color:#43282a}
html[data-theme="dark"] .newsletter-text strong{color:#ececf3}
html[data-theme="dark"] .newsletter-form input{background:#16161d;border-color:#35353f;color:#e6e6ee}

/* site drawer */
html[data-theme="dark"] .site-drawer{background:#181820;color:var(--text)}
html[data-theme="dark"] .drawer-nav a{color:#cfcfd9}
html[data-theme="dark"] .drawer-divider{color:#8f8fa0;border-color:#2b2b36}
html[data-theme="dark"] .drawer-search input{background:#22222b;border-color:#33333f;color:#e6e6ee}

/* ── FOOTER (inline styles in footer.ejs) ───────────────────── */
html[data-theme="dark"] .main-footer{background:#15151b}
html[data-theme="dark"] .main-footer .footer-groups .fg,
html[data-theme="dark"] .main-footer .footer-groups .fg.f-cell{background:linear-gradient(170deg,#1c1c25,#191920);border-color:#2b2b36;color:#cfcfd9}
html[data-theme="dark"] .main-footer .footer-col h4{color:#ececf3}
html[data-theme="dark"] .main-footer .footer-groups ul a{color:#a9a9b6}
html[data-theme="dark"] .main-footer .footer-groups ul a:hover{color:#ff6a5c}
html[data-theme="dark"] .main-footer .footer-groups .cs-item{color:#a9a9b6;border-right-color:#2b2b36}
html[data-theme="dark"] .main-footer .footer-about p{color:#a9a9b6}
html[data-theme="dark"] .main-footer .footer-bottom{background:linear-gradient(90deg,#16161c,#1b1b22);border-top-color:#2b2b36}
html[data-theme="dark"] .main-footer .fc-head{color:#e6e6ee}
html[data-theme="dark"] .main-footer .fc-body{color:#9a9aa8}
html[data-theme="dark"] .main-footer .footer-bottom-links a{background:#1d1d25;border-color:#33333f;color:#c9c9d3}
html[data-theme="dark"] .main-footer .footer-bottom-links a:hover{background:#c0392b;border-color:#c0392b;color:#fff}
html[data-theme="dark"] .main-footer .footer-version{background:#1d1d25;border-color:#33333f;color:#8f8fa0}
html[data-theme="dark"] .main-footer .footer-social a{background:#22222b;color:#cfcfd9}

/* ── Front content (homepage / article / category, var-driven) ─ */
html[data-theme="dark"] .ph-sec,
html[data-theme="dark"] .news-section,
html[data-theme="dark"] .widget,
html[data-theme="dark"] .card,
html[data-theme="dark"] .content-box,
html[data-theme="dark"] .cat-section,
html[data-theme="dark"] .hero-side{background:var(--wht);border-color:var(--bdr)}
html[data-theme="dark"] .ph-tab{background:#22222b;color:#c9c9d3}
html[data-theme="dark"] .ph-tab.active{background:var(--acc2);color:#fff}
html[data-theme="dark"] .ph-caption{background:#1d1d25}
html[data-theme="dark"] .widget-title,
html[data-theme="dark"] .section-title,
html[data-theme="dark"] .cat-section .section-title{color:var(--txt)}
html[data-theme="dark"] .article-main{background:var(--wht);border-color:var(--bdr)}
html[data-theme="dark"] .article-title{color:var(--txt)}
html[data-theme="dark"] .article-meta,
html[data-theme="dark"] .article-content,
html[data-theme="dark"] .article-content p{color:#d5d5de}
html[data-theme="dark"] .sidebar .widget,
html[data-theme="dark"] .content-layout .sidebar{background:var(--wht);border-color:var(--bdr)}
html[data-theme="dark"] .breadcrumb,
html[data-theme="dark"] .pagination .page-btn{background:#22222b;border-color:#33333f;color:#c9c9d3}
html[data-theme="dark"] .pagination .page-btn a{color:#c9c9d3}

/* generic cards used across templates */
html[data-theme="dark"] .news-card,
html[data-theme="dark"] .news-card-body,
html[data-theme="dark"] .side-story,
html[data-theme="dark"] .post-card,
html[data-theme="dark"] .list-item,
html[data-theme="dark"] .box,
html[data-theme="dark"] .panel-item{background:var(--wht);border-color:var(--bdr)}
html[data-theme="dark"] .news-card-title a,
html[data-theme="dark"] .side-story a,
html[data-theme="dark"] .card-title,
html[data-theme="dark"] .post-card h3 a{color:var(--txt)}
html[data-theme="dark"] .news-card-title a:hover,
html[data-theme="dark"] .side-story a:hover,
html[data-theme="dark"] .card-title:hover{color:var(--acc2)}

html[data-theme="dark"] .image-placeholder,
html[data-theme="dark"] .thumb-placeholder,
html[data-theme="dark"] .ph-img,
html[data-theme="dark"] .section-img-ph{background:#24242d}

/* search / forms on front */
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="search"],
html[data-theme="dark"] textarea,
html[data-theme="dark"] select{background:#1d1d25;border-color:#33333f;color:#e6e6ee}

/* occasion/eid banner (pale gradients) */
html[data-theme="dark"] .eid-banner,
html[data-theme="dark"] .occasion-banner{background:linear-gradient(90deg,#23203a,#3a1d2a);border-color:#3a3046}

/* ── Admin / Panel / CNF (panel.css forces light with !important) ─ */
html[data-theme="dark"] body.admin-body{background:#131318 !important;color:#e6e6ee}
html[data-theme="dark"] .admin-wrapper{background:#131318}
html[data-theme="dark"] .admin-sidebar{background:#181820 !important;border-color:#2b2b36}
html[data-theme="dark"] .sidebar-nav a{color:#c9c9d3}
html[data-theme="dark"] .sidebar-nav a:hover,
html[data-theme="dark"] .sidebar-nav a.active{background:#24242d;color:#fff}
html[data-theme="dark"] .admin-main{background:#14141a}
html[data-theme="dark"] .admin-topbar{background:#1a1a22 !important;border-color:#2b2b36}
html[data-theme="dark"] .admin-content{background:#14141a}
html[data-theme="dark"] .admin-card,
html[data-theme="dark"] .content-body,
html[data-theme="dark"] .panel-content,
html[data-theme="dark"] .box-card{background:#1b1b23 !important;color:#e0e0e8}
html[data-theme="dark"] .card-header{
  background:#20202a;border-color:#2e2e3a;color:#e6e6ee
}
html[data-theme="dark"] .admin-table{background:#1b1b23;color:#d5d5de}
html[data-theme="dark"] .admin-table th{background:#22222c;color:#ececf3;border-color:#2e2e3a}
html[data-theme="dark"] .admin-table td{border-color:#2b2b36}
html[data-theme="dark"] .admin-table tr:hover td{background:#20202a}
html[data-theme="dark"] .form-group label{color:#d9d9e2}
html[data-theme="dark"] .form-group input,
html[data-theme="dark"] .form-group select,
html[data-theme="dark"] .form-group textarea{background:#16161d;border-color:#33333f;color:#e6e6ee}
html[data-theme="dark"] .admin-stats .stat-card{background:#1b1b23;border-color:#2e2e3a}
html[data-theme="dark"] .stat-number{color:#fff}
html[data-theme="dark"] .topbar-user-btn{background:#22222b;border-color:#33333f;color:#d5d5de}
html[data-theme="dark"] .topbar-dropdown{background:#1a1a22;border-color:#33333f}
html[data-theme="dark"] .topbar-dd-item{color:#d5d5de}
html[data-theme="dark"] .topbar-dd-item:hover{background:#24242d}
html[data-theme="dark"] .admin-alert{background:#1d1d25;border-color:#33333f;color:#e6e6ee}

/* CNF themed sidebar tints adjusted for dark */
html[data-theme="dark"] .cnf-sidebar{background:#181820 !important}
html[data-theme="dark"] body.admin-body.cnf-admin-theme .admin-main,
html[data-theme="dark"] body.admin-body.cnf-emp-theme .admin-main{background:#14141a}

/* ── Theme toggle buttons ─────────────────────────────────────── */
html[data-theme="dark"] .nav-theme-btn{background:#22222b;border-color:#33333f;color:#ffd54f}
html[data-theme="dark"] .topbar-theme-btn{background:#22222b;border-color:#33333f;color:#ffd54f}

/* ── Auth pages (login / register) ─────────────────────────────── */
html[data-theme="dark"] .login-card{background:#1b1b23;box-shadow:0 2px 24px rgba(0,0,0,.5);border:1px solid #2b2b36}
html[data-theme="dark"] .field input{background:#14141a;border-color:#33333f;color:#e6e6ee}
html[data-theme="dark"] .field input:focus{background:#181820;border-color:#1a73e8}
html[data-theme="dark"] .card-sub{color:#a9a9b6}
html[data-theme="dark"] .card-sub strong{color:#e6e6ee}
html[data-theme="dark"] .divider-line{background:#2b2b36}
html[data-theme="dark"] .divider-text{color:#77778a}
html[data-theme="dark"] .field label{color:#d9d9e2}

/* ── FORCED OVERRIDES (dark) — beats main.css "WHITE LIGHT THEME" ── */
html[data-theme="dark"] body.site-front,
html[data-theme="dark"] .homepage,
html[data-theme="dark"] .article-page,
html[data-theme="dark"] .category-page,
html[data-theme="dark"] .search-page,
html[data-theme="dark"] .live-page,
html[data-theme="dark"] .info-section{
  background:#121217 !important; color:#e6e6ee !important;
}
html[data-theme="dark"] .section-block,
html[data-theme="dark"] .news-card,
html[data-theme="dark"] .side-story,
html[data-theme="dark"] .widget,
html[data-theme="dark"] .author-box,
html[data-theme="dark"] .category-header,
html[data-theme="dark"] .main-footer{
  background:#1a1a22 !important; border-color:#2b2b36 !important; box-shadow:none;
}
html[data-theme="dark"] .card-title,
html[data-theme="dark"] .side-title,
html[data-theme="dark"] .cat-main-title,
html[data-theme="dark"] .cat-side-title,
html[data-theme="dark"] .section-title,
html[data-theme="dark"] .article-title,
html[data-theme="dark"] .article-content,
html[data-theme="dark"] .cat-main-excerpt,
html[data-theme="dark"] .card-excerpt{color:#e6e6ee !important}
html[data-theme="dark"] .card-meta,
html[data-theme="dark"] .article-meta,
html[data-theme="dark"] .breadcrumb,
html[data-theme="dark"] .cat-main-excerpt{color:#a9a9b6 !important}
html[data-theme="dark"] .article-excerpt{color:#c9c9d3;border-left-color:#c0392b}
html[data-theme="dark"] .article-content p,
html[data-theme="dark"] .article-content li{color:#d5d5de}
html[data-theme="dark"] .live-entry-new{background:#1c2024 !important}
html[data-theme="dark"] .tag{background:#22222b;color:#d9d9e2;border-color:#33333f}
html[data-theme="dark"] .suggestion-item,
html[data-theme="dark"] .cat-side-title,
html[data-theme="dark"] .article-divider,
html[data-theme="dark"] .article-toolbar,
html[data-theme="dark"] .article-share-bottom{border-color:#2b2b36}
html[data-theme="dark"] .pagination .page-btn{background:#1a1a22;border-color:#33333f;color:#d9d9e2}
html[data-theme="dark"] .share-menu-drop{background:#1a1a22;border-color:#33333f;box-shadow:0 12px 32px rgba(0,0,0,.5)}
html[data-theme="dark"] .share-menu-item{color:#d9d9e2}
html[data-theme="dark"] .share-menu-item:hover{background:#24242d}
html[data-theme="dark"] .atb-bookmark{background:#2a2a35}
html[data-theme="dark"] .atb-toast{background:#1b1b23;border-color:#33333f;color:#e6e6ee}
html[data-theme="dark"] .nav-toggle{color:#e6e6ee}
html[data-theme="dark"] .main-footer{background:#15151b !important; color:#a9a9b6 !important; border-top-color:#c0392b}
html[data-theme="dark"] .main-footer .footer-logo{color:#e6e6ee !important}
html[data-theme="dark"] .footer-bottom{background:#131318 !important; border-color:#2b2b36 !important}
html[data-theme="dark"] .alert-success{background:#0f2a1c;color:#7ee2a5;border-color:#1f4d33}
html[data-theme="dark"] .alert-error{background:#2a1111;color:#ff9d9d;border-color:#4d1f1f}