/* -----------------------------------------------------------
   Mục Thẻ học từ (/flashcards, /ja/flashcards…). Sinh bởi
   tools/site/build_flashcard_pages.py — sửa giao diện ở đây, sửa chữ ở
   tools/flashcards/data/.

   Tách khỏi style.css cùng lý do với stories-pic.css: sửa style.css là đổi
   dấu `?v=` trên mọi trang của site, còn mấy dòng này chỉ mục thẻ học cần.
   CSP `style-src 'self'` cấm `<style>` nhúng, nên mọi thứ nằm ở file này.
----------------------------------------------------------- */

.fc { padding: 36px 0 64px; }
.fc h1 { font-size: clamp(28px, 4vw, 40px); line-height: 1.2; margin: 0 0 14px; }
.fc h2 { margin-top: 40px; }

/* Nền kem của tranh (đo góc ảnh: 253,249,232) — ô thẻ cùng màu nên tranh
   không hiện thành một ô vuông sáng hơn giữa thẻ. */
.fc-grid {
  list-style: none; margin: 28px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px;
}
.fc-card {
  display: flex; flex-direction: column;
  padding: 12px 14px 14px; border: 1px solid #ece3cc; border-radius: 18px; background: #fdf9ea;
}
.fc-card img { width: 100%; aspect-ratio: 1; border-radius: 12px; }
.fc-main { margin: 10px 0 6px; font-size: 22px; font-weight: 700; line-height: 1.35; color: var(--ink); }
.fc-langs { margin: 0; display: grid; gap: 2px; font-size: 15px; line-height: 1.45; }
.fc-langs div { display: grid; grid-template-columns: 6.2em 1fr; gap: 8px; align-items: baseline; }
.fc-langs dt { color: var(--ink-faint); font-size: 13px; }
.fc-langs dd { margin: 0; color: var(--ink); }
.fc-alt { color: var(--ink-faint); font-size: 0.9em; }
/* Pinyin trên từng chữ: đủ nhỏ để không lấn chữ Hán, đủ đậm để bé lớn đọc được. */
.fc rt { font-size: 0.62em; color: var(--ink-soft); }
.fc-main rt { font-size: 0.5em; }

/* Ô chủ đề: ảnh đại diện vuông như ô chọn chủ đề trong app. */
.fc-topics {
  list-style: none; margin: 18px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px;
}
.fc-topics a {
  display: flex; align-items: center; gap: 14px; height: 100%; padding: 10px 14px 10px 10px;
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 14px;
  text-decoration: none; color: var(--ink-soft); font-size: 14px; line-height: 1.4;
}
.fc-topics a:hover { border-color: var(--brand-300); background: var(--bg-tint); }
.fc-topics a[aria-current="page"] { border-color: var(--brand-500); background: var(--bg-tint); }
.fc-topics img { width: 72px; height: 72px; flex: 0 0 72px; border-radius: 12px; }
.fc-topics b { display: block; color: var(--ink); font-size: 16px; }
.fc-cta .points { margin-bottom: 16px; }

@media (max-width: 520px) {
  /* Điện thoại 375 pt: hai cột thẻ, mỗi thẻ ~160 px — tranh vẫn đủ to cho bé chỉ vào. */
  .fc-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .fc-card { padding: 8px 9px 10px; border-radius: 14px; }
  .fc-main { font-size: 18px; }
  .fc-langs { font-size: 14px; }
  .fc-langs div { grid-template-columns: 1fr; gap: 0; }
  .fc-langs dt { font-size: 11px; }
}

/* In ra làm thẻ: bỏ khung trang, ba thẻ một hàng, không thẻ nào bị cắt ngang
   giữa hai tờ. Viền nét đứt là đường cắt bằng kéo. */
@media print {
  .topbar, footer, .crumbs, .fc-cta, .fc-nav, .fc-more, .section-lede, .credit { display: none !important; }
  body { font-size: 11pt; background: #fff; }
  .fc { padding: 0; }
  .fc h1 { font-size: 16pt; margin: 0 0 6mm; }
  .fc-grid { grid-template-columns: repeat(3, 1fr); gap: 5mm; margin: 0; }
  .fc-card { break-inside: avoid; page-break-inside: avoid; border: 1px dashed #999; border-radius: 4mm;
             background: #fff; padding: 3mm; }
  .fc-card img { border-radius: 2mm; }
  .fc-main { font-size: 16pt; }
  .fc-langs { font-size: 10pt; }
  .fc-langs dt { font-size: 8pt; }
}
