/*!
 * Persian (RTL) copy of Build-en/css/comments.css; text in IranSans.
 * Comments: the list (comments.tpl) and the form (addcomments.tpl) on blog articles, podcast episodes and price pages.
 * Light / dark follow html[data-theme] (css/site-theme.css). The rich-text box is the CMS's TinyMCE editor; its inner
 * page is themed by js/comments.js.
 */
:root {
	--cm-red: #fb4848; --cm-ink: #29292b; --cm-muted: #6b6b72; --cm-line: #e6e6eb; --cm-card: #fff; --cm-field: #f6f6f8;
	--cm-font: 'IranSans', sans-serif; --cm-dir: -1;
}
html[data-theme="dark"] { --cm-ink: #f2f2f5; --cm-muted: #a3a3ac; --cm-line: rgba(255, 255, 255, .1); --cm-card: #18181b; --cm-field: #222226; }

/* ---- the form card */
#dle-comments-form {
	margin: 34px 0 0; padding: clamp(20px, 3vw, 34px); border: 1px solid var(--cm-line); border-radius: 22px;
	background: var(--cm-card); color: var(--cm-ink); font-family: var(--cm-font);
}
.rp-cm-head { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.rp-cm-ico { flex: 0 0 auto; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: rgba(251, 72, 72, .1); color: var(--cm-red); font-size: 21px; }
.rp-cm-title { margin: 0 0 4px; padding: 0; font-family: var(--cm-font); font-weight: 800; font-size: 22px; line-height: 1.4; color: var(--cm-ink); }
.rp-cm-sub { margin: 0; font-size: 14px; font-weight: 400; line-height: 1.8; color: var(--cm-muted); }

.rp-cm-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.rp-cm-field { display: flex; flex-direction: column; gap: 7px; margin: 0; }
.rp-cm-field > span, .rp-cm-field > label { font-size: 13px; font-weight: 600; color: var(--cm-ink); }
.rp-cm-field em { font-style: normal; font-weight: 400; color: var(--cm-muted) !important; }
.rp-cm-input {
	width: 100%; height: 50px; padding: 0 16px; border: 1px solid var(--cm-line); border-radius: 14px; background: var(--cm-field);
	color: var(--cm-ink); font-family: var(--cm-font); font-size: 15px; font-weight: 400; outline: none; box-shadow: none;
	transition: border-color .25s, box-shadow .25s, background-color .25s;
}
textarea.rp-cm-input { height: auto; min-height: 150px; padding: 14px 16px; resize: vertical; line-height: 1.8; }
.rp-cm-input::placeholder { color: var(--cm-muted); opacity: .8; }
.rp-cm-input:focus { border-color: var(--cm-red); box-shadow: 0 0 0 4px rgba(251, 72, 72, .14); background: var(--cm-card); }
.rp-cm-msg { margin-bottom: 18px; }

/* the CMS's rich-text editor (TinyMCE) in place of the textarea */
#dle-comments-form .tox.tox-tinymce { border: 1px solid var(--cm-line) !important; border-radius: 14px !important; overflow: hidden; }
#dle-comments-form .tox .tox-editor-header, #dle-comments-form .tox .tox-toolbar__primary, #dle-comments-form .tox .tox-toolbar-overlord { background: var(--cm-field) !important; border: 0 !important; box-shadow: none !important; }
#dle-comments-form .tox .tox-editor-header { border-bottom: 1px solid var(--cm-line) !important; padding: 2px 4px !important; }
#dle-comments-form .tox .tox-tbtn { color: var(--cm-muted); border-radius: 8px; }
#dle-comments-form .tox .tox-tbtn svg { fill: currentColor !important; }
#dle-comments-form .tox .tox-tbtn:hover { background: rgba(251, 72, 72, .1) !important; color: var(--cm-red); }
#dle-comments-form .tox .tox-edit-area::before { border-color: var(--cm-red) !important; border-radius: 0 !important; }
#dle-comments-form .tox:focus-within { border-color: var(--cm-red) !important; box-shadow: 0 0 0 4px rgba(251, 72, 72, .14); }
#dle-comments-form .tox .tox-edit-area__iframe { background: var(--cm-card) !important; }

/* captcha + send */
.rp-cm-foot { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.rp-cm-captcha { display: flex; align-items: flex-end; gap: 12px; }
.rp-cm-captcha-img, .rp-cm-captcha-img a, .rp-cm-captcha-img span { display: block; flex: 0 0 auto; width: 130px; }
.rp-cm-captcha-img img { width: 130px; height: 50px; max-width: none; object-fit: cover; border: 1px solid var(--cm-line); border-radius: 12px; background: #fff; cursor: pointer; }
.rp-cm-captcha .rp-cm-field { width: 170px; }
.rp-cm-send {
	display: inline-flex; align-items: center; gap: 10px; height: 50px; padding: 0 26px; border: 0; border-radius: 14px; margin-inline-start: auto;
	background: var(--cm-red); color: #fff; font-family: var(--cm-font); font-size: 15px; font-weight: 600; cursor: pointer;
	transition: background-color .25s, transform .25s, box-shadow .25s;
}
.rp-cm-send:hover { background: #e23a3a; transform: translateY(-2px); box-shadow: 0 14px 28px -16px rgba(251, 72, 72, .8); }
.rp-cm-send:focus-visible { outline: 2px solid var(--cm-red); outline-offset: 3px; }
.rp-cm-send i { transition: transform .3s; }
.rp-cm-send:hover i { transform: translateX(calc(4px * var(--cm-dir, 1))); }

/* ---- comment list */
.rp-cm {
	display: flex; gap: 16px; margin: 0 0 14px; padding: 20px 22px; border: 1px solid var(--cm-line); border-radius: 18px;
	background: var(--cm-card); color: var(--cm-ink); font-family: var(--cm-font);
}
.rp-cm-avatar { flex: 0 0 48px; height: 48px; border-radius: 50%; background: var(--cm-field) center / cover no-repeat; border: 2px solid rgba(251, 72, 72, .25); }
.rp-cm-body { flex: 1 1 auto; min-width: 0; }
.rp-cm-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 6px; }
.rp-cm-name { font-weight: 700; font-size: 15px; color: var(--cm-ink); }
.rp-cm-date { font-size: 12.5px; color: var(--cm-muted); }
.rp-cm-text { font-size: 15px; font-weight: 400; line-height: 1.9; color: var(--cm-ink); overflow-wrap: break-word; }
.rp-cm-text p { margin: 0 0 .6em; }
.rp-cm-text .quote, .rp-cm-text blockquote { margin: 8px 0; padding: 10px 14px; border-inline-start: 3px solid var(--cm-red); border-radius: 10px; background: rgba(251, 72, 72, .06); font-size: 14px; }
.rp-cm-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.rp-cm-actions a, .rp-cm-act { color: inherit; text-decoration: none !important; }
.rp-cm-act, .rp-cm-actions > a {
	display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid var(--cm-line); border-radius: 999px;
	font-size: 12.5px; color: var(--cm-muted); cursor: pointer; transition: border-color .25s, color .25s, background-color .25s;
}
.rp-cm-act:hover, .rp-cm-actions a:hover .rp-cm-act { border-color: var(--cm-red); color: var(--cm-red); background: rgba(251, 72, 72, .06); }
.rp-cm-act.is-del:hover { border-color: #c0392b; color: #c0392b; }
.rp-cm-mass:empty { display: none; }
.rp-cm-mass { margin-inline-start: auto; }

/* CMS notices (e.g. "your comment awaits moderation") above the form */
#dle-ajax-comments:empty { display: none; }
#dle-ajax-comments .berrors, #dle-ajax-comments .info, .rp-bl-info .berrors {
	margin: 16px 0; padding: 14px 18px; border: 1px solid var(--cm-line); border-radius: 14px; background: var(--cm-card); color: var(--cm-ink);
}

@media (max-width: 767px) {
	.rp-cm-row { grid-template-columns: minmax(0, 1fr); }
	.rp-cm-foot { align-items: stretch; flex-direction: column; }
	.rp-cm-captcha .rp-cm-field { flex: 1 1 auto; width: auto; }
	.rp-cm-send { justify-content: center; margin-inline-start: 0; }
	.rp-cm { padding: 16px; gap: 12px; }
	.rp-cm-avatar { flex-basis: 40px; height: 40px; }
}
@media (prefers-reduced-motion: reduce) { .rp-cm-send, .rp-cm-send i, .rp-cm-input { transition: none; } }

/* ---- Persian: right-to-left, IranSans weights */
#dle-comments-form, .rp-cm { direction: rtl; text-align: right; }
.rp-cm-title, .rp-cm-name { font-family: 'IranSansBold', 'IranSans', sans-serif; font-weight: 400; }
.rp-cm-field > span, .rp-cm-field > label, .rp-cm-send { font-family: 'IranSansMedium', 'IranSans', sans-serif; font-weight: 400; }
.rp-cm-text .quote, .rp-cm-text blockquote { border-radius: 10px; }
