/* ================================
   Article Farm — RTL-First SEO Theme
   ================================ */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;900&family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --bg-primary:   #0D0F14;
  --bg-secondary: #13161E;
  --bg-card:      #1A1D27;
  --bg-hover:     #20243A;
  --accent:       #6366F1;
  --accent-light: #818CF8;
  --accent-dim:   rgba(99,102,241,.15);
  --red:          #EF4444;
  --red-dim:      rgba(239,68,68,.15);
  --gold:         #F59E0B;
  --text-primary: #E2E8F0;
  --text-secondary:#94A3B8;
  --text-muted:   #64748B;
  --border:       rgba(255,255,255,.07);
  --border-hover: rgba(99,102,241,.4);
  --shadow:       0 4px 24px rgba(0,0,0,.4);
  --shadow-lg:    0 8px 48px rgba(0,0,0,.6);
  --radius:       12px;
  --radius-lg:    20px;
  --font-ar:      'Cairo', sans-serif;
  --font-en:      'Outfit', sans-serif;
  --transition:   all .25s cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  background: var(--bg-primary); color: var(--text-primary); font-family: var(--font-ar);
  line-height: 1.75; min-height: 100vh; direction: ltr; text-align: left;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

/* Skip link for accessibility */
.skip-link {
  position: absolute; top: -40px; left: 0;
  background: var(--accent); color: #fff;
  padding: 8px 16px; z-index: 10000;
  font-weight: 700; border-radius: 0 0 8px 0;
  transition: top .2s ease;
}
.skip-link:focus { top: 0; }

/* Prevent content from being hidden by sticky share bar on mobile */
@media(max-width: 768px) {
  body:has(.share-bar-sticky) { padding-bottom: 60px; }
}
body.lang-ar { font-family: var(--font-ar); }
body.lang-en { font-family: var(--font-en); }

/* --- RTL Arabic Alignment Overrides --- */
body.lang-ar .card-body {
  direction: rtl;
  text-align: right;
}
body.lang-ar .card-title,
body.lang-ar .card-excerpt,
body.lang-ar .hero-featured-excerpt,
body.lang-ar .hero-featured-title,
body.lang-ar .hero-side-body,
body.lang-ar .footer-desc,
body.lang-ar .footer-col-title,
body.lang-ar .footer-links,
body.lang-ar .footer-bottom,
body.lang-ar .articles-count,
body.lang-ar .articles-header,
body.lang-ar .cat-filter-bar,
body.lang-ar .author-desc,
body.lang-ar .author-name,
body.lang-ar .related-inline-title {
  direction: rtl;
  text-align: right;
}
body.lang-ar .hero-featured-body {
  direction: rtl;
  text-align: right;
}
body.lang-ar .footer-bottom {
  display: flex;
  flex-direction: row-reverse;
  justify-content: space-between;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; transition: var(--transition); }

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

.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: 24px; }
@media(max-width:1024px){ .grid-3,.grid-4{ grid-template-columns: repeat(2,1fr); } }
@media(max-width:640px) { .grid-3,.grid-4,.grid-2{ grid-template-columns: 1fr; } }

.ticker-bar { background: var(--red); color: #fff; font-size: .85rem; font-weight: 700; padding: 8px 0; overflow: hidden; white-space: nowrap; }
.ticker-label { background: #B91C1C; padding: 0 16px; margin-inline-end: 12px; display: inline-block; letter-spacing: .05em; }
.ticker-content { display: inline-block; animation: ticker 35s linear infinite; }
@media (prefers-reduced-motion: reduce) {
  .ticker-content { animation: none; white-space: normal; display: block; }
}
@keyframes ticker { 0%{ transform: translateX(100vw); } 100%{ transform: translateX(-100%); } }

.site-header { position: sticky; top: 0; z-index: 100; background: rgba(13,15,20,.92); backdrop-filter: blur(16px); border-bottom: 1px solid var(--border); padding: 14px 0; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.25rem; }
.logo-img { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; }
.logo span { background: linear-gradient(135deg,var(--accent),var(--accent-light)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.nav { display: flex; align-items: center; gap: 4px; }
.nav-link { padding: 7px 14px; border-radius: 8px; font-size: .9rem; font-weight: 500; color: var(--text-secondary); transition: var(--transition); }
.nav-link:hover, .nav-link.active { background: var(--accent-dim); color: var(--accent-light); }

.lang-switch { display: flex; align-items: center; gap: 4px; background: var(--bg-card); border-radius: 8px; padding: 4px; }
.lang-btn { padding: 5px 12px; border-radius: 6px; font-size: .8rem; font-weight: 600; cursor: pointer; border: none; background: transparent; color: var(--text-muted); transition: var(--transition); }
.lang-btn.active { background: var(--accent); color: #fff; }

.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 4px; }
.hamburger span { width: 24px; height: 2px; background: var(--text-primary); border-radius: 2px; transition: var(--transition); }
@media(max-width:768px){ .hamburger{ display: flex; } .nav{ display: none; position: absolute; top: 100%; inset-inline-start: 0; right: 0; background: var(--bg-secondary); flex-direction: column; padding: 12px; gap: 4px; border-bottom: 1px solid var(--border); } .nav.open{ display: flex; } }

.hero { padding: 60px 0 40px; background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(99,102,241,.18) 0%, transparent 70%); }
.hero-title { font-size: clamp(2rem,5vw,3.5rem); font-weight: 900; line-height: 1.2; }
.hero-title span { background: linear-gradient(135deg,var(--accent),var(--accent-light),#A78BFA); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero-sub { color: var(--text-secondary); font-size: 1.1rem; margin-top: 12px; max-width: 600px; }

.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: var(--transition); display: flex; flex-direction: column; }
.card:hover { transform: translateY(-4px); border-color: var(--border-hover); box-shadow: var(--shadow); }
.card-img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.card-img-placeholder { width: 100%; aspect-ratio: 16/9; background: linear-gradient(135deg,var(--bg-hover),var(--accent-dim)); display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 2rem; }
.card-body { padding: 18px; flex: 1; display: flex; flex-direction: column; gap: 10px; }
.card-cat { display: inline-flex; align-items: center; gap: 6px; background: var(--accent-dim); color: var(--accent-light); font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 4px 10px; border-radius: 20px; }
.card-cat.breaking { background: var(--red-dim); color: #FCA5A5; }
.card-title { font-size: 1rem; font-weight: 700; line-height: 1.5; color: var(--text-primary); flex: 1; }
.card-title:hover { color: var(--accent-light); }
.card-excerpt { font-size: .85rem; color: var(--text-secondary); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; align-items: center; justify-content: space-between; font-size: .78rem; color: var(--text-muted); margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }
.card-meta .views::before { content: "👁 "; }

.card-featured { grid-column: span 2; }
.card-featured .card-img { aspect-ratio: 21/9; }
.card-featured .card-title { font-size: 1.3rem; }
@media(max-width:640px){ .card-featured{ grid-column: span 1; } }

.section { padding: 40px 0; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.section-title { font-size: 1.4rem; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.section-title::before { content: ""; width: 4px; height: 1.4em; background: var(--accent); border-radius: 4px; display: inline-block; }
.section-link { font-size: .85rem; color: var(--accent-light); font-weight: 600; }
.section-link:hover { color: #fff; }

/* ── Clean Article Single-Column Layout ────────────────────────────── */
.article-container-clean {
  max-width: 860px; margin: 0 auto; padding: 40px 20px;
}
.article-main-clean {
  width: 100%;
}

.article-page { display: block; }

.article-header { margin-bottom: 28px; }
.article-cat { margin-bottom: 12px; }
.article-title { font-size: clamp(1.8rem, 5vw, 2.8rem); font-weight: 900; line-height: 1.35; margin-bottom: 16px; text-align: right; direction: rtl; background: linear-gradient(135deg, #E2E8F0, #94A3B8); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
body.lang-en .article-title { text-align: left; direction: ltr; }
.article-meta { display: flex; align-items: center; gap: 16px; color: var(--text-muted); font-size: .85rem; flex-wrap: wrap; margin-bottom: 20px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.article-meta span { display: flex; align-items: center; gap: 6px; }
.article-cover { width: 100%; border-radius: var(--radius-lg); aspect-ratio: 16/9; object-fit: cover; margin-bottom: 32px; }

.article-body { font-size: 1.1rem; line-height: 1.95; color: var(--text-primary); direction: rtl; text-align: right; }
body.lang-en .article-body { direction: ltr; text-align: left; }

.article-body h2 { font-size: 1.55rem; font-weight: 800; margin: 36px 0 16px; color: var(--accent-light); text-align: right; direction: rtl; border-right: 4px solid var(--accent); padding-right: 12px; scroll-margin-top: 80px; }
body.lang-en .article-body h2 { text-align: left; direction: ltr; border-right: none; border-left: 4px solid var(--accent); padding-right: 0; padding-left: 12px; }
.article-body h3 { font-size: 1.25rem; font-weight: 700; margin: 24px 0 10px; color: var(--text-secondary); text-align: right; direction: rtl; }
body.lang-en .article-body h3 { text-align: left; direction: ltr; }
.article-body p { margin-bottom: 20px; text-align: justify; text-align-last: right; direction: rtl; hyphens: auto; word-break: break-word; overflow-wrap: break-word; }
body.lang-en .article-body p { text-align: justify; text-align-last: left; direction: ltr; word-break: break-word; overflow-wrap: break-word; }
.article-body strong { color: var(--accent-light); font-weight: 700; }
.article-body ul, .article-body ol { margin: 16px 0; padding-right: 24px; padding-left: 0; }
body.lang-en .article-body ul, body.lang-en .article-body ol { padding-left: 24px; padding-right: 0; }
.article-body li { margin-bottom: 8px; line-height: 1.9; }
.article-body li::marker { color: var(--accent); }
.article-body a { color: var(--accent-light); text-decoration: underline; text-decoration-color: rgba(129,140,248,.4); transition: var(--transition); }
.article-body a:hover { color: var(--gold); text-decoration-color: var(--gold); }
.article-body img { width: 100%; border-radius: var(--radius); margin: 24px 0; border: 1px solid var(--border); }
.article-body blockquote { background: var(--accent-dim); border-right: 4px solid var(--accent); padding: 16px 20px; margin: 24px 0; border-radius: 8px; font-style: italic; color: var(--text-secondary); direction: rtl; text-align: right; }
body.lang-en .article-body blockquote { border-right: none; border-left: 4px solid var(--accent); direction: ltr; text-align: left; }
.article-body table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: .9rem; direction: rtl; }
body.lang-en .article-body table { direction: ltr; }
.article-body th, .article-body td { border: 1px solid var(--border); padding: 10px 14px; text-align: right; }
body.lang-en .article-body th, body.lang-en .article-body td { text-align: left; }
.article-body th { background: var(--bg-hover); font-weight: 700; color: var(--accent-light); }
.article-body pre { background: #0a0c12; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; overflow-x: auto; margin: 20px 0; direction: ltr; text-align: left; }
.article-body code { font-family: 'Courier New', Courier, monospace; background: #1A1D27; padding: 2px 6px; border-radius: 4px; font-size: .9em; direction: ltr; }

/* ── Recommendations Section ────────────────────────────────────────── */
.recommendations-section {
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
  padding: 60px 0;
  margin-top: 60px;
}
.recommendations-title {
  font-size: 1.5rem; font-weight: 800; margin-bottom: 28px;
  display: flex; align-items: center; gap: 10px;
}
.recommendations-title::before {
  content: ""; width: 4px; height: 1.3em; background: var(--accent); border-radius: 4px;
}


.article-info { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding: 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 24px; }
.article-info-item { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--text-muted); }
.article-reading-time { display: inline-flex; align-items: center; gap: 6px; background: var(--accent-dim); color: var(--accent-light); padding: 4px 12px; border-radius: 20px; font-size: .8rem; font-weight: 700; }

.breadcrumb-nav { display: flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--text-muted); margin-bottom: 20px; flex-wrap: wrap; list-style: none; padding: 0; }
.breadcrumb-nav a { color: var(--accent-light); font-weight: 600; }
.breadcrumb-nav a:hover { text-decoration: underline; }
.breadcrumb-sep { color: var(--border-hover); }
.breadcrumb-current { color: var(--text-secondary); font-weight: 500; }

.share-bar { display: flex; align-items: center; gap: 10px; margin: 32px 0; padding: 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); flex-wrap: wrap; }
.share-title { font-size: .85rem; font-weight: 700; color: var(--text-secondary); margin-inline-end: 8px; }
.share-btn { padding: 8px 16px; border-radius: 8px; font-size: .8rem; font-weight: 600; cursor: pointer; border: none; transition: var(--transition); color: #fff; display: inline-flex; align-items: center; gap: 6px; }
.share-btn:hover { transform: translateY(-2px); opacity: .9; }
.share-btn.twitter { background: #1DA1F2; }
.share-btn.whatsapp { background: #25D366; }
.share-btn.facebook { background: #1877F2; }
.share-btn.copy { background: var(--bg-hover); border: 1px solid var(--border); color: var(--text-secondary); }

.faq-section { margin: 40px 0; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; }
.faq-title { font-size: 1.4rem; font-weight: 800; margin-bottom: 20px; color: var(--accent-light); text-align: right; direction: rtl; }
body.lang-en .faq-title { text-align: left; direction: ltr; }
.faq-item { border-bottom: 1px solid var(--border); padding: 16px 0; }
.faq-item:last-child { border-bottom: none; }
.faq-question { font-size: 1.05rem; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--text-primary); text-align: right; direction: rtl; }
body.lang-en .faq-question { text-align: left; direction: ltr; }
.faq-question::after { content: "▼"; font-size: .7rem; color: var(--accent-light); transition: var(--transition); flex-shrink: 0; }
.faq-question.open::after { transform: rotate(180deg); }
.faq-answer { font-size: .95rem; color: var(--text-secondary); line-height: 1.9; margin-top: 12px; display: none; text-align: right; direction: rtl; }
body.lang-en .faq-answer { text-align: left; direction: ltr; }
.faq-answer.visible { display: block; animation: fadeInUp .3s ease; }

.author-box { display: flex; gap: 16px; align-items: flex-start; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin: 32px 0; direction: ltr; text-align: left; }
body.lang-ar .author-box > div { direction: rtl; text-align: right; }
.author-avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 2px solid var(--accent); }
.author-name { font-weight: 700; font-size: 1rem; color: var(--text-primary); }
.author-desc { font-size: .85rem; color: var(--text-muted); margin-top: 4px; line-height: 1.6; }

.related-inline { margin: 32px 0; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.related-inline-title { font-size: 1.1rem; font-weight: 800; margin-bottom: 16px; color: var(--accent-light); text-align: right; direction: rtl; }
body.lang-en .related-inline-title { text-align: left; direction: ltr; }

.tags-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.tag { background: var(--bg-hover); border: 1px solid var(--border); padding: 6px 14px; border-radius: 20px; font-size: .8rem; color: var(--text-secondary); transition: var(--transition); }
.tag:hover { border-color: var(--accent); color: var(--accent-light); }

.sidebar { display: flex; flex-direction: column; gap: 28px; }
.sidebar-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.sidebar-title { font-size: 1rem; font-weight: 800; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--border); text-align: right; direction: rtl; }
body.lang-en .sidebar-title { text-align: left; direction: ltr; }
.sidebar-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); align-items: flex-start; }
.sidebar-item:last-child { border: none; padding-bottom: 0; }
.sidebar-item-img { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.sidebar-item-title { font-size: .85rem; font-weight: 600; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.admin-wrap { padding: 40px 0; max-width: 720px; margin: 0 auto; }
.admin-title { font-size: 1.8rem; font-weight: 900; margin-bottom: 28px; }
.form-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 32px; }
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: .85rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }
.form-input, .form-select, .form-textarea { width: 100%; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 8px; padding: 11px 14px; color: var(--text-primary); font-family: inherit; font-size: .95rem; transition: var(--transition); }
.form-input:focus, .form-select:focus, .form-textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.form-textarea { min-height: 100px; resize: vertical; }
.form-check { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; cursor: pointer; }
.form-check input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
.model-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.model-card { border: 2px solid var(--border); border-radius: var(--radius); padding: 14px 16px; cursor: pointer; transition: var(--transition); }
.model-card.selected { border-color: var(--accent); background: var(--accent-dim); }
.model-card-name { font-weight: 700; font-size: .9rem; }
.model-card-desc { font-size: .78rem; color: var(--text-muted); margin-top: 4px; }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 24px; border-radius: 10px; font-weight: 700; font-size: .9rem; cursor: pointer; border: none; transition: var(--transition); font-family: inherit; }
.btn-primary { background: linear-gradient(135deg,var(--accent),#4F46E5); color: #fff; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(99,102,241,.4); }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text-secondary); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent-light); }
.btn-danger { background: var(--red); color: #fff; }
.btn-full { width: 100%; justify-content: center; }
.btn-sm { padding: 7px 14px; font-size: .8rem; }

.alert { padding: 14px 18px; border-radius: 10px; font-size: .9rem; margin-bottom: 18px; border: 1px solid; display: flex; align-items: center; gap: 10px; }
.alert-success { background: rgba(34,197,94,.1); border-color: rgba(34,197,94,.3); color: #86EFAC; }
.alert-error   { background: var(--red-dim); border-color: rgba(239,68,68,.3); color: #FCA5A5; }
.alert-info    { background: var(--accent-dim); border-color: rgba(99,102,241,.3); color: var(--accent-light); }

.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: .75rem; font-weight: 700; }
.badge-red { background: var(--red-dim); color: #FCA5A5; }
.badge-accent { background: var(--accent-dim); color: var(--accent-light); }
.badge-gold { background: rgba(245,158,11,.15); color: #FCD34D; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 32px 0; }
.page-btn { padding: 8px 16px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-secondary); font-weight: 600; cursor: pointer; transition: var(--transition); }
.page-btn:hover { border-color: var(--accent); color: var(--accent-light); }
.page-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.site-footer { background: var(--bg-secondary); border-top: 1px solid var(--border); padding: 48px 0 24px; margin-top: 60px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 36px; }
@media(max-width:768px){ .footer-grid{ grid-template-columns: 1fr 1fr; gap: 28px; } }
@media(max-width:480px){ .footer-grid{ grid-template-columns: 1fr; } }
.footer-brand .logo { margin-bottom: 12px; }
.footer-desc { font-size: .85rem; color: var(--text-muted); line-height: 1.7; }
.footer-col-title { font-weight: 800; font-size: .9rem; margin-bottom: 14px; color: var(--text-secondary); }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a { font-size: .85rem; color: var(--text-muted); transition: var(--transition); }
.footer-links a:hover { color: var(--accent-light); }
.footer-bottom { padding-top: 24px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; font-size: .8rem; color: var(--text-muted); }

.login-page { min-height: 80vh; display: flex; align-items: center; justify-content: center; }
.login-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 40px; width: 100%; max-width: 400px; }
.login-title { font-size: 1.5rem; font-weight: 900; text-align: center; margin-bottom: 28px; }

.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent-light); }
.text-red { color: #FCA5A5; }
.mt-4 { margin-top: 16px; } .mt-8 { margin-top: 32px; }
.mb-4 { margin-bottom: 16px; } .mb-8 { margin-bottom: 32px; }
.flex { display: flex; } .items-center { align-items: center; } .gap-2 { gap: 8px; }
.hidden { display: none !important; }

@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.animate-in { animation: fadeInUp .4s ease both; }
.delay-1 { animation-delay: .1s; } .delay-2 { animation-delay: .2s; } .delay-3 { animation-delay: .3s; }

::-webkit-scrollbar { width: 6px; } ::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 3px; }

.skeleton { background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-hover) 50%, var(--bg-card) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius); }
@keyframes shimmer { 0%{ background-position: 200% 0; } 100%{ background-position: -200% 0; } }

.source-badge { display: inline-flex; align-items: center; gap: 6px; background: var(--bg-hover); padding: 4px 10px; border-radius: 20px; font-size: .75rem; color: var(--text-muted); }
.source-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }

.progress-wrap { background: var(--bg-hover); border-radius: 20px; height: 8px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg,var(--accent),var(--accent-light)); border-radius: 20px; transition: width .5s ease; }

/* ── Reading Progress Bar ──────────────────────────────────────────── */
#reading-progress {
  position: fixed; top: 0; left: 0; right: 0; z-index: 9999;
  height: 3px; background: transparent; pointer-events: none;
}
#reading-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #A78BFA, var(--gold));
  width: 0%; transition: width .1s linear;
}

/* ── Table of Contents ─────────────────────────────────────────────── */
.toc-box {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 24px; margin: 0 0 32px;
  border-right: 4px solid var(--accent);
}
body.lang-en .toc-box { border-right: none; border-left: 4px solid var(--accent); }
.toc-title {
  font-size: .9rem; font-weight: 800; color: var(--accent-light);
  margin-bottom: 14px; display: flex; align-items: center; gap: 8px;
  text-transform: uppercase; letter-spacing: .06em;
}
.toc-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.toc-list li a {
  font-size: .88rem; color: var(--text-secondary); font-weight: 500;
  display: flex; align-items: flex-start; gap: 8px; line-height: 1.5;
  transition: var(--transition); padding: 2px 0;
}
.toc-list li a::before {
  content: "›"; color: var(--accent); font-size: 1rem; flex-shrink: 0;
  margin-top: 1px;
}
.toc-list li a:hover { color: var(--accent-light); padding-right: 4px; }
body.lang-en .toc-list li a:hover { padding-right: 0; padding-left: 4px; }

/* ── Article Figure / Hero Image ───────────────────────────────────── */
.article-figure {
  margin: 0 0 36px; border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  position: relative;
}
.article-figure img {
  width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block;
  transition: transform .4s ease;
}
.article-figure:hover img { transform: scale(1.01); }
.article-figure-caption {
  background: rgba(13,15,20,.85); backdrop-filter: blur(8px);
  padding: 10px 16px; font-size: .78rem; color: var(--text-muted);
  text-align: center; direction: rtl; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.article-cat-label {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent); color: #fff;
  font-size: .7rem; font-weight: 800; letter-spacing: .08em;
  padding: 4px 12px; border-radius: 20px; text-transform: uppercase;
  position: absolute; top: 16px; right: 16px; z-index: 2;
}
body.lang-en .article-cat-label { right: auto; left: 16px; }

/* ── Sticky Share Bar (Mobile) ─────────────────────────────────────── */
.share-bar-sticky {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
  background: rgba(19,22,30,.96); backdrop-filter: blur(16px);
  border-top: 1px solid var(--border); padding: 10px 16px;
  align-items: center; justify-content: space-around; gap: 8px;
}
@media(max-width: 768px) { .share-bar-sticky { display: flex; } }
.share-bar-sticky .share-btn { flex: 1; justify-content: center; font-size: .75rem; padding: 8px 4px; }

/* ── Related Articles Grid (Inline) ────────────────────────────────── */
.related-inline-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px;
}
@media(max-width: 500px) { .related-inline-grid { grid-template-columns: 1fr; } }
.related-inline-card {
  display: flex; gap: 10px; background: var(--bg-secondary);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 10px;
  transition: var(--transition); align-items: flex-start;
}
.related-inline-card:hover { border-color: var(--border-hover); background: var(--bg-hover); }
.related-inline-img {
  width: 64px; height: 64px; border-radius: 8px; object-fit: cover; flex-shrink: 0;
}
.related-inline-title {
  font-size: .82rem; font-weight: 600; line-height: 1.4; color: var(--text-primary);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.related-inline-title:hover { color: var(--accent-light); }
.related-inline-cat { font-size: .7rem; color: var(--accent-light); font-weight: 700; margin-bottom: 4px; display: block; }

/* ── Category Filter Bar ───────────────────────────────────────────── */
.cat-filter-bar {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 32px;
  padding-bottom: 20px; border-bottom: 1px solid var(--border);
}
.cat-filter-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px; border-radius: 20px; font-size: .82rem; font-weight: 600;
  border: 1.5px solid var(--border); background: var(--bg-card);
  color: var(--text-secondary); cursor: pointer; transition: var(--transition);
  text-decoration: none;
}
.cat-filter-btn:hover,
.cat-filter-btn.active {
  border-color: var(--accent); background: var(--accent-dim);
  color: var(--accent-light); transform: translateY(-1px);
}
.cat-filter-btn .cat-count {
  background: var(--bg-hover); border-radius: 10px; padding: 1px 7px;
  font-size: .7rem; color: var(--text-muted);
}
.cat-filter-btn.active .cat-count { background: rgba(99,102,241,.3); color: var(--accent-light); }

/* ── Articles Page List View ───────────────────────────────────────── */
.articles-header {
  margin-bottom: 28px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px;
}
.articles-count { font-size: .85rem; color: var(--text-muted); }

/* ── Home Featured Hero Article ────────────────────────────────────── */
.hero-featured {
  display: grid; grid-template-columns: 1.5fr 1fr; gap: 32px;
  margin-bottom: 40px; align-items: stretch;
}
@media(max-width: 768px) { .hero-featured { grid-template-columns: 1fr; } }
.hero-featured-main {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; transition: var(--transition);
  display: flex; flex-direction: column;
}
.hero-featured-main:hover { border-color: var(--border-hover); box-shadow: var(--shadow-lg); }
.hero-featured-main img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.hero-featured-body { padding: 24px; flex: 1; display: flex; flex-direction: column; gap: 12px; }
.hero-featured-title {
  font-size: clamp(1.2rem, 2.5vw, 1.6rem); font-weight: 900; line-height: 1.35;
  color: var(--text-primary);
}
.hero-featured-title:hover { color: var(--accent-light); }
.hero-featured-excerpt { font-size: .9rem; color: var(--text-secondary); line-height: 1.8; }
.hero-featured-side { display: flex; flex-direction: column; gap: 14px; }
.hero-side-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; gap: 0; transition: var(--transition);
  flex-direction: row; align-items: stretch; height: 100px;
}
.hero-side-card:hover { border-color: var(--border-hover); }
.hero-side-card img { width: 100px; height: 100px; object-fit: cover; flex-shrink: 0; }
.hero-side-body { padding: 10px 14px; flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.hero-side-title { font-size: .85rem; font-weight: 700; line-height: 1.4; color: var(--text-primary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hero-side-title:hover { color: var(--accent-light); }
.hero-side-meta { font-size: .72rem; color: var(--text-muted); }

/* ── SEO Hidden Extras ─────────────────────────────────────────────── */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

