/* ==========================================================================
   URDU NASTALIQ & ARABIC TYPOGRAPHY ENFORCEMENT
   ========================================================================== */

/* 1. Global Nastaliq Font Family Declaration */
:root {
  --tq-font-urdu: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', 'Urdu Typesetting', serif;
  --tq-font-arabic: 'Amiri Quran', 'Scheherazade New', 'Traditional Arabic', serif;
}

/* 2. High-Specificity Nastaliq Rule (Overrules Elementor & Core WP Defaults) */
html[dir="rtl"],
body[dir="rtl"],
.urdu-text,
.urdu-text *,
.tq-chapter-single p,
.tq-chapter-single li,
.tq-chapter-single h1,
.tq-chapter-single h2,
.tq-chapter-single h3,
.tq-chapter-single h4,
.tq-chapter-single div,
.elementor-widget-text-editor.urdu-text,
.elementor-widget-text-editor.urdu-text p,
.elementor-widget-heading.urdu-text .elementor-heading-title,
.tq-mcq-card,
.tq-qa-item {
  font-family: var(--tq-font-urdu) !important;
  direction: rtl !important;
  text-align: right !important;
  line-height: 2.4 !important; /* Critical for Urdu Nastaliq baseline and dots */
  letter-spacing: 0 !important;
}

/* 3. Heading Sizes for Nastaliq */
.urdu-text h1, h1.urdu-text {
  font-size: 2.2rem !important;
  line-height: 2.6 !important;
}

.urdu-text h2, h2.urdu-text {
  font-size: 1.8rem !important;
  line-height: 2.5 !important;
}

.urdu-text h3, h3.urdu-text {
  font-size: 1.4rem !important;
  line-height: 2.3 !important;
}

.urdu-text p {
  font-size: 1.25rem !important;
  margin-bottom: 1.2rem;
}

/* 4. Distinct Arabic Script for Quranic Verses Only */
.arabic-ayat,
.arabic-ayat * {
  font-family: var(--tq-font-arabic) !important;
  direction: rtl !important;
  text-align: right !important;
  font-size: 1.75rem !important;
  line-height: 2.7 !important;
  color: #0f5132 !important;
}


/* Typography Classes */
.urdu-text {
  font-family: var(--tq-font-urdu);
  direction: rtl;
  text-align: right;
  line-height: 2.3;
  font-size: 1.25rem;
}

.arabic-ayat {
  font-family: var(--tq-font-arabic);
  direction: rtl;
  text-align: right;
  font-size: 1.7rem;
  line-height: 2.6;
  color: var(--tq-primary);
}

/* Header & Switcher */
.tq-site-header {
  background: #ffffff;
  border-bottom: 2px solid var(--tq-border);
  padding: 1rem 1.5rem;
}

.tq-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.tq-logo a {
  text-decoration: none;
  display: flex;
  flex-direction: column;
}

.tq-logo-title {
  font-size: 1.75rem;
  color: var(--tq-primary);
  font-weight: 700;
}

.tq-logo-sub {
  font-size: 0.85rem;
  color: var(--tq-text-muted);
}

/* Class Switcher Pill Bar */
.tq-class-switcher-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.tq-switcher-label {
  font-family: var(--tq-font-urdu);
  font-size: 1.1rem;
  font-weight: 600;
}

.tq-switcher-buttons {
  display: flex;
  gap: 0.4rem;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 9999px;
}

.tq-btn-class {
  border: none;
  background: transparent;
  padding: 8px 16px;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #334155;
}

.tq-btn-class:hover {
  background: #e2e8f0;
}

.tq-btn-class.active {
  background: var(--tq-primary);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(15, 81, 50, 0.25);
}

/* Main Content Layout */
.tq-main-content, .tq-archive-wrap {
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1.25rem;
}

.tq-chapter-header {
  text-align: center;
  margin-bottom: 2rem;
}

.tq-chapter-title {
  font-size: 2.4rem;
  color: var(--tq-primary);
  margin-top: 0.5rem;
}

.tq-class-pill {
  background: #e8f5e9;
  color: var(--tq-primary);
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
}

/* PDF Download Button */
.tq-download-block {
  margin: 1.5rem 0 2.5rem;
  text-align: center;
}

.tq-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--tq-primary);
  color: #ffffff;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  font-size: 1rem;
  transition: background 0.2s ease;
}

.tq-download-btn:hover {
  background: var(--tq-primary-hover);
}

/* MCQ Interactive Cards */
.tq-mcq-card {
  background: #ffffff;
  border: 1px solid var(--tq-border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.tq-mcq-question {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 12px;
}

.tq-badge {
  background: var(--tq-primary);
  color: #ffffff;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-family: var(--tq-font-sans);
}

.tq-mcq-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

.tq-opt-btn {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tq-opt-btn:hover {
  background: #e2e8f0;
}

.tq-opt-btn.correct {
  background: #dcfce7 !important;
  border-color: var(--tq-correct) !important;
  color: var(--tq-correct) !important;
  font-weight: bold;
}

.tq-opt-btn.wrong {
  background: #fee2e2 !important;
  border-color: var(--tq-wrong) !important;
  color: var(--tq-wrong) !important;
}

/* Accordion for Short Questions */
.tq-qa-item {
  border: 1px solid var(--tq-border);
  border-radius: 8px;
  margin-bottom: 0.75rem;
  overflow: hidden;
  background: #ffffff;
}

.tq-qa-toggle {
  width: 100%;
  padding: 14px 18px;
  background: #fdfdfd;
  border: none;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 1.25rem;
  font-weight: 600;
  text-align: right;
}

.tq-qa-toggle:hover {
  background: #f8fafc;
}

.tq-qa-answer {
  display: none;
  padding: 14px 18px;
  border-top: 1px solid var(--tq-border);
  background: #ffffff;
  color: #374151;
}

/* Footer */
.tq-site-footer {
  background: #1e293b;
  color: #e2e8f0;
  padding: 2.5rem 1rem;
  text-align: center;
  margin-top: 4rem;
}
