/* =========================================================================
   AskSphere — Comments + Image lightbox
   ========================================================================= */

/* Comment area inside answer card */
.as-answer-card__comments {
    margin: 16px 0 0;
    padding: 16px 0 0;
    border-top: 1px solid #f1f5f9;
}
.as-comments-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 0 0 16px;
}
.as-comment {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 10px;
}
.as-comment__avatar-img {
    border-radius: 50%;
    display: block;
}
.as-comment__head {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 0 0 4px;
}
.as-comment__head strong {
    color: #0f172a;
    font-size: 13px;
    font-weight: 600;
}
.as-comment__head small {
    color: #94a3b8;
    font-size: 11px;
}
.as-comment__content {
    color: #1e293b;
    font-size: 13.5px;
    line-height: 1.65;
    overflow-wrap: anywhere;
}
.as-comment__content p { margin: 0 0 8px; }
.as-comment__content p:last-child { margin-bottom: 0; }
.as-comments-empty,
.as-comments-loading {
    color: #94a3b8;
    font-size: 13px;
    margin: 0 0 14px;
}

/* Comment form */
.as-comment-form {
    display: block;
    margin: 8px 0 0;
}
.as-comment-form__input-wrap {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
}
.as-comment-form__avatar {
    border-radius: 50%;
    display: block;
    margin-top: 4px;
}
.as-comment-form__textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font: inherit;
    font-size: 13.5px;
    line-height: 1.55;
    color: #0f172a;
    background: #f8fafc;
    resize: vertical;
    min-height: 44px;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.as-comment-form__textarea:focus {
    outline: none;
    border-color: #315cf5;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(49,92,245,.12);
}

.as-comment-form__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0 0 42px;
    flex-wrap: wrap;
}
.as-comment-form__thumbs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.as-comment-thumb {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}
.as-comment-thumb img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.as-comment-thumb__remove {
    position: absolute;
    top: 0; right: 0;
    width: 16px; height: 16px;
    padding: 0;
    border: 0;
    background: rgba(15,23,42,.8);
    color: #fff;
    font-size: 11px;
    line-height: 1;
    border-radius: 0 0 0 4px;
    cursor: pointer;
}
.as-comment-thumb__remove:hover { background: #dc2626; }

.as-comment-form__attach {
    padding: 6px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #475569;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background .12s ease, border-color .12s ease;
    font-family: inherit;
}
.as-comment-form__attach:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.as-comment-form__submit {
    padding: 6px 14px;
    min-height: 32px;
    font-size: 12px;
}

.as-comment-form__alert {
    margin: 10px 0 0 42px;
    padding: 8px 12px;
    border-radius: 7px;
    font-size: 12.5px;
    border: 1px solid transparent;
}
.as-comment-form__alert.is-error {
    background: #fff5f5;
    border-color: #ffd9dd;
    color: #8f1d2a;
}
.as-comment-form__alert.is-success {
    background: #eefaf1;
    border-color: #b6ebc5;
    color: #15794a;
}

/* Comment image thumbnails — smaller than answer images */
.as-image-grid--comment {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0 0;
}
.as-image-grid--comment .as-image-grid__item {
    width: 64px;
    height: 64px;
    border-radius: 6px;
    cursor: zoom-in;
}
.as-image-grid--comment .as-image-grid__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: auto;
}

/* Lightbox */
.as-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(15,23,42,.92);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
}
.as-lightbox.is-open {
    opacity: 1;
    pointer-events: auto;
}
.as-lightbox img {
    max-width: 92vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.as-lightbox__close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    color: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s ease;
}
.as-lightbox__close:hover { background: rgba(255,255,255,.24); }