/* Marathi / Devanagari font (Noto Sans Devanagari) is hosted on this site itself, so the same font shows on the
   home page, articles, login and dashboards. The devanagari files are patched so conjuncts such as "ष्ट्र"
   (महाराष्ट्र, राष्ट्र, ट्रक) are drawn correctly on lang="mr" pages too. "?v=2" is a cache-buster. */
@font-face { font-family: 'Noto Sans Devanagari'; font-style: normal; font-weight: 400; font-display: swap; src: url('/assets/fonts/noto-sans-devanagari-devanagari-400-normal.woff2?v=2') format('woff2'); unicode-range: U+0900-097F,U+1CD0-1CF9,U+200C-200D,U+20A8,U+20B9,U+20F0,U+25CC,U+A830-A839,U+A8E0-A8FF,U+11B00-11B09; }
@font-face { font-family: 'Noto Sans Devanagari'; font-style: normal; font-weight: 400; font-display: swap; src: url('/assets/fonts/noto-sans-devanagari-latin-400-normal.woff2?v=2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Noto Sans Devanagari'; font-style: normal; font-weight: 500; font-display: swap; src: url('/assets/fonts/noto-sans-devanagari-devanagari-500-normal.woff2?v=2') format('woff2'); unicode-range: U+0900-097F,U+1CD0-1CF9,U+200C-200D,U+20A8,U+20B9,U+20F0,U+25CC,U+A830-A839,U+A8E0-A8FF,U+11B00-11B09; }
@font-face { font-family: 'Noto Sans Devanagari'; font-style: normal; font-weight: 500; font-display: swap; src: url('/assets/fonts/noto-sans-devanagari-latin-500-normal.woff2?v=2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Noto Sans Devanagari'; font-style: normal; font-weight: 600; font-display: swap; src: url('/assets/fonts/noto-sans-devanagari-devanagari-600-normal.woff2?v=2') format('woff2'); unicode-range: U+0900-097F,U+1CD0-1CF9,U+200C-200D,U+20A8,U+20B9,U+20F0,U+25CC,U+A830-A839,U+A8E0-A8FF,U+11B00-11B09; }
@font-face { font-family: 'Noto Sans Devanagari'; font-style: normal; font-weight: 600; font-display: swap; src: url('/assets/fonts/noto-sans-devanagari-latin-600-normal.woff2?v=2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Noto Sans Devanagari'; font-style: normal; font-weight: 700; font-display: swap; src: url('/assets/fonts/noto-sans-devanagari-devanagari-700-normal.woff2?v=2') format('woff2'); unicode-range: U+0900-097F,U+1CD0-1CF9,U+200C-200D,U+20A8,U+20B9,U+20F0,U+25CC,U+A830-A839,U+A8E0-A8FF,U+11B00-11B09; }
@font-face { font-family: 'Noto Sans Devanagari'; font-style: normal; font-weight: 700; font-display: swap; src: url('/assets/fonts/noto-sans-devanagari-latin-700-normal.woff2?v=2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Noto Sans Devanagari'; font-style: normal; font-weight: 800; font-display: swap; src: url('/assets/fonts/noto-sans-devanagari-devanagari-800-normal.woff2?v=2') format('woff2'); unicode-range: U+0900-097F,U+1CD0-1CF9,U+200C-200D,U+20A8,U+20B9,U+20F0,U+25CC,U+A830-A839,U+A8E0-A8FF,U+11B00-11B09; }
@font-face { font-family: 'Noto Sans Devanagari'; font-style: normal; font-weight: 800; font-display: swap; src: url('/assets/fonts/noto-sans-devanagari-latin-800-normal.woff2?v=2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

/* =====================================================
   MH Upnagar - Main Stylesheet
   Theme: Sunset Orange + Charcoal (matched to logo)
   ===================================================== */

:root {
  --primary: #ff6a00;
  --primary-dark: #e64a00;
  --primary-light: #ff9a3c;
  --charcoal: #1a1a22;
  --charcoal-soft: #2b2b35;
  --bg: #f7f7f9;
  --card-bg: #ffffff;
  --text: #232329;
  --text-muted: #6b6b76;
  --border: #ececf0;
  --success: #1e9e5a;
  --danger: #e63946;
  --warning: #f0a500;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(26,26,34,0.06);
  --shadow-lg: 0 10px 30px rgba(26,26,34,0.12);
  --font: 'Noto Sans Devanagari', 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-wrap: break-word;
}
/* public site: footer always sits at the bottom, even on short pages */
body.site-body { min-height: 100vh; display: flex; flex-direction: column; }
body.site-body > .site-footer { margin-top: auto; }

button, input, select, textarea { font-family: inherit; }
.article-page .content, .article-page .content * { font-family: var(--font) !important; }
#contentEditable, #contentEditable * { font-family: var(--font) !important; }

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ---------- Top bar ---------- */
.topbar { background: var(--charcoal); color: #cfcfd6; font-size: 13px; padding: 6px 0; }
.topbar .container { display: flex; justify-content: space-between; align-items: center; }
.topbar .date { color: #9c9ca5; }
.topbar a { color: #cfcfd6; margin-left: 14px; }
.topbar a:hover { color: var(--primary-light); }

/* ---------- Header ---------- */
header.site-header {
  background: #fff;
  border-bottom: 3px solid var(--primary);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; gap: 20px; }
.logo-block { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo-block img { height: 54px; width: 54px; object-fit: cover; border-radius: 50%; flex-shrink: 0; }
.logo-block .brand-text { display: flex; flex-direction: column; min-width: 0; }
.logo-block .brand-text strong { font-size: 22px; line-height: 1.25; color: var(--charcoal); letter-spacing: .5px; }
.logo-block .brand-text span { font-size: 11.5px; color: var(--text-muted); line-height: 1.3; }

.search-box { flex: 1; max-width: 320px; display: flex; }
.search-box input {
  flex: 1; min-width: 0; border: 1px solid var(--border); border-right: none; border-radius: 8px 0 0 8px;
  padding: 9px 12px; font-size: 14px; outline: none; font-family: var(--font); background: #fff;
}
.search-box input:focus { border-color: var(--primary); }
.search-box button {
  background: var(--primary); border: none; color: #fff; padding: 0 16px;
  border-radius: 0 8px 8px 0; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.search-box button:hover { background: var(--primary-dark); }
.search-toggle { display: none; }

/* ---------- Nav ---------- */
nav.main-nav { background: var(--charcoal); }
nav.main-nav ul { display: flex; flex-wrap: wrap; }
nav.main-nav a {
  display: block; padding: 12px 18px; color: #e8e8ec; font-size: 14.5px; font-weight: 500;
  transition: background .2s; white-space: nowrap;
}
nav.main-nav a:hover, nav.main-nav a.active { background: var(--primary); color: #fff; }

/* ---------- Layout ---------- */
.main-layout { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); gap: 28px; padding: 30px 0 50px; align-items: start; }
.main-layout > * { min-width: 0; }

/* ---------- Featured / Hero ---------- */
a.hero-featured {
  display: block;               /* <a> is inline by default - without this the fixed height is ignored and the page collapses */
  position: relative; border-radius: var(--radius); overflow: hidden;
  height: 380px; margin-bottom: 26px; box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, var(--charcoal), #3a3a46);
}
.hero-featured img { width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.hero-featured .overlay {
  position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0,0,0,.85) 5%, rgba(0,0,0,.1) 65%);
  display: flex; flex-direction: column; justify-content: flex-end; padding: 28px;
}
.hero-featured .cat-tag {
  background: var(--primary); color: #fff; font-size: 12px; font-weight: 600;
  padding: 4px 12px; border-radius: 20px; width: fit-content; margin-bottom: 12px;
}
.hero-featured h1 {
  color: #fff; font-size: 28px; line-height: 1.35; max-width: 750px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.hero-featured .meta { color: #d8d8dc; font-size: 13px; margin-top: 10px; }

/* ---------- Article cards ---------- */
.section-title {
  display: flex; align-items: center; gap: 10px; margin: 8px 0 18px;
  font-size: 19px; font-weight: 700; color: var(--charcoal);
}
.section-title::before { content: ''; width: 5px; height: 22px; background: var(--primary); border-radius: 3px; flex-shrink: 0; }

.article-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }

.article-card {
  display: flex; flex-direction: column;
  background: var(--card-bg); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s;
}
.article-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.article-card .thumb { aspect-ratio: 16 / 9; overflow: hidden; background: #eee; flex-shrink: 0; }
.article-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.article-card .body { padding: 14px 16px; display: flex; flex-direction: column; flex: 1; min-width: 0; }
.article-card .cat-tag {
  display: inline-block; align-self: flex-start; font-size: 11px; font-weight: 700; color: var(--primary-dark);
  background: #fff1e6; padding: 3px 10px; border-radius: 20px; margin-bottom: 8px;
}
.article-card h3 {
  font-size: 16px; line-height: 1.45; margin-bottom: 8px; color: var(--charcoal);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.article-card p {
  font-size: 13.5px; color: var(--text-muted); margin-bottom: 10px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.article-card .meta { font-size: 12px; color: #9a9aa2; display: flex; justify-content: space-between; margin-top: auto; padding-top: 4px; }

.list-row { display: flex; gap: 14px; background: var(--card-bg); border-radius: var(--radius); padding: 12px; margin-bottom: 14px; box-shadow: var(--shadow); }
.list-row .thumb { width: 120px; min-width: 120px; height: 84px; border-radius: 8px; overflow: hidden; background: #eee; }
.list-row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.list-row .info { min-width: 0; flex: 1; }
.list-row h3 {
  font-size: 15px; line-height: 1.45; margin-bottom: 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.list-row .excerpt {
  color: #8a8a92; font-size: 13.5px; margin-bottom: 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.list-row .meta { font-size: 12px; color: #9a9aa2; }

/* ---------- Sidebar ---------- */
.sidebar-box { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 22px; }
.sidebar-box h4 { font-size: 16px; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 2px solid var(--primary); color: var(--charcoal); }
.trending-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--border); }
.trending-item:last-child { border: none; }
.trending-item .num { font-size: 20px; font-weight: 800; color: var(--primary); min-width: 26px; line-height: 1.4; }
.trending-item h5 { font-size: 13.5px; line-height: 1.5; color: var(--text); font-weight: 600; }
.trending-item:hover h5 { color: var(--primary-dark); }
.cat-list a { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.cat-list a:last-child { border: none; }
.cat-list a:hover { color: var(--primary-dark); }
.cat-list span { color: #b0b0b8; font-size: 12px; }

/* ---------- Footer (sober: plain lists, thin lines, no decoration) ---------- */
footer.site-footer { background: var(--charcoal); color: #b4b4bd; padding: 40px 0 0; margin-top: 30px; border-top: 3px solid var(--primary); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.1fr) minmax(0, 1fr); gap: 48px; padding-bottom: 30px; }
.footer-grid > * { min-width: 0; }
.footer-grid h4 { color: #fff; font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.footer-brand img { height: 46px; width: auto; margin-bottom: 12px; border-radius: 4px; background: #fff; }
.footer-brand .f-tag { color: #dcdce2; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.footer-brand p { font-size: 13.5px; color: #a0a0aa; line-height: 1.75; max-width: 420px; }
.footer-grid ul a { color: #a0a0aa; font-size: 14px; display: block; padding: 4px 0; }
.footer-grid ul a:hover { color: #fff; }
.footer-cats ul { columns: 2; column-gap: 28px; }
.footer-cats li { break-inside: avoid; }
.footer-bottom {
  border-top: 1px solid #34343f; padding: 16px 0 20px; font-size: 13px; color: #85858f;
  display: flex; justify-content: space-between; align-items: center; gap: 8px 20px; flex-wrap: wrap;
}
.footer-bottom a { color: #b4b4bd; }
.footer-bottom a:hover { color: #fff; }

/* ---------- Breadcrumb ---------- */
.breadcrumb { font-size: 13px; color: var(--text-muted); padding: 16px 0 0; }
.breadcrumb a:hover { color: var(--primary-dark); }

/* ---------- Article page ---------- */
.article-page h1 { font-size: 27px; line-height: 1.45; color: var(--charcoal); margin: 12px 0; }
.article-page .cat-tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 20px; }
.article-page .article-meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--text-muted); border-bottom: 1px solid var(--border); padding-bottom: 16px; margin-bottom: 20px; }
.article-page .featured-image { border-radius: var(--radius); overflow: hidden; margin-bottom: 20px; max-height: 420px; }
.article-page .featured-image img { width: 100%; height: 100%; max-height: 420px; object-fit: cover; }
.article-page .content { font-size: 16.5px; line-height: 1.85; color: #2a2a32; }
.article-page .content p { margin-bottom: 16px; }
.article-page .content h2, .article-page .content h3 { line-height: 1.4; margin: 24px 0 12px; color: var(--charcoal); }
.article-page .content ul, .article-page .content ol { margin: 0 0 16px 22px; }
.article-page .content ul { list-style: disc; }
.article-page .content li { margin-bottom: 6px; }
.article-page .content a { color: var(--primary-dark); text-decoration: underline; }
.article-page .content img { max-width: 100%; height: auto; border-radius: 8px; display: block; margin: 14px auto; }
.article-page .content figure { margin: 18px 0; text-align: center; }
.article-page .content figure img { margin: 0 auto; }
.article-page .content figcaption { font-size: 13.5px; color: var(--text-muted); margin-top: 8px; line-height: 1.5; }
.article-page .content::after { content: ''; display: block; clear: both; }
.article-page .content iframe, .article-page .content video { max-width: 100%; }
.article-page .content table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin-bottom: 16px; }
.article-page .content blockquote { border-left: 4px solid var(--primary); background: #fff7ef; padding: 10px 16px; margin: 0 0 16px; border-radius: 0 8px 8px 0; }

/* ---------- Auth pages ---------- */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--charcoal) 0%, #33202a 55%, var(--primary-dark) 100%);
  padding: 20px;
}
.auth-card { background: #fff; width: 100%; max-width: 400px; border-radius: 14px; padding: 34px 30px; box-shadow: 0 20px 50px rgba(0,0,0,.35); }
.auth-card img { height: 56px; margin: 0 auto 8px; display: block; }
.auth-card h2 { text-align: center; margin-bottom: 4px; color: var(--charcoal); }
.auth-card .sub { text-align: center; color: var(--text-muted); font-size: 13px; margin-bottom: 24px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; color: var(--charcoal); }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--border); border-radius: 8px;
  font-size: 14.5px; font-family: var(--font); outline: none; transition: .2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--primary); }
.btn { display: inline-block; padding: 11px 22px; border-radius: 8px; border: none; font-size: 14.5px; font-weight: 600; cursor: pointer; transition: .2s; text-align: center; }
.btn-primary { background: var(--primary); color: #fff; width: 100%; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-sm { padding: 6px 14px; font-size: 13px; border-radius: 6px; }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.alert { padding: 11px 14px; border-radius: 8px; font-size: 13.5px; margin-bottom: 16px; }
.alert-error { background: #fdecec; color: var(--danger); border: 1px solid #f6c9cc; }
.alert-success { background: #e9f9ef; color: var(--success); border: 1px solid #bdeccf; }
.demo-note { background: #fff7ec; border: 1px dashed var(--primary); border-radius: 8px; padding: 10px 12px; font-size: 12.5px; color: #8a5a1e; margin-top: 16px; }

/* ---------- Dashboard (admin/editor) ---------- */
.dash-body { background: var(--bg); min-height: 100vh; }
.dash-shell { display: flex; min-height: 100vh; }
.dash-sidebar {
  width: 240px; background: var(--charcoal); color: #dcdce2; padding: 20px 0; flex-shrink: 0;
}
.dash-sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 0 20px 20px; border-bottom: 1px solid #33333d; margin-bottom: 16px; }
.dash-sidebar .brand img { height: 36px; border-radius: 6px; }
.dash-sidebar .brand strong { font-size: 15px; color: #fff; }
.dash-sidebar .role-badge { font-size: 10px; background: var(--primary); color: #fff; padding: 2px 8px; border-radius: 10px; text-transform: uppercase; }
.dash-sidebar nav a {
  display: flex; align-items: center; gap: 10px; padding: 11px 20px; font-size: 14px; color: #c4c4cc;
  border-left: 3px solid transparent;
}
.dash-sidebar nav a:hover, .dash-sidebar nav a.active { background: #24242e; color: #fff; border-left-color: var(--primary); }
.dash-main { flex: 1; padding: 24px 30px; max-width: calc(100% - 240px); }
@media (max-width: 800px) { .dash-shell { flex-direction: column; } .dash-sidebar { width: 100%; } .dash-main { max-width: 100%; } }

.dash-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.dash-topbar h1 { font-size: 22px; color: var(--charcoal); }
.dash-topbar .user-chip { display: flex; align-items: center; gap: 10px; background: #fff; padding: 8px 14px; border-radius: 30px; box-shadow: var(--shadow); font-size: 13.5px; }
.dash-topbar .user-chip .avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 26px; }
@media (max-width: 800px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-card { background: #fff; border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); border-left: 4px solid var(--primary); }
.stat-card .num { font-size: 26px; font-weight: 800; color: var(--charcoal); }
.stat-card .label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.card-head h3 { font-size: 17px; color: var(--charcoal); }

table.data-table { width: 100%; border-collapse: collapse; font-size: 13.8px; }
table.data-table th { text-align: left; padding: 10px 12px; background: #f4f4f7; color: var(--text-muted); font-weight: 600; font-size: 12.5px; text-transform: uppercase; }
table.data-table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data-table tr:hover td { background: #fafafc; }
.badge { padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 700; }
.badge-published { background: #e9f9ef; color: var(--success); }
.badge-draft { background: #f0f0f3; color: #77777f; }
.badge-pending { background: #fff4e0; color: var(--warning); }
.badge-admin { background: #fdecec; color: var(--danger); }
.badge-editor { background: #eaf1fc; color: #2563eb; }
.action-links a { margin-right: 10px; font-size: 12.5px; font-weight: 600; }
.action-links .edit { color: #2563eb; }
.action-links .delete { color: var(--danger); }

.thumb-sm { width: 54px; height: 40px; border-radius: 6px; overflow: hidden; background: #eee; }
.thumb-sm img { width: 100%; height: 100%; object-fit: cover; }

.editor-toolbar { display: flex; gap: 8px; background: #f4f4f7; border: 1px solid var(--border); border-bottom: none; border-radius: 8px 8px 0 0; padding: 8px; flex-wrap: wrap; }
.editor-toolbar button { background: #fff; border: 1px solid var(--border); border-radius: 5px; padding: 5px 10px; cursor: pointer; font-size: 13px; }
.editor-toolbar button:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
#contentEditable { border: 1px solid var(--border); border-radius: 0 0 8px 8px; min-height: 260px; padding: 14px; font-size: 15px; line-height: 1.7; outline: none; }

/* ---------- SEO box (article form) ---------- */
.seo-box { background: #f9fafb; border: 1.5px dashed var(--border); border-radius: 10px; padding: 16px; margin-bottom: 18px; }
.seo-box-title { font-weight: 700; font-size: 14px; margin-bottom: 12px; color: var(--charcoal); }
.seo-box-title span { font-weight: 400; font-size: 12px; color: var(--text-muted); }
.char-count { float: right; font-weight: 400; font-size: 11.5px; color: #9a9aa2; }
.char-count.over { color: var(--danger); font-weight: 700; }
.serp-preview { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; margin-top: 6px; }
.serp-title { color: #1a0dab; font-size: 17px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.serp-url { color: #006621; font-size: 12.5px; margin: 2px 0 4px; }
.serp-desc { color: #545454; font-size: 13px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-state .icon { font-size: 40px; margin-bottom: 10px; }

.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 8px 14px; border-radius: 6px; background: #fff; box-shadow: var(--shadow); font-size: 13.5px; }
.pagination a.active, .pagination span.active { background: var(--primary); color: #fff; }

/* =====================================================
   RESPONSIVE
   ===================================================== */

/* Small laptops / tablets landscape */
@media (max-width: 1024px) {
  .main-layout { gap: 22px; }
  .hero-featured h1 { font-size: 25px; }
}

/* Tablets: sidebar drops below the news, its boxes sit side by side */
@media (max-width: 900px) {
  .container { padding: 0 16px; }
  .header-inner { padding-left: 16px; padding-right: 16px; }
  .main-layout { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 24px 0 40px; }
  aside { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; align-items: start; }
  a.hero-featured { height: 320px; }
  .hero-featured h1 { font-size: 23px; }
  .article-page h1 { font-size: 24px; }
  .footer-grid { gap: 32px; }
  aside .sidebar-box:only-child { grid-column: 1 / -1; }
}

/* Phones */
@media (max-width: 768px) {
  .topbar { display: none; }

  /* header: logo + search icon; search bar opens below on tap */
  .header-inner { flex-wrap: wrap; padding: 8px 14px; gap: 8px 12px; }
  .logo-block { gap: 8px; flex: 1; }
  .logo-block img { height: 42px; width: 42px; }
  .logo-block .brand-text strong { font-size: 18px; }
  .logo-block .brand-text span {
    font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
  }
  .search-toggle {
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 40px; height: 40px; background: #fff7ef; color: var(--primary-dark);
    border: 1.5px solid #ffd9bd; border-radius: 10px; cursor: pointer;
  }
  .site-header.search-open .search-toggle { background: var(--primary); color: #fff; border-color: var(--primary); }
  .search-box { display: none; order: 3; flex: 0 0 100%; max-width: 100%; }
  .site-header.search-open .search-box { display: flex; }
  .search-box input { padding: 11px 12px; font-size: 15px; }
  .search-box button { padding: 0 18px; }

  /* category menu: one swipeable line instead of a tall dropdown */
  nav.main-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  nav.main-nav::-webkit-scrollbar { display: none; }
  nav.main-nav .container { padding: 0 6px; }
  nav.main-nav ul { flex-wrap: nowrap; width: max-content; min-width: 100%; }
  nav.main-nav a { padding: 11px 14px; font-size: 14px; }

  .main-layout { padding: 16px 0 28px; }
  aside { display: block; }
  .hide-mobile { display: none; }

  a.hero-featured { height: clamp(210px, 62vw, 300px); margin-bottom: 18px; border-radius: 12px; }
  .hero-featured .overlay { padding: 16px; }
  .hero-featured h1 { font-size: 19px; line-height: 1.4; }
  .hero-featured .meta { font-size: 12px; margin-top: 6px; }
  .hero-featured .cat-tag { font-size: 11px; padding: 3px 10px; margin-bottom: 8px; }

  .section-title { font-size: 17px; margin: 4px 0 14px; }

  /* news cards become compact rows: photo left, headline right */
  .article-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .article-card { flex-direction: row; align-items: stretch; }
  .article-card:hover { transform: none; }
  .article-card .thumb { aspect-ratio: auto; width: 118px; min-width: 118px; min-height: 96px; }
  .article-card .body { padding: 10px 12px; justify-content: center; }
  .article-card .cat-tag { font-size: 10.5px; padding: 2px 9px; margin-bottom: 5px; }
  .article-card h3 { font-size: 14.5px; line-height: 1.45; margin-bottom: 4px; }
  .article-card p { display: none; }
  .article-card .meta { font-size: 11.5px; gap: 10px; justify-content: flex-start; }

  .list-row { gap: 10px; padding: 10px; margin-bottom: 12px; }
  .list-row .thumb { width: 96px; min-width: 96px; height: 76px; }
  .list-row h3 { font-size: 14px; }
  .list-row .excerpt { display: none; }

  .breadcrumb { font-size: 12px; padding-top: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  .article-page h1 { font-size: 21px; margin: 10px 0; }
  .article-page .article-meta { gap: 6px 14px; font-size: 12px; padding-bottom: 12px; margin-bottom: 14px; }
  .article-page .content { font-size: 16px; line-height: 1.8; }
  .article-page .featured-image { max-height: 240px; border-radius: 10px; }
  .article-page .featured-image img { max-height: 240px; }

  .sidebar-box { padding: 14px; margin-bottom: 16px; }

  /* ---- footer (phone): brand on top, then "विभाग" and "त्वरित लिंक्स" in 2 plain columns ---- */
  footer.site-footer { padding: 28px 0 0; margin-top: 22px; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 20px; padding-bottom: 22px; align-items: start; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-brand img { height: 42px; margin-bottom: 10px; }
  .footer-brand p { max-width: none; font-size: 13px; line-height: 1.7; }
  .footer-cats ul { columns: 1; }
  .footer-grid h4 { font-size: 14.5px; margin-bottom: 8px; }
  .footer-grid ul a { padding: 5px 0; font-size: 13.5px; }
  .footer-bottom { flex-direction: column; text-align: center; font-size: 12px; line-height: 1.7; gap: 2px; padding: 14px 0 calc(18px + env(safe-area-inset-bottom, 0px)); }

  /* auth + dashboards */
  .auth-card { padding: 26px 20px; }

  .dash-shell { flex-direction: column; }
  .dash-sidebar { width: 100%; padding: 0; }
  .dash-sidebar .brand { padding: 10px 16px; margin-bottom: 0; }
  .dash-sidebar nav { display: flex; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .dash-sidebar nav::-webkit-scrollbar { display: none; }
  .dash-sidebar nav a { white-space: nowrap; border-left: none; border-bottom: 3px solid transparent; padding: 12px 14px; }
  .dash-sidebar nav a:hover, .dash-sidebar nav a.active { border-left-color: transparent; border-bottom-color: var(--primary); }
  .dash-main { padding: 18px 14px; max-width: 100%; }
  .dash-topbar h1 { font-size: 18px; }
  .stat-grid { gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-card .num { font-size: 21px; }
  .card { padding: 14px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table.data-table { white-space: nowrap; }
}

/* Very small phones */
@media (max-width: 380px) {
  .container { padding: 0 12px; }
  .article-card .thumb { width: 104px; min-width: 104px; }
  .hero-featured h1 { font-size: 17.5px; }
  .footer-grid { gap: 22px 12px; }
}

/* small buttons inside card headers should not stretch full width */
.card-head .btn-primary, .dash-topbar .btn-primary { width: auto; }


/* =====================================================
   DASHBOARD: language switch, forms, analytics
   ===================================================== */
.lang-switch { margin-left: auto; display: inline-flex; border: 1px solid #454552; border-radius: 20px; overflow: hidden; flex-shrink: 0; }
.lang-switch a { padding: 4px 11px; font-size: 12px; font-weight: 700; color: #b9b9c3; line-height: 1.6; }
.lang-switch a:hover { color: #fff; }
.lang-switch a.active { background: var(--primary); color: #fff; }
.lang-switch.on-light { display: flex; width: fit-content; margin: 0 auto 18px; border-color: #ddd; }
.lang-switch.on-light a { color: #777; }
.lang-switch.on-light a.active { color: #fff; }
.dash-sidebar .brand { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.status-row { display: flex; gap: 20px; align-items: center; margin-bottom: 18px; }
.feat-label { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; margin-top: 20px; }
.data-table td.wrap { white-space: normal; min-width: 180px; }
.data-table a.tlink { color: var(--charcoal); font-weight: 600; }
.data-table a.tlink:hover { color: var(--primary-dark); }

.an-sub { color: var(--text-muted); font-size: 13.5px; margin: -6px 0 16px; }
.an-range { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.an-range a { padding: 7px 16px; border-radius: 20px; background: #fff; box-shadow: var(--shadow); font-size: 13px; font-weight: 600; color: var(--text-muted); }
.an-range a:hover { color: var(--primary-dark); }
.an-range a.active { background: var(--primary); color: #fff; }
.an-kpis { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.stat-card .sub { margin-top: 6px; font-size: 12px; }
.vs { color: #9a9aa2; font-size: 12px; font-weight: 400; }
.delta { font-weight: 700; font-size: 12px; }
.delta.up { color: var(--success); }
.delta.down { color: var(--danger); }
.delta.flat { color: #9a9aa2; }
.an-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }
.an-grid > .card { margin-bottom: 0; min-width: 0; }
.an-block { margin-bottom: 20px; }
.an-note { font-size: 13px; color: var(--text-muted); margin-top: 10px; }
.an-foot { font-size: 12.5px; color: #8a8a92; line-height: 1.7; margin: 6px 0 30px; }
.empty-chart { padding: 28px 10px; text-align: center; color: #9a9aa2; font-size: 14px; background: #fafafc; border-radius: 8px; }

.chart { position: relative; padding-top: 18px; }
.chart .ymax { position: absolute; top: 0; left: 0; font-size: 11px; color: #9a9aa2; }
.cbars {
  display: flex; align-items: flex-end; gap: 2px; height: 200px; border-bottom: 1px solid var(--border);
  background: repeating-linear-gradient(to top, transparent 0, transparent calc(25% - 1px), #efeff3 calc(25% - 1px), #efeff3 25%);
}
.chart.mini .cbars { height: 130px; }
.chart.short .cbars { height: 130px; }
.cbars .col { flex: 1; min-width: 0; height: 100%; position: relative; }
.cbars .col span { position: absolute; bottom: 0; border-radius: 3px 3px 0 0; }
.cbars .v { left: 8%; right: 8%; background: #ffd0a8; min-height: 1px; }
.cbars .v.solid { background: linear-gradient(0deg, var(--primary), var(--primary-light)); }
.cbars .u { left: 24%; right: 24%; background: var(--primary); }
.cbars .col:hover .v { background: #ffb37a; }
.cbars .col:hover .v.solid { filter: brightness(.9); }
.clabels { display: flex; gap: 2px; height: 18px; margin-top: 4px; }
.clabels span { flex: 1; min-width: 0; position: relative; font-size: 10.5px; color: #9a9aa2; }
.clabels span b { position: absolute; left: 50%; transform: translateX(-50%); font-weight: 400; white-space: nowrap; }
.chart .legend { font-size: 12px; color: var(--text-muted); margin-top: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: -1px; }
.legend .lv { background: #ffd0a8; }
.legend .lu { background: var(--primary); }

.hbar { display: grid; grid-template-columns: 130px minmax(0, 1fr) 96px; gap: 10px; align-items: center; padding: 7px 0; font-size: 13.5px; }
.hbar .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .track { background: #f1f1f5; border-radius: 6px; height: 10px; overflow: hidden; }
.hbar .track i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-light)); border-radius: 6px; }
.hbar .val { text-align: right; color: var(--text-muted); font-size: 12.5px; white-space: nowrap; }

.an-article-head { display: flex; gap: 16px; align-items: center; }
.an-article-head .thumb-sm.big { width: 120px; height: 80px; flex-shrink: 0; border-radius: 8px; overflow: hidden; }
.an-article-head .thumb-sm.big img { width: 100%; height: 100%; object-fit: cover; }
.an-article-head h2 { font-size: 18px; line-height: 1.45; margin-bottom: 4px; }
.an-article-head .meta { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; }
.an-article-head .acts { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 900px) { .an-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 768px) {
  .dash-sidebar .brand .lang-switch { margin-left: auto; }
  .form-row-2 { grid-template-columns: 1fr; gap: 0; }
  .status-row { flex-direction: column; align-items: stretch; gap: 12px; }
  .feat-label { margin-top: 0; }
  .an-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hbar { grid-template-columns: 96px minmax(0, 1fr) 84px; gap: 8px; font-size: 13px; }
  .cbars { height: 160px; }
  .an-article-head { flex-direction: column; align-items: flex-start; }
  .an-article-head .thumb-sm.big { width: 100%; height: 150px; }
  .an-range a { padding: 6px 12px; font-size: 12.5px; }
}


/* ---------- Article editor: images, hints, 404 ---------- */
.editor-toolbar .tb-img { font-weight: 700; }
.img-bar { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-left: 8px; padding-left: 8px; border-left: 2px solid var(--border); }
.img-bar button.danger { color: var(--danger); }
.editor-hint { font-size: 12.5px; color: var(--text-muted); margin: 6px 0 8px; }
.field-hint { display: inline-block; margin-top: 6px; font-size: 12.5px; color: var(--primary-dark); font-weight: 600; }
.upload-note { font-size: 13px; color: var(--primary-dark); background: #fff7ef; border: 1px dashed #ffc79a; padding: 6px 12px; border-radius: 6px; margin-bottom: 8px; }
#contentEditable img { max-width: 100%; height: auto; cursor: pointer; border-radius: 6px; }
#contentEditable img.sel { outline: 3px solid var(--primary); }
#contentEditable figure { margin: 12px 0; text-align: center; }
#contentEditable figcaption { font-size: 13px; color: var(--text-muted); }

.notfound { text-align: center; padding: 56px 0 34px; }
.notfound .code { font-size: 84px; font-weight: 800; line-height: 1; color: var(--primary); }
.notfound h1 { font-size: 24px; margin: 14px 0 8px; color: var(--charcoal); }
.notfound p { color: var(--text-muted); margin-bottom: 22px; }
.notfound .btn-home { display: inline-block; background: var(--primary); color: #fff; padding: 11px 26px; border-radius: 8px; font-weight: 600; }
.notfound .btn-home:hover { background: var(--primary-dark); }
.article-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 40px; }
@media (max-width: 900px) { .article-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 768px) {
  .article-grid.four { grid-template-columns: minmax(0, 1fr); }
  .notfound { padding: 34px 0 20px; }
  .notfound .code { font-size: 64px; }
  .img-bar { margin-left: 0; padding-left: 0; border-left: 0; width: 100%; margin-top: 6px; }
  /* on phones pictures inside articles always sit centred, full width */
  .article-page .content img { float: none !important; display: block; margin: 14px auto !important; }
  .article-page .content figure img, .article-page .content p img { width: 100% !important; }
}


/* ---------- English URL (slug) field ---------- */
.alert-warn { background: #fff8e6; color: #7a5b00; border: 1px solid #f3dc9a; }
.lbl-note { font-weight: 400; font-size: 12px; color: var(--text-muted); }
.slug-row { display: flex; align-items: stretch; gap: 8px; }
.slug-row .slug-prefix { display: flex; align-items: center; padding: 0 12px; background: #f1f1f5; border: 1px solid var(--border); border-right: 0; border-radius: 8px 0 0 8px; color: var(--text-muted); font-size: 13px; white-space: nowrap; }
.slug-row input { flex: 1; min-width: 0; border-radius: 0 8px 8px 0 !important; font-family: Consolas, Menlo, monospace; font-size: 14px; }
.slug-row .btn { width: auto; white-space: nowrap; }
.slug-msg { font-size: 12.5px; margin-top: 6px; min-height: 0; }
.slug-msg.muted { color: var(--text-muted); }
.slug-msg.warn { color: #b45309; font-weight: 600; }
.slug-line { font-size: 12px; color: #9a9aa2; font-family: Consolas, Menlo, monospace; margin-top: 2px; word-break: break-all; }
.slug-line.bad { color: #b45309; }
.slug-inline { display: flex; align-items: center; gap: 6px; }
.slug-inline .slug-prefix { color: #9a9aa2; font-size: 12.5px; white-space: nowrap; }
.slug-inline input { min-width: 140px; padding: 6px 8px; font-family: Consolas, Menlo, monospace; font-size: 13px; }
.slug-inline input.bad { border-color: #f0a500; background: #fffaf0; }
.slug-inline .btn { width: auto; }
@media (max-width: 768px) {
  .slug-row { flex-wrap: wrap; }
  .slug-row .slug-prefix { border-right: 1px solid var(--border); border-radius: 8px 8px 0 0; width: 100%; padding: 6px 12px; }
  .slug-row input { border-radius: 0 0 8px 8px !important; flex: 1 1 100%; }
  .slug-row .btn { width: 100%; }
}
