/* Comment Summary - frontend styles */

.mutyun-comment-summary {
    margin: 10px 0 0 0;
    padding: 12px 14px 12px 16px;
    background: #eef5ff;
    border-left: 4px solid #2271b1;
    border-radius: 3px;
    color: #222;
    line-height: 1.6;
    font-size: 0.95em;
}

.mutyun-comment-summary__label {
    font-weight: bold;
    font-size: 1.05em;
    margin-bottom: 6px;
    color: #135e96;
}

.mutyun-comment-summary__body {
    font-size: 1em;
    line-height: 1.7;
    word-break: break-word;
}

.mutyun-comment-summary__disclaimer {
    margin-top: 8px;
    font-size: 0.85em;
    color: #888;
    line-height: 1.5;
}

/* Ensure the summary stays a normal block, even inside AA mode */
body.comment-aa-mode .mutyun-comment-summary,
body.comment-aa-mode .mutyun-comment-summary__body,
body.comment-aa-mode .mutyun-comment-summary__disclaimer,
body.comment-aa-mode .mutyun-comment-summary__label {
    white-space: normal !important;
    overflow-x: visible !important;
    font-family: inherit !important;
    line-height: 1.6 !important;
    letter-spacing: normal !important;
}

/* Dark mode */
html.mutyun-dark-mode body .mutyun-comment-summary {
    background-color: color-mix(in srgb, var(--mutyun-dm-bg) 88%, #fff 12%) !important;
    color: var(--mutyun-dm-text) !important;
    border-left-color: var(--mutyun-dm-link, #4ea1ff) !important;
}
html.mutyun-dark-mode body .mutyun-comment-summary__label {
    color: var(--mutyun-dm-link, #4ea1ff) !important;
}
html.mutyun-dark-mode body .mutyun-comment-summary__body {
    color: var(--mutyun-dm-text) !important;
}
html.mutyun-dark-mode body .mutyun-comment-summary__disclaimer {
    color: rgba(255, 255, 255, 0.55) !important;
}

/* Mobile */
@media (max-width: 600px) {
    .mutyun-comment-summary {
        padding: 10px 12px;
        font-size: 0.92em;
    }
    .mutyun-comment-summary__label {
        font-size: 1em;
    }
}

/* ============================================================
 * Per-comment summary (item-level)
 * ============================================================ */

.mutyun-cs-item {
    margin: 4px 0;
}

.mutyun-cs-item__notice {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    padding: 4px 10px;
    margin: 0 0 6px 0;
    background: #eef5ff;
    border: 1px solid #c6d8f0;
    border-radius: 999px;
    color: #135e96;
    font-size: 0.85em;
    font-weight: 600;
    line-height: 1.3;
    cursor: pointer;
    text-align: left;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.mutyun-cs-item__notice:hover,
.mutyun-cs-item__notice:focus-visible {
    background: #dceaff;
    border-color: #2271b1;
    outline: none;
}

.mutyun-cs-item__notice-icon {
    font-size: 1em;
}

.mutyun-cs-item__notice-text {
    display: inline;
}

.mutyun-cs-item__notice[aria-expanded="true"] {
    background: #fff7e6;
    border-color: #f0c87a;
    color: #8a5a00;
}

.mutyun-cs-item__summary {
    padding: 6px 10px 6px 12px;
    margin: 0 0 2px 0;
    background: #f6f9fd;
    border-left: 3px solid #c6d8f0;
    border-radius: 2px;
    color: #3a4654;
    line-height: 1.6;
    word-break: break-word;
}

.mutyun-cs-item__original {
    padding: 4px 0;
    line-height: 1.6;
    word-break: break-word;
}

.mutyun-cs-item__original[hidden],
.mutyun-cs-item__summary[hidden] {
    display: none !important;
}

/* Admin "summarize" button. Styled inline next to edit/delete controls. */
.mutyun-cs-item-admin-btn {
    margin-left: 0.5em;
    color: #2271b1;
    text-decoration: none;
    font-size: 0.85em;
    cursor: pointer;
}

.mutyun-cs-item-admin-btn:hover,
.mutyun-cs-item-admin-btn:focus-visible {
    text-decoration: underline;
    color: #135e96;
}

.mutyun-cs-item-admin-btn--ok {
    color: #2e7d32;
}

.mutyun-cs-item-admin-btn--err {
    color: #b91c1c;
}

/* Dark mode */
html.mutyun-dark-mode body .mutyun-cs-item__notice {
    background-color: color-mix(in srgb, var(--mutyun-dm-bg) 80%, #fff 20%) !important;
    border-color: color-mix(in srgb, var(--mutyun-dm-bg) 60%, #fff 40%) !important;
    color: var(--mutyun-dm-link, #4ea1ff) !important;
}
html.mutyun-dark-mode body .mutyun-cs-item__notice:hover,
html.mutyun-dark-mode body .mutyun-cs-item__notice:focus-visible {
    background-color: color-mix(in srgb, var(--mutyun-dm-bg) 70%, #fff 30%) !important;
}
html.mutyun-dark-mode body .mutyun-cs-item__notice[aria-expanded="true"] {
    background-color: color-mix(in srgb, var(--mutyun-dm-bg) 80%, #ffb84d 20%) !important;
    border-color: #f0c87a !important;
    color: #ffd28a !important;
}
html.mutyun-dark-mode body .mutyun-cs-item__summary {
    background-color: color-mix(in srgb, var(--mutyun-dm-bg) 88%, #fff 12%) !important;
    border-left-color: var(--mutyun-dm-link, #4ea1ff) !important;
    color: var(--mutyun-dm-text) !important;
}
html.mutyun-dark-mode body .mutyun-cs-item-admin-btn {
    color: var(--mutyun-dm-link, #4ea1ff) !important;
}

/* AA mode: keep the summary block readable rather than monospace-walled */
body.comment-aa-mode .mutyun-cs-item,
body.comment-aa-mode .mutyun-cs-item__notice,
body.comment-aa-mode .mutyun-cs-item__summary {
    white-space: normal !important;
    overflow-x: visible !important;
    font-family: inherit !important;
    line-height: 1.6 !important;
    letter-spacing: normal !important;
}
/* Original retains AA-mode styling so the user sees the raw artwork */

/* Mobile */
@media (max-width: 600px) {
    .mutyun-cs-item__notice {
        font-size: 0.8em;
        padding: 3px 9px;
    }
}
