/* ══════════════════════ VOCAB DETAIL VIEW (shared) ══════════════════════
   Reused word-detail popup for "Bộ thủ và Từ vựng HSK" (and any future
   caller — e.g. Character Studio's own vocabulary list). Reuses the exact
   .vp-modal-backdrop / .vp-modal / .vp-modal-header / .vp-modal-title /
   .vp-modal-close / .vp-modal-body shell already established in
   character-studio.html's "Học từ với chữ này" modal — a page that already
   defines those rules only needs the new .vdv-* rules below; a page that
   doesn't (hsk-vocabulary.html) links this whole file and gets both. This
   is not a second modal system — it is the same shell, same class names,
   used from a second page. */

.vp-modal-backdrop { position: fixed; inset: 0; background: var(--scrim); z-index: 90; display: none; align-items: center; justify-content: center; padding: 24px; }
.vp-modal-backdrop.open { display: flex; }
.vp-modal { background: var(--surface); border-radius: 22px; width: 100%; max-width: 640px; max-height: 90vh; box-shadow: var(--shadow-md); display: flex; flex-direction: column; overflow: hidden; }
.vp-modal-header { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.vp-modal-title { font-size: var(--hs-text-lg); font-weight: 800; color: var(--text); }
.vp-modal-close { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 999px; border: 1px solid var(--border2); background: var(--surface); color: var(--text2); display: flex; align-items: center; justify-content: center; }
.vp-modal-close:hover { border-color: var(--green); color: var(--text); }
.vp-modal-body { flex: 1 1 auto; overflow-y: auto; padding: 22px 20px; }
@media (max-width: 767px) {
  .vp-modal-backdrop { padding: 0; align-items: flex-end; }
  .vp-modal { max-width: 100%; max-height: 96vh; border-radius: 20px 20px 0 0; }
}

/* ── word-detail content (new) — entire main content centered as a
   "learning card", per the reference layout: hanzi / pinyin+🔊 / meaning /
   💡 ChineseGo Memory / 例句 all stacked and centered, not left-aligned. ── */
.vdv-word-row { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.vdv-hanzi { font-size: 63px; font-weight: 700; line-height: 1; } /* 1.5x the original 42px */
.vdv-pinyin-row { display: flex; align-items: center; justify-content: center; gap: 8px; }
.vdv-pinyin { font-size: var(--hs-text-lg); color: var(--green); font-weight: 600; }
.vdv-audio-btn { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 999px; border: 1px solid var(--border2); background: var(--surface); color: var(--text2); display: flex; align-items: center; justify-content: center; font-size: 14px; transition: border-color .2s, color .2s; }
.vdv-audio-btn:hover { border-color: var(--green); color: var(--text); }
.vdv-type { font-size: var(--hs-text-metadata-min); font-weight: 700; color: var(--text3); border: 1px solid var(--border2); border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.vdv-meaning { margin-top: 8px; font-size: var(--hs-text-body); color: var(--text); line-height: var(--hs-line-normal); text-align: center; }
.vdv-meaning.is-empty { color: var(--text3); font-style: italic; }

.vdv-section { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); text-align: center; }
.vdv-section-label { font-size: var(--hs-text-metadata); font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--text3); margin-bottom: 10px; }
.vdv-memory-text { font-size: var(--hs-text-body); color: var(--text); line-height: var(--hs-line-prose); }
.vdv-example-zh { font-size: 20px; font-weight: 600; }
.vdv-example-pinyin { font-size: var(--hs-text-metadata); color: var(--green); margin-top: 4px; }
.vdv-example-vi { font-size: var(--hs-text-body); color: var(--text2); margin-top: 6px; }
.vdv-example-empty { color: var(--text3); font-style: italic; font-size: var(--hs-text-metadata); }

/* Grid, not flex-wrap — two fixed columns guarantee the pair NEVER wraps to
   separate rows at any width. A too-long label wraps to a second LINE
   inside its own button (height grows) instead of pushing the second
   button onto a new row. */
.vdv-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
.vdv-action-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-align: center;
  min-height: 44px; padding: 11px 14px; border-radius: 999px; border: 1.5px solid var(--border2); background: var(--surface2);
  color: var(--text); font-family: inherit; font-size: var(--hs-text-metadata); font-weight: 700;
  transition: border-color .2s, background .2s, color .2s;
}
.vdv-action-btn:hover:not(:disabled) { border-color: var(--green); color: var(--green); }
.vdv-action-btn:disabled { cursor: default; }
.vdv-action-btn.is-done { background: color-mix(in srgb, var(--green) 14%, transparent); border-color: var(--green); color: var(--green); }

.vdv-cta-row { text-align: center; margin-top: 18px; }
.vdv-char-cta { display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px; border-radius: 999px; background: var(--green); color: var(--bg); font-weight: 700; font-size: var(--hs-text-metadata); text-decoration: none; transition: background .2s; }
.vdv-char-cta:hover { background: var(--green-dark); }

.vdv-nav-row { gap: 10px; border-bottom: none; border-top: 1px solid var(--border); }
.vdv-nav-btn {
  flex: 0 1 auto; display: inline-flex; align-items: center; gap: 6px; min-width: 0;
  padding: 9px 14px; border-radius: 999px; border: 1px solid var(--border2); background: var(--surface);
  color: var(--text2); font-family: inherit; font-size: var(--hs-text-metadata-min); font-weight: 700;
  transition: color .2s, border-color .2s;
}
.vdv-nav-btn .vdv-nav-word { max-width: 8em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vdv-nav-btn:hover:not(:disabled) { color: var(--text); border-color: var(--border-ac); }
.vdv-nav-btn:disabled { opacity: .35; cursor: default; }
.vdv-nav-counter { font-size: var(--hs-text-metadata-min); color: var(--text3); font-weight: 700; white-space: nowrap; }

@media (max-width: 480px) {
  .vdv-hanzi { font-size: 51px; } /* 1.5x the original 34px */
  .vdv-nav-btn .vdv-nav-word { max-width: 4.5em; }
  .vdv-nav-row { padding: 12px 14px; }
  /* Tighter padding/font at narrow widths so the two-column action row
     stays legible — still same row (grid, see .vdv-actions above), a long
     label just wraps to its own second line inside the button instead. */
  .vdv-action-btn { padding: 10px 8px; font-size: var(--hs-text-metadata-min); }
}
