/* ==========================================================
   ACHARID BLOG — Premium Editorial SaaS Design System
   Stripe / Linear inspired. Pure CSS variables.
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Noto+Sans+Arabic:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --background: #ffffff;
  --background-alt: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f4f5f7;
  --border: #e5e7eb;
  --border-strong: #d1d5db;

  --text: #0b1020;
  --text-muted: #4b5563;
  --text-soft: #6b7280;

  --primary: #0b1020;
  /* deep navy/near black */
  --primary-2: #151a2e;
  --accent: #4f46e5;
  /* electric indigo */
  --accent-hover: #4338ca;
  --accent-soft: #eef2ff;

  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;

  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --shadow-sm: 0 1px 2px rgba(11, 16, 32, 0.04);
  --shadow: 0 1px 3px rgba(11, 16, 32, 0.06), 0 1px 2px rgba(11, 16, 32, 0.04);
  --shadow-md: 0 4px 12px rgba(11, 16, 32, 0.06), 0 2px 4px rgba(11, 16, 32, 0.04);
  --shadow-lg: 0 10px 30px rgba(11, 16, 32, 0.08);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, monospace;

  --container: 1200px;
  --article-max: 760px;

  --header-h: 68px;
}

/* Dark mode */
[data-theme="dark"] {
  --background: #0a0e1a;
  --background-alt: #0f1424;
  --surface: #111827;
  --surface-2: #161d2e;
  --border: #1f2937;
  --border-strong: #374151;

  --text: #e5e7eb;
  --text-muted: #9ca3af;
  --text-soft: #6b7280;

  --primary: #e5e7eb;
  --primary-2: #f3f4f6;
  --accent: #818cf8;
  --accent-hover: #a5b4fc;
  --accent-soft: #1e1b4b;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* RTL adjustments — applied on <html dir="rtl"> */
html[dir="rtl"] {
  --font-sans: 'Noto Sans Arabic', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, sans-serif;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--background);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background .2s ease, color .2s ease;
}

img,
svg,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color .15s ease;
}

a:hover {
  color: var(--accent-hover);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

ul {
  list-style: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--text);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2rem, 4vw + 0.5rem, 3.25rem);
  font-weight: 800;
}

h2 {
  font-size: clamp(1.5rem, 2.5vw + 0.5rem, 2.25rem);
}

h3 {
  font-size: 1.35rem;
}

h4 {
  font-size: 1.1rem;
}

p {
  color: var(--text-muted);
}

::selection {
  background: var(--accent);
  color: #fff;
}

/* ---------- Layout ---------- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: 72px 0;
}

.section-sm {
  padding: 40px 0;
}

.section-lg {
  padding: 100px 0;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.section-head h2 {
  flex: 1;
  min-width: 200px;
}

.section-head .link {
  font-weight: 500;
  font-size: 0.95rem;
  white-space: nowrap;
}

.section-head .link::after {
  content: ' →';
  transition: margin .15s;
}

.section-head .link:hover::after {
  margin-left: 4px;
}

html[dir="rtl"] .section-head .link::after {
  content: ' ←';
}

html[dir="rtl"] .section-head .link:hover::after {
  margin-left: 0;
  margin-right: 4px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
}

[data-theme="dark"] .site-header {
  background: rgba(10, 14, 26, 0.8);
}

.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-desktop a {
  color: var(--text-muted);
  font-size: 0.93rem;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--radius);
  transition: background .15s, color .15s;
}

.nav-desktop a:hover,
.nav-desktop a.active {
  color: var(--text);
  background: var(--surface-2);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  color: var(--text-muted);
  transition: background .15s, color .15s;
}

.icon-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: all .15s;
}

.lang-switch:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.lang-switch .sep {
  color: var(--border-strong);
}

.lang-switch .active {
  color: var(--text);
  font-weight: 600;
}

.menu-toggle {
  display: none;
}

/* ---------- Hero ---------- */
.hero {
  padding: 80px 0 60px;
  background:
    radial-gradient(900px 400px at 85% 10%, var(--accent-soft) 0%, transparent 60%),
    var(--background);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 56px;
  align-items: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 20px;
}

.hero-eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.hero h1 {
  margin-bottom: 20px;
}

.hero h1 .accent {
  color: var(--accent);
}

.hero .lead {
  font-size: 1.15rem;
  line-height: 1.65;
  max-width: 560px;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius);
  transition: all .15s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--text-muted);
  color: #fff;
}

.btn-primary:hover {
  background: var(--text-muted);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-accent {
  background: var(--accent);
  color: #fff;
}

.btn-accent:hover {
  background: var(--accent-hover);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
}

.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}

.hero-search {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 10px 10px 10px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-md);
  max-width: 560px;
}

.hero-search input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  padding: 8px 0;
}

.hero-search input::placeholder {
  color: var(--text-soft);
}

.hero-visual {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.hero-visual::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
}

.hero-visual .card-mock {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-lg);
  font-size: 0.85rem;
  color: var(--text);
}

.card-mock.c1 {
  top: 24px;
  left: 24px;
}

.card-mock.c2 {
  top: 120px;
  right: 24px;
  width: 200px;
}

.card-mock.c3 {
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
}

.card-mock .mini-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--surface-2);
  margin-top: 8px;
}

.card-mock .mini-bar.fill {
  background: var(--accent);
  width: 70%;
}

/* ---------- Article Cards ---------- */
.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.featured-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 28px;
}

.featured-main .article-card {
  height: 100%;
}

.article-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.article-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.article-card .thumb {
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--primary-2), var(--accent));
  position: relative;
  overflow: hidden;
}

.article-card .thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.12), transparent 50%);
}

.article-card .thumb.ai {
  background: linear-gradient(135deg, #4f46e5, #818cf8);
}

.article-card .thumb.saas {
  background: linear-gradient(135deg, #0891b2, #06b6d4);
}

.article-card .thumb.biz {
  background: linear-gradient(135deg, #059669, #10b981);
}

.article-card .thumb.sec {
  background: linear-gradient(135deg, #dc2626, #f97316);
}

.article-card .thumb.comp {
  background: linear-gradient(135deg, #7c3aed, #ec4899);
}

.article-card .thumb svg {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 48px;
  height: 48px;
  color: rgba(255, 255, 255, 0.9);
  z-index: 1;
}

.article-card .body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 10px;
}

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: 999px;
  align-self: flex-start;
}

.article-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}

.article-card h3 a {
  color: inherit;
}

.article-card h3 a:hover {
  color: var(--accent);
}

.article-card .excerpt {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card .meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--text-soft);
  margin-top: auto;
  padding-top: 10px;
}

.author-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.author-chip .avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 700;
}

/* ---------- Category strips ---------- */
.category-strip {
  padding: 48px 0;
  border-top: 1px solid var(--border);
}

.category-strip:first-of-type {
  border-top: none;
  padding-top: 0;
}

/* ---------- Newsletter ---------- */
.newsletter {
  background: var(--text-muted);
  color: #fff;
  border-radius: var(--radius-xl);
  padding: 56px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.newsletter::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--warning) 0%, transparent 60%);
  top: -300px;
  right: -200px;
  opacity: 0.4;
  pointer-events: none;
}

.newsletter h2 {
  color: #fff;
  position: relative;
}

.newsletter p {
  color: rgba(255, 255, 255, 0.8);
  max-width: 520px;
  margin: 12px auto 28px;
  position: relative;
}

.newsletter-form {
  display: flex;
  gap: 8px;
  max-width: 480px;
  margin: 0 auto;
  background: #000000;
  border-radius: var(--radius);
  padding: 6px;
  position: relative;
}

.newsletter-form input {
  flex: 1;
  border: none;
  outline: none;
  padding: 12px 14px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text);
  background: transparent;
}

.newsletter-form button {
  padding: 12px 22px;
  background: var(--text-muted);
  color: #fff;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.92rem;
}

.newsletter-form button:hover {
  background: var(--accent);
}

.newsletter-note {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 14px;
  position: relative;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--background-alt);
  border-top: 1px solid var(--border);
  padding: 64px 0 24px;
  margin-top: 80px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}

.footer-brand {
  max-width: 340px;
}

.footer-brand p {
  font-size: 0.92rem;
  margin-top: 12px;
}

.footer-col h4 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-soft);
  margin-bottom: 16px;
  font-weight: 600;
}

.footer-col a {
  display: block;
  color: var(--text-muted);
  font-size: 0.92rem;
  padding: 4px 0;
}

.footer-col a:hover {
  color: var(--text);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-soft);
}

/* ---------- Article page ---------- */
.article-wrap {
  padding: 40px 0 80px;
}

.breadcrumbs {
  font-size: 0.88rem;
  color: var(--text-soft);
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.breadcrumbs a {
  color: var(--text-muted);
}

.breadcrumbs .sep {
  color: var(--text-soft);
}

.article-header {
  max-width: var(--article-max);
  margin: 0 auto 32px;
}

.article-header .badge {
  margin-bottom: 16px;
}

.article-header h1 {
  font-size: clamp(1.75rem, 3vw + 0.5rem, 2.75rem);
  margin-bottom: 20px;
  letter-spacing: -0.025em;
}

.article-header .lead {
  font-size: 1.15rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.article-meta .author-chip .avatar {
  width: 40px;
  height: 40px;
  font-size: 0.9rem;
}

.article-meta .author-name {
  font-weight: 600;
  color: var(--text);
  font-size: 0.95rem;
}

.article-meta .author-role {
  font-size: 0.82rem;
  color: var(--text-soft);
}

.article-meta .dot {
  color: var(--border-strong);
}

.article-meta .dates {
  font-size: 0.85rem;
  color: var(--text-soft);
}

.featured-img {
  aspect-ratio: 16/8;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  margin-bottom: 40px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  position: relative;
}

.featured-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.12), transparent 50%);
}

.article-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 56px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.article-content {
  max-width: var(--article-max);
  width: 100%;
}

.article-sidebar {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  align-self: start;
}

/* Prose */
.prose {
  font-size: 1.08rem;
  line-height: 1.75;
  color: var(--text);
}

.prose p {
  color: var(--text);
  margin-bottom: 1.4em;
}

.prose h2 {
  margin-top: 2em;
  margin-bottom: 0.6em;
  font-size: 1.6rem;
}

.prose h3 {
  margin-top: 1.6em;
  margin-bottom: 0.5em;
  font-size: 1.3rem;
}

.prose ul,
.prose ol {
  margin-bottom: 1.4em;
  padding-left: 1.4em;
}

html[dir="rtl"] .prose ul,
html[dir="rtl"] .prose ol {
  padding-left: 0;
  padding-right: 1.4em;
}

.prose li {
  margin-bottom: 0.5em;
  color: var(--text);
}

.prose ul li {
  list-style: disc;
}

.prose ol li {
  list-style: decimal;
}

.prose strong {
  color: var(--text);
  font-weight: 600;
}

.prose a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose code {
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--accent);
}

.prose pre {
  background: var(--primary);
  color: #e5e7eb;
  padding: 20px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin-bottom: 1.4em;
  font-size: 0.9rem;
}

.prose blockquote {
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 20px;
  margin: 1.4em 0;
  color: var(--text-muted);
  font-style: italic;
}

html[dir="rtl"] .prose blockquote {
  border-left: none;
  border-right: 3px solid var(--accent);
  padding: 4px 20px 4px 0;
}

.prose img {
  border-radius: var(--radius);
  margin: 1.5em 0;
}

/* Quick answer box */
.quick-answer {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin: 28px 0;
}

.quick-answer h3 {
  color: var(--accent);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.quick-answer p {
  color: var(--text);
  font-weight: 500;
  margin: 0;
}

/* TOC */
.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 24px 0 36px;
}

.toc h4 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-soft);
  margin-bottom: 12px;
  font-weight: 600;
}

.toc ol {
  counter-reset: toc;
  padding-left: 0;
}

.toc li {
  list-style: none;
  counter-increment: toc;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.toc li:last-child {
  border-bottom: none;
}

.toc li::before {
  content: counter(toc, decimal-leading-zero);
  color: var(--accent);
  font-weight: 600;
  margin-right: 10px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.toc a {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
}

.toc a:hover {
  color: var(--accent);
}

/* Sidebar widgets */
.sidebar-widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 20px;
}

.sidebar-widget h4 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-soft);
  margin-bottom: 14px;
  font-weight: 600;
}

.sidebar-widget .item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.sidebar-widget .item:last-child {
  border-bottom: none;
}

.sidebar-widget .item a {
  color: var(--text);
  font-weight: 500;
  display: block;
}

.sidebar-widget .item a:hover {
  color: var(--accent);
}

.sidebar-widget .item small {
  color: var(--text-soft);
  font-size: 0.78rem;
}

/* Comparison table */
.compare-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 0.95rem;
}

.compare-table th,
.compare-table td {
  padding: 12px 14px;
  text-align: start;
  border-bottom: 1px solid var(--border);
}

html[dir="rtl"] .compare-table th,
html[dir="rtl"] .compare-table td {
  text-align: right;
}

.compare-table th {
  background: var(--surface-2);
  font-weight: 600;
  color: var(--text);
}

.compare-table tr:last-child td {
  border-bottom: none;
}

/* FAQ */
.faq {
  margin: 40px 0;
}

.faq h2 {
  margin-bottom: 20px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
  background: var(--surface);
}

.faq-q {
  width: 100%;
  text-align: start;
  padding: 18px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.faq-q::after {
  content: '+';
  font-size: 1.4rem;
  color: var(--accent);
  transition: transform .2s;
}

.faq-item.open .faq-q::after {
  content: '−';
}

.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height .25s ease, padding .25s ease;
  padding: 0 22px;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.faq-item.open .faq-a {
  max-height: 400px;
  padding: 0 22px 18px;
}

/* Author box */
.author-box {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 40px 0;
}

.author-box .avatar-lg {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  font-weight: 700;
  flex-shrink: 0;
}

.author-box h3 {
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.author-box .role {
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 10px;
}

.author-box p {
  font-size: 0.92rem;
}

/* Ad placeholder */
.ad-placeholder {
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-soft);
  margin-bottom: 25px;
  min-height: 100px;
  display: grid;
  place-items: center;
  
}

.ad-top {
  min-height: 90px;
  max-width: 760px;
  place-content: center;
  place-items: center;
  
}

.ad-in-article {
  min-height: 90px;
  place-content: center;
}

.ad-in-article-2 {
  min-height: 90px;
  place-content: center;
}

.ad-sidebar {
  min-height: 250px;
  place-content: center;
}
.ad-bottom {
  min-height: 120px;
  place-content: center;
}

/* Related */
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 32px;
}

/* Search modal */
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 16, 32, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
}

.search-overlay.active {
  display: flex;
}

.search-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 92%;
  max-width: 640px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.search-modal input {
  width: 100%;
  padding: 20px 24px;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 1.1rem;
  font-family: inherit;
}

.search-results {
  max-height: 420px;
  overflow-y: auto;
  border-top: 1px solid var(--border);
}

.search-result {
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 14px;
  align-items: center;
  cursor: pointer;
}

.search-result:last-child {
  border-bottom: none;
}

.search-result:hover {
  background: var(--surface-2);
}

.search-result .sr-thumb {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  flex-shrink: 0;
}

.search-result .sr-title {
  font-weight: 600;
  color: var(--text);
  font-size: 0.95rem;
}

.search-result .sr-meta {
  font-size: 0.8rem;
  color: var(--text-soft);
}

.search-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-soft);
  font-size: 0.92rem;
}

/* Mobile menu */
.mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 86%;
  max-width: 360px;
  background: var(--surface);
  z-index: 300;
  transform: translateX(100%);
  transition: transform .25s ease;
  padding: 20px;
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
}

html[dir="rtl"] .mobile-menu {
  right: auto;
  left: 0;
  transform: translateX(-100%);
}

.mobile-menu.active {
  transform: translateX(0);
}

.mobile-menu .close {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  margin-bottom: 12px;
}

.mobile-menu .close:hover {
  background: var(--surface-2);
}

.mobile-menu nav a {
  display: block;
  padding: 14px 4px;
  color: var(--text);
  font-weight: 500;
  font-size: 1.02rem;
  border-bottom: 1px solid var(--border);
}

.mobile-menu nav a:last-child {
  border-bottom: none;
}

.mobile-menu .lang-switch {
  margin-top: 24px;
  width: 100%;
  justify-content: center;
}

.mobile-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 250;
  display: none;
}

.mobile-backdrop.active {
  display: block;
}

/* Category listing page */
.category-hero {
  padding: 60px 0 32px;
  border-bottom: 1px solid var(--border);
}

.category-hero h1 {
  font-size: 2.25rem;
  margin-bottom: 10px;
}

.category-hero p {
  max-width: 640px;
  font-size: 1.05rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hero-visual {
    aspect-ratio: 16/10;
  }

  .article-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .featured-grid {
    grid-template-columns: 1fr;
  }

  .article-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .article-sidebar {
    position: static;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }

  .nav-desktop {
    display: none;
  }

  .menu-toggle {
    display: grid;
  }

  .header-actions .icon-btn.search {
    display: grid;
  }

  .lang-switch .label {
    display: none;
  }
}

@media (max-width: 640px) {
  .section {
    padding: 48px 0;
  }

  .hero {
    padding: 48px 0 40px;
  }

  .article-grid {
    grid-template-columns: 1fr;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }

  .newsletter {
    padding: 40px 24px;
  }

  .newsletter-form {
    flex-direction: column;
    padding: 10px;
  }

  .newsletter-form input {
    padding: 12px;
  }

  .newsletter-form button {
    width: 100%;
    padding: 14px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn {
    justify-content: center;
  }

  .author-box {
    flex-direction: column;
    text-align: center;
  }

  .author-box .avatar-lg {
    margin: 0 auto;
  }
}

@media (max-width: 360px) {
  .container {
    padding: 0 16px;
  }

  body {
    font-size: 15px;
  }
}

/* Utilities */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.newsletter-form1 {
  display: flex;
  gap: 8px;
  max-width: 100%;
  margin: 0 ;
  background: #000000;
  border-radius: var(--radius);
  padding: 6px;
  position: relative;
  flex-wrap: wrap;
  align-items: center;
}
.newsletter-form1 input {
  flex: 1;
  border: none;
  outline: none;
  padding: 12px 14px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text);
  background: transparent;
  min-width: 0;
}

.newsletter-form1 button {
  padding: 12px 22px;
  background: var(--text-muted);
  color: #fff;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.92rem;
}

.newsletter-form1 button:hover {
  background: var(--accent);
}

.newsletter-note {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 14px;
  position: relative;
}
