/* MH Modern Comments - intentionally scoped to .mhmc */
.mhmc {
    --mhmc-bg: #1f272b;
    --mhmc-bg-2: #252f34;
    --mhmc-bg-3: #2c373c;
    --mhmc-border: rgba(255,255,255,.055);
    --mhmc-text: #b9c4ca;
    --mhmc-muted: #718087;
    --mhmc-heading: #e3e9ec;
    --mhmc-accent: #8d99ff;
    --mhmc-hover: rgba(255,255,255,.045);
    width: 100%;
    box-sizing: border-box;
    color: var(--mhmc-text);
    font-size: 15px;
    line-height: 1.5;
}

.mhmc * { box-sizing: border-box; }

.mhmc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.mhmc-title {
    color: var(--mhmc-heading);
    font-size: 16px;
    font-weight: 500;
}

.mhmc-count-number { margin-right: 4px; }

.mhmc-sort {
    display: inline-flex;
    padding: 4px;
    border-radius: 6px;
    background: var(--mhmc-bg-2);
}

.mhmc-sort-btn {
    border: 0;
    background: transparent;
    color: var(--mhmc-muted);
    padding: 7px 13px;
    border-radius: 5px;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    transition: .15s ease;
}

.mhmc-sort-btn:hover { color: var(--mhmc-heading); }
.mhmc-sort-btn.is-active {
    background: var(--mhmc-bg-3);
    color: var(--mhmc-heading);
}

.mhmc-form-wrap {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin-bottom: 30px;
}

.mhmc-form-avatar {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 50%;
    overflow: hidden;
    background: #6249a5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.mhmc-form-avatar img,
.mhmc-form-avatar .avatar {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mhmc-guest-avatar { font-weight: 600; }

.mhmc-comment-form {
    width: 100%;
}

.mhmc-comment-form textarea,
.mhmc-guest-fields input {
    width: 100%;
    border: 1px solid var(--mhmc-border);
    background: var(--mhmc-bg-2);
    color: var(--mhmc-text);
    border-radius: 5px;
    outline: none;
    font: inherit;
}

.mhmc-comment-form textarea {
    min-height: 70px;
    padding: 12px 14px;
    resize: vertical;
}

.mhmc-comment-form textarea::placeholder,
.mhmc-guest-fields input::placeholder {
    color: #56636a;
}

.mhmc-comment-form textarea:focus,
.mhmc-guest-fields input:focus {
    border-color: rgba(141,153,255,.45);
}

.mhmc-guest-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
}

.mhmc-guest-fields input { padding: 9px 11px; }

.mhmc-form-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 8px;
}

.mhmc-form-status {
    margin-right: auto;
    color: var(--mhmc-muted);
    font-size: 12px;
}

.mhmc-submit,
.mhmc-cancel-reply {
    border: 0;
    border-radius: 5px;
    padding: 8px 14px;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
}

.mhmc-submit {
    background: var(--mhmc-bg-3);
    color: var(--mhmc-heading);
}

.mhmc-submit:hover { filter: brightness(1.15); }
.mhmc-submit:disabled { opacity: .5; cursor: wait; }

.mhmc-cancel-reply {
    background: transparent;
    color: var(--mhmc-muted);
}

.mhmc-comment {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    position: relative;
    margin-bottom: 26px;
}

.mhmc-avatar-wrap {
    width: 38px;
    min-width: 38px;
}

.mhmc-avatar {
    display: block;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
}

.mhmc-comment-body {
    min-width: 0;
    flex: 1;
}

.mhmc-comment-head {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 9px;
    margin-bottom: 3px;
}

.mhmc-author {
    color: #dce3e6;
    font-weight: 600;
}

.mhmc-time {
    color: var(--mhmc-muted);
    font-size: 12px;
}

.mhmc-content {
    color: #aebac0;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.mhmc-content p { margin: 0 0 8px; }
.mhmc-content p:last-child { margin-bottom: 0; }

.mhmc-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    color: #718087;
}

.mhmc-vote,
.mhmc-reply-btn,
.mhmc-more-btn {
    border: 0;
    background: transparent;
    color: inherit;
    padding: 0;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
}

.mhmc-vote {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.mhmc-vote:hover,
.mhmc-reply-btn:hover,
.mhmc-more-btn:hover { color: #c5d0d5; }

.mhmc-vote.is-active { color: var(--mhmc-accent); }
.mhmc-vote:disabled { opacity: .55; cursor: wait; }

.mhmc-icon {
    display: inline-block;
    font-size: 16px;
    line-height: 1;
}

.mhmc-more-btn { position: relative; }

.mhmc-more-menu {
    display: none;
    position: absolute;
    z-index: 10;
    margin-top: 4px;
    background: var(--mhmc-bg-3);
    border: 1px solid var(--mhmc-border);
    border-radius: 6px;
    padding: 5px;
    box-shadow: 0 8px 25px rgba(0,0,0,.25);
}

.mhmc-more-menu.is-open { display: block; }

.mhmc-delete-btn {
    border: 0;
    background: transparent;
    color: #e28c8c;
    cursor: pointer;
    padding: 6px 10px;
    font: inherit;
    font-size: 12px;
}

.mhmc-replies-area {
    margin-top: 9px;
    margin-left: 0;
}

.mhmc-load-replies {
    border: 0;
    background: transparent;
    color: #7d8b92;
    padding: 0;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
}

.mhmc-load-replies:hover { color: #b8c4c9; }

.mhmc-replies {
    position: relative;
    margin-top: 14px;
    margin-left: 0;
    padding-left: 25px;
}

.mhmc-replies::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 15px;
    width: 1px;
    background: rgba(255,255,255,.065);
}

.mhmc-replies .mhmc-comment {
    margin-bottom: 20px;
}

.mhmc-replies .mhmc-avatar,
.mhmc-replies .mhmc-avatar-wrap {
    width: 32px;
    min-width: 32px;
    height: 32px;
}

.mhmc-inline-form {
    margin-top: 12px;
}

.mhmc-replying {
    margin-bottom: 7px;
    color: var(--mhmc-muted);
    font-size: 12px;
}

.mhmc-list-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 18px 0;
    color: var(--mhmc-muted);
    font-size: 12px;
}

.mhmc-spinner {
    display: inline-block;
    width: 13px;
    height: 13px;
    border: 2px solid rgba(255,255,255,.12);
    border-top-color: #8d99ff;
    border-radius: 50%;
    animation: mhmc-spin .7s linear infinite;
}

@keyframes mhmc-spin {
    to { transform: rotate(360deg); }
}

.mhmc-load-more {
    display: block;
    margin: 4px auto 0;
    border: 1px solid var(--mhmc-border);
    background: var(--mhmc-bg-2);
    color: #9da9ae;
    border-radius: 5px;
    padding: 8px 14px;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
}

.mhmc-load-more:hover {
    color: #d5dde0;
    background: var(--mhmc-bg-3);
}

@media (max-width: 600px) {
    .mhmc-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .mhmc-sort {
        width: 100%;
    }

    .mhmc-sort-btn {
        flex: 1;
    }

    .mhmc-guest-fields {
        grid-template-columns: 1fr;
    }

    .mhmc-comment {
        gap: 8px;
    }

    .mhmc-avatar-wrap,
    .mhmc-avatar {
        width: 32px;
        min-width: 32px;
        height: 32px;
    }

    .mhmc-replies {
        padding-left: 16px;
    }

    .mhmc-replies::before {
        left: 4px;
    }
}
