/* =========================================================
   اسلام اور سائنس — Course Website
   Fonts: Nastaleeq (Urdu body) / Amiri (Arabic Qur'anic text)
   ========================================================= */

@font-face {
  font-family: "Nastaleeq";
  src: url("../fonts/NafeesNastaleeq.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Amiri";
  src: url("../fonts/Amiri-Regular.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Amiri";
  src: url("../fonts/Amiri-Bold.woff2") format("woff2");
  font-weight: bold;
  font-style: normal;
  font-display: swap;
}

:root {
  --teal: #0f766e;
  --teal-dark: #0b5750;
  --gold: #b8892f;
  --gold-light: #e7b96a;
  --purple: #6d28d9;
  --purple-light: #8b5cf6;
  --blue: #1d4ed8;
  --blue-light: #3b82f6;
  --orange: #c2410c;
  --orange-light: #f97316;
  --green: #15803d;
  --red: #b91c1c;
  --cream: #fbf6ec;
  --cream-2: #f4ecda;
  --ink: #2a2016;
  --ink-soft: #55483a;
  --card-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Nastaleeq", "Noto Nastaliq Urdu", serif;
  background: var(--cream);
  color: var(--ink);
  direction: rtl;
  line-height: 2;
  font-size: 19px;
  overflow-x: hidden;
}

.quran {
  font-family: "Amiri", serif;
  direction: rtl;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
}

/* ---------------- Header / Nav ---------------- */

header.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(90deg, var(--teal-dark), var(--teal) 55%, #14877c);
  color: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
}

.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 24px;
  font-weight: 700;
  white-space: nowrap;
}
.brand .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold-light);
  box-shadow: 0 0 0 4px rgba(231, 185, 106, 0.35);
}

nav.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

nav.main-nav a {
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 600;
  transition: background 0.2s, transform 0.15s;
  white-space: nowrap;
}
nav.main-nav a:hover {
  background: rgba(255, 255, 255, 0.16);
}
nav.main-nav a.active {
  background: #fff;
  color: var(--teal-dark);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 6px;
  background: none;
  border: none;
}
.hamburger span {
  width: 26px;
  height: 3px;
  background: #fff;
  border-radius: 2px;
}

/* ---------------- Layout shell ---------------- */

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 20px 70px;
  min-height: 60vh;
}

.page {
  display: none;
  animation: fadeIn 0.35s ease;
}
.page.active {
  display: block;
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-title {
  font-size: 30px;
  font-weight: 700;
  margin: 6px 0 6px;
  color: var(--teal-dark);
}
.page-sub {
  color: var(--ink-soft);
  margin-bottom: 26px;
  font-size: 17px;
}

/* ---------------- Home ---------------- */

.hero {
  text-align: center;
  padding: 50px 16px 34px;
  border-radius: var(--radius);
  background: radial-gradient(circle at 30% 20%, rgba(184, 137, 47, 0.18), transparent 60%),
    radial-gradient(circle at 80% 0%, rgba(15, 118, 110, 0.16), transparent 55%), var(--cream-2);
  margin-bottom: 40px;
}
.hero h1 {
  font-size: 40px;
  margin: 0 0 10px;
  color: var(--teal-dark);
}
.hero p {
  font-size: 19px;
  color: var(--ink-soft);
  max-width: 640px;
  margin: 0 auto;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}

.big-card {
  border-radius: var(--radius);
  padding: 28px 22px;
  color: #fff;
  box-shadow: var(--card-shadow);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
  min-height: 190px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.big-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
}
.big-card .icon {
  font-size: 40px;
  position: absolute;
  top: 18px;
  left: 18px;
  opacity: 0.35;
}
.big-card h3 {
  font-size: 22px;
  margin: 0 0 6px;
}
.big-card p {
  font-size: 15px;
  margin: 0;
  opacity: 0.92;
}
.card-syllabus {
  background: linear-gradient(135deg, var(--blue), var(--blue-light));
}
.card-articles {
  background: linear-gradient(135deg, var(--teal-dark), var(--teal));
}
.card-qa {
  background: linear-gradient(135deg, var(--purple), var(--purple-light));
}
.card-mcq {
  background: linear-gradient(135deg, var(--orange), var(--orange-light));
}

.home-note {
  margin-top: 40px;
  background: var(--cream-2);
  border-radius: var(--radius);
  padding: 20px 24px;
  border-right: 5px solid var(--gold);
  color: var(--ink-soft);
}

/* ---------------- Syllabus ---------------- */

.syllabus-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.syllabus-item {
  background: #fff;
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--card-shadow);
  border-right: 5px solid var(--gold);
}
.syllabus-num {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
}
.syllabus-title {
  flex: 1 1 auto;
  font-size: 19px;
  font-weight: 600;
  color: var(--ink);
}
.syllabus-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.pill {
  font-size: 13px;
  padding: 7px 13px;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
  transition: opacity 0.15s;
}
.pill:hover {
  opacity: 0.85;
}
.pill-article {
  background: #e3f4f1;
  color: var(--teal-dark);
}
.pill-qa {
  background: #ede4fb;
  color: var(--purple);
}
.pill-mcq {
  background: #fde3d1;
  color: var(--orange);
}

/* ---------------- Topic-switcher layout (Articles / QA / MCQ) ---------------- */

.topic-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 26px;
  align-items: start;
}

.topic-sidebar {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 10px;
  position: sticky;
  top: 90px;
  max-height: 78vh;
  overflow-y: auto;
}
.topic-sidebar button {
  display: block;
  width: 100%;
  text-align: right;
  background: none;
  border: none;
  padding: 11px 14px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  cursor: pointer;
  margin-bottom: 3px;
  transition: background 0.15s;
}
.topic-sidebar button:hover {
  background: var(--cream-2);
}
.topic-sidebar button.active {
  background: var(--teal);
  color: #fff;
  font-weight: 700;
}

.topic-select-mobile {
  display: none;
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 2px solid var(--teal);
  font-family: inherit;
  font-size: 16px;
  background: #fff;
  color: var(--ink);
  margin-bottom: 18px;
}

.content-pane {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 30px 34px;
  min-height: 400px;
}

.content-pane h2.article-title {
  color: var(--teal-dark);
  font-size: 26px;
  margin-top: 0;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 3px solid var(--gold-light);
}

.article-body h3 {
  color: var(--teal-dark);
  font-size: 21px;
  margin: 26px 0 10px;
}
.article-body p {
  text-align: justify;
  margin: 0 0 16px;
  color: var(--ink);
}
.article-body p.lead {
  font-weight: 700;
  color: var(--ink-soft);
  background: var(--cream-2);
  padding: 14px 16px;
  border-radius: 10px;
  border-right: 4px solid var(--teal);
}

.quote-box {
  background: linear-gradient(135deg, #fbf3e3, #f7ead0);
  border-top: 3px solid var(--gold);
  border-bottom: 3px solid var(--gold);
  border-radius: 10px;
  padding: 18px 20px;
  margin: 22px 0;
  text-align: center;
}
.quote-box .arabic {
  font-family: "Amiri", serif;
  font-size: 24px;
  color: var(--ink);
  margin-bottom: 10px;
  line-height: 2.1;
}
.quote-box .translation {
  font-style: italic;
  color: var(--ink-soft);
  margin-bottom: 8px;
  font-size: 17px;
}
.quote-box .ref {
  color: var(--gold);
  font-weight: 700;
  font-size: 15px;
}

/* ---------------- Q&A accordion ---------------- */

.qa-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}
.qa-toolbar button {
  background: var(--purple);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  font-weight: 600;
}

.qa-item {
  border: 1px solid #eee1f5;
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
}
.qa-question {
  background: #f6effc;
  padding: 14px 18px;
  font-weight: 700;
  color: var(--purple);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 17px;
}
.qa-question .arrow {
  transition: transform 0.2s;
  flex: 0 0 auto;
  font-size: 14px;
}
.qa-item.open .qa-question .arrow {
  transform: rotate(180deg);
}
.qa-answer {
  padding: 0 18px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  text-align: justify;
  color: var(--ink);
}
.qa-item.open .qa-answer {
  padding: 16px 18px 18px;
  max-height: 1200px;
}

/* ---------------- MCQ ---------------- */

.mcq-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}
.mcq-score {
  background: var(--cream-2);
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 700;
  color: var(--orange);
}
.mcq-toolbar button {
  background: var(--orange);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  font-weight: 600;
}

.mcq-card {
  border: 1px solid #fbe3cf;
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 16px;
  background: #fffaf4;
}
.mcq-q {
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 14px;
  color: var(--ink);
}
.mcq-q .qnum {
  color: var(--orange);
  margin-left: 6px;
}
.mcq-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.mcq-opt {
  background: #fff;
  border: 2px solid #f0dcc7;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  text-align: right;
  transition: background 0.15s, border-color 0.15s;
  color: var(--ink);
}
.mcq-opt:hover {
  border-color: var(--orange-light);
}
.mcq-opt.correct {
  background: #e7f6e9;
  border-color: var(--green);
  color: var(--green);
  font-weight: 700;
}
.mcq-opt.wrong {
  background: #fbe7e7;
  border-color: var(--red);
  color: var(--red);
  font-weight: 700;
}
.mcq-opt[disabled] {
  cursor: default;
}
.mcq-answer-line {
  margin-top: 10px;
  font-size: 14px;
  color: var(--green);
  font-weight: 700;
  display: none;
}
.mcq-card.answered .mcq-answer-line {
  display: block;
}

/* ---------------- Footer ---------------- */

footer.site-footer {
  text-align: center;
  padding: 30px 20px 26px;
  color: var(--ink-soft);
  font-size: 14px;
  border-top: 1px solid #e6dcc6;
  background: var(--cream-2);
}
.footer-inner {
  max-width: 780px;
  margin: 0 auto;
}
.footer-credit {
  font-size: 15px;
  line-height: 1.9;
  margin-bottom: 14px;
  color: var(--ink);
}
.footer-credit a {
  color: var(--teal-dark);
  font-weight: 700;
  border-bottom: 1px dotted var(--teal);
}
.footer-credit a:hover {
  color: var(--gold);
  border-bottom-color: var(--gold);
}
.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  font-size: 13.5px;
}
.footer-links a {
  color: var(--ink-soft);
  font-weight: 600;
  padding: 3px 4px;
}
.footer-links a:hover {
  color: var(--teal-dark);
}
.footer-links .sep {
  color: #cbbfa0;
}
.footer-copy {
  font-size: 13px;
  color: #8a7a63;
  padding-top: 10px;
  border-top: 1px solid #e6dcc6;
}

@media (max-width: 640px) {
  .footer-credit {
    font-size: 14px;
  }
  .footer-links {
    gap: 5px;
    font-size: 13px;
  }
}

/* ---------------- Responsive ---------------- */

@media (max-width: 900px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .topic-layout {
    grid-template-columns: 1fr;
  }
  .topic-sidebar {
    display: none;
  }
  .topic-select-mobile {
    display: block;
  }
  .content-pane {
    padding: 22px 18px;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 17px;
  }
  nav.main-nav {
    position: fixed;
    top: 60px;
    right: 0;
    left: 0;
    background: var(--teal-dark);
    flex-direction: column;
    align-items: stretch;
    padding: 10px 16px;
    gap: 2px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }
  nav.main-nav.open {
    max-height: 400px;
    padding-bottom: 16px;
  }
  nav.main-nav a {
    padding: 12px 14px;
    border-radius: 8px;
  }
  .hamburger {
    display: flex;
  }
  .card-grid {
    grid-template-columns: 1fr;
  }
  .hero h1 {
    font-size: 30px;
  }
  .mcq-options {
    grid-template-columns: 1fr;
  }
  .syllabus-item {
    flex-wrap: wrap;
  }
}
