/* ── reset & base ─────────────────────────────────────────────────── */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-bg: #ffffff;
  --color-text: #1a1a2e;
  --color-muted: #555;
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-accent: #f0f4ff;
  --color-border: #e2e8f0;
  --max-width: 960px;
  --radius: 8px;
}

html {
  font-size: 18px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ── typography ───────────────────────────────────────────────────── */

h1, h2, h3 {
  line-height: 1.3;
  font-weight: 700;
}

h1 { font-size: 2.2rem; margin-bottom: 0.75rem; }
h2 { font-size: 1.6rem; margin-bottom: 0.6rem; }
h3 { font-size: 1.2rem; margin-bottom: 0.4rem; }

p { margin-bottom: 1rem; }

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

ul {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}
li { margin-bottom: 0.4rem; }

/* ── header ────────────────────────────────────────────────────────── */

header {
  border-bottom: 1px solid var(--color-border);
  padding: 1rem 0;
}

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.02em;
}
.logo:hover { text-decoration: none; color: var(--color-primary); }

nav ul {
  display: flex;
  list-style: none;
  gap: 1.5rem;
  padding: 0;
  margin: 0;
}

nav a {
  color: var(--color-muted);
  font-weight: 500;
  font-size: 0.95rem;
}
nav a:hover {
  color: var(--color-primary);
  text-decoration: none;
}

/* ── language toggle ───────────────────────────────────────────────── */

.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
}

.lang-btn {
  background: none;
  border: 1px solid var(--color-border);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--color-primary);
  font-size: 0.85rem;
  font-weight: 500;
}
.lang-btn:hover {
  background: var(--color-accent);
}

.lang-active {
  font-weight: 700;
  color: var(--color-text);
}

/* ── footer ────────────────────────────────────────────────────────── */

footer {
  border-top: 1px solid var(--color-border);
  margin-top: 4rem;
  padding: 2rem 0;
  text-align: center;
  color: var(--color-muted);
  font-size: 0.85rem;
}

/* ── hero ──────────────────────────────────────────────────────────── */

.hero {
  padding: 5rem 0 3rem;
  text-align: center;
  background: linear-gradient(180deg, var(--color-accent) 0%, var(--color-bg) 100%);
}

.hero h1 {
  font-size: 2.8rem;
  max-width: 700px;
  margin: 0 auto 1rem;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--color-muted);
  max-width: 600px;
  margin: 0 auto 2rem;
}

/* ── buttons ───────────────────────────────────────────────────────── */

.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  transition: background 0.2s, transform 0.1s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}
.btn-primary:hover { background: var(--color-primary-dark); }

/* ── features grid ─────────────────────────────────────────────────── */

.features {
  padding: 3rem 0;
}

.features h2 {
  text-align: center;
  margin-bottom: 2rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
}

.feature-card {
  padding: 1.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
}

.feature-card h3 { margin-bottom: 0.5rem; }
.feature-card p { color: var(--color-muted); font-size: 0.95rem; }

/* ── cta ───────────────────────────────────────────────────────────── */

.cta {
  text-align: center;
  padding: 3rem 0 5rem;
}

.cta h2 { margin-bottom: 0.5rem; }
.cta p { color: var(--color-muted); margin-bottom: 1.5rem; }

/* ── page header ───────────────────────────────────────────────────── */

.page-header {
  padding: 3rem 0 2rem;
  text-align: center;
  background: var(--color-accent);
}

.page-header h1 { margin-bottom: 0.25rem; }
.page-header p { color: var(--color-muted); font-size: 1rem; }

/* ── service cards ─────────────────────────────────────────────────── */

.services-list { padding: 3rem 0; }

.service-card {
  padding: 2rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.service-card h2 { font-size: 1.3rem; margin-bottom: 0.5rem; }
.service-card p { color: var(--color-muted); margin-bottom: 0; }

/* ── about ─────────────────────────────────────────────────────────── */

.about-content { padding: 3rem 0; }
.about-content h2 { margin-top: 2rem; }
.about-content h2:first-child { margin-top: 0; }

/* ── contact ───────────────────────────────────────────────────────── */

.contact-content { padding: 3rem 0; }

.contact-card {
  max-width: 640px;
  margin: 0 auto;
  padding: 2rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.contact-email {
  font-size: 1.1rem;
  padding: 1rem 0;
}
.contact-note {
  font-style: italic;
  color: var(--color-muted);
  margin-top: 1.5rem;
}

/* ── article list ──────────────────────────────────────────────────── */

.article-list { padding: 3rem 0; }

.article-card {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--color-border);
}

.article-card:first-child { padding-top: 0; }

.article-card h2 {
  font-size: 1.3rem;
  margin-bottom: 0.25rem;
}
.article-card h2 a { color: var(--color-text); }
.article-card h2 a:hover { color: var(--color-primary); }

.article-card time {
  display: block;
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-bottom: 0.5rem;
}

.article-card p {
  font-size: 0.95rem;
  color: var(--color-muted);
}

.read-more {
  font-weight: 600;
  font-size: 0.9rem;
}

.empty-state {
  text-align: center;
  color: var(--color-muted);
  padding: 2rem 0;
}

/* ── article detail ─────────────────────────────────────────────────── */

.article-detail { padding: 3rem 0; }

.article-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.breadcrumbs {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-bottom: 1rem;
}
.breadcrumbs a { color: var(--color-muted); }
.breadcrumbs span { color: var(--color-text); }

.article-header time {
  display: block;
  font-size: 0.9rem;
  color: var(--color-muted);
  margin-top: 0.5rem;
}

.article-body {
  font-size: 1.05rem;
  max-width: 680px;
}

.article-keywords {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.keywords-label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-muted);
}

.keyword-tag {
  display: inline-block;
  background: var(--color-accent);
  color: var(--color-primary);
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
}

.article-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

/* ── RTL (Arabic) ──────────────────────────────────────────────────── */

[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

[dir="rtl"] .logo {
  letter-spacing: 0;
}

[dir="rtl"] .breadcrumbs a::after {
  content: none;
}

[dir="rtl"] .article-body {
  text-align: right;
}

[dir="rtl"] .read-more::after {
  content: " ←";
}

[dir="rtl"] .read-more::before {
  content: none;
}

[dir="rtl"] ul {
  padding-left: 0;
  padding-right: 1.5rem;
}

/* ── responsive ────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  html { font-size: 16px; }
  .hero { padding: 3rem 0 2rem; }
  .hero h1 { font-size: 2rem; }
  nav ul { gap: 1rem; }
}
