:root {
  --bg: #f7f8fb;
  --card: #ffffff;
  --ink: #182232;
  --muted: #5f6d7c;
  --brand: #0f766e;
  --brand2: #1d4ed8;
  --soft: #eaf7f5;
  --soft2: #eef4ff;
  --line: #dbe4ef;
  --danger: #b42318;
  --ok: #177245;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Noto Naskh Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
  direction: rtl;
  background: linear-gradient(180deg, var(--bg) 0%, #eef8f5 100%);
  color: var(--ink);
  line-height: 1.9;
}

a { color: inherit; text-decoration: none; }
.container { width: min(1120px, 92%); margin: auto; }

.common-site-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(26, 26, 46, 0.93);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  direction: ltr;
}

.common-site-nav__inner {
  width: min(1100px, calc(100% - 32px));
  min-height: 66px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.common-site-nav__brand {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding: 8px 0;
}

.common-site-nav__logo {
  height: 38px;
  width: auto;
  display: block;
}

.common-site-nav__links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.common-site-nav__link {
  color: rgba(255, 255, 255, 0.78);
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 0.88rem;
  line-height: 1.2;
  font-weight: 700;
  white-space: nowrap;
  transition: color 0.18s ease, background 0.18s ease;
}

.common-site-nav__link:hover,
.common-site-nav__link:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

.common-site-nav__badge {
  color: #1a1a2e;
  background: linear-gradient(135deg, #ffd166, #ffc233);
  padding: 5px 12px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--brand); }
.brand-badge {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color: white;
  display: grid;
  place-items: center;
  font-family: Arial, sans-serif;
  font-weight: 800;
}

.navlinks { display: flex; gap: 12px; flex-wrap: wrap; }
.navlinks a { padding: 8px 12px; border-radius: 8px; background: var(--soft); color: var(--brand); font-size: 14px; }

.hero { padding: 58px 0 36px; }
.hero-card {
  background: linear-gradient(135deg, #ffffff 0%, #edf8f6 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 32px;
  box-shadow: 0 18px 50px rgba(15, 118, 110, 0.12);
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 28px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--brand);
  background: var(--soft);
  border: 1px solid var(--line);
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
}

h1 { font-size: clamp(32px, 5vw, 54px); margin: 16px 0 12px; line-height: 1.45; }
h2 { font-size: clamp(24px, 3vw, 34px); margin: 34px 0 12px; color: #115e59; }
h3 { font-size: 22px; margin: 18px 0 10px; color: var(--brand); }
p { font-size: 18px; margin: 0 0 12px; }
.lead { font-size: 21px; color: var(--muted); }

.hero-img, .topic-visual {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  place-items: center;
  padding: 24px;
}

.hero-img { min-height: 260px; }
.hero-img img, .topic-visual img { max-width: 100%; height: auto; }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin: 28px 0 50px; }
.card, .content, .sidebar { background: var(--card); border: 1px solid var(--line); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.05); }
.card { border-radius: 8px; padding: 22px; transition: 0.2s ease; }
.card:hover { transform: translateY(-4px); box-shadow: 0 16px 36px rgba(15, 118, 110, 0.14); }
.topic-num {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--brand);
  display: grid;
  place-items: center;
  font-family: Arial, sans-serif;
  font-weight: 800;
  margin-bottom: 12px;
}

.card h2 { font-size: 22px; margin: 0 0 8px; }
.card p { font-size: 16px; color: var(--muted); }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}

.btn.secondary { background: var(--soft); color: var(--brand); border: 1px solid var(--line); }
.topic-layout { display: grid; grid-template-columns: 280px 1fr; gap: 24px; margin: 28px 0 50px; }
.sidebar { position: sticky; top: 82px; align-self: start; border-radius: 8px; padding: 18px; }
.sidebar a { display: block; padding: 9px 12px; border-radius: 8px; color: var(--muted); font-size: 15px; }
.sidebar a:hover { background: var(--soft); color: var(--brand); }
.content { border-radius: 8px; padding: 30px; }
.topic-head { display: grid; grid-template-columns: 1fr 260px; gap: 20px; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: 24px; margin-bottom: 20px; }
.topic-visual { background: var(--soft); }

.info-box, .key-box, .quiz-box, .example-box, .warning-box {
  border-radius: 8px;
  padding: 20px;
  margin: 22px 0;
  border: 1px solid var(--line);
}

.info-box, .example-box { background: #f8fbff; }
.key-box { background: var(--soft); }
.quiz-box { background: #f4fbf6; }
.warning-box { background: #fff7ed; }
ul, ol { padding-right: 24px; margin-top: 8px; }
li { margin: 8px 0; font-size: 17px; }
.section { padding: 10px 0 4px; border-bottom: 1px dashed #dbe5ee; }
.section:last-child { border-bottom: 0; }

.flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 18px 0; }
.flow div { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 14px; text-align: center; font-weight: 800; }
.compare { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0; }
.compare div { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 16px; }

.quiz-question { margin: 18px 0; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.quiz-options { display: grid; gap: 10px; margin-top: 10px; }
.option {
  width: 100%;
  text-align: right;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
}

.option.correct { border-color: var(--ok); background: #ecfdf3; color: var(--ok); }
.option.wrong { border-color: var(--danger); background: #fff1f0; color: var(--danger); }
.feedback { font-weight: 700; margin-top: 8px; min-height: 28px; }
.footer { margin-top: 50px; padding: 26px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 15px; }
.progress { height: 8px; background: #e1eaf2; border-radius: 999px; overflow: hidden; margin: 18px 0 0; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand2)); width: 0%; }
.nextprev { display: flex; justify-content: space-between; gap: 14px; margin-top: 28px; flex-wrap: wrap; }
.note { background: #fff7e9; border: 1px solid #efd7ad; border-radius: 8px; padding: 16px; margin: 18px 0; }

@media (max-width: 900px) {
  .hero-card, .topic-head, .topic-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .grid, .flow, .compare { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  .common-site-nav__inner { width: calc(100% - 16px); min-height: 56px; gap: 10px; }
  .common-site-nav__logo { height: 32px; }
  .common-site-nav__links { gap: 2px; }
  .common-site-nav__link { font-size: 0.78rem; padding: 6px 8px; }
  .common-site-nav__badge { display: none; }
  .grid, .flow, .compare { grid-template-columns: 1fr; }
  .hero-card, .content { padding: 22px; }
  .nav { align-items: flex-start; flex-direction: column; }
  .navlinks a { font-size: 13px; }
  p { font-size: 16px; }
  .lead { font-size: 18px; }
}

@media (max-width: 480px) {
  .common-site-nav__link:first-child { display: none; }
  .common-site-nav__link { font-size: 0.74rem; padding: 6px 7px; }
}
