/* ==========================================================================
   Public comments on a chapter.
   Loaded only by the public manifesto reader. The thread lives inside its
   chapter section, so it inherits the reading measure and hides and shows with
   the chapter it belongs to.
   ========================================================================== */

/* The side panel. It only becomes a drawer once the script has parked the
   threads; without JavaScript it is never opened and comments stay inside their
   chapter, exactly as they were. */
.mp-comments-panel {
    display: none;
}

.mp-comments-panel.is-open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 70;
    width: min(440px, 94vw);
    background: #fff;
    border-left: 1px solid rgba(11, 22, 19, 0.12);
    box-shadow: -1.25rem 0 3rem rgba(11, 22, 19, 0.12);
}

.mp-comments-panel-head {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1.15rem;
    border-bottom: 1px solid rgba(11, 22, 19, 0.1);
}

.mp-comments-panel-title {
    margin: 0;
    color: #10231c;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.mp-comments-close {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 999px;
    background: none;
    color: #64756d;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
}

.mp-comments-close:hover {
    background: #f1f5f3;
    color: #10231c;
}

.mp-comments-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.15rem;
}

/* Inside the drawer the thread is the whole panel, so it drops its own rule. */
.mp-comments-panel-body .mp-comments {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.mp-comments-scrim {
    position: fixed;
    inset: 0;
    z-index: 65;
    background: rgba(11, 22, 19, 0.35);
}

.mp-comments-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.mp-comments-toggle.is-quiet {
    background: #f4f7f5;
}

/* ---------- reading ---------- */
.mp-comments-status {
    margin: 0 0 0.85rem;
    color: #64756d;
    font-size: 0.85rem;
    font-weight: 700;
}

.mp-comments-status:empty {
    display: none;
}

.mp-comments-status.is-ok {
    color: #15803d;
}

.mp-comments-status.is-error {
    color: #b91c1c;
}

.mp-comments-compose-open {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-bottom: 1.1rem;
    padding: 0.55rem 1rem;
    border: 1px dashed rgba(11, 22, 19, 0.22);
    border-radius: 0.7rem;
    background: #fff;
    color: #0f766e;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 800;
    cursor: pointer;
}

.mp-comments-compose-open:hover {
    border-color: #0f766e;
    background: #f4f7f5;
}

/* ---------- writing ---------- */
.mp-comments-write .mp-comment-form {
    margin-top: 0;
}

.mp-comments-write-back {
    margin-bottom: 0.9rem;
    padding: 0;
    border: 0;
    background: none;
    color: #64756d;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 800;
    cursor: pointer;
}

.mp-comments-write-back:hover {
    color: #0f766e;
    text-decoration: underline;
}

.mp-comments-toggle {
    padding: 0.45rem 0.95rem;
    border: 1px solid rgba(11, 22, 19, 0.14);
    border-radius: 999px;
    background: #fff;
    color: #10231c;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
}

.mp-comments-toggle:hover {
    border-color: rgba(15, 118, 110, 0.4);
    color: #0f766e;
}

.mp-comments-toggle[aria-expanded="true"] {
    border-color: #10231c;
    background: #10231c;
    color: #fff;
}

.mp-comments {
    margin-top: 2.5rem;
    padding-top: 1.75rem;
    border-top: 1px solid rgba(11, 22, 19, 0.12);
}

.mp-comments-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.1rem;
}

.mp-comments-title {
    margin: 0;
    color: #0b1613;
    font-size: 1.08rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.mp-comments-count {
    flex: none;
    color: #64756d;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.mp-comment-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.85rem;
}

.mp-comment {
    display: flex;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(11, 22, 19, 0.1);
    border-radius: 0.85rem;
    background: #fff;
}

.mp-comment-avatar {
    flex: none;
    display: grid;
    place-items: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 999px;
    background: #10231c;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 800;
}

.mp-comment-main {
    min-width: 0;
}

.mp-comment-meta {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 0 0 0.35rem;
}

.mp-comment-author {
    color: #0b1613;
    font-size: 0.92rem;
    font-weight: 800;
}

.mp-comment-time {
    color: #64756d;
    font-size: 0.76rem;
}

.mp-comment-body {
    margin: 0;
    color: #2f3a35;
    font-size: 0.98rem;
    line-height: 1.65;
    overflow-wrap: break-word;
}

.mp-comment-report {
    margin-top: 0.5rem;
    padding: 0;
    border: 0;
    background: none;
    color: #94a3b8;
    font: inherit;
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
}

.mp-comment-report:hover:not(:disabled) {
    color: #b91c1c;
    text-decoration: underline;
}

.mp-comment-report:disabled {
    cursor: default;
    opacity: 0.6;
}

.mp-comment-report-wrap {
    margin-top: 0.5rem;
}

/* Report and Reply share one row under the comment. */
.mp-comment-actions-row {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.mp-comment-actions-row .mp-comment-report-wrap {
    margin-top: 0;
}

.mp-comment-reply {
    padding: 0;
    border: 0;
    background: none;
    color: #94a3b8;
    font: inherit;
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
}

.mp-comment-reply:hover {
    color: #0f766e;
    text-decoration: underline;
}

/* Replies hang off their comment, one level only. */
.mp-comment-replies {
    list-style: none;
    margin: 0.85rem 0 0;
    padding-left: 1rem;
    border-left: 2px solid rgba(11, 22, 19, 0.08);
    display: grid;
    gap: 0.6rem;
}

.mp-comment.is-reply {
    padding: 0.7rem 0.85rem;
    background: #fbfcfb;
}

.mp-comment.is-reply .mp-comment-avatar {
    width: 1.75rem;
    height: 1.75rem;
    font-size: 0.75rem;
}

.mp-comment-form.is-reply {
    margin-top: 0.85rem;
    padding: 0.9rem;
    background: #fff;
}

.mp-comment-reasons {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.mp-comment-reasons-label {
    color: #94a3b8;
    font-size: 0.74rem;
    font-weight: 700;
}

.mp-comment-reason {
    padding: 0.25rem 0.6rem;
    border: 1px solid rgba(11, 22, 19, 0.14);
    border-radius: 999px;
    background: #fff;
    color: #475569;
    font: inherit;
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
}

.mp-comment-reason:hover:not(:disabled) {
    border-color: rgba(185, 28, 28, 0.4);
    color: #b91c1c;
}

.mp-comments-empty,
.mp-comments-note {
    margin: 0 0 1.25rem;
    color: #64756d;
    font-size: 0.9rem;
    line-height: 1.6;
}

.mp-comments-more-wrap {
    margin: 1rem 0 0;
}

.mp-comments-more {
    padding: 0.45rem 0.9rem;
    border: 1px solid rgba(11, 22, 19, 0.14);
    border-radius: 999px;
    background: #fff;
    color: #10231c;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
}

.mp-comments-more:hover {
    border-color: rgba(15, 118, 110, 0.4);
    color: #0f766e;
}

/* ---------- the form ---------- */
.mp-comment-form {
    margin-top: 1.75rem;
    padding: 1.15rem;
    border: 1px solid rgba(11, 22, 19, 0.1);
    border-radius: 0.85rem;
    background: #f4f7f5;
}

.mp-comment-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.mp-comment-form label {
    display: grid;
    gap: 0.3rem;
}

.mp-comment-form label > span {
    color: #64756d;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.mp-comment-form label > span em {
    font-style: normal;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: #94a3b8;
}

.mp-comment-form input[type="text"],
.mp-comment-form input[type="email"],
.mp-comment-form textarea {
    width: 100%;
    padding: 0.6rem 0.7rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.6rem;
    background: #fff;
    color: #0b1613;
    font: inherit;
    font-size: 0.95rem;
}

.mp-comment-form textarea {
    line-height: 1.6;
    resize: vertical;
}

.mp-comment-form input:focus,
.mp-comment-form textarea:focus {
    outline: none;
    border-color: #0f766e;
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.1);
}

.mp-comment-body-field {
    margin-top: 0.75rem;
}

/* Off-screen rather than hidden: a bot reading the DOM still fills it in. */
.mp-comment-honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.mp-comment-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.mp-comment-status {
    font-size: 0.85rem;
    font-weight: 700;
    color: #64756d;
}

.mp-comment-status.is-ok {
    color: #15803d;
}

.mp-comment-status.is-error {
    color: #b91c1c;
}

.mp-comment-terms {
    margin: 0.85rem 0 0;
    color: #829089;
    font-size: 0.76rem;
    line-height: 1.55;
}

@media (max-width: 640px) {
    .mp-comment {
        padding: 0.8rem;
    }

    .mp-comment-actions .button {
        width: 100%;
    }
}
