/* ─── PASHTO COURSE STYLES ─────────────────────────────────────────────────────
   Font strategy: Noto Naskh Arabic loaded from Google Fonts.
   Covers Arabic Extended block (U+0600-U+06FF) including Pashto-specific
   characters: ټ ډ ړ ږ ښ ګ ڼ ې ۍ (U+0679, U+0688, U+0693, U+0696, U+069A,
   U+06AB, U+06BC, U+06D0, U+06CD).
   ─────────────────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Noto+Naskh+Arabic:wght@400;500;700&display=swap');

/* ── PASHTO FONT APPLICATION ──────────────────────────────────────────────── */
.ps-text,
[dir="rtl"],
.alpha-card-letter,
.alpha-card-form-char,
.alpha-card-example-word,
.lj-target-word,
.lj-rendered,
.lj-tile,
.lj-placed-letter {
  font-family: 'Noto Naskh Arabic', 'Vazirmatn', 'Tahoma', 'Arial Unicode MS', sans-serif;
}

/* ── TOPBAR ────────────────────────────────────────────────────────────────── */
.topbar-course {
  font-family: 'Noto Naskh Arabic', sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0px;
  color: #c8d8e8;
  direction: rtl;
}

/* ── COURSE HERO ───────────────────────────────────────────────────────────── */
.map-hero h1 {
  font-family: 'Noto Naskh Arabic', serif;
  font-size: 42px;
  font-weight: 700;
  direction: rtl;
}

/* ── UNIT HEADER ───────────────────────────────────────────────────────────── */
.unit-header-title {
  font-family: 'Noto Naskh Arabic', sans-serif;
  direction: rtl;
  unicode-bidi: plaintext;
}

/* ── SECTION SIDEBAR ───────────────────────────────────────────────────────── */
.section-item.active {
  border-left: 3px solid #8a3a1a;
}

/* ── SECTION CARDS ─────────────────────────────────────────────────────────── */
.section-card {
  border-radius: 8px;
}

.section-card-title {
  font-family: 'Noto Naskh Arabic', 'Noto Sans', sans-serif;
  unicode-bidi: plaintext;
  direction: rtl;
}

/* ── GRAMMAR MODALS ────────────────────────────────────────────────────────── */
.grammar-modal {
  border-radius: 8px;
}

.grammar-modal-title {
  font-family: 'Noto Naskh Arabic', 'Noto Sans', sans-serif;
  unicode-bidi: plaintext;
}

.grammar-modal-para {
  font-family: 'Noto Naskh Arabic', 'Noto Sans', sans-serif;
  line-height: 1.9;
  unicode-bidi: plaintext;
}

/* ── ALPHABET CARDS ────────────────────────────────────────────────────────── */
.alpha-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.alpha-card {
  background: var(--card, var(--surface));
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 14px 12px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
  text-align: center;
  user-select: none;
}

.alpha-card:hover {
  border-color: #8a3a1a;
  box-shadow: 0 3px 12px rgba(138, 58, 26, 0.12);
  transform: translateY(-1px);
}

.alpha-card.expanded {
  border-color: #8a3a1a;
  background: var(--surface2, #f5f5f5);
}

.alpha-card-letter {
  font-size: 44px;
  font-weight: 400;
  line-height: 1.2;
  color: var(--accent, #8a3a1a);
  margin-bottom: 8px;
  direction: rtl;
}

.alpha-card-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.alpha-card-name {
  font-family: 'Noto Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.alpha-card-translit {
  font-family: 'Noto Sans', sans-serif;
  font-size: 11px;
  color: var(--red, #c8403a);
  background: rgba(200, 64, 58, 0.08);
  padding: 1px 6px;
  border-radius: 4px;
}

.alpha-card-sound {
  font-size: 10px;
  color: var(--text3);
  line-height: 1.4;
  margin-bottom: 6px;
  font-style: italic;
}

.alpha-card-connect-badge {
  display: inline-block;
  font-family: 'Noto Sans', sans-serif;
  font-size: 8px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 8px;
  margin-top: 4px;
}

.alpha-card-connect-badge.connector {
  background: rgba(45, 122, 80, 0.1);
  color: #2d7a50;
  border: 1px solid rgba(45, 122, 80, 0.25);
}

.alpha-card-connect-badge.non-connector {
  background: rgba(212, 119, 42, 0.1);
  color: #c8963a;
  border: 1px solid rgba(212, 119, 42, 0.25);
}

/* ── EXPANDED CARD CONTENT ─────────────────────────────────────────────────── */
.alpha-card-expanded {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  text-align: right;
}

.alpha-card-forms {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 10px;
}

.alpha-card-form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.alpha-card-form-label {
  font-family: 'Noto Sans', sans-serif;
  font-size: 9px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text3);
  text-align: left;
  flex: 1;
}

.alpha-card-form-char {
  font-size: 22px;
  color: var(--text);
  direction: rtl;
  line-height: 1.3;
}

.alpha-card-example {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.alpha-card-example-word {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  direction: rtl;
}

.alpha-card-example-gloss {
  font-size: 11px;
  color: var(--text3);
  font-style: italic;
  direction: ltr;
  text-align: right;
}

.alpha-note {
  background: rgba(138, 58, 26, 0.06);
  border: 1px solid rgba(138, 58, 26, 0.18);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 16px;
  line-height: 1.6;
  font-style: italic;
}

/* ── LETTER JOINER EXERCISE ─────────────────────────────────────────────────── */
.lj-target {
  background: var(--surface2, #f5f5f5);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 24px;
  text-align: center;
  margin: 16px 0;
}

.lj-target-word {
  font-size: 52px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
  direction: rtl;
  margin-bottom: 6px;
  display: block;
}

.lj-target-sub {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.lj-target-translit {
  font-family: 'Noto Sans', sans-serif;
  font-size: 14px;
  color: var(--red, #c8403a);
}

.lj-target-meaning {
  font-family: 'Noto Sans', sans-serif;
  font-size: 14px;
  color: var(--text3);
  font-style: italic;
}

.lj-assembly {
  min-height: 100px;
  border: 2px dashed var(--border2);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 12px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: border-color 0.15s, background 0.15s;
}

.lj-assembly.correct {
  border-color: var(--green, #2d7a50);
  background: var(--green-light, rgba(45, 122, 80, 0.07));
}

.lj-assembly.wrong {
  border-color: var(--red, #c8403a);
  background: var(--red-light, rgba(200, 64, 58, 0.07));
}

.lj-rendered {
  font-size: 36px;
  font-weight: 600;
  direction: rtl;
  color: var(--accent, #8a3a1a);
  min-height: 44px;
  line-height: 1.3;
}

.lj-placeholder {
  font-size: 18px;
  color: var(--text3);
  font-style: italic;
  font-family: 'Noto Sans', sans-serif;
}

.lj-placed-tiles {
  display: flex;
  flex-direction: row-reverse;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.lj-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  height: 52px;
  padding: 0 8px;
  font-size: 28px;
  font-weight: 500;
  border: 2px solid var(--border2);
  border-radius: 8px;
  background: var(--bg, #f7f5f0);
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.1s;
  direction: rtl;
  user-select: none;
}

.lj-tile:hover {
  background: var(--surface2);
  border-color: #8a3a1a;
  transform: translateY(-2px);
}

.lj-tile.placed {
  background: rgba(138, 58, 26, 0.08);
  border-color: #8a3a1a;
  color: #8a3a1a;
}

.lj-tile.placed:hover {
  background: rgba(200, 64, 58, 0.08);
  border-color: var(--red);
  color: var(--red);
}

.lj-bank {
  display: flex;
  flex-direction: row-reverse;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 16px 0 8px;
}

/* ── SENTENCE CONSTRUCTION RTL ──────────────────────────────────────────────── */
.sc-drop-zone.rtl,
.sc-tiles.rtl {
  direction: rtl;
  font-family: 'Noto Naskh Arabic', sans-serif;
}

.sc-tile.rtl {
  font-family: 'Noto Naskh Arabic', sans-serif;
}

/* ── READING SECTIONS ────────────────────────────────────────────────────────── */
.reading-content,
.reading-text {
  unicode-bidi: plaintext;
}

/* ── FOOTER ──────────────────────────────────────────────────────────────────── */
.course-footer {
  border-top: 1px solid rgba(138, 58, 26, 0.2);
}

/* ── SCORE / PROGRESS ACCENTS ─────────────────────────────────────────────────── */
.practice-progress-fill {
  background: #8a3a1a;
}

/* ── ALPHABET FLASHCARD — PASHTO OVERRIDES ─────────────────────────────────────── */
.fc-card-front [style*="Noto Naskh Arabic"],
.fc-card-back [style*="Noto Naskh Arabic"] {
  direction: rtl;
}
