/* Tarhestan — Course comments: the same design as the article comments (Tarhestan Funnel).
 * The color variables below are placeholders; replace them with the values from the article stylesheet
 * (the :root / .tfa block) so the two sections match exactly. */

.tfa.tfa-course{
	--tfa-ink:#1f1518;
	--tfa-text:#3a2f32;
	--tfa-muted:#7a6a6d;
	--tfa-line:#ecdfe0;
	--tfa-soft:#fbf6f6;
	--tfa-navy:#82151d;
	--tfa-navy-2:#82151d;
	--tfa-red-2:#bf1e2e;
	--tfa-accent:#bf1e2e;
	--tfa-ease:cubic-bezier(.3,.7,.2,1);
	direction:rtl;
}

/* ---------- Comments ---------- */
.tfa-comments{max-width:720px;margin:0 auto}
.tfc-head{display:flex;align-items:center;gap:.6rem;margin-bottom:1.1rem}
.tfa h2.tfc-title{margin:0;font-size:1.2rem;font-weight:900;color:var(--tfa-ink)}
.tfc-count{min-width:28px;padding:0 .5rem;border-radius:999px;background:var(--tfa-navy);color:#fff;font-size:.78rem;font-weight:800;line-height:24px;text-align:center}
.tfa .tfc-list,.tfa .tfc-list .children{list-style:none;margin:0;padding:0}
.tfa .tfc-list{display:grid;gap:.75rem}
.tfc-item{margin:0}
.tfc-c{display:flex;gap:.8rem;padding:1rem;border:1px solid var(--tfa-line);border-radius:16px;background:#fff}
.bypostauthor>.tfc-c{border-color:color-mix(in srgb,var(--tfa-accent) 45%,var(--tfa-line))}
.tfc-c__avatar img{display:block;width:44px;height:44px;border-radius:50%}
.tfc-c__body{flex:1;min-width:0}
.tfc-c__head{display:flex;align-items:center;flex-wrap:wrap;gap:.3rem .6rem}
.tfc-c__name{font-size:.92rem;color:var(--tfa-ink)}
.tfc-badge{padding:0 .5rem;border-radius:6px;background:color-mix(in srgb,var(--tfa-accent) 18%,#fff);color:#8a4b00;font-size:.7rem;font-weight:800;line-height:20px}
.tfc-c__time{margin-inline-start:auto;font-size:.75rem;color:var(--tfa-muted)}
.tfc-c__text{margin-top:.35rem;font-size:.92rem;line-height:1.95;color:var(--tfa-text);overflow-wrap:anywhere}
.tfc-c__text p{margin:0 0 .5em}
.tfc-c__text p:last-child{margin:0}
.tfa p.tfc-c__pending{margin:.35rem 0 0;padding:.2rem .6rem;border-radius:8px;background:color-mix(in srgb,var(--tfa-accent) 12%,#fff);color:#8a4b00;font-size:.78rem}
.tfc-c__actions{margin-top:.35rem}
.tfc-c__actions a{display:inline-flex;align-items:center;gap:.3rem;font-size:.8rem;font-weight:700;color:var(--tfa-navy-2);text-decoration:none}
.tfc-c__actions a::before{content:"↩";font-size:.9em}
.tfc-c__actions a:hover{color:var(--tfa-red-2)}
.tfa .tfc-list .children{display:grid;gap:.6rem;margin:.6rem 1.4rem 0 0;padding-right:1rem;border-right:2px solid var(--tfa-line)}
.tfc-list .children .tfc-c{background:var(--tfa-soft);border-color:transparent}
.tfc-item--hidden{display:none}
.tfc-item--in{animation:tfc-in .4s var(--tfa-ease) both}
@keyframes tfc-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
.tfa .tfc-more:not(#tfa-x){display:flex;align-items:center;justify-content:center;gap:.35rem;width:100%;min-height:44px;margin:.9rem 0 0;padding:0 1rem;border:0;border-radius:14px;background-color:var(--cs-btn-bg,rgba(130,21,29,.81));background-image:var(--cs-btn-grad,linear-gradient(to right,rgba(130,21,29,.81) 0%,rgb(191,30,46) 50%,rgba(130,21,29,.81) 100%));color:#fff;font:inherit;font-size:.88rem;font-weight:700;cursor:pointer;box-shadow:none;transition:filter .2s}
.tfa .tfc-more:not(#tfa-x):hover{filter:brightness(1.1);color:#fff}
/* Buttons of the comment form use the same gradient (the course page sets --cs-btn-* variables). */
.tfa-course .tfc-submit,
.tfa-course .tfa-btn--primary{background-color:var(--cs-btn-bg,rgba(130,21,29,.81));background-image:var(--cs-btn-grad,linear-gradient(to right,rgba(130,21,29,.81) 0%,rgb(191,30,46) 50%,rgba(130,21,29,.81) 100%));color:#fff;border:0;border-radius:12px;min-height:46px;padding:0 1.5rem;font-weight:800;cursor:pointer;transition:filter .2s}
.tfa-course .tfc-submit:hover,
.tfa-course .tfa-btn--primary:hover{filter:brightness(1.1)}
.tfa .tfc-more[hidden]{display:none}
.tfa :is(.tfc-empty,.tfc-closed){margin:0;padding:1rem;border-radius:14px;background:var(--tfa-soft);color:var(--tfa-muted);font-size:.9rem;text-align:center}

/* Comment form */
.tfc-respond{margin-top:1.5rem;padding:clamp(1rem,2.5vw,1.4rem);border-radius:18px;background:var(--tfa-soft)}
.tfc-list .tfc-respond{margin:.6rem 0 0;background:#fff;border:1px solid var(--tfa-line)}
.tfa h3.tfc-form__title{display:flex;justify-content:space-between;align-items:center;gap:.5rem;margin:0 0 .3rem;font-size:1.02rem;font-weight:900;color:var(--tfa-ink)}
.tfc-form__title small a{font-size:.8rem;font-weight:600;color:var(--tfa-red-2);text-decoration:none}
.tfa p.tfc-note,.tfa .tfc-form .logged-in-as{margin:0 0 .4rem;font-size:.8rem;color:var(--tfa-muted)}
.tfc-form .logged-in-as a{color:var(--tfa-navy-2)}
.tfc-form{display:grid;grid-template-columns:1fr 1fr;gap:.8rem}
.tfc-form>*{grid-column:1/-1;margin:0}
.tfc-form>.tfc-field:not(.tfc-field--text){grid-column:auto}
.tfc-field label{display:block;margin-bottom:.3rem;font-size:.82rem;font-weight:700;color:var(--tfa-ink)}
.tfc-req{color:var(--tfa-red-2)}
.tfa .tfc-field :is(input,textarea):not(#tfa-x){width:100%;min-height:46px;padding:.6rem .85rem;margin:0;border:1.5px solid var(--tfa-line);border-radius:12px;background:#fff;color:var(--tfa-text);font:inherit;font-size:.92rem;box-shadow:none;transition:border-color .2s,box-shadow .2s}
.tfa .tfc-field textarea:not(#tfa-x){min-height:110px;line-height:1.9;resize:vertical}
.tfa .tfc-field :is(input,textarea):not(#tfa-x):focus{outline:none;border-color:var(--tfa-navy-2);box-shadow:0 0 0 3px color-mix(in srgb,var(--tfa-navy-2) 14%,transparent)}
.tfc-cookies label{display:flex;align-items:flex-start;gap:.45rem;font-size:.8rem;line-height:1.8;color:var(--tfa-muted);cursor:pointer}
.tfa .tfc-cookies input:not(#tfa-x){flex:none;width:16px;height:16px;min-height:0;margin:.3rem 0 0;padding:0;appearance:auto;-webkit-appearance:checkbox;accent-color:var(--tfa-navy-2)}
.tfc-submit-row{display:flex;justify-content:flex-end}
@media (max-width:560px){
	.tfc-form{grid-template-columns:1fr}
	.tfc-c{padding:.85rem;gap:.65rem}
	.tfc-c__avatar img{width:36px;height:36px}
	.tfa .tfc-list .children{margin-right:.5rem;padding-right:.6rem}
	.tfc-submit-row .tfa-btn{width:100%}
}
@media (prefers-reduced-motion:reduce){
	.tfa *{transition-duration:.01ms!important;animation-duration:.01ms!important}
}
