/* =========================================
   MoneyWise / ماني وايز — Main Stylesheet
   Finance & Money Saving Site
   ========================================= */

/* ---------- CSS Variables ---------- */
:root {
  --primary: #1a7f4b;
  --primary-dark: #145f38;
  --primary-light: #e8f5ee;
  --accent: #f5a623;
  --accent-dark: #d4891a;
  --text-dark: #1a1a2e;
  --text-mid: #404060;
  --text-light: #6b7280;
  --bg-white: #ffffff;
  --bg-light: #f8fafb;
  --bg-section: #f0f7f3;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.12);
  --radius: 12px;
  --radius-sm: 8px;
  --font-main: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --font-arabic: 'Segoe UI', 'Tahoma', 'Arial Unicode MS', sans-serif;
  --transition: .25s ease;
}

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

html { scroll-behavior: smooth; font-size: 16px; }
html[dir="rtl"] { font-family: var(--font-arabic); }
html[dir="ltr"] { font-family: var(--font-main); }

body {
  color: var(--text-dark);
  background: var(--bg-white);
  line-height: 1.7;
  overflow-x: hidden;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4, h5 {
  line-height: 1.3;
  color: var(--text-dark);
  font-weight: 700;
}

p { color: var(--text-mid); margin-bottom: 1rem; }

ul { list-style: none; }

.container { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.container--narrow { max-width: 800px; margin: 0 auto; padding: 0 24px; }

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.text-accent { color: var(--accent); }
.text-primary { color: var(--primary); }
.badge {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  font-size: .75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.badge--accent { background: #fff7e6; color: var(--accent-dark); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 50px;
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn--primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn--primary:hover { background: var(--primary-dark); color: #fff; border-color: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn--outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn--outline:hover { background: var(--primary); color: #fff; }
.btn--accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn--accent:hover { background: var(--accent-dark); border-color: var(--accent-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn--sm { padding: 8px 20px; font-size: .85rem; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.25rem;
}
.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.logo-text .en { font-size: 1.05rem; font-weight: 700; color: var(--text-dark); }
.logo-text .ar { font-size: .7rem; color: var(--text-light); direction: rtl; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-links a {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: .9rem;
  color: var(--text-dark);
  transition: all var(--transition);
}
.nav-links a:hover, .nav-links a.active {
  background: var(--primary-light);
  color: var(--primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Language Toggle */
.lang-toggle {
  display: flex;
  align-items: center;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 3px;
  cursor: pointer;
  gap: 0;
}
.lang-btn {
  padding: 5px 12px;
  border-radius: 50px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-light);
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  background: transparent;
}
.lang-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  background: none;
  border: none;
}
.hamburger span {
  width: 24px;
  height: 2px;
  background: var(--text-dark);
  border-radius: 2px;
  transition: all var(--transition);
}

/* Mobile Nav */
.mobile-nav {
  display: none;
  flex-direction: column;
  background: var(--bg-white);
  border-top: 1px solid var(--border);
  padding: 16px 24px 20px;
  gap: 4px;
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  color: var(--text-dark);
}
.mobile-nav a:hover { background: var(--primary-light); color: var(--primary); }

/* ---------- AdSense Ad Slots ---------- */
.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fafafa;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-light);
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .05em;
  text-transform: uppercase;
  overflow: hidden;
}
.ad-slot--leaderboard { width: 100%; min-height: 90px; max-height: 90px; }
.ad-slot--rectangle { width: 300px; min-height: 250px; }
.ad-slot--large-rect { width: 336px; min-height: 280px; }
.ad-slot--banner { width: 100%; min-height: 60px; }
.ad-slot--in-content { width: 100%; min-height: 90px; margin: 28px 0; }

/* Strip (full-width top/bottom bar) */
.ad-strip {
  background: var(--bg-light);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  text-align: center;
}

/* ---------- Hero Section ---------- */
.hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, #27ae74 100%);
  color: #fff;
  padding: 80px 0 90px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  position: relative;
}
.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,.15);
  color: rgba(255,255,255,.95);
  padding: 6px 16px;
  border-radius: 50px;
  font-size: .8rem;
  font-weight: 600;
  margin-bottom: 20px;
  letter-spacing: .06em;
  text-transform: uppercase;
  border: 1px solid rgba(255,255,255,.2);
}
.hero h1 {
  color: #fff;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.2;
  margin-bottom: 18px;
}
.hero h1 span { color: var(--accent); }
.hero p {
  color: rgba(255,255,255,.85);
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 32px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* Stats strip inside hero */
.hero-stats {
  display: flex;
  gap: 32px;
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid rgba(255,255,255,.2);
}
.stat-item { text-align: center; }
.stat-num {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
  display: block;
}
.stat-label { font-size: .78rem; color: rgba(255,255,255,.75); }

/* Hero right (card panel) */
.hero-card {
  background: rgba(255,255,255,.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 20px;
  padding: 32px;
  color: #fff;
}
.hero-card h3 { color: #fff; margin-bottom: 18px; font-size: 1.1rem; }
.tip-list { display: flex; flex-direction: column; gap: 12px; }
.tip-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  background: rgba(255,255,255,.08);
  border-radius: var(--radius-sm);
}
.tip-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.tip-content p { color: rgba(255,255,255,.9); font-size: .85rem; margin: 0; }
.tip-content strong { color: #fff; font-size: .9rem; display: block; margin-bottom: 2px; }

/* ---------- Section Base ---------- */
.section { padding: 72px 0; }
.section--gray { background: var(--bg-section); }
.section--dark { background: var(--text-dark); }
.section-header { text-align: center; margin-bottom: 48px; }
.section-header h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin-bottom: 12px; }
.section-header p { color: var(--text-light); font-size: 1rem; max-width: 600px; margin: 0 auto; }

/* ---------- Category Pills ---------- */
.categories {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 44px;
}
.cat-pill {
  padding: 8px 20px;
  border-radius: 50px;
  border: 1.5px solid var(--border);
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-mid);
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-white);
}
.cat-pill:hover, .cat-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ---------- Article Cards ---------- */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
}
.articles-grid--featured {
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: auto;
}
.articles-grid--featured .card--featured { grid-row: span 2; }

.card {
  background: var(--bg-white);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: transparent; }

.card-img {
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--primary-light), #d4edda);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  overflow: hidden;
  position: relative;
}
.card-img .cat-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--primary);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
html[dir="rtl"] .card-img .cat-tag { left: auto; right: 12px; }

.card-body { padding: 24px; flex: 1; display: flex; flex-direction: column; }
.card-body h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
  line-height: 1.4;
}
.card-body h3 a { color: var(--text-dark); }
.card-body h3 a:hover { color: var(--primary); }
.card-body p { font-size: .875rem; color: var(--text-light); flex: 1; line-height: 1.6; margin-bottom: 16px; }

.card-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: .78rem;
  color: var(--text-light);
  margin-top: auto;
}
.card-meta span { display: flex; align-items: center; gap: 4px; }

/* ---------- Featured Post (large card) ---------- */
.card--featured .card-img { aspect-ratio: 16/9; font-size: 5rem; }
.card--featured .card-body h3 { font-size: 1.3rem; }
.card--featured .card-body p { font-size: .9rem; }

/* ---------- Sidebar Layout ---------- */
.content-sidebar {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
  align-items: start;
}
html[dir="rtl"] .content-sidebar { direction: rtl; }

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: sticky;
  top: 88px;
}
.sidebar-widget {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.widget-header {
  background: var(--primary);
  color: #fff;
  padding: 14px 20px;
  font-weight: 700;
  font-size: .9rem;
}
.widget-body { padding: 20px; }
.widget-list { display: flex; flex-direction: column; gap: 14px; }
.widget-list-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.widget-list-item:last-child { border-bottom: none; padding-bottom: 0; }
.widget-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  font-size: .75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.widget-list-item h4 { font-size: .85rem; font-weight: 600; line-height: 1.3; color: var(--text-dark); }
.widget-list-item h4 a { color: var(--text-dark); }
.widget-list-item h4 a:hover { color: var(--primary); }
.widget-list-item span { font-size: .72rem; color: var(--text-light); }

/* ---------- Article Page ---------- */
.article-header { padding: 48px 0 40px; background: var(--bg-section); border-bottom: 1px solid var(--border); }
.article-header .breadcrumb {
  font-size: .8rem;
  color: var(--text-light);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.article-header .breadcrumb a { color: var(--primary); }
.article-title { font-size: clamp(1.7rem, 3.5vw, 2.5rem); line-height: 1.25; margin-bottom: 16px; }
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-size: .83rem;
  color: var(--text-light);
}
.article-meta span { display: flex; align-items: center; gap: 6px; }

.article-content { padding: 48px 0 60px; }
.article-content h2 { font-size: 1.5rem; margin: 36px 0 14px; padding-top: 8px; border-top: 2px solid var(--primary-light); }
.article-content h3 { font-size: 1.2rem; margin: 24px 0 10px; color: var(--primary-dark); }
.article-content p { margin-bottom: 18px; font-size: 1rem; line-height: 1.8; }
.article-content ul, .article-content ol {
  margin: 0 0 18px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
html[dir="rtl"] .article-content ul,
html[dir="rtl"] .article-content ol { margin: 0 24px 18px 0; }
.article-content li { font-size: .975rem; color: var(--text-mid); line-height: 1.7; }
.article-content li::marker { color: var(--primary); }

.article-content blockquote {
  border-left: 4px solid var(--primary);
  background: var(--primary-light);
  padding: 16px 22px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 24px 0;
  font-style: italic;
  color: var(--text-mid);
}
html[dir="rtl"] .article-content blockquote {
  border-left: none;
  border-right: 4px solid var(--primary);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.highlight-box {
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin: 28px 0;
}
.highlight-box h4 { color: var(--primary); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.highlight-box ul { margin: 0; }

/* Table styles for articles */
.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: .9rem;
}
.article-content th {
  background: var(--primary);
  color: #fff;
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
}
html[dir="rtl"] .article-content th { text-align: right; }
.article-content td { padding: 11px 16px; border-bottom: 1px solid var(--border); }
.article-content tr:hover td { background: var(--bg-section); }

/* Share section */
.share-section {
  border-top: 1px solid var(--border);
  padding-top: 28px;
  margin-top: 40px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.share-btn {
  padding: 8px 20px;
  border-radius: 50px;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  color: #fff;
}
.share-btn--twitter { background: #1da1f2; }
.share-btn--facebook { background: #1877f2; }
.share-btn--copy { background: var(--text-light); cursor: pointer; }
.share-btn:hover { opacity: .9; transform: translateY(-1px); transition: all var(--transition); }

/* ---------- Tips / Feature Boxes ---------- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 24px;
}
.feature-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: all var(--transition);
  text-align: center;
}
.feature-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: var(--primary-light); }
.feature-icon {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), #27ae74);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 18px;
}
.feature-card h3 { font-size: 1rem; margin-bottom: 8px; }
.feature-card p { font-size: .875rem; color: var(--text-light); margin: 0; }

/* ---------- Newsletter ---------- */
.newsletter-section {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff;
  padding: 64px 0;
  text-align: center;
}
.newsletter-section h2 { color: #fff; font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 10px; }
.newsletter-section p { color: rgba(255,255,255,.82); margin-bottom: 28px; }
.newsletter-form {
  display: flex;
  max-width: 500px;
  margin: 0 auto;
  gap: 0;
  border-radius: 50px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.newsletter-form input {
  flex: 1;
  padding: 14px 22px;
  border: none;
  font-size: .95rem;
  outline: none;
  color: var(--text-dark);
}
.newsletter-form button {
  padding: 14px 28px;
  background: var(--accent);
  color: #fff;
  border: none;
  font-weight: 700;
  font-size: .9rem;
  cursor: pointer;
  transition: background var(--transition);
  white-space: nowrap;
}
.newsletter-form button:hover { background: var(--accent-dark); }
.newsletter-note { font-size: .75rem; color: rgba(255,255,255,.55); margin-top: 12px; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--text-dark);
  color: rgba(255,255,255,.75);
  padding: 60px 0 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.footer-brand .logo .logo-text .en { color: #fff; }
.footer-brand p { margin-top: 14px; font-size: .875rem; line-height: 1.7; }
.footer-col h4 { color: #fff; font-size: .9rem; margin-bottom: 16px; }
.footer-col ul { display: flex; flex-direction: column; gap: 10px; }
.footer-col li a { color: rgba(255,255,255,.65); font-size: .85rem; transition: color var(--transition); }
.footer-col li a:hover { color: var(--accent); }

.footer-bottom {
  padding: 22px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .82rem;
}
.footer-bottom a { color: rgba(255,255,255,.55); }
.footer-bottom a:hover { color: var(--accent); }

/* ---------- Breadcrumb / page hero ---------- */
.page-hero {
  background: linear-gradient(to right, var(--primary), #27ae74);
  color: #fff;
  padding: 48px 0;
  text-align: center;
}
.page-hero h1 { color: #fff; font-size: clamp(1.6rem, 3vw, 2.3rem); }
.page-hero p { color: rgba(255,255,255,.85); margin-top: 8px; }

/* ---------- Contact Form ---------- */
.contact-form {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px;
}
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-weight: 600;
  font-size: .88rem;
  margin-bottom: 6px;
  color: var(--text-dark);
}
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .95rem;
  transition: border-color var(--transition);
  outline: none;
  color: var(--text-dark);
  font-family: inherit;
  background: var(--bg-white);
}
.form-group input:focus, .form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,127,75,.1);
}
.form-group textarea { min-height: 130px; resize: vertical; }

/* ---------- About Page ---------- */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
}
.team-card {
  text-align: center;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 20px;
  transition: all var(--transition);
}
.team-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.team-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #27ae74);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 14px;
}
.team-card h3 { font-size: 1rem; margin-bottom: 4px; }
.team-card p { font-size: .82rem; color: var(--text-light); margin: 0; }

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 48px;
}
.page-num {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .88rem;
  font-weight: 600;
  border: 1.5px solid var(--border);
  color: var(--text-mid);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}
.page-num:hover, .page-num.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ---------- Toast Notification ---------- */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--text-dark);
  color: #fff;
  padding: 14px 22px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  box-shadow: var(--shadow-lg);
  z-index: 999;
  transform: translateY(20px);
  opacity: 0;
  transition: all .35s ease;
  pointer-events: none;
}
html[dir="rtl"] .toast { right: auto; left: 28px; }
.toast.show { transform: translateY(0); opacity: 1; }

/* ---------- Scroll to Top ---------- */
.scroll-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 44px;
  height: 44px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 99;
  opacity: 0;
  transform: translateY(20px);
  transition: all var(--transition);
  box-shadow: var(--shadow-md);
}
.scroll-top.visible { opacity: 1; transform: translateY(0); }
.scroll-top:hover { background: var(--primary-dark); transform: translateY(-2px); }
html[dir="rtl"] .scroll-top { right: auto; left: 28px; }

/* ---------- RTL Adjustments ---------- */
html[dir="rtl"] .card-img .cat-tag { left: auto; right: 12px; }
html[dir="rtl"] .footer-grid { direction: rtl; }
html[dir="rtl"] .hero-inner { direction: rtl; }
html[dir="rtl"] .article-content blockquote {
  border-left: none;
  border-right: 4px solid var(--primary);
}
html[dir="rtl"] .breadcrumb { direction: rtl; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .articles-grid--featured { grid-template-columns: 1fr 1fr; }
  .articles-grid--featured .card--featured { grid-column: span 2; grid-row: span 1; }
  .content-sidebar { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero-card { display: none; }
  .hero-stats { justify-content: space-between; }
  .articles-grid { grid-template-columns: 1fr; }
  .articles-grid--featured { grid-template-columns: 1fr; }
  .articles-grid--featured .card--featured { grid-column: span 1; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; gap: 10px; text-align: center; }
  .newsletter-form { flex-direction: column; border-radius: var(--radius); }
  .newsletter-form input { border-radius: var(--radius-sm); }
  .newsletter-form button { border-radius: var(--radius-sm); }
  .features-grid { grid-template-columns: 1fr 1fr; }
  .hero-stats { flex-wrap: wrap; gap: 16px; }
}

@media (max-width: 480px) {
  .section { padding: 48px 0; }
  .features-grid { grid-template-columns: 1fr; }
  .hero { padding: 52px 0 64px; }
  .hero-actions { flex-direction: column; align-items: flex-start; }
}
