/* ============================================================
   التعليقات - بسيطة بأسلوب إنستغرام: اسم الحساب وتحته التعليق، بلا صور، والردود مطويّة.
   ============================================================
   نفس لغة الموقع: عنوان بمعيّن وخط يتلاشى، وفاصل بمعيّن بين التعليقات (كفواصل الودجات وVianLayout).
   الألوان كلها رموز --vian-* من style.css. روابط هذا الملف تعيد ضبط لونها في الوضع الليلي بـ
   :not(:hover) لأن القاعدة العامة html.dark-skin a:not(:hover) في style.css أعلى أولوية من
   المحدد البسيط. الردود مطويّة بعنصر <details> الأصلي: يعمل بلا جافاسكربت.
   ============================================================ */

.vian-comments {
    margin-top: 30px;
}

/* ------------------------------------------------------------
   العناوين: التعليقات (N) وعنوان النموذج
   ------------------------------------------------------------ */
.vian-comments-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 22px;
    padding: 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    text-align: start;
    color: var(--vian-ink);
}

.vian-comments-heading::before {
    content: "";
    flex: none;
    width: 9px;
    height: 9px;
    background: var(--vian-accent);
    transform: rotate(45deg);
}

.vian-comments-heading::after {
    content: "";
    flex: 1 1 auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--vian-accent));
}

/* الشارة قبل الخط (الترتيب في الـ DOM: النص ثم العدد؛ ::after آخرها) */
.vian-comments-count {
    min-width: 24px;
    padding: 1px 8px;
    border-radius: 10px;
    background: var(--vian-sunken);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.6;
    text-align: center;
    color: var(--vian-muted);
}

/* عنوان النموذج أصغر (يتحوّل إلى "الرد على فلان" عند الرد) */
.vian-comments-heading--form {
    margin: 30px 0 14px;
    font-size: 16px;
}

.vian-comments-empty,
.vian-comments-closed {
    margin: 0 0 8px;
    padding: 28px 20px;
    border: 1px dashed var(--vian-line);
    border-radius: 3px;
    text-align: center;
    color: var(--vian-muted);
}

/* ------------------------------------------------------------
   القائمة
   ------------------------------------------------------------ */
.vian-comment-list,
.vian-replies__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.vian-comment {
    position: relative;
    margin: 0;
    padding: 0;
}

/* فاصل بمعيّن بين التعليقات الأعلى (نفس فاصل ودجات فيان) */
.vian-comment-list > .vian-comment + .vian-comment {
    margin-block-start: 18px;
    padding-block-start: 18px;
}

.vian-comment-list > .vian-comment + .vian-comment::before {
    content: "";
    position: absolute;
    inset-block-start: 0;
    inset-inline: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--vian-line) 18%, var(--vian-line) 82%, transparent);
}

.vian-comment-list > .vian-comment + .vian-comment::after {
    content: "";
    position: absolute;
    inset-block-start: -3px;
    left: 50%;
    width: 7px;
    height: 7px;
    background: var(--vian-card);
    border: 1px solid var(--vian-accent);
    transform: translateX(-50%) rotate(45deg);
}

/* ------------------------------------------------------------
   التعليق: الاسم والوقت، ثم النص، ثم "رد"
   ------------------------------------------------------------ */
.vian-comment__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 10px;
}

.vian-comment__author {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--vian-ink);
}

.vian-comment__badge {
    padding: 0 8px;
    border: 1px solid var(--vian-accent);
    border-radius: 3px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.7;
    color: var(--vian-ink-soft);
}

.vian-comment__time {
    font-size: 13px;
    text-decoration: none;
}

html .vian-comment__time,
html.dark-skin .vian-comment__time:not(:hover) {
    color: var(--vian-muted);
}

html .vian-comment__time:hover,
html.dark-skin .vian-comment__time:hover {
    color: var(--vian-link-hover);
}

.vian-comment__text {
    margin-top: 4px;
    font-size: 15px;
    line-height: 1.75;
    color: var(--vian-ink);
    overflow-wrap: anywhere;
}

.vian-comment__text p {
    margin: 0 0 8px;
}

.vian-comment__text > :last-child {
    margin-bottom: 0;
}

/* روابط داخل نص التعليق: بلون الروابط وبخط تحتها ليُميَّز الرابط عن النص */
.vian-comment__text a:not(.vian-comment__mention) {
    text-decoration: underline;
    text-underline-offset: 3px;
}

html .vian-comment__text a:not(.vian-comment__mention),
html.dark-skin .vian-comment__text a:not(.vian-comment__mention):not(:hover) {
    color: var(--vian-link);
}

html .vian-comment__text a:not(.vian-comment__mention):hover,
html.dark-skin .vian-comment__text a:not(.vian-comment__mention):hover {
    color: var(--vian-link-hover);
}

/* التعليق المردود عليه (بعد تسطيح الردود الأعمق) */
.vian-comment__mention {
    font-weight: 700;
    text-decoration: none;
}

html .vian-comment__mention,
html.dark-skin .vian-comment__mention:not(:hover) {
    color: var(--vian-link);
}

html .vian-comment__mention:hover,
html.dark-skin .vian-comment__mention:hover {
    color: var(--vian-link-hover);
}

.vian-comment__pending {
    margin: 6px 0 0;
    padding: 6px 12px;
    border-inline-start: 3px solid var(--vian-warn);
    background: color-mix(in srgb, var(--vian-warn) 14%, transparent);
    font-size: 13px;
    color: var(--vian-ink);
}

.vian-comment__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 16px;
    margin-top: 6px;
    font-size: 13px;
    font-weight: 700;
}

.vian-comment__actions a {
    text-decoration: none;
}

html .vian-comment__actions a,
html.dark-skin .vian-comment__actions a:not(:hover) {
    color: var(--vian-muted);
}

html .vian-comment__actions a:hover,
html.dark-skin .vian-comment__actions a:hover {
    color: var(--vian-link-hover);
}

/* ------------------------------------------------------------
   الردود: مطويّة خلف "عرض الردود (N)"
   ------------------------------------------------------------ */
.vian-replies {
    margin-top: 10px;
}

.vian-replies__toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    font-size: 13px;
    font-weight: 700;
    color: var(--vian-muted);
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.vian-replies__toggle::-webkit-details-marker {
    display: none;
}

/* خط قصير قبل النص كإنستغرام */
.vian-replies__toggle::before {
    content: "";
    width: 24px;
    height: 1px;
    background: var(--vian-line);
}

.vian-replies__toggle:hover {
    color: var(--vian-link-hover);
}

.vian-replies__toggle:focus-visible {
    outline: 2px solid var(--vian-accent);
    outline-offset: 3px;
}

.vian-replies:not([open]) .vian-replies__hide,
.vian-replies[open] .vian-replies__show {
    display: none;
}

.vian-replies__list {
    margin-top: 12px;
    padding-inline-start: 16px;
    border-inline-start: 2px solid var(--vian-line);
}

.vian-comment--reply + .vian-comment--reply {
    margin-top: 14px;
}

.vian-comment--reply .vian-comment__text {
    font-size: 14.5px;
}

/* ------------------------------------------------------------
   نموذج التعليق
   ------------------------------------------------------------ */
.vian-comment-form {
    margin: 0;
}

.vian-comment-form p {
    margin: 0 0 12px;
}

.vian-comment-form textarea,
.vian-comment-form input[type="text"],
.vian-comment-form input[type="email"] {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.6;
    color: var(--vian-ink);
    background: var(--vian-field);
    border: 1px solid var(--vian-line);
    border-radius: 3px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.vian-comment-form textarea {
    min-height: 88px;
    resize: vertical;
}

.vian-comment-form textarea:focus,
.vian-comment-form input[type="text"]:focus,
.vian-comment-form input[type="email"]:focus {
    outline: none;
    border-color: var(--vian-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--vian-accent) 18%, transparent);
}

.vian-comment-form label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--vian-ink);
}

.vian-comment-form .comment-form-cookies-consent {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--vian-muted);
}

.vian-comment-form .comment-form-cookies-consent label {
    margin: 0;
    font-weight: 400;
    color: var(--vian-muted);
}

.vian-comment-form .form-submit {
    margin-bottom: 0;
}

.vian-comment-submit {
    padding: 10px 30px;
    border: 0;
    border-radius: 3px;
    background: var(--vian-btn-bg);
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    color: var(--vian-btn-text);
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.vian-comment-submit:hover {
    opacity: 0.88;
}

html .vian-comment-submit,
html .vian-comment-submit:hover,
html.dark-skin .vian-comment-submit:not(:hover),
html.dark-skin .vian-comment-submit:hover {
    background: var(--vian-btn-bg);
    color: var(--vian-btn-text);
}

.vian-comment-submit:focus-visible {
    outline: 2px solid var(--vian-accent);
    outline-offset: 2px;
}

#cancel-comment-reply-link {
    font-size: 13px;
    font-weight: 400;
    text-decoration: underline;
}

html #cancel-comment-reply-link,
html.dark-skin #cancel-comment-reply-link:not(:hover) {
    color: var(--vian-muted);
}

html #cancel-comment-reply-link:hover,
html.dark-skin #cancel-comment-reply-link:hover {
    color: var(--vian-link-hover);
}

/* زائر يجب أن يسجّل دخوله ليعلّق */
.vian-comments-login {
    margin: 0;
    padding: 22px 20px;
    border: 1px dashed var(--vian-line);
    border-radius: 3px;
    text-align: center;
    color: var(--vian-muted);
}

.vian-comments-login a {
    text-decoration: underline;
    text-underline-offset: 3px;
}

html .vian-comments-login a,
html.dark-skin .vian-comments-login a:not(:hover) {
    color: var(--vian-link);
}

html .vian-comments-login a:hover,
html.dark-skin .vian-comments-login a:hover {
    color: var(--vian-link-hover);
}

/* ترقيم التعليقات (إن فُعِّل في إعدادات ووردبريس) */
.vian-comments .comment-navigation {
    margin-top: 18px;
    font-size: 13px;
}

.vian-comments .comment-navigation .nav-links {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}
