/* App-aligned theme (matches Flutter indigo / white cards) */
:root {
  --bg: #ffffff;
  --bg-soft: #f7f8fa;
  --surface: #ffffff;
  --text: rgba(0, 0, 0, 0.87);
  --muted: rgba(0, 0, 0, 0.54);
  --accent: #3f51b5;
  --accent-soft: rgba(63, 81, 181, 0.1);
  --accent-strong: #303f9f;
  --border: #e0e0e0;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --radius: 14px;
  --radius-sm: 12px;
  --max: 720px;
  --font-ar: "Segoe UI", Tahoma, "Noto Sans Arabic", Arial, sans-serif;
  --font-en: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-ar);
  background: var(--bg-soft);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
}

html[lang="en"] body {
  font-family: var(--font-en);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 16px 56px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  margin: 0 -16px 20px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--border);
}

.topnav {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}

.brand:hover {
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.78rem;
  color: #fff;
  background: var(--accent);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-title {
  font-weight: 700;
  font-size: 1rem;
}

.brand-sub {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

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

.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
}

.nav-link + .nav-link {
  border-inline-start: 1px solid var(--border);
}

.nav-link:hover {
  color: var(--text);
  text-decoration: none;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 2px;
  height: 2px;
  border-radius: 999px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.2s ease;
}

.nav-link:hover::after,
.nav-link.is-active::after {
  transform: scaleX(1);
}

.nav-link.is-active {
  color: var(--accent);
  font-weight: 600;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.lang-switch a {
  min-width: 40px;
  text-align: center;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
}

.lang-switch a:hover {
  color: var(--text);
  background: var(--bg-soft);
  text-decoration: none;
}

.lang-switch a.active {
  background: var(--accent);
  color: #fff;
}

/* ---------- Content ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 18px;
  box-shadow: var(--shadow);
}

.page-kicker {
  display: inline-flex;
  margin: 0 0 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
}

h1 {
  margin: 0 0 8px;
  font-size: 1.35rem;
  line-height: 1.3;
  font-weight: 700;
}

h2 {
  margin: 24px 0 10px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

h2::before {
  content: "";
  display: block;
  width: 28px;
  height: 3px;
  border-radius: 999px;
  margin-bottom: 8px;
  background: var(--accent);
}

h3 {
  margin: 18px 0 8px;
  font-size: 0.98rem;
  font-weight: 600;
}

.meta {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0 0 18px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  border: 1px solid var(--border);
}

p,
li {
  color: var(--text);
  font-size: 0.95rem;
}

ul,
ol {
  padding-inline-start: 1.2rem;
}

li + li {
  margin-top: 4px;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 12px 0 18px;
  font-size: 0.88rem;
  overflow-x: auto;
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
}

th,
td {
  padding: 10px 12px;
  text-align: start;
  vertical-align: top;
  min-width: 100px;
  border-bottom: 1px solid var(--border);
}

tr:last-child td {
  border-bottom: 0;
}

th {
  background: var(--bg-soft);
  font-weight: 600;
}

.home-links {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.home-links a {
  display: block;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow);
}

.home-links a:hover {
  border-color: var(--accent);
  text-decoration: none;
  color: var(--text);
}

.home-links span {
  display: block;
  margin-top: 6px;
  font-weight: 400;
  color: var(--muted);
  font-size: 0.88rem;
}

.contact-block {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  border: 1px solid rgba(63, 81, 181, 0.18);
}

.contact-block p {
  margin: 0;
}

.contact-block a {
  color: var(--accent);
  font-weight: 500;
  word-break: break-word;
}

.footer {
  margin-top: 24px;
  color: var(--muted);
  font-size: 0.84rem;
  text-align: center;
}

[data-contact-row][hidden] {
  display: none !important;
}

/* In-app WebView: hide site chrome, keep content */
html.is-embed .site-header,
html.is-embed .footer,
html.is-embed .lang-switch,
body.is-embed .site-header,
body.is-embed .footer,
body.is-embed .lang-switch {
  display: none !important;
}

html.is-embed .wrap,
body.is-embed .wrap {
  padding: 12px 12px 28px;
}

html.is-embed .card,
body.is-embed .card {
  box-shadow: none;
  border-radius: 12px;
}

@media (max-width: 640px) {
  .nav-actions {
    width: 100%;
    justify-content: space-between;
  }

  .card {
    padding: 16px 14px;
  }
}
