/* VARIABLES — MODE SOMBRE PAR DÉFAUT */

.es-comments {
    --comment-bg: #151b30;
    --comment-soft: #10172b;
    --comment-text: #f1f5f9;
    --comment-muted: #aab6cf;
    --comment-border: #35405c;
    --comment-link: #c4b5fd;
    --comment-error: #fca5a5;

    min-width: 0;
    color: var(--comment-text);
}

html[data-theme="light"] .es-comments {
    --comment-bg: #ffffff;
    --comment-soft: #f8fafc;
    --comment-text: #172033;
    --comment-muted: #475569;
    --comment-border: #dce1ec;
    --comment-link: #6d28d9;
    --comment-error: #b91c1c;
}

/* STRUCTURE */

.es-comments,
.es-comments *,
.es-comments *::before,
.es-comments *::after {
    box-sizing: border-box;
}

.es-comments-admin {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 24px;
}

.es-comments :is(h2, h3, strong) {
    color: var(--comment-text);
}

.es-comments :is(p, small) {
    color: var(--comment-muted);
}

.es-comments a {
    color: var(--comment-link);
}

/* CARTES ET FORMULAIRE */

.es-comments :is(
    .es-comment,
    .es-comment-form,
    .es-comment-notice
) {
    margin: 18px 0;
    padding: 22px;
    border: 1px solid var(--comment-border);
    border-radius: 16px;
    background: var(--comment-bg);
    overflow-wrap: anywhere;
}

.es-comments :is(
    .es-comment-heading,
    .es-comment-actions,
    .es-comment-pagination,
    .es-comment-filters
) {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.es-comments .es-comment-heading {
    justify-content: space-between;
}

.es-comments .es-comment-text {
    margin-top: 14px;
    color: var(--comment-text);
    line-height: 1.8;
    overflow-wrap: anywhere;
}

.es-comments .es-comment-rating {
    color: var(--comment-link);
    font-size: 0.85rem;
}

.es-comments .es-comment-actions {
    margin-top: 18px;
}

/* CHAMPS */

.es-comments label {
    display: block;
    margin-bottom: 8px;
    color: var(--comment-text);
    font-weight: 600;
}

.es-comments :is(textarea, select) {
    width: 100%;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--comment-border);
    border-radius: 10px;
    background: var(--comment-soft);
    color: var(--comment-text);
    font: inherit;
}

.es-comments textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
}

.es-comments textarea::placeholder {
    color: var(--comment-muted);
    opacity: 1;
}

.es-comments .errorlist {
    color: var(--comment-error);
}

/* BOUTONS ET FILTRES */

.es-comments button,
.es-comments .es-comment-filters a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: 10px;
    font: inherit;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.es-comments button {
    background: #6d28d9;
    color: #ffffff;
}

.es-comments button:hover {
    background: #5b21b6;
}

.es-comments .es-comment-filters a {
    border-color: var(--comment-border);
    background: var(--comment-soft);
    color: var(--comment-link);
}

.es-comments .es-comment-filters a:hover {
    border-color: var(--comment-link);
}

.es-comments .es-comment-filters a[aria-current="page"] {
    background: #6d28d9;
    color: #ffffff;
}

.es-comments .es-comment-reject {
    background: #b91c1c;
}

.es-comments .es-comment-reject:hover {
    background: #991b1b;
}

/* ACCESSIBILITÉ */

.es-comments :is(a, button, textarea, select):focus-visible {
    outline: 3px solid #a78bfa;
    outline-offset: 3px;
}

/* MOBILE */

@media (max-width: 600px) {
    .es-comments-admin {
        padding: 16px;
    }

    .es-comments :is(
        .es-comment,
        .es-comment-form,
        .es-comment-notice
    ) {
        padding: 18px;
    }

    .es-comments .es-comment-actions button {
        flex: 1 1 120px;
    }
}