/* =========================================================
   ایم فل سیرت اسٹڈیز — Course Website
   Fonts: Nastaleeq (Urdu body) / Amiri (Arabic Qur'anic & Hadith 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 {
  --green: #0f5c3f;
  --green-dark: #08362a;
  --gold: #b8892f;
  --gold-light: #e7b96a;
  --maroon: #7a1f2b;
  --maroon-light: #a83a48;
  --blue: #1d5c8f;
  --blue-light: #3b83c4;
  --teal: #0d7d6f;
  --teal-light: #17a495;
  --brown: #8a5a2b;
  --brown-light: #b07d43;
  --success: #15803d;
  --danger: #b91c1c;
  --cream: #faf7ee;
  --cream-2: #f3ecd9;
  --ink: #24201a;
  --ink-soft: #55503f;
  --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(--green-dark), var(--green) 55%, #12483a);
  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(--green-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(--green-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, 92, 63, 0.18), transparent 55%), var(--cream-2);
  margin-bottom: 40px;
}
.hero h1 {
  font-size: 40px;
  margin: 0 0 10px;
  color: var(--green-dark);
}
.hero p {
  font-size: 19px;
  color: var(--ink-soft);
  max-width: 680px;
  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(--green-dark), var(--green));
}
.card-qa {
  background: linear-gradient(135deg, var(--maroon), var(--maroon-light));
}
.card-mcq {
  background: linear-gradient(135deg, var(--brown), var(--brown-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;
  box-shadow: var(--card-shadow);
  border-right: 5px solid var(--gold);
  transition: box-shadow 0.15s;
}
.syllabus-item:hover {
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12);
}
.syllabus-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.syllabus-num {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18);
}
/* Colour-code the 15 topics by chronological/thematic cluster so the
   syllabus reads as a visual map, matching the coloured home cards. */
.syllabus-item:nth-child(-n + 5) .syllabus-num {
  background: linear-gradient(135deg, var(--green-dark), var(--green));
}
.syllabus-item:nth-child(-n + 5) {
  border-right-color: var(--green);
}
.syllabus-item:nth-child(n + 6):nth-child(-n + 10) .syllabus-num {
  background: linear-gradient(135deg, var(--maroon), var(--maroon-light));
}
.syllabus-item:nth-child(n + 6):nth-child(-n + 10) {
  border-right-color: var(--maroon);
}
.syllabus-item:nth-child(n + 11) .syllabus-num {
  background: linear-gradient(135deg, var(--brown), var(--brown-light));
}
.syllabus-item:nth-child(n + 11) {
  border-right-color: var(--brown);
}
.syllabus-title-wrap {
  flex: 1 1 auto;
  min-width: 0;
}
.syllabus-title {
  font-size: 19px;
  font-weight: 600;
  color: var(--ink);
}
.syllabus-central-q {
  margin-top: 6px;
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.8;
}
.syllabus-toggle {
  flex: 0 0 auto;
  background: var(--cream-2);
  border: none;
  color: var(--green-dark);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.syllabus-toggle:hover {
  background: #e9dfc3;
}
.syllabus-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.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: #e1efe9;
  color: var(--green-dark);
}
.pill-qa {
  background: #f6e3e6;
  color: var(--maroon);
}
.pill-mcq {
  background: #f2e5d3;
  color: var(--brown);
}
.syllabus-points {
  display: none;
  margin: 16px 0 2px;
  padding: 16px 22px 4px 4px;
  border-top: 1px dashed #e3d9bc;
  list-style: none;
}
.syllabus-item.expanded .syllabus-points {
  display: block;
}
.syllabus-points li {
  position: relative;
  padding-right: 22px;
  margin-bottom: 10px;
  font-size: 15.5px;
  color: var(--ink-soft);
  line-height: 1.85;
}
.syllabus-points li::before {
  content: "";
  position: absolute;
  right: 0;
  top: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
}

/* ---------------- 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(--green);
  color: #fff;
  font-weight: 700;
}

.topic-select-mobile {
  display: none;
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 2px solid var(--green);
  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(--green-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(--green-dark);
  font-size: 21px;
  margin: 30px 0 14px;
  padding-right: 16px;
  border-right: 5px solid var(--green);
  position: relative;
}
.article-body h3::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold);
  margin-left: 10px;
  vertical-align: middle;
}
/* Cycle a set of accent colors across successive headings so long
   articles read as visually segmented sections rather than one grey block. */
.article-body h3:nth-of-type(5n + 1) {
  border-right-color: var(--green);
  color: var(--green-dark);
}
.article-body h3:nth-of-type(5n + 1)::before {
  background: var(--green);
}
.article-body h3:nth-of-type(5n + 2) {
  border-right-color: var(--maroon);
  color: var(--maroon);
}
.article-body h3:nth-of-type(5n + 2)::before {
  background: var(--maroon);
}
.article-body h3:nth-of-type(5n + 3) {
  border-right-color: var(--brown);
  color: #6b4520;
}
.article-body h3:nth-of-type(5n + 3)::before {
  background: var(--brown);
}
.article-body h3:nth-of-type(5n + 4) {
  border-right-color: var(--blue);
  color: var(--blue);
}
.article-body h3:nth-of-type(5n + 4)::before {
  background: var(--blue);
}
.article-body h3:nth-of-type(5n + 5) {
  border-right-color: var(--gold);
  color: #7a5210;
}
.article-body h3:nth-of-type(5n + 5)::before {
  background: var(--gold);
}
.article-body p {
  text-align: justify;
  margin: 0 0 16px;
  color: var(--ink);
}
.article-body p.lead {
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--green-dark), var(--green) 70%, #12483a);
  padding: 18px 20px;
  border-radius: 12px;
  border-right: 5px solid var(--gold-light);
  box-shadow: var(--card-shadow);
}

.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;
  position: relative;
}
.quote-box::before {
  content: "❝";
  display: block;
  font-size: 26px;
  color: var(--gold);
  opacity: 0.55;
  margin-bottom: 2px;
  font-family: Georgia, serif;
}
.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 .translation:empty {
  display: none;
}
.quote-box .ref {
  color: var(--gold);
  font-weight: 700;
  font-size: 15px;
}
.quote-box .ref:empty {
  display: none;
}

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

.qa-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}
.qa-toolbar button {
  background: var(--maroon);
  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 #f2dee1;
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
}
.qa-question {
  background: #fbeeef;
  padding: 14px 18px;
  font-weight: 700;
  color: var(--maroon);
  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: 1600px;
}

/* ---------------- 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(--brown);
}
.mcq-toolbar button {
  background: var(--brown);
  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 #ecdfc9;
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 16px;
  background: #fffbf3;
}
.mcq-q {
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 14px;
  color: var(--ink);
}
.mcq-q .qnum {
  color: var(--brown);
  margin-left: 6px;
}
.mcq-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.mcq-opt {
  background: #fff;
  border: 2px solid #ecdfc9;
  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(--brown-light);
}
.mcq-opt.correct {
  background: #e7f6e9;
  border-color: var(--success);
  color: var(--success);
  font-weight: 700;
}
.mcq-opt.wrong {
  background: #fbe7e7;
  border-color: var(--danger);
  color: var(--danger);
  font-weight: 700;
}
.mcq-opt[disabled] {
  cursor: default;
}
.mcq-answer-line {
  margin-top: 10px;
  font-size: 14px;
  color: var(--success);
  font-weight: 700;
  display: none;
}
.mcq-card.answered .mcq-answer-line {
  display: block;
}
.mcq-explanation {
  margin-top: 8px;
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.85;
  display: none;
}
.mcq-card.answered .mcq-explanation {
  display: block;
}
.mcq-explanation-label {
  font-weight: 700;
  color: var(--brown);
}

/* ---------------- 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(--green-dark);
  font-weight: 700;
  border-bottom: 1px dotted var(--green);
}
.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(--green-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(--green-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-head {
    flex-wrap: wrap;
  }
  .syllabus-toggle {
    margin-top: 8px;
  }
}
