/* ============================================
   مجلس القلم — Complete Stylesheet (v2)
   Default Font: Mehr Nastaliq Web
   ============================================ */

/* FONTS */
@import url('https://fonts.googleapis.com/css2?family=Noto+Nastaliq+Urdu:wght@400;600;700&display=swap');

/* Local Server Fonts (public_html/Font/) */
@font-face {
  font-family: 'Mehr Nastaliq Web';
  src: url('Font/Mehr%20Nastaliq%20Web.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Al Qalam Quran Majeed';
  src: url('Font/Al-Qalam-Quran-Majeed.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --font: 'Mehr Nastaliq Web', 'Noto Nastaliq Urdu', 'Noto Nastaliq', serif;
  --primary:       #1a3a5c;
  --primary-dark:  #0f2540;
  --primary-light: #e8f0f8;
  --accent:        #c8a84b;
  --gold:          #d4af37;
  --text:          #1a1a2e;
  --text-light:    #555;
  --text-muted:    #888;
  --bg:            #f5f7fa;
  --white:         #ffffff;
  --border:        #e0e6ed;
  --radius:        10px;
  --shadow:        0 2px 15px rgba(0,0,0,0.08);
  --shadow-lg:     0 8px 30px rgba(0,0,0,0.14);
}

/* RESET & BASE */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 17px;
  line-height: 2.0;
  color: var(--text);
  background: var(--bg);
  direction: rtl;
}

a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; }
ul { list-style: none; }

/* CONTAINER */
.container { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* ============================================
   HEADER
   ============================================ */
.site-header { position: sticky; top: 0; z-index: 1000; }

.header-top {
  background: var(--primary-dark);
  padding: 6px 0;
  font-size: 13px;
  color: rgba(255,255,255,0.75);
}
.header-top-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.social-links a {
  color: rgba(255,255,255,0.7);
  margin-right: 8px;
  font-size: 14px;
}
.social-links a:hover { color: var(--accent); }

.header-main {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  position: relative; /* needed for mobile dropdown nav */
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  gap: 16px;
}

.logo h1 {
  font-size: 26px;
  color: white;
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1.2;
}
.logo p { color: rgba(255,255,255,0.7); font-size: 12px; }

/* Logo image (uploaded via admin) */
.site-logo-img {
  height: 50px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  display: block;
}

/* NAV */
.main-nav ul {
  display: flex;
  gap: 4px;
  align-items: center;
}
.main-nav ul li a {
  color: rgba(255,255,255,0.9);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 15px;
  transition: all 0.2s;
  display: block;
}
.main-nav ul li a:hover {
  background: rgba(255,255,255,0.15);
  color: white;
}

/* HEADER ACTIONS */
.header-actions { display: flex; gap: 8px; align-items: center; }

/* MOBILE MENU BUTTON */
.mobile-menu-btn {
  display: none;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  font-size: 22px;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}
.mobile-menu-btn:hover { background: rgba(255,255,255,0.25); }

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-block;
  padding: 9px 20px;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
  text-align: center;
  white-space: nowrap;
}
.btn-primary  { background: var(--accent); color: white; border-color: var(--accent); }
.btn-primary:hover { background: #b8922f; border-color: #b8922f; color: white; }
.btn-outline  { background: transparent; color: white; border-color: rgba(255,255,255,0.6); }
.btn-outline:hover { background: rgba(255,255,255,0.1); color: white; }
.btn-success  { background: #27ae60; color: white; border-color: #27ae60; }
.btn-success:hover { background: #219a52; }
.btn-danger   { background: #e74c3c; color: white; border-color: #e74c3c; }
.btn-danger:hover { background: #c0392b; }
.btn-gold     { background: var(--gold); color: var(--primary-dark); border-color: var(--gold); font-weight: 700; }
.btn-gold:hover { background: #c9a227; }
.btn-block    { width: 100%; display: block; }

/* ============================================
   HERO SECTION
   ============================================ */
.hero-section {
  background: linear-gradient(135deg, var(--primary-dark) 0%, #2c5f8a 100%);
  padding: 30px 0;
}
.hero-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}
.hero-card {
  background: rgba(255,255,255,0.08);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.15);
}
.hero-img-placeholder {
  height: 180px;
  background: linear-gradient(135deg, rgba(200,168,75,0.3), rgba(26,58,92,0.5));
  display: flex;
  align-items: flex-start;
  padding: 15px;
}
.hero-cat {
  background: var(--accent);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}
.hero-content { padding: 20px; }
.hero-content h2 { color: white; font-size: 20px; margin-bottom: 10px; line-height: 1.5; }
.hero-content h2 a { color: white; }
.hero-content h2 a:hover { color: var(--accent); }
.hero-content p { color: rgba(255,255,255,0.75); font-size: 14px; margin-bottom: 12px; }
.hero-content .meta { display: flex; gap: 14px; font-size: 13px; color: rgba(255,255,255,0.6); flex-wrap: wrap; }

.hero-side { display: flex; flex-direction: column; gap: 14px; }
.side-card {
  background: rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 18px;
  border: 1px solid rgba(255,255,255,0.12);
  flex: 1;
}
.side-cat { font-size: 11px; background: rgba(200,168,75,0.3); color: var(--accent); padding: 3px 10px; border-radius: 15px; }
.side-card h3 { color: white; font-size: 16px; margin: 10px 0 8px; line-height: 1.5; }
.side-card h3 a { color: white; }
.side-card h3 a:hover { color: var(--accent); }
.side-card .meta { font-size: 12px; color: rgba(255,255,255,0.55); display: flex; gap: 10px; flex-wrap: wrap; }

/* ============================================
   CATEGORIES BAR
   ============================================ */
.cats-bar {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
  overflow-x: auto;
}
.cats-inner {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.cats-label { color: var(--text-muted); font-size: 13px; white-space: nowrap; }
.cats-bar a {
  color: var(--primary);
  padding: 4px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  font-size: 13px;
  white-space: nowrap;
  transition: all 0.2s;
}
.cats-bar a:hover { background: var(--primary); color: white; border-color: var(--primary); }

/* ============================================
   MAIN CONTENT GRID
   ============================================ */
.main-content { padding: 30px 0 50px; }
.content-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 28px;
}

/* ============================================
   ARTICLE CARDS
   ============================================ */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 10px;
}
.section-header h2 { font-size: 20px; color: var(--primary); }
.see-all { font-size: 13px; color: var(--accent); }

.articles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-bottom: 25px;
}

.article-card {
  background: white;
  border-radius: 12px;
  padding: 18px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: all 0.25s;
  position: relative;
}
.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}
.article-cat-badge {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  padding: 3px 10px;
  border-radius: 15px;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 8px;
  margin-left: 70px; /* leave room for views badge on the left */
}

/* Views count — TOP-LEFT corner of card (LTR position, since page is RTL "left" = CSS left) */
.article-views-top {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg);
  padding: 3px 9px;
  border-radius: 12px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 3px;
  z-index: 2;
}

.article-card h3 { font-size: 16px; margin-bottom: 8px; line-height: 1.6; }
.article-card h3 a { color: var(--text); }
.article-card h3 a:hover { color: var(--primary); }
.article-card p { color: var(--text-light); font-size: 13px; line-height: 1.9; margin-bottom: 12px; }

.article-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 10px;
  gap: 8px;
  flex-wrap: wrap;
}
.author-link {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  font-weight: 600;
}
.article-date { color: var(--text-muted); }

/* ============================================
   AUTHOR AVATARS / PHOTOS — fully round everywhere
   ============================================ */
.author-avatar {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50% !important;
  background: var(--primary);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
  vertical-align: middle;
}
.author-avatar.author-photo,
img.author-avatar {
  object-fit: cover;
  width: 32px;
  height: 32px;
  border-radius: 50% !important;
  aspect-ratio: 1 / 1;
}

.author-avatar-lg {
  width: 46px;
  height: 46px;
  min-width: 46px;
  border-radius: 50% !important;
  background: var(--primary);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}
img.author-avatar-lg {
  object-fit: cover;
  width: 46px;
  height: 46px;
  border-radius: 50% !important;
  aspect-ratio: 1 / 1;
}

.author-avatar-xl {
  width: 80px;
  height: 80px;
  min-width: 80px;
  border-radius: 50% !important;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
  margin: 0 auto 12px;
  overflow: hidden;
}
img.author-avatar-xl {
  object-fit: cover;
  width: 80px;
  height: 80px;
  border-radius: 50% !important;
  aspect-ratio: 1 / 1;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar { display: flex; flex-direction: column; gap: 18px; }
.sidebar-widget {
  background: white;
  border-radius: 12px;
  padding: 18px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.widget-title {
  font-size: 16px;
  color: var(--primary);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 8px;
  margin-bottom: 14px;
}

.search-form { display: flex; gap: 8px; }
.search-form input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font);
  font-size: 13px;
  direction: rtl;
}
.search-form button {
  padding: 8px 14px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font);
}

.author-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
}
.author-item:last-child { border-bottom: none; }
.author-item:hover { color: var(--primary); }
.author-item strong { display: block; font-size: 14px; }
.author-item small { color: var(--text-muted); font-size: 11px; }

.cat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--text);
}
.cat-item:last-child { border-bottom: none; }
.cat-item:hover { color: var(--primary); }
.cat-count {
  background: var(--primary-light);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}

.submit-widget { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: white; }
.submit-widget .widget-title { color: var(--accent); border-color: var(--accent); }
.submit-widget p { color: rgba(255,255,255,0.8); font-size: 13px; margin-bottom: 12px; }

.load-more-wrap { text-align: center; margin-top: 10px; }

/* ============================================
   BREADCRUMB
   ============================================ */
.breadcrumb {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
  font-size: 13px;
  color: var(--text-muted);
}
.breadcrumb span { margin: 0 6px; color: var(--text-muted); }
.breadcrumb a { color: var(--primary); }
.breadcrumb a:hover { color: var(--accent); }

/* ============================================
   ARTICLE DETAIL PAGE
   ============================================ */
.article-detail { padding: 28px 0 50px; }
.article-detail-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 28px;
}

.article-full {
  background: white;
  border-radius: 14px;
  padding: 32px;
  box-shadow: var(--shadow);
}
.article-full h1 {
  font-size: 26px;
  line-height: 1.5;
  margin: 12px 0 16px;
  color: var(--text);
}
.article-info {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
  margin-bottom: 20px;
}
.article-body {
  font-size: 18px;
  line-height: 2.3;
  color: var(--text);
}
.article-body p { margin-bottom: 18px; }
.article-body h2, .article-body h3 {
  color: var(--primary);
  margin: 20px 0 10px;
}

/* Font classes for submitted articles (kept for compatibility) */
.content-font-mehr { font-family: 'Mehr Nastaliq Web', serif; }
.content-font-noto { font-family: 'Noto Nastaliq Urdu', serif; }
.content-font-amiri { font-family: 'Amiri', serif; }
.content-font-scheherazade { font-family: 'Scheherazade New', serif; }
.content-font-alqalam { font-family: 'Al Qalam Quran Majeed', serif; }

/* Inline per-selection font spans (new editor behavior) */
.font-mehr-inline   { font-family: 'Mehr Nastaliq Web', serif; }
.font-noto-inline   { font-family: 'Noto Nastaliq Urdu', serif; }
.font-amiri-inline  { font-family: 'Amiri', serif; }
.font-scheherazade-inline { font-family: 'Scheherazade New', serif; }
.font-alqalam-inline { font-family: 'Al Qalam Quran Majeed', serif; }

/* Author box in article */
.author-profile {
  background: white;
  border-radius: 14px;
  padding: 24px;
  box-shadow: var(--shadow);
  text-align: center;
}
.author-profile h2 { font-size: 18px; margin: 10px 0 8px; }
.author-profile p { color: var(--text-light); font-size: 14px; line-height: 1.9; }

/* Author social icons (on profile pages) */
.author-social-icons {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.author-social-icons a {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
  transition: transform 0.2s;
}
.author-social-icons a:hover { transform: translateY(-3px); }
.social-icon-whatsapp  { background: #25D366; }
.social-icon-facebook  { background: #1877F2; }
.social-icon-instagram { background: linear-gradient(45deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888); }
.social-icon-twitter   { background: #1DA1F2; }

/* ============================================
   SHARE BUTTONS (article page) — brand icons
   ============================================ */
.share-section {
  background: white;
  border-radius: 12px;
  padding: 20px 25px;
  margin-top: 20px;
  box-shadow: var(--shadow);
  border-right: 4px solid var(--primary);
}
.share-section h3 { font-size: 16px; color: var(--primary); margin-bottom: 14px; }
.share-btns { display: flex; gap: 12px; flex-wrap: wrap; }
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  color: white;
  font-size: 19px;
  flex-shrink: 0;
}
.share-btn:hover { transform: translateY(-3px); box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
.share-btn.whatsapp { background: #25D366; }
.share-btn.facebook { background: #1877F2; }
.share-btn.twitter  { background: #1DA1F2; }
.share-btn.copy     { background: var(--primary); }

/* ============================================
   STATS ROW
   ============================================ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.stat-box {
  background: white;
  border-radius: 12px;
  padding: 22px 16px;
  text-align: center;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.stat-box .num { font-size: 32px; font-weight: 700; color: var(--primary); }
.stat-box .lbl { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ============================================
   ADMIN TABLE
   ============================================ */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.admin-table th {
  background: var(--primary);
  color: white;
  padding: 12px 14px;
  font-size: 14px;
  text-align: right;
}
.admin-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--primary-light); }

/* BADGES */
.badge { padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.badge-published { background: #d4efdf; color: #1e8449; }
.badge-pending   { background: #fdebd0; color: #d68910; }
.badge-rejected  { background: #fadbd8; color: #c0392b; }

/* ============================================
   AUTH PAGES
   ============================================ */
.auth-page {
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}
.auth-box {
  background: white;
  border-radius: 16px;
  padding: 36px;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 4px 30px rgba(0,0,0,0.12);
}
.auth-box h2 {
  font-size: 22px;
  color: var(--primary);
  margin-bottom: 20px;
  text-align: center;
}
.auth-links {
  text-align: center;
  margin-top: 18px;
  font-size: 14px;
  color: var(--text-muted);
}
.auth-links a { color: var(--primary); font-weight: 600; }
.auth-links a:hover { color: var(--accent); }

/* ============================================
   FORMS
   ============================================ */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 7px;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  font-family: var(--font);
  font-size: 16px;
  direction: rtl;
  color: var(--text);
  background: white;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,58,92,0.08);
  outline: none;
}
.form-group textarea { min-height: 120px; resize: vertical; }

/* ALERTS */
.alert {
  padding: 13px 16px;
  border-radius: 9px;
  margin-bottom: 16px;
  font-size: 14px;
}
.alert-error   { background: #fdecea; color: #c0392b; border: 1px solid #f5c6cb; }
.alert-success { background: #d4efdf; color: #1e8449; border: 1px solid #c3e6cb; }

/* ============================================
   DASHBOARD
   ============================================ */
.dashboard { padding: 28px 0 50px; }
.dashboard-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
}
.dashboard-sidebar {
  background: white;
  border-radius: 14px;
  padding: 24px;
  box-shadow: var(--shadow);
  height: fit-content;
  position: sticky;
  top: 90px;
}
.dash-user {
  text-align: center;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.dash-nav a {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 4px;
  transition: all 0.2s;
}
.dash-nav a:hover,
.dash-nav a.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.75);
  padding: 40px 0 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  padding-bottom: 30px;
}
.footer-col h3 { color: var(--accent); font-size: 18px; margin-bottom: 12px; }
.footer-col h4 { color: var(--accent); font-size: 15px; margin-bottom: 12px; }
.footer-col p { font-size: 13px; line-height: 1.9; }
.footer-col ul li { margin-bottom: 7px; }
.footer-col ul li a { color: rgba(255,255,255,0.7); font-size: 13px; }
.footer-col ul li a:hover { color: var(--accent); }
.footer-social a {
  display: inline-block;
  background: rgba(255,255,255,0.1);
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  margin-left: 6px;
  margin-top: 8px;
}
.footer-social a:hover { background: var(--accent); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 16px 0;
  text-align: center;
  font-size: 13px;
  color: rgba(255,255,255,0.5);
}

/* ============================================
   PROMO BANNER ADS (homepage)
   ============================================ */
.promo-banner-wrap {
  margin: 18px 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.promo-banner-wrap img {
  width: 100%;
  display: block;
  border-radius: 12px;
}

/* ============================================
   ADMIN: LOGO / SETTINGS UPLOAD BOXES
   ============================================ */
.settings-photo-preview {
  width: 140px;
  max-height: 80px;
  object-fit: contain;
  display: block;
  margin-bottom: 10px;
  background: var(--bg);
  border-radius: 8px;
  padding: 8px;
  border: 1px solid var(--border);
}
.banner-photo-preview {
  width: 100%;
  max-width: 320px;
  border-radius: 8px;
  display: block;
  margin-bottom: 10px;
  border: 1px solid var(--border);
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .content-grid { grid-template-columns: 1fr 280px; }
  .footer-grid  { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  body { font-size: 15px; }

  /* Mobile Header */
  .header-actions { display: none; }
  .mobile-menu-btn { display: flex !important; }

  /* Header order: menu button FIRST (rightmost in RTL), then logo */
  .header-inner {
    flex-direction: row;
    justify-content: flex-start;
  }
  .mobile-menu-btn { order: 1; }
  .logo            { order: 2; }
  .main-nav        { order: 3; }
  .header-actions  { order: 4; }

  .site-logo-img { height: 38px; max-width: 130px; }
  .logo h1 { font-size: 19px; }
  .logo p  { font-size: 10px; }

  /* Mobile Nav — slides down from header */
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    background: var(--primary-dark);
    z-index: 9999;
    border-top: 2px solid var(--accent);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
  }
  .main-nav.open { display: block !important; }
  .main-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 8px 0;
  }
  .main-nav ul li a {
    padding: 13px 20px;
    font-size: 16px;
    border-radius: 0;
    border-bottom: 1px solid rgba(255,255,255,0.07);
  }
  .main-nav ul li:last-child a { border-bottom: none; }

  /* Grid layouts */
  .content-grid        { grid-template-columns: 1fr; }
  .hero-grid           { grid-template-columns: 1fr; }
  .hero-side           { display: none; }
  .articles-grid       { grid-template-columns: 1fr; }
  .article-detail-grid { grid-template-columns: 1fr; }
  .dashboard-grid      { grid-template-columns: 1fr; }
  .stats-row           { grid-template-columns: repeat(3, 1fr); }
  .footer-grid         { grid-template-columns: 1fr 1fr; }

  .article-full { padding: 20px; }
  .article-full h1 { font-size: 20px; }
  .article-body { font-size: 16px; }

  .auth-box { padding: 24px 18px; }

  /* Ensure avatars stay round and visible on mobile everywhere */
  .author-avatar, img.author-avatar { width: 30px; height: 30px; min-width: 30px; }
  .author-avatar-lg, img.author-avatar-lg { width: 42px; height: 42px; min-width: 42px; }
  .author-avatar-xl, img.author-avatar-xl { width: 70px; height: 70px; min-width: 70px; }

  .share-btn { width: 40px; height: 40px; font-size: 17px; }
}

@media (max-width: 480px) {
  .stats-row           { grid-template-columns: 1fr; }
  .footer-grid         { grid-template-columns: 1fr; }
  .articles-grid       { grid-template-columns: 1fr; }
  .logo h1             { font-size: 17px; }
  .hero-content h2     { font-size: 17px; }
  .site-logo-img       { height: 32px; max-width: 110px; }
}






/* ===== DASHBOARD MOBILE COMPLETE FIX ===== */
@media (max-width: 768px) {

  /* Dashboard grid — ایک کالم */
  .dashboard-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 14px !important;
    width: 100% !important;
  }

  /* Sidebar کارڈ */
  .dashboard-sidebar {
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 16px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }

  /* یوزر پروفائل باکس */
  .dash-user {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    padding-bottom: 14px !important;
    width: 100% !important;
  }

  /* پروفائل فوٹو */
  .photo-preview-circle {
    width: 80px !important;
    height: 80px !important;
    min-width: 80px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    margin: 0 auto 10px !important;
    display: block !important;
  }

  .photo-placeholder {
    width: 80px !important;
    height: 80px !important;
    min-width: 80px !important;
    border-radius: 50% !important;
    font-size: 28px !important;
    margin: 0 auto 10px !important;
  }

  /* Nav links موبائل میں گرڈ */
  .dash-nav {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
    width: 100% !important;
  }

  .dash-nav a {
    padding: 9px 10px !important;
    font-size: 13px !important;
    text-align: center !important;
    border: 1px solid var(--border) !important;
    border-radius: 8px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  /* Main content area */
  .dashboard > .container > .dashboard-grid > div:last-child {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }

  /* Dash box */
  .dash-box {
    width: 100% !important;
    max-width: 100% !important;
    padding: 16px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .dash-box-title {
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  .dash-box-title h2 {
    font-size: 16px !important;
  }

  /* Table scroll */
  .table-wrap {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .admin-table {
    min-width: 480px !important;
    font-size: 12px !important;
  }

  .admin-table th,
  .admin-table td {
    padding: 8px 10px !important;
    white-space: nowrap !important;
  }

  /* Stats row */
  .stats-row {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
  }

  .stat-box {
    padding: 12px 6px !important;
  }

  .stat-box .num {
    font-size: 20px !important;
  }

  .stat-box .lbl {
    font-size: 10px !important;
  }

  /* Profile form */
  .photo-upload-label {
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Buttons */
  .btn {
    font-size: 13px !important;
    padding: 8px 14px !important;
  }

  .btn-block {
    width: 100% !important;
  }
}

@media (max-width: 400px) {
  .dash-nav {
    grid-template-columns: 1fr !important;
  }

  .stats-row {
    grid-template-columns: 1fr 1fr !important;
  }
}

