/*
 * Khối "Luyện Flashcard" — shortcode [tdf_luyen_flashcard].
 *
 * Dùng biến màu/font của theme "Ở Nhà Cùng Trọng" (--wp--preset--*), kèm
 * giá trị dự phòng sau dấu phẩy để đổi theme khác vẫn không vỡ.
 * Theme ≥ 1.27.0 tự làm phẳng khung khi khối nằm ở cột phụ (ngăn khối bằng
 * đường kẻ đứt). Chữ nhỏ nhất 14px, nút cao 44px, chữ tiếng Việt không dùng
 * font mono, không viết hoa toàn bộ.
 */

.tdf-block {
	background: var(--wp--preset--color--raised, #ffffff);
	border: 1px solid var(--wp--preset--color--line, #d8ddd1);
	border-radius: 10px;
	box-shadow: 0 1px 2px rgba(28, 38, 32, 0.06), 0 6px 18px rgba(28, 38, 32, 0.05);
	padding: 1rem 1.125rem;
	font-family: var(--wp--preset--font-family--be-vietnam-pro, "Be Vietnam Pro", sans-serif);
	color: var(--wp--preset--color--ink, #1c2620);
}

/* `hidden` phải thắng mọi luật display bên dưới (JS bật/tắt bằng hidden). */
.tdf-block [hidden] {
	display: none !important;
}

.tdf-block__title {
	margin: 0 0 0.5rem;
	font-size: 1.125rem;
}

.tdf-block__desc {
	margin: 0 0 0.875rem;
	color: var(--wp--preset--color--ink-soft, #4b5a51);
	font-size: 0.9375rem;
	line-height: 1.6;
}

/* ---------- Thẻ đang luyện ---------- */
.tdf-type {
	margin: 0 0 0.25rem;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--wp--preset--color--ink-soft, #4b5a51);
}

.tdf-type:empty {
	display: none;
}

.tdf-prompt {
	margin: 0 0 1rem;
	font-family: var(--wp--preset--font-family--literata, "Literata", serif);
	font-weight: 600;
	font-size: 1.5rem;
	line-height: 1.3;
	word-break: break-word;
}

.tdf-form {
	display: flex;
	gap: 0.5rem;
}

.tdf-input {
	flex: 1;
	min-width: 0;
	min-height: 44px;
	box-sizing: border-box;
	padding: 0.5rem 0.75rem;
	font: inherit;
	font-size: 1rem;
	border: 1.5px solid var(--wp--preset--color--line-strong, #82926c);
	border-radius: 8px;
	background: var(--wp--preset--color--raised, #ffffff);
	color: inherit;
}

.tdf-input:focus {
	outline: 2px solid var(--wp--preset--color--moss, #3f6b52);
	outline-offset: 1px;
}

.tdf-submit {
	flex: none;
	min-height: 44px;
	padding: 0 1rem;
	border: none;
	border-radius: 8px;
	background: var(--wp--preset--color--moss, #3f6b52);
	color: #ffffff;
	font: inherit;
	font-size: 0.9375rem;
	font-weight: 600;
	cursor: pointer;
}

.tdf-submit:hover {
	background: var(--wp--preset--color--moss-deep, #2c4d3a);
}

/* Dòng "Đáp án: …" — 1 màu trung tính, không phán đúng/sai. */
.tdf-feedback {
	margin: 0.75rem 0 0;
	font-size: 0.9375rem;
	font-weight: 600;
}

.tdf-feedback:empty {
	display: none;
}

.tdf-reveal {
	margin-top: 0.75rem;
}

.tdf-reveal-image {
	display: block;
	max-width: 100%;
	max-height: 260px;
	width: auto;
	margin: 0 0 0.75rem;
	border-radius: 10px;
	object-fit: cover;
}

.tdf-reveal-note {
	margin: 0 0 0.75rem;
	font-style: italic;
	font-size: 0.9375rem;
	color: var(--wp--preset--color--ink-soft, #4b5a51);
}

.tdf-reveal-note:empty {
	display: none;
}

/* ---------- Nút ---------- */
.tdf-block__start,
.tdf-block__next,
.tdf-block__stop {
	min-height: 44px;
	padding: 0 1rem;
	border-radius: 999px;
	font: inherit;
	font-size: 0.9375rem;
	font-weight: 600;
	cursor: pointer;
}

.tdf-block__start,
.tdf-block__next {
	border: 1px solid var(--wp--preset--color--moss, #3f6b52);
	background: var(--wp--preset--color--moss-tint, #dbe8de);
	color: var(--wp--preset--color--moss-deep, #2c4d3a);
}

.tdf-block__start:hover,
.tdf-block__next:hover {
	background: var(--wp--preset--color--moss, #3f6b52);
	color: #ffffff;
}

.tdf-block__stop {
	margin-top: 0.75rem;
	border: 1px solid var(--wp--preset--color--line-strong, #82926c);
	background: transparent;
	color: var(--wp--preset--color--ink-soft, #4b5a51);
}

.tdf-block__stop:hover {
	color: var(--wp--preset--color--ink, #1c2620);
	border-color: var(--wp--preset--color--ink, #1c2620);
}

.tdf-block button:focus-visible {
	outline: 2px solid var(--wp--preset--color--gold, #a8763a);
	outline-offset: 2px;
}
