/* Version: 1.17 */
/* https://h5p.org/node/839 */
/* check also ... /wp-content/plugins/h5p/h5p-php-library/styles/h5p.css */

/* بارگذاری مستقیم وزیرمتن با اعداد فارسی از سرورهای پرقدرت گوگل */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;600&display=swap');


span.joubel-icon-tip-normal {display: none !important;}

[class^="h5p"] * {
	font-family: "Vazirmatn", Tahoma, sans-serif !important;
	color: black;
	direction: rtl;
	font-weight: 400 !important;
}
/* (v1.14) فقط داخل H5P؛ قبلاً روی کلاس fa خود سایت (مثلاً «پدر» در الفبا) هم اثر می‌گذاشت */
.h5p-content .fa {font: normal normal normal 14px/1 H5PFontAwesome4 !important;}
.h5p-audio-inner .h5p-audio-minimal-button {font-family: 'H5PFontAwesome4' !important;}
.h5p-dictation .h5p-audio-minimal-button.h5p-audio-minimal-slow {font-family: "H5PDictation", sans-serif !important; }

[data-content-id="45"] .h5p-question-content {direction: ltr !important; color: red;}
[data-content-id="45"] {direction: ltr !important; color: red;}

html.h5p-iframe .h5p-content {border: none;}
.h5p-question-introduction, .h5p-question-content, span[role=option] {font-size:19px; font-weight: 600;}
div.h5p-label p {font-size:17px !important; word-wrap: break-word !important;}

.h5p-question-audio {z-index:9999;}

.h5p-question-content {background: #fed !important; padding: 10px 5px !important;}

@media screen and (min-width: 600px) {
.flex {display: flex;}
.flex .h5p-question-content {flex-basis: 60%;}
.flex .h5p-question-image {flex-basis: 40%;}
.flex .h5p-question-image {height: 300px;}
.flex .h5p-question-audio {flex-basis: 40%;}
.flex {background: #fed;}
}

.h5p-sort-paragraphs .h5p-sort-paragraphs-paragraph {padding: 0 !important;}


.h5p-drag-dropzone-container {padding-left: 2px;} /* space with the next word or comma , */
.h5p-word-selectable-words table {margin-bottom: 25px;}
.h5p-word-selectable-words table td {background:#def; vertical-align:middle !important;}
.h5p-mark-the-words table td [aria-selected="true"] {border: 3px solid #000;} 
.h5p-word-selectable-words table td:nth-child(1) {background: #fed;}
.h5p-mark-the-words .h5p-word-selectable-words table td:nth-child(1) p span[role=option]{
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  pointer-events: none;
}
.h5p-mark-the-words .h5p-word-inner p {margin: 0; padding: 3px;}

/* Instructions - Start */

.h5p-question-introduction table {
	width: 100%;
	border: none;
	border-right: 10px solid black !important;	
	font-weight: 500;
	background: lightblue;
}

.h5p-question-introduction table td {
	border: none;
	padding: 8px;
}

.h5p-question-introduction table td:nth-child(2) {
	text-align: left !important;
	direction: ltr !important;
	font-family: sans-serif;
}
.h5p-task-description {visibility: hidden;}
.h5p-question-introduction {display: none;}

/* نمایش «شرح تمرین» و «مقدمهٔ سؤال» وقتی تمرین داخل عنصری با کلاس h5p-show-intro باشد.
   حالت iframe: فایل custom-h5p.js کلاس را روی <html> داخل قاب می‌گذارد.
   حالت div: کلاس روی خود عنصر والد در صفحه است. */
.h5p-show-intro .h5p-task-description {visibility: visible;}
.h5p-show-intro .h5p-question-introduction {display: block;}

/* Instructions - End*/

/* (v1.15) گزینه‌های Multiple Choice در دو ستونِ هم‌عرض که کل عرض را پر می‌کنند (دو طرف تراز)؛
   در قاب باریک (موبایل) یک ستون. */
.h5p-multichoice .h5p-answers {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	column-gap: 10px;
}
@container (max-width: 560px) {
	.h5p-multichoice .h5p-answers {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* (v1.15) قاعدهٔ قدیمی «span.h5p-alternative-inner p {float:right; margin-right:50px}» حذف شد:
   گزینه‌هایی که متنشان داخل <p> است (انگلیسی) را به هم می‌ریخت. */

/* (v1.6) قاعدهٔ قدیمی .h5p-drag-dropped حذف شد: در نسخهٔ جدید H5P کلمهٔ رهاشده را از جای خالی بیرون می‌زد. */

/* did not work - later
.h5p-dragquestion .h5p-dropzone > .h5p-inner > .ui-droppable {
    border: 3px dotted black !important;
    background: orchid !important;
}
.h5p-drag-draggables-container, .h5p-drag-droppable-words {display: grid; grid-template-columns: repeat(auto-fill, 220px);} 
*/


.joubel-speech-bubble-inner, .h5p-multichoice > .h5p-question, .h5p-multichoice label, .h5p-multichoice .h5p-feedback-text , .h5p-multichoice .h5p-answer .h5p-feedback-inner , .popover-title, .popover-content { text-align: right; direction: rtl;}

.h5p-blanks .h5p-wrong::after, .h5p-blanks .h5p-correct::after { left: 0.5em; right:inherit; }

.h5p-multichoice .h5p-input-container { float: right; }

.h5p-multichoice .h5p-input { right: -1000px; left:inherit; }

.h5p-multichoice .joubel-tip-container { left:0; right:inherit; }

.joubel-speech-bubble { left:1em; right:inherit; min-width: 10em; }

.joubel-speech-bubble-inner::before, .joubel-speech-bubble::before { left:10px; right:inherit; }

.h5p-multichoice .h5p-answer > label::before { left:0.75em; right:inherit; }

.h5p-blanks button.h5p-button::after { font-family: 'H5PFontAwesome4'; content: "\f06e"; padding-right: 0.5em; }

.h5p-blanks button.h5p-button.h5p-check-answer::after { content:"\f058"; }

.h5p-blanks button.h5p-button.h5p-try-again::after { content:"\f021"; }

.h5p-blanks button.h5p-button::before, .h5p-blanks button.h5p-button.h5p-check-answer::before, .h5p-blanks button.h5p-button.h5p-try-again::before { content:""; }

.h5p-multichoice .h5p-show-solution-container .h5p-multichoice-check-button::after { content: "\f058"; font-family: 'H5PFontAwesome4'; padding-right: 0.5em; }

.h5p-multichoice .h5p-show-solution-container .h5p-multichoice-check-button::before { content:""; }


/*
.h5p-answers {display: flex; gap: 5px;} 
.h5p-answer * {padding: 0px;}
.h5p-multichoice .h5p-alternative-container {
	text-indent: -1em; 
	padding: 0.25em 0.75em .25em 2.1em;
	padding: 0.25em 1em 0.25em 1em;
	padding: 0.25em;
}
.h5p-alternative-container .h5p-alternative-inner {padding:0px;}
.h5p-multichoice .h5p-answer[role="checkbox"] .h5p-alternative-container:before {content: ""}
.h5p-multichoice .h5p-answer[role="checkbox"] .h5p-alternative-container:after {content: "\e602";}
*/

/* ============================================================
   اصلاحات راست‌به‌چپ برای ظاهر جدید H5P (نسخهٔ 1.6)
   ============================================================ */

/* ۱.۱ فلش دکمه‌های «بعدی» و «قبلی» در Question Set: آینه‌ای شود */
.h5p-theme-next::after,
.h5p-theme-previous::before {
	display: inline-block;
	transform: scaleX(-1);
}

/* ۱.۲ دکمهٔ «بررسی» (و هر دکمهٔ اصلی): آیکون هنگام هاور به سمت راستِ متن برود، نه روی متن */
.h5p-theme-primary-cta::before {
	transform: translate(calc(-1 * var(--icon-transform-x)), var(--icon-transform-y));
}

/* ۱.۴ دستگیرهٔ کشیدن (⠿) در ابتدای کلمه، یعنی سمت راست */
.h5p-theme .h5p-draggable.h5p-draggable--has-handle.ui-draggable-handle:not(.ui-draggable-disabled)::before {
	left: auto;
	right: 0;
	border-radius: 0 var(--h5p-theme-border-radius-small) var(--h5p-theme-border-radius-small) 0;
}
.h5p-theme .h5p-draggable.h5p-draggable--has-handle:not(.h5p-draggable-correct):not(.h5p-draggable-wrong):not(.ui-draggable-disabled):not(:has(.h5p-image)) {
	padding-left: var(--padding);
	padding-right: calc(var(--padding) + var(--handle-width));
}
.h5p-drag-text .h5p-draggable.h5p-draggable--has-handle.h5p-draggable-correct,
.h5p-drag-text .h5p-draggable.h5p-draggable--has-handle.h5p-draggable-wrong {
	padding-left: 0;
	padding-right: var(--handle-width);
}
.h5p-drag-text .h5p-drag-draggables-container.no-handles .h5p-draggable {
	padding-right: 0;
}

/* ۱.۵ و ۱.۶ جای بانک کلمه‌ها در Drag the Words:
   - صفحهٔ پهن (کادر تمرین ۵۶۰ پیکسل یا بیشتر): ستونی در سمت راستِ متن
   - صفحهٔ باریک (موبایل): زیر متن، از راست چیده شود
   چیدمان با container query تعیین می‌شود، نه با کلاسی که JS بعداً اضافه می‌کند،
   پس از همان لحظهٔ اول درست نمایش داده می‌شود و پرش نمی‌کند. */
.h5p-drag-text .h5p-question-content {
	container-type: inline-size;
}
.h5p-drag-text .h5p-drag-task,
.h5p-drag-text .h5p-drag-task.h5p-drag-wide-screen {
	display: flex;
	flex-direction: column;
	gap: var(--h5p-theme-spacing-s);
}
.h5p-drag-text .h5p-drag-task .h5p-drag-draggables-container {
	flex-direction: row;
	min-width: 0;
	padding-top: 0;
}
@container (min-width: 560px) {
	.h5p-drag-text .h5p-drag-task,
	.h5p-drag-text .h5p-drag-task.h5p-drag-wide-screen {
		flex-direction: row-reverse;
		align-items: flex-start;
	}
	.h5p-drag-text .h5p-drag-task .h5p-drag-droppable-words-container {
		flex: 1 1 auto;
		width: auto;
	}
	.h5p-drag-text .h5p-drag-task .h5p-drag-draggables-container {
		flex-direction: column;
		min-width: fit-content;
	}
}


/* ============================================================
   یکدست کردن رنگ کارت تمرین (نسخهٔ 1.7)
   کل کارت سؤال کرم، نوار نتیجه هم‌رنگ کارت، جعبهٔ متن سفید برای خوانایی.
   دکمه‌های آبی و نوار پیمایش عمداً تغییر نکرده‌اند.
   ============================================================ */
.h5p-theme.h5p-question {
	background-color: #fed;
}
.h5p-theme .h5p-question-evaluation-container.evaluation-mode {
	background-color: transparent;
	border-top: 1px solid #f2d6bb;
}
.h5p-drag-text .h5p-drag-droppable-words-container {
	background-color: #fff;
	border-color: #f2d6bb;
}


/* ============================================================
   نوار امتیاز (نسخهٔ 1.8)
   ============================================================ */
/* متن «شما … امتیاز گرفتید» داخل نوار فقط برای صفحه‌خوان است. H5P آن را با رنگ شفاف پنهان می‌کند،
   ولی قاعدهٔ color: black بالای همین فایل آن را پیدا می‌کرد. */
.h5p-joubelui-score-bar-progress,
.h5p-joubelui-score-bar-progress * {
	color: transparent !important;
}
/* راست‌به‌چپ: نوار از راست پر شود و ستاره در انتهای آن، یعنی سمت چپ، باشد */
.h5p-joubelui-score-bar-progress-wrapper {
	margin-right: 0;
	margin-left: 1.7em;
	border-radius: 0 1.5em 1.5em 0;
}
.h5p-joubelui-score-bar-progress {
	left: auto;
	right: 0;
	border-radius: 0 .5em .5em 0;
}
.h5p-joubelui-score-bar-star {
	right: auto;
	left: 0;
}


/* ============================================================
   Multiple Choice و Mark the Words (نسخهٔ 1.9)
   ============================================================ */
/* گزینهٔ چندخطی: H5P متن گزینه را چپ‌چین می‌کند. در یک خط پیدا نیست، ولی خط دوم به چپ می‌رفت. */
.h5p-multichoice .h5p-alternative-container {
	text-align: right;
}
.h5p-multichoice .h5p-alternative-inner {
	margin-right: var(--h5p-theme-spacing-xxs);
	margin-left: var(--h5p-theme-spacing-s);
}

/* Mark the Words با جدول: ستون اول (شمارهٔ جمله یا متن راهنما) قابل انتخاب نباشد.
   ویرایشگر جدید H5P (CKEditor 5) متن خانه‌های جدول را دیگر داخل <p> نمی‌گذارد،
   برای همین قاعدهٔ قدیمیِ «td:nth-child(1) p span» دیگر به کلمه‌ها نمی‌رسید. */
.h5p-mark-the-words .h5p-word-selectable-words table tr > :first-child,
.h5p-mark-the-words .h5p-word-selectable-words table tr > :first-child [role="option"] {
	pointer-events: none;
	-webkit-user-select: none;
	user-select: none;
}
.h5p-mark-the-words .h5p-word-selectable-words table tr > :first-child [role="option"] {
	cursor: default;
	border-color: transparent !important;
	background: none !important;
}

/* (نسخهٔ 1.11) پنهان‌سازی محکم‌تر متن نوار امتیاز با اندازهٔ قلم صفر:
   متن هیچ جایی نمی‌گیرد و رنگ یا فاصلهٔ داخلی هم دیگر اثری ندارد.
   (روش text-indent در نسخهٔ 1.10 نوار را در سایت تا لبهٔ صفحه کش می‌داد و حذف شد.) */
.h5p-joubelui-score-bar-progress {
	font-size: 0 !important;
	line-height: 0 !important;
	padding: 0 !important;
	height: 100% !important;
	border-radius: 0 6px 6px 0 !important;
}


/* ============================================================
   تمرین‌های انگلیسی (نسخهٔ 1.12)
   اگر تمرین داخل عنصری با کلاس ltr باشد (مثلاً گروه وردپرس با کلاس ltr)، فایل custom-h5p.js
   کلاس ltr را روی <html> داخل قاب می‌گذارد و این بخش همهٔ اصلاحات راست‌به‌چپ را برمی‌گرداند.
   ============================================================ */
html.ltr [class^="h5p"] *,
html.ltr [class^="h5p"] {
	direction: ltr;
}
html.ltr .joubel-speech-bubble-inner, html.ltr .h5p-multichoice > .h5p-question, html.ltr .h5p-multichoice label,
html.ltr .h5p-multichoice .h5p-feedback-text, html.ltr .h5p-multichoice .h5p-answer .h5p-feedback-inner,
html.ltr .popover-title, html.ltr .popover-content {
	text-align: left;
	direction: ltr;
}
html.ltr .h5p-question-introduction, html.ltr .h5p-question-content {
	text-align: left;
}
/* فلش‌ها و آیکون دکمهٔ اصلی */
html.ltr .h5p-theme-next::after,
html.ltr .h5p-theme-previous::before {
	transform: none;
}
html.ltr .h5p-theme-primary-cta::before {
	transform: translate(var(--icon-transform-x), var(--icon-transform-y));
}
/* دستگیرهٔ کشیدن */
html.ltr .h5p-theme .h5p-draggable.h5p-draggable--has-handle.ui-draggable-handle:not(.ui-draggable-disabled)::before {
	left: 0;
	right: auto;
	border-radius: var(--h5p-theme-border-radius-small) 0 0 var(--h5p-theme-border-radius-small);
}
html.ltr .h5p-theme .h5p-draggable.h5p-draggable--has-handle:not(.h5p-draggable-correct):not(.h5p-draggable-wrong):not(.ui-draggable-disabled):not(:has(.h5p-image)) {
	padding-right: var(--padding);
	padding-left: calc(var(--padding) + var(--handle-width));
}
html.ltr .h5p-drag-text .h5p-draggable.h5p-draggable--has-handle.h5p-draggable-correct,
html.ltr .h5p-drag-text .h5p-draggable.h5p-draggable--has-handle.h5p-draggable-wrong {
	padding-right: 0;
	padding-left: var(--handle-width);
}
/* Drag the Words: بانک کلمه‌ها سمت راستِ متن (حالت عادی H5P در چپ‌به‌راست) */
/* (v1.14) در چپ‌به‌راست هم بانک کلمه‌ها در ابتدای سطر باشد، یعنی سمت چپ */
@container (min-width: 560px) {
	html.ltr .h5p-drag-text .h5p-drag-task,
	html.ltr .h5p-drag-text .h5p-drag-task.h5p-drag-wide-screen {
		flex-direction: row-reverse;
	}
}
/* نوار امتیاز */
html.ltr .h5p-joubelui-score-bar-progress-wrapper {
	margin-left: 0;
	margin-right: 1.7em;
	border-radius: 1.5em 0 0 1.5em;
}
html.ltr .h5p-joubelui-score-bar-progress {
	right: auto;
	left: 0;
	border-radius: 6px 0 0 6px !important;
}
html.ltr .h5p-joubelui-score-bar-star {
	left: auto;
	right: 0;
}
/* Multiple Choice */
html.ltr .h5p-multichoice .h5p-alternative-container {
	text-align: left;
}
html.ltr .h5p-multichoice .h5p-alternative-inner {
	margin-right: var(--h5p-theme-spacing-s);
	margin-left: var(--h5p-theme-spacing-xxs);
}


/* ============================================================
   جدول‌ها در Mark the Words (نسخهٔ 1.13)
   جدولی که از Word چسبانده شده عرض ثابت (مثلاً style="width:420px") با خود می‌آورد.
   در صفحه همیشه تمام عرض باشد. با table-layout: auto ستون‌ها خودشان جا را تقسیم می‌کنند،
   پس وقتی «+۱/−۱» بعد از بررسی یا نمایش پاسخ اضافه می‌شود، جدول از ۱۰۰٪ بیرون نمی‌زند؛
   فقط ستون اول کمی باریک‌تر می‌شود و متنش می‌شکند.
   ============================================================ */
.h5p-mark-the-words .h5p-word-selectable-words table {
	width: 100% !important;
	max-width: 100% !important;
	table-layout: auto !important;
	height: auto !important;
}
.h5p-mark-the-words .h5p-word-selectable-words table col,
.h5p-mark-the-words .h5p-word-selectable-words table td,
.h5p-mark-the-words .h5p-word-selectable-words table th {
	width: auto !important;
}
/* ستون آخر (گزینه‌ها) فقط به اندازهٔ محتوایش جا بگیرد و نشکند */
.h5p-mark-the-words .h5p-word-selectable-words table tr > :last-child:not(:first-child) {
	width: 1% !important;
	white-space: nowrap;
}

/* (v1.14) ویرایشگر جدید H5P (CKEditor 5) جدول را داخل <figure class="table"> می‌گذارد و عرض را روی همان figure می‌نویسد */
.h5p-mark-the-words .h5p-word-selectable-words figure,
.h5p-mark-the-words .h5p-word-selectable-words figure.table {
	width: 100% !important;
	max-width: 100% !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
	display: block !important;
	float: none !important;
}

/* (v1.15) متن گزینه‌ای که داخل <p> است حاشیهٔ اضافهٔ بالا/پایین نگیرد تا ارتفاع و فاصله‌ها مثل گزینه‌های فارسی باشد */
.h5p-multichoice .h5p-alternative-inner p,
.h5p-multichoice .h5p-alternative-inner div {
	margin: 0;
	padding: 0;
}

/* (v1.16) تمرین‌های تکی (بیرون از Question Set) فاصلهٔ داخلی نداشتند و گزینه‌ها و دکمه‌ها به لبهٔ کادر کرم می‌چسبیدند.
   حالا مثل تمرین‌های داخل Question Set فاصله دارند. */
.h5p-container.h5p-standalone.h5p-question {
	padding: var(--h5p-theme-spacing-s) var(--h5p-theme-spacing-m);
	box-sizing: border-box;
}


/* ============================================================
   Fill in the Blanks (نسخهٔ 1.17)
   H5P فقط سمت چپ خانه فاصلهٔ داخلی می‌گذارد؛ در فارسی متن به لبهٔ راست می‌چسبید.
   حالا هر دو طرف فاصله دارد، و جای آیکون درست/غلط و راهنما در راست‌به‌چپ سمت چپ است.
   ============================================================ */
.h5p-blanks .h5p-text-input {
	padding-left: var(--h5p-theme-spacing-xs);
	padding-right: var(--h5p-theme-spacing-xs);
}
/* درست / غلط: آیکون سمت چپ خانه، پس فضای خالی هم سمت چپ */
.h5p-blanks .h5p-correct .h5p-text-input,
.h5p-blanks .h5p-wrong .h5p-text-input {
	padding-right: var(--h5p-theme-spacing-xs);
	padding-left: var(--h5p-theme-spacing-m);
}
.h5p-blanks .h5p-correct:after,
.h5p-blanks .h5p-wrong:after {
	right: auto;
	left: var(--h5p-theme-spacing-xxs);
}
/* راهنما (tip) */
.h5p-blanks .joubel-tip-container {
	right: auto;
	left: 0.4em;
}
.h5p-blanks .has-tip .h5p-text-input {
	padding-right: var(--h5p-theme-spacing-xs);
	padding-left: 2.25em;
}
.h5p-blanks .has-tip.h5p-correct:after,
.h5p-blanks .has-tip.h5p-wrong:after {
	right: auto;
	left: 2.25em;
}
.h5p-blanks .has-tip.h5p-correct .h5p-text-input,
.h5p-blanks .has-tip.h5p-wrong .h5p-text-input {
	padding-right: var(--h5p-theme-spacing-xs);
	padding-left: 3.5em;
}
.h5p-blanks .h5p-correct-answer {
	margin-left: 0;
	margin-right: .5em;
}
/* چپ‌به‌راست (گروه ltr): همه برعکس */
html.ltr .h5p-blanks .h5p-correct .h5p-text-input,
html.ltr .h5p-blanks .h5p-wrong .h5p-text-input {
	padding-left: var(--h5p-theme-spacing-xs);
	padding-right: var(--h5p-theme-spacing-m);
}
html.ltr .h5p-blanks .h5p-correct:after,
html.ltr .h5p-blanks .h5p-wrong:after {
	left: auto;
	right: var(--h5p-theme-spacing-xxs);
}
html.ltr .h5p-blanks .joubel-tip-container {
	left: auto;
	right: 0.4em;
}
html.ltr .h5p-blanks .has-tip .h5p-text-input {
	padding-left: var(--h5p-theme-spacing-xs);
	padding-right: 2.25em;
}
html.ltr .h5p-blanks .has-tip.h5p-correct:after,
html.ltr .h5p-blanks .has-tip.h5p-wrong:after {
	left: auto;
	right: 2.25em;
}
html.ltr .h5p-blanks .has-tip.h5p-correct .h5p-text-input,
html.ltr .h5p-blanks .has-tip.h5p-wrong .h5p-text-input {
	padding-left: var(--h5p-theme-spacing-xs);
	padding-right: 3.5em;
}
html.ltr .h5p-blanks .h5p-correct-answer {
	margin-right: 0;
	margin-left: .5em;
}
