/* ── Comments widget — matches site design language ─────────── */

.comments {
    margin-top: 96px;
    padding-top: 32px;
    border-top: 1px solid var(--rule-strong);
}

.comments-lbl {
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: 14px;
    color: var(--fg-mute);
    letter-spacing: .06em;
    text-transform: uppercase;
    margin-bottom: 28px;
}

/* ── Comment list ────────────────────────────────────────── */

.comment {
    padding: 20px 0;
    border-bottom: 1px solid var(--rule);
}

.comment:first-of-type {
    border-top: 1px solid var(--rule);
}

.comment--has-replies {
    border-bottom: none;
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: 13px;
    color: var(--fg-mute);
    margin-bottom: 8px;
    letter-spacing: .04em;
}

.comment-meta strong {
    color: var(--fg-dim);
    font-weight: 500;
}

.comment-meta time {
    color: var(--fg-mute);
}

.comment-meta em {
    color: var(--warn);
    font-style: normal;
}

.comment-body {
    margin: 0;
    font-size: 16px;
    line-height: 1.65;
    color: var(--fg-dim);
}

.mention {
    color: var(--accent);
    font-weight: 500;
}

.comment-actions {
    margin-top: 8px;
    display: flex;
    gap: 14px;
}

.comment-actions button, .btn-reply {
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: 11px;
    border-radius: 5px;
    cursor: pointer;
    padding: 4px 10px;
    letter-spacing: .04em;
    border: 1px solid transparent;
    transition: background .15s, color .15s, border-color .15s;
}

.btn-reply {
    background: color-mix(in oklab, var(--accent) 12%, var(--bg-2));
    border-color: color-mix(in oklab, var(--accent) 35%, transparent);
    color: var(--accent);
}
.btn-reply:hover {
    background: color-mix(in oklab, var(--accent) 22%, var(--bg-2));
}

.btn-edit {
    background: color-mix(in oklab, #818cf8 12%, var(--bg-2));
    border-color: color-mix(in oklab, #818cf8 35%, transparent);
    color: #818cf8;
}
.btn-edit:hover {
    background: color-mix(in oklab, #818cf8 22%, var(--bg-2));
}

.btn-cancel-edit, .btn-cancel-reply {
    background: var(--bg-2);
    border-color: var(--rule-strong);
    color: var(--fg-mute);
}
.btn-cancel-edit:hover, .btn-cancel-reply:hover {
    border-color: var(--fg-mute);
    color: var(--fg-dim);
}

.btn-delete-own {
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: 11px;
    background: color-mix(in oklab, #c0392b 12%, var(--bg-2));
    border: 1px solid color-mix(in oklab, #c0392b 35%, transparent);
    border-radius: 5px;
    cursor: pointer;
    color: #f08080;
    padding: 4px 10px;
    letter-spacing: .04em;
    transition: background .15s, color .15s;
}

.btn-delete-own:hover {
    background: color-mix(in oklab, #c0392b 25%, var(--bg-2));
    color: #ffaaaa;
}

/* ── Replies ─────────────────────────────────────────────── */

.comment-replies {
    margin-top: 4px;
    margin-left: 20px;
    border-left: 2px solid var(--rule-strong);
    padding-left: 20px;
}

.comment--reply {
    padding: 14px 0;
}

.comment--reply .comment-meta {
    font-size: 12px;
}

.comment--reply .comment-body {
    font-size: 15px;
}

/* ── Reply form ──────────────────────────────────────────── */

.reply-form {
    margin-top: 12px;
}

.reply-form .edit-btns {
    margin-top: 8px;
    display: flex;
    gap: 8px;
}

.btn-submit-reply {
    background: var(--accent);
    color: var(--accent-ink);
    border: 1px solid var(--accent);
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: 12px;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity .15s;
}

.btn-submit-reply:hover { opacity: .85; }

.btn-cancel-reply {
    background: transparent;
    color: var(--fg-dim);
    border: 1px solid var(--rule-strong);
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: 12px;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: all .15s;
}

.btn-cancel-reply:hover {
    border-color: var(--fg-dim);
    color: var(--fg);
}

.reply-form textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-2);
    border: 1px solid var(--rule-strong);
    border-radius: 6px;
    color: var(--fg);
    font-family: inherit;
    font-size: 13px;
    line-height: 1.6;
    resize: vertical;
    box-sizing: border-box;
    transition: border-color .15s;
}

.reply-form textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.reply-form textarea::placeholder {
    color: var(--fg-mute);
}

/* ── Edit form ───────────────────────────────────────────── */

.comment-edit-form {
    margin-top: 10px;
}

.comment-edit-form textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-2);
    border: 1px solid var(--rule-strong);
    border-radius: 6px;
    color: var(--fg);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    box-sizing: border-box;
    transition: border-color .15s;
}

.comment-edit-form textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.comment-edit-form .edit-btns {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.comment-edit-form button {
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: 12px;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: all .15s;
}

.btn-save-edit {
    background: var(--accent);
    color: var(--accent-ink);
    border: 1px solid var(--accent);
}

.btn-save-edit:hover {
    opacity: .85;
}

.btn-cancel-edit {
    background: transparent;
    color: var(--fg-dim);
    border: 1px solid var(--rule-strong);
}

.btn-cancel-edit:hover {
    border-color: var(--fg-dim);
    color: var(--fg);
}

/* ── Auth section ────────────────────────────────────────── */

.auth-section {
    margin-top: 32px;
}

.auth-section--top {
    margin-top: 0;
    margin-bottom: 0;
}

.auth-label {
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: 12px;
    color: var(--fg-mute);
    letter-spacing: .06em;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.auth-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 4px;
}

.auth-field {
    display: flex;
    flex-direction: column;
}

.auth-section input.input-error {
    border-color: #f05252;
}

.field-error {
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: 11px;
    color: #f05252;
    margin: 4px 0 0;
    letter-spacing: .02em;
}

.auth-section input {
    width: 100%;
    padding: 9px 12px;
    background: var(--bg-2);
    border: 1px solid var(--rule-strong);
    border-radius: 6px;
    color: var(--fg);
    font-family: inherit;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color .15s;
}

.auth-section input::placeholder {
    color: var(--fg-mute);
}

.auth-section input:focus {
    outline: none;
    border-color: var(--accent);
}

.cf-turnstile,
#turnstile-mount {
    margin: 24px 0 12px;
}

.user-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: color-mix(in oklab, var(--accent) 7%, var(--bg-2));
    border: 1px solid color-mix(in oklab, var(--accent) 30%, transparent);
    border-left: 3px solid var(--accent);
    border-radius: 6px;
    font-size: 12px;
    font-family: "DM Mono", ui-monospace, monospace;
    letter-spacing: .03em;
    color: var(--fg-dim);
    margin-bottom: 24px;
}

.user-bar strong {
    color: var(--fg);
    font-weight: 500;
}

.user-bar .btn-signout {
    margin-left: auto;
    background: color-mix(in oklab, #c0392b 18%, var(--bg-2));
    color: #f08080;
    border: 1px solid color-mix(in oklab, #c0392b 40%, transparent);
    border-radius: 5px;
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .04em;
    padding: 5px 12px;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, color .15s;
}

.user-bar .btn-signout:hover {
    background: color-mix(in oklab, #c0392b 30%, var(--bg-2));
    color: #ffaaaa;
}

/* ── Comment form ────────────────────────────────────────── */

.comment-form {
    margin-top: 20px;
}

.comment-form textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-2);
    border: 1px solid var(--rule-strong);
    border-radius: 6px;
    color: var(--fg);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.65;
    resize: vertical;
    box-sizing: border-box;
    transition: border-color .15s;
}

.comment-form textarea::placeholder {
    color: var(--fg-mute);
}

.comment-form textarea:focus {
    outline: none;
    border-color: var(--accent);
}

/* ── Buttons ─────────────────────────────────────────────── */

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 8px 18px;
    background: var(--accent);
    color: var(--accent-ink);
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    border: 1px solid var(--accent);
    border-radius: 6px;
    cursor: pointer;
    transition: opacity .15s;
}

.btn-primary:hover {
    opacity: .85;
}

.btn-link {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--fg-mute);
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: 11px;
    letter-spacing: .04em;
    text-decoration: underline;
    padding: 0;
    transition: color .15s;
}

.btn-link:hover {
    color: var(--fg);
}

/* ── Admin badge ─────────────────────────────────────────── */

.badge-admin {
    display: inline-flex;
    align-items: center;
    padding: 1px 7px;
    background: color-mix(in oklab, var(--accent) 15%, var(--bg-2));
    border: 1px solid color-mix(in oklab, var(--accent) 40%, transparent);
    color: var(--accent);
    border-radius: 999px;
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
}

/* ── Status messages ─────────────────────────────────────── */

.status-msg {
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: 12px;
    color: var(--fg-mute);
    margin-top: 8px;
    min-height: 1.4em;
    letter-spacing: .02em;
}
.status-msg.status-error { color: #f05252; }
.status-msg.status-success {
    display: block;
    color: var(--fg-dim);
    background: color-mix(in oklab, var(--accent) 9%, var(--bg-2));
    border: 1px solid color-mix(in oklab, var(--accent) 28%, transparent);
    border-left: 3px solid var(--accent);
    border-radius: 6px;
    padding: 10px 14px;
    margin-top: 12px;
    font-weight: 500;
    letter-spacing: .02em;
}

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 600px) {
    .auth-fields {
        grid-template-columns: 1fr;
    }

}
