/* ==========================================================
   Gil Comment Box - frontend.css
   همه رنگ‌ها و اندازه‌ها از متغیرهای --gcb-* می‌آیند که از
   «صفحه تنظیمات افزونه» ساخته می‌شوند؛ نیازی به ویرایش این فایل نیست.
   ========================================================== */

/* --- کادر اصلی --- */
.gcb {
	font-family: var(--gcb-font-family, inherit);
	font-size: var(--gcb-font-size, 14px);
	line-height: 1.7;
	color: var(--gcb-box-text);
	background: var(--gcb-box-bg);
	border-radius: var(--gcb-box-radius);
	box-shadow: var(--gcb-box-shadow);
	margin: var(--gcb-box-margin);
	overflow: hidden;
	text-align: start;
}
/* جهت: راست‌چین / چپ‌چین (با !important تا قالب سایت آن را بهم نزند) */
.gcb[dir="rtl"], .gcb[dir="rtl"] * { direction: rtl !important; }
.gcb[dir="ltr"], .gcb[dir="ltr"] * { direction: ltr !important; }
.gcb, .gcb[dir] * { text-align: start !important; }
.gcb .gcb-form__submit { text-align: center !important; }
.gcb *, .gcb *::before, .gcb *::after { box-sizing: border-box; }

/* --- هدر --- */
.gcb-head {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 18px 22px;
	border-bottom: 1px solid var(--gcb-head-border);
}
.gcb .gcb-head__title {
	margin: 0;
	padding: 0;
	font-family: inherit;
	font-size: var(--gcb-head-title-size);
	font-weight: 700;
	line-height: 1.5;
	color: var(--gcb-head-title);
}
.gcb-head__count { font-size: .9em; color: var(--gcb-head-count); }
.gcb-inner { padding: 22px; }

/* --- فرم: چیدمان --- */
.gcb-respond { margin: 0; }
.gcb-respond__bar { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.gcb-respond__bar #gcb-replying-to { font-size: .9em; color: var(--gcb-cm-replyto-name); }
.gcb-respond__bar a { color: var(--gcb-cancel-text); font-size: .9em; text-decoration: none; }

.gcb-form__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); /* اطلاعات کاربر یک‌سوم، متن نظر دوسوم */
	gap: 16px;
	align-items: stretch;
}
.gcb-form__fields { display: flex; flex-direction: column; gap: 14px; }
.gcb-form__grid--single { grid-template-columns: 1fr; }

/* --- فیلدهای نام / موبایل / ایمیل --- */
.gcb .gcb-field { position: relative; margin: 0; padding: 0; }
.gcb-field__icon {
	position: absolute;
	inset-inline-start: 14px;
	top: 50%;
	transform: translateY(-50%);
	width: 20px;
	height: 20px;
	color: var(--gcb-field-icon);
	pointer-events: none;
}
.gcb .gcb-field input {
	display: block;
	width: 100%;
	height: var(--gcb-field-height);
	margin: 0;
	padding-block: 0;
	padding-inline-start: 46px;
	padding-inline-end: 14px;
	background: var(--gcb-field-bg);
	border: 1px solid var(--gcb-field-border);
	border-radius: var(--gcb-field-radius);
	font-family: inherit;
	font-size: .95em;
	color: var(--gcb-field-text);
	outline: none;
	box-shadow: none;
	transition: border-color .2s, box-shadow .2s;
}
.gcb .gcb-field input::placeholder { color: var(--gcb-field-placeholder); opacity: 1; }
.gcb .gcb-field input:focus {
	border-color: var(--gcb-field-focus);
	box-shadow: 0 0 0 3px var(--gcb-field-ring);
}
/* موبایل: همیشه هم‌جهت با صفحه (راست‌چین در فارسی) */
.gcb[dir="rtl"] .gcb-field--phone input[type="tel"],
.gcb[dir="rtl"] .gcb-field--phone input[type="tel"]::placeholder { direction: rtl !important; text-align: right !important; }
.gcb[dir="ltr"] .gcb-field--phone input[type="tel"],
.gcb[dir="ltr"] .gcb-field--phone input[type="tel"]::placeholder { direction: ltr !important; text-align: left !important; }

/* فیلد پرنشده یا نادرست هنگام ارسال: قرمز */
.gcb .gcb-field input.gcb-invalid,
.gcb .gcb-form__box.gcb-invalid {
	border-color: var(--gcb-field-invalid) !important;
	box-shadow: 0 0 0 3px var(--gcb-field-invalid-ring) !important;
}

/* --- کادر متن نظر --- */
.gcb-form__box {
	display: flex;
	flex-direction: column;
	min-height: var(--gcb-area-min-height);
	padding: 14px;
	background: var(--gcb-area-bg);
	border: 1px solid var(--gcb-area-border);
	border-radius: var(--gcb-field-radius);
	transition: border-color .2s, box-shadow .2s;
}
.gcb-form__box:focus-within {
	border-color: var(--gcb-field-focus);
	box-shadow: 0 0 0 3px var(--gcb-field-ring);
}
.gcb .gcb-form__box textarea {
	flex: 1;
	display: block;
	width: 100%;
	min-height: 90px;
	margin: 0;
	padding: 4px;
	border: 0;
	outline: 0;
	box-shadow: none;
	resize: none;
	background: transparent;
	font-family: inherit;
	font-size: .95em;
	color: var(--gcb-area-text);
}
.gcb .gcb-form__box textarea::placeholder { color: var(--gcb-area-placeholder); opacity: 1; }

/* --- دکمه ارسال --- */
.gcb .gcb-form__submit {
	align-self: flex-end;
	margin: 10px 0 0;
	padding: 12px 24px;
	background: var(--gcb-btn-bg);
	color: var(--gcb-btn-text);
	border: 0;
	border-radius: var(--gcb-btn-radius);
	font-family: inherit;
	font-size: var(--gcb-btn-size);
	font-weight: 600;
	line-height: 1.4;
	cursor: pointer;
	box-shadow: none;
	transition: background .2s, color .2s;
}
.gcb .gcb-form__submit:hover,
.gcb .gcb-form__submit:focus {
	background: var(--gcb-btn-hover-bg);
	color: var(--gcb-btn-hover-text);
}

/* --- یادداشت و پیام‌ها --- */
.gcb .gcb-form__note { margin: 12px 0 0; font-size: .85em; color: var(--gcb-note-text); }
.gcb-notice {
	margin-bottom: 16px;
	padding: 12px 16px;
	background: var(--gcb-notice-bg);
	border: 1px solid var(--gcb-notice-border);
	border-radius: 10px;
	color: var(--gcb-notice-text);
}
.gcb .gcb-closed { margin: 16px 0 0; color: var(--gcb-note-text); }
.gcb .gcb-closed a { color: var(--gcb-nav-link); }

/* --- لیست نظرات --- */
.gcb ol.gcb-list,
.gcb ol.gcb-list ol,
.gcb .children {
	list-style: none;
	margin: 0;
	padding: 0;
}
.gcb ol.gcb-list { margin-top: 26px; }
.gcb ol.gcb-list:first-child { margin-top: 0; }

/* باکس هر نظر؛ پاسخ‌ها داخل همین باکس قرار می‌گیرند */
.gcb li.gcb-comment {
	list-style: none;
	margin: var(--gcb-thread-gap) 0 0;
	padding: var(--gcb-cm-padding) !important;
	background: var(--gcb-cm-bg);
	border: 1px solid var(--gcb-cm-border);
	border-radius: var(--gcb-cm-radius);
}
.gcb li.gcb-comment::before,
.gcb li.gcb-comment::after { display: none; }
.gcb li.gcb-comment--reply { background: var(--gcb-reply-bg); }

.gcb-comment__card { display: flex; gap: 14px; }
.gcb-comment__avatar img { display: block; border-radius: var(--gcb-cm-avatar-radius); }
.gcb-comment__body { flex: 1; min-width: 0; }
.gcb-comment__meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.gcb .gcb-comment__author { font-size: 1.05em; color: var(--gcb-cm-name); }
.gcb-comment__date { font-size: .85em; color: var(--gcb-cm-date); }
.gcb-comment__replyto { margin-top: 2px; font-size: .85em; color: var(--gcb-cm-replyto); }
.gcb-comment__replyto b { color: var(--gcb-cm-replyto-name); font-weight: 600; }
.gcb .gcb-comment__pending { margin: 6px 0 0; font-size: .85em; color: var(--gcb-cm-pending); }
.gcb-comment__text { color: var(--gcb-cm-text); }
.gcb .gcb-comment__text p { margin: 6px 0 0; line-height: 1.9; color: inherit; }

/* --- دکمه پاسخ --- */
.gcb-comment__actions { margin-top: 8px; }
.gcb .gcb-reply-link {
	display: inline-block;
	padding: 4px 14px;
	border: 1px solid var(--gcb-reply-border);
	border-radius: 20px;
	color: var(--gcb-reply-text);
	font-size: .85em;
	text-decoration: none;
	cursor: pointer;
	transition: background .2s, color .2s;
}
.gcb .gcb-reply-link:hover {
	background: var(--gcb-reply-hover-bg);
	color: var(--gcb-reply-hover-text);
}

/* --- پاسخ مدیر --- */
.gcb li.gcb-comment--admin {
	background: var(--gcb-admin-bg);
	border-color: var(--gcb-admin-border);
	border-inline-start: var(--gcb-admin-stripe-width) solid var(--gcb-admin-stripe);
}
.gcb li.gcb-comment--admin > .gcb-comment__card .gcb-comment__author { color: var(--gcb-admin-name); }
.gcb li.gcb-comment--admin > .gcb-comment__card .gcb-comment__text { color: var(--gcb-admin-text); }
.gcb-badge {
	display: inline-block;
	padding: 2px 10px;
	background: var(--gcb-admin-badge-bg);
	color: var(--gcb-admin-badge-text);
	border-radius: var(--gcb-admin-badge-radius);
	font-size: .8em;
	font-weight: 600;
	line-height: 1.7;
}

/* --- پاسخ‌های تو در تو (بدون خط عمودی، فقط تورفتگی) --- */
.gcb .children {
	margin-top: 4px;
	margin-inline-start: var(--gcb-thread-indent);
}
/* فرم پاسخ وقتی داخل باکس نظر می‌آید */
.gcb li.gcb-comment .gcb-respond { margin-top: 14px; }

/* --- صفحه‌بندی --- */
.gcb-nav { margin-top: 16px; display: flex; justify-content: space-between; font-size: .95em; }
.gcb-nav a { color: var(--gcb-nav-link); text-decoration: none; }

/* --- موبایل --- */
@media (max-width: 767px) {
	.gcb-form__grid { grid-template-columns: 1fr; }
	.gcb-inner { padding: 16px; }
	.gcb .children { margin-inline-start: var(--gcb-thread-indent-mobile); }
	.gcb li.gcb-comment { padding: 12px 12px 14px !important; }
	.gcb-comment__card { gap: 10px; }
}
