/* ═══════════════════════════════════════════════════════════════════
   LESSON PROTOTYPE — Phase 4.3 (pilot: Grammar-Teiru)
   ───────────────────────────────────────────────────────────────────
   Status: PROTOTYPE. Bukan `lesson.css` final — nama & isi masih bisa
   berubah setelah review rollout. Semua komponen ber-prefix `.np-l-`
   (lesson) dan dibangun dari token Phase 4.2 + kyoto-theme:
     radius   : --r-xs/sm/md/lg/xl
     shadow   : --shadow-xs/sm/md
     surface  : --surface / --cream / --red-pale / --green-pale / --gold-pale
     border   : --border / --border-mid
     font     : --font-jp / --font-sans
   Setiap var() diberi fallback literal supaya komponen tetap tampil
   benar bila dimuat di halaman yang belum memuat kyoto-theme.css.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Pola utama ─────────────────────────────────────────────── */
.np-l-pattern {
  box-sizing: border-box;
  background: var(--surface, #FEFCF8);
  border: 1px solid var(--border-mid, rgba(107, 79, 58, .18));
  border-radius: var(--r-lg, 14px);
  box-shadow: var(--shadow-xs, 0 1px 4px rgba(45, 45, 45, .06));
  padding: 24px;
  text-align: center;
}
.np-l-pattern-jp {
  font-family: var(--font-jp, 'Noto Serif JP', serif);
  font-size: clamp(26px, 6vw, 32px);
  font-weight: 700;
  line-height: 1.4;
  color: var(--primary, #6B4F3A);
  margin: 0 0 6px;
}
.np-l-pattern-arti {
  font-size: var(--np-fs-body, 16px);
  color: var(--ink-mid, #4A4A4A);
  margin: 0 0 12px;
}
.np-l-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 0; padding: 0; list-style: none; }
.np-l-chip {
  font-size: 13px; font-weight: 700; color: var(--ink-soft, #6E6E6E);
  background: var(--cream, #F8F3E9);
  border: 1px solid var(--border, rgba(107, 79, 58, .10));
  border-radius: 999px; padding: 4px 12px;
}

/* ── Formation ──────────────────────────────────────────────── */
.np-l-form {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  background: var(--surface, #FEFCF8);
  border: 1px dashed var(--border-mid, rgba(107, 79, 58, .18));
  border-radius: var(--r-md, 10px);
  padding: 16px 20px; margin: 0 0 16px;
}
.np-l-form-part {
  font-family: var(--font-jp, 'Noto Serif JP', serif);
  font-size: 20px; font-weight: 700; line-height: 1;
  color: var(--ink, #2D2D2D);
  background: var(--cream, #F8F3E9);
  border: 1px solid var(--border-mid, rgba(107, 79, 58, .18));
  border-radius: var(--r-sm, 6px); padding: 8px 14px;
}
.np-l-form-op { font-size: 20px; font-weight: 800; color: var(--ink-soft, #6E6E6E); }
.np-l-form-label { font-size: 13px; font-weight: 700; color: var(--ink-soft, #6E6E6E); }

/* ── Contoh kalimat ─────────────────────────────────────────── */
.np-l-example {
  box-sizing: border-box;
  background: var(--surface, #FEFCF8);
  border: 1px solid var(--border, rgba(107, 79, 58, .10));
  border-left: 3px solid var(--gold, #C89B3C);
  border-radius: var(--r-md, 10px);
  box-shadow: var(--shadow-xs, 0 1px 4px rgba(45, 45, 45, .06));
  padding: 14px 18px; margin: 0 0 12px;
}
/* Specificity: aturan tema punya .card p (0,1,1) yang dimuat setelah file
   ini — komponen teks dikunci dengan konteks induk supaya hierarchy
   typographic prototype tidak tertimpa. */
.np-l-example .np-l-example-jp,
.np-l-example-jp {
  font-family: var(--font-jp, 'Noto Serif JP', serif);
  /* 20px desktop / 18px mobile; line-height longgar untuk ruang furigana */
  font-size: 20px; line-height: 2.05;
  color: var(--ink, #2D2D2D);
  margin: 0;
}
.np-l-example-jp rt {
  font-size: .5em;
  color: var(--ink-soft, #6E6E6E);
  font-family: var(--font-sans, 'DM Sans', system-ui, sans-serif);
}
.np-l-example .np-l-example-reading,
.np-l-example-reading {
  font-size: 13px; color: var(--ink-soft, #6E6E6E);
  margin: 6px 0 2px; letter-spacing: .02em;
}
.np-l-example .np-l-example-id,
.np-l-example-id { font-size: 14px; color: var(--ink-mid, #4A4A4A); margin: 0 0 6px; }
/* 44px untuk SEMUA tombol audio di halaman lesson — termasuk yang di tabel
   formation/kolom Bacaan (di luar .np-l-example). Tampilan kuis (quiz-opt)
   tidak berubah selain tinggi sentuhnya. */
.listen-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 44px;
  font-size: 16px; cursor: pointer;
}
.np-l-example .listen-btn {
  min-width: 44px; min-height: 44px;
  border: 1px solid var(--border-mid, rgba(107, 79, 58, .18));
  border-radius: var(--r-sm, 6px); background: transparent;
}

/* ── Kesalahan umum ─────────────────────────────────────────── */
.np-l-mistake { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.np-l-mistake li { border-radius: var(--r-md, 10px); padding: 12px 16px; font-size: 14px; line-height: 1.65; }
.np-l-mistake li .why { font-size: 13px; }
.np-l-mistake-bad  { background: var(--red-pale, #FAEAEA);   border: 1px solid rgba(166, 58, 58, .25); }
.np-l-mistake-good { background: var(--green-pale, #EAF2E8); border: 1px solid rgba(91, 124, 91, .25); }
.np-l-mistake b { font-family: var(--font-jp, 'Noto Serif JP', serif); }
.np-l-mistake li .why, .np-l-mistake .why { display: block; margin-top: 4px; color: var(--ink-soft, #6E6E6E); }

/* ── Mini practice (static, tanpa engine quiz) ──────────────── */
.np-l-practice { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.np-l-practice li {
  background: var(--gold-pale, #FBF4E3);
  border: 1px solid rgba(200, 155, 60, .35);
  border-radius: var(--r-md, 10px);
  padding: 12px 16px; font-size: 15px; line-height: 1.7;
}
.np-l-practice .jp { font-family: var(--font-jp, 'Noto Serif JP', serif); font-size: 17px; }
.np-l-practice summary {
  cursor: pointer; font-weight: 700; font-size: 13px;
  color: var(--primary, #6B4F3A); margin-top: 6px;
  min-height: 44px; display: inline-flex; align-items: center;
}
.np-l-practice details[open] summary { margin-bottom: 4px; }

/* ── Tautan daftar materi (untuk halaman di luar sequence katalog) ── */
.np-l-hublink { display: flex; justify-content: center; margin: 8px 0 4px; }
.np-l-hublink a {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 10px 18px;
  border: 1px solid var(--border-mid, rgba(107, 79, 58, .18));
  border-radius: 999px; background: var(--surface, #FEFCF8);
  /* Warna teks disengaja literal + override dark eksplisit (konvensi
     kyoto-theme untuk pasangan bg+teks): teks cokelat tidak boleh ikut
     var --primary yang berbalik emas di atas latar tetap terang. */
  color: #6B4F3A; font-weight: 700; font-size: 14px;
  text-decoration: none;
}
.np-l-hublink a:hover { border-color: var(--gold, #C89B3C); }
[data-theme="dark"] .np-l-hublink a { background: var(--surface, #1A1A1A); color: #C89B3C; }

/* ── Tujuan belajar ─────────────────────────────────────────── */
.np-l-goal { margin: 16px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.np-l-goal li { font-size: 15px; line-height: 1.6; color: var(--ink-mid, #4A4A4A); padding-left: 26px; position: relative; }
.np-l-goal li::before { content: '✓'; position: absolute; left: 4px; color: var(--green, #5B7C5B); font-weight: 800; }

/* ── Mobile ─────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .np-l-pattern { padding: 18px 14px; }
  .np-l-example .np-l-example-jp, .np-l-example-jp { font-size: 18px; }
  .np-l-example { padding: 12px 14px; }
  .np-l-form { padding: 12px 14px; }
  .np-l-form-part { font-size: 17px; padding: 7px 11px; }
}

@media (prefers-reduced-motion: reduce) {
  .np-l-practice summary, .np-l-example .listen-btn { transition: none; }
}
