:root {
  --navy: #1f2a4a;
  --ink: #1c1b19;
  --muted: #5e594f;
  --gold: #c9a96e;
  --ivory: #f7f5f0;
  --card: #fffcf7;
  --line: #e6e0d4;
  --max: 46rem;
}

* { box-sizing: border-box; }

html[data-lang="ar"] .en { display: none; }
html[data-lang="en"] .ar { display: none; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(ellipse at top, #fff 0%, var(--ivory) 42%);
  font-family: "SF Pro Text", "Segoe UI", Tahoma, "Noto Naskh Arabic", sans-serif;
  font-size: 1.05rem;
  line-height: 1.75;
}

a { color: var(--navy); }
a:hover { color: #8a6d34; }

.skip {
  position: absolute;
  inset-inline-start: 1rem;
  top: -3rem;
  background: var(--navy);
  color: white;
  padding: 0.4rem 0.8rem;
  z-index: 3;
}
.skip:focus { top: 0.5rem; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(247, 245, 240, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner,
.wrap {
  width: min(var(--max), calc(100% - 2rem));
  margin-inline: auto;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--navy);
  text-decoration: none;
  font-weight: 650;
}

.mark {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 0.6rem;
  background: var(--navy);
  position: relative;
  flex: none;
}
.mark::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0.72rem;
  height: 0.72rem;
  transform: translate(-50%, -50%);
  border: 2px solid var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.28);
}

nav {
  display: flex;
  align-items: center;
  gap: 0.35rem 1rem;
  flex-wrap: wrap;
}

nav a {
  text-decoration: none;
  color: var(--navy);
  font-size: 0.95rem;
}
nav a[aria-current="page"] {
  box-shadow: inset 0 -2px 0 var(--gold);
}

.lang {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: white;
}

.lang button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  padding: 0.28rem 0.7rem;
  cursor: pointer;
}
.lang button[aria-pressed="true"] {
  background: var(--navy);
  color: white;
}

main { padding: 2.2rem 0 3rem; }

h1, h2, h3 {
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, "Noto Naskh Arabic", serif;
  font-weight: 700;
  line-height: 1.35;
  color: var(--navy);
}

h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 0.6rem; }
h2 { font-size: 1.35rem; margin: 2rem 0 0.4rem; }
h3 { font-size: 1.08rem; margin: 1.3rem 0 0.3rem; }

.lede { font-size: 1.12rem; color: var(--muted); margin-top: 0; }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  padding: 1rem 1.1rem;
  margin-top: 1.4rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.8rem;
  margin-top: 1.4rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1rem 1.05rem;
}
.card h2 { margin-top: 0; font-size: 1.15rem; }
.card p { margin-bottom: 0; }

.meta { color: var(--muted); font-size: 0.92rem; }

.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.3rem; }

.button {
  display: inline-block;
  text-decoration: none;
  background: var(--navy);
  color: white;
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
}
.button.secondary {
  background: transparent;
  color: var(--navy);
  border: 1px solid var(--navy);
}
.button:hover { color: white; }
.button.secondary:hover { color: var(--navy); background: #fff; }

ul { padding-inline-start: 1.2rem; }
li + li { margin-top: 0.25rem; }

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}
.site-footer .wrap {
  padding: 1.2rem 0 2rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.site-footer a { color: var(--navy); }

@media (max-width: 640px) {
  .header-inner { align-items: flex-start; }
  .site-footer .wrap { flex-direction: column; }
}
