/* ============================================================
   Habari — Commentaires frontend
   ============================================================ */

/* Section */
.habari-comments {
    margin-top: var(--habari-space-sm, 0.75rem);
    padding-top: var(--habari-space-lg, 2rem);
    border-top: 2px solid var(--habari-dark-200, #e5e7eb);
}

/* ============================================================
   En-tête : compteur + tri
   ============================================================ */

.habari-comments__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.habari-comments__title {
    font-family: var(--habari-font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: var(--habari-secondary-navy);
    margin: 0;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* Tri — boutons icône */
.habari-comments__sort {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.habari-comments__sort-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0.35rem 0.55rem;
    cursor: pointer;
    color: var(--habari-dark-400, #9ca3af);
    font-size: 0.8rem;
    font-family: inherit;
    transition: color 0.15s;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.habari-comments__sort-btn:hover {
    color: var(--habari-secondary-navy);
}

.habari-comments__sort-btn--active {
    color: var(--habari-primary-brand);
}

.habari-comments__sort-arrow {
    font-size: 0.65rem;
    vertical-align: middle;
}

/* Liste */
.habari-comments__list {
    display: flex;
    flex-direction: column;
}

.habari-comments__loader {
    display: flex;
    justify-content: center;
    padding: 2rem;
}

.habari-comments__load-more {
    text-align: center;
    margin-top: 1.5rem;
}

.habari-comments__btn-more {
    border: 2px solid var(--habari-secondary-navy) !important;
    color: var(--habari-secondary-navy) !important;
    background: transparent !important;
    border-radius: 0 !important;
    font-weight: 600;
    padding: 0.6rem 1.5rem;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, color 0.15s;
}

.habari-comments__btn-more:hover {
    background: var(--habari-secondary-navy) !important;
    color: #fff !important;
}

/* Connexion / ban */
.habari-comments__login-prompt,
.habari-comments__blocked {
    margin-top: 1rem;
    padding: 1rem;
    font-size: 0.9rem;
    border-left: 3px solid var(--habari-dark-200);
    background: var(--habari-dark-50, #f9fafb);
    color: var(--habari-dark-600);
}

.habari-comments__blocked {
    border-left-color: var(--habari-primary-brand);
    background: #fef2f2;
    color: var(--habari-primary-brand);
}

/* ============================================================
   Commentaire individuel
   ============================================================ */

.habari-comment {
    display: flex;
    gap: 0.875rem;
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--habari-dark-100, #f3f4f6);
}

.habari-comment:last-child {
    border-bottom: none;
}

/* Réponses : indentation + fond différencié */
.habari-comment--reply {
    margin-left: 3rem;
    padding: 0.875rem 0.75rem;
    border-left: 3px solid var(--habari-dark-200, #e5e7eb);
    border-bottom: none;
    background: var(--habari-dark-50, #f9fafb);
}

.habari-comment--deleted .habari-comment__body {
    color: var(--habari-dark-400, #9ca3af);
    font-style: italic;
}

/* ─── Avatar ─── */
/* Exception DA : border-radius 50% uniquement pour les avatars utilisateurs */
.habari-comment__avatar {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    overflow: hidden;
    background: var(--habari-secondary-navy);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    border-radius: 50% !important; /* Exception DA — avatars uniquement */
}

.habari-comment__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.habari-comment__avatar--admin {
    outline: 2px solid var(--habari-primary-brand);
    outline-offset: 2px;
}

.habari-comment__avatar--lmplus {
    outline: 2px solid var(--habari-gold);
    outline-offset: 2px;
}

/* Colonne gauche : avatar + votes */
.habari-comment__left {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    width: 64px;
    gap: 0.75rem;
}

/* Votes en ligne horizontale */
.habari-comment .habari-comment__vote-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.15rem;
}

.habari-comment .habari-comment__vote-group .habari-comment__action-btn {
    padding: 0;
    line-height: 1;
}

.habari-comment .habari-comment__vote-group .habari-comment__vote-count {
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 1.5ch;
    text-align: center;
    color: var(--habari-dark-500, #6b7280);
    pointer-events: none;
}

.habari-comment__vote-count--active {
    font-weight: 700;
}

.habari-comment__vote-count--active:first-of-type {
    color: var(--habari-success-500, #22c55e);
}

.habari-comment__vote-count--active:last-of-type {
    color: var(--habari-primary-brand);
}


/* ─── Contenu ─── */
.habari-comment__main {
    flex: 1;
    min-width: 0;
}

/* Méta */
.habari-comment__meta {
    margin-bottom: 0.25rem;
}

.habari-comment__author-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.15rem;
}

/* Auteur : rouge pour les utilisateurs normaux */
.habari-comment__author {
    font-weight: 700;
    color: var(--habari-primary-brand);
    font-size: 0.875rem;
}

/* Auteur de l'article : navy */
.habari-comment__author--is-author {
    color: var(--habari-secondary-navy);
}

/* Badges */
.habari-comment__badge {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.1rem 0.4rem;
    line-height: 1.5;
    display: inline-block;
}

.habari-comment__badge--lmplus {
    background: var(--habari-gold);
    color: #fff;
}

.habari-comment__badge--author {
    background: var(--habari-secondary-navy);
    color: #fff;
}

/* Date — ligne séparée */
.habari-comment__date {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.72rem;
    color: var(--habari-dark-400, #9ca3af);
    margin-bottom: 0.5rem;
}

.habari-comment__date svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.habari-comment__edited {
    font-size: 0.7rem;
    color: var(--habari-dark-400);
    font-style: italic;
}

/* Corps du commentaire */
.habari-comment__body {
    font-size: 0.9rem;
    line-height: 1.65;
    color: var(--habari-dark-800, #1f2937);
    word-break: break-word;
    margin-bottom: 0.5rem;
}

/* Markdown rendu */
.habari-comment__body strong { font-weight: 700; }
.habari-comment__body em    { font-style: italic; }
.habari-comment__body s     { text-decoration: line-through; }
.habari-comment__body code  { background: var(--habari-dark-100, #f3f4f6); padding: 0.1em 0.3em; font-family: monospace; font-size: 0.85em; }
.habari-comment__body blockquote {
    margin: 0.4rem 0;
    padding-left: 0.75rem;
    border-left: 3px solid var(--habari-dark-300, #d1d5db);
    color: var(--habari-dark-500, #6b7280);
    font-style: italic;
}
.habari-comment__body a {
    color: var(--habari-secondary-navy);
    text-decoration: underline;
}
.habari-comment__body .habari-comment__h2 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0.5rem 0 0.15rem;
    line-height: 1.3;
}
.habari-comment__body .habari-comment__h3 {
    font-size: 0.9rem;
    font-weight: 700;
    margin: 0.4rem 0 0.1rem;
    line-height: 1.3;
}
.habari-comment__body ul,
.habari-comment__body ol {
    margin: 0.25rem 0;
    padding-left: 1.4rem;
}
.habari-comment__body li {
    margin: 0;
    padding: 0;
    line-height: 1.65;
}
.habari-comment__body ul { list-style: disc; }
.habari-comment__body ol { list-style: decimal; }
/* Miniatures images en ligne */
.habari-comment__img-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0.5rem 0;
}

.habari-comment__img-thumb {
    width: 120px;
    height: 120px;
    object-fit: cover;
    cursor: pointer;
    display: block;
    flex-shrink: 0;
}

/* Lightbox images commentaires */
#habari-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .88);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    cursor: zoom-out;
}
#habari-lb-img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    display: block;
}
#habari-lb-prev,
#habari-lb-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,.15);
    border: none;
    color: #fff;
    font-size: 1.5rem;
    padding: .5rem .9rem;
    cursor: pointer;
    z-index: 1;
    line-height: 1;
    font-family: inherit;
}
#habari-lb-prev { left: 1rem; }
#habari-lb-next { right: 1rem; }
#habari-lb-prev:hover,
#habari-lb-next:hover { background: rgba(255,255,255,.3); }

/* Carte prévisualisation lien */
.habari-comment__link-preview {
    display: flex;
    align-items: stretch;
    gap: 0;
    margin: 0.5rem 0;
    border: 1px solid var(--habari-dark-200, #e5e7eb);
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    max-width: 420px;
    transition: border-color .15s;
}
.habari-comment__link-preview:hover { border-color: var(--habari-dark-400); }

.habari-comment__link-preview__img {
    width: 100px;
    min-width: 100px;
    height: 100px;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
}
.habari-comment__link-preview__body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.2rem;
    padding: 0.5rem 0.65rem;
    min-width: 0;
}
.habari-comment__link-preview__domain {
    font-size: 0.7rem;
    color: var(--habari-dark-400);
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.habari-comment__link-preview__title {
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
}
.habari-comment__link-preview__desc {
    font-size: 0.75rem;
    color: var(--habari-dark-500, #6b7280);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
}

/* Auteur avec page publique */
a.habari-comment__author {
    text-decoration: none;
    color: inherit;
    font-weight: 700;
}
a.habari-comment__author:hover { text-decoration: underline; }

/* ─── Zone d'édition inline ─── */
.habari-comment__edit-area {
    display: none;
    margin-bottom: 0.5rem;
}

.habari-comment__edit-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.habari-comment__edit-save {
    display: inline-block;
    background: var(--habari-primary-brand) !important;
    color: #fff !important;
    border: 2px solid var(--habari-primary-brand) !important;
    border-radius: 0 !important;
    padding: 0.35rem 0.9rem;
    font-weight: 700;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    line-height: 1.4;
    font-family: inherit;
}

.habari-comment__edit-save:hover {
    background: transparent !important;
    color: var(--habari-primary-brand) !important;
}

.habari-comment__edit-cancel {
    display: inline-block;
    background: transparent !important;
    border: 1px solid var(--habari-dark-300, #d1d5db) !important;
    border-radius: 0 !important;
    color: var(--habari-dark-600, #4b5563) !important;
    padding: 0.35rem 0.9rem;
    font-size: 0.82rem;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
    line-height: 1.4;
    font-family: inherit;
}

.habari-comment__edit-cancel:hover {
    border-color: var(--habari-dark-500) !important;
    color: var(--habari-dark-800) !important;
}

.habari-comment__edit-area .habari-comment__edit-textarea {
    width: 100%;
    min-height: 80px;
    border: 1px solid var(--habari-dark-300, #d1d5db);
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
    background: #fff;
}

.habari-comment__edit-area .habari-comment__edit-textarea:focus {
    outline: none;
    border-color: var(--habari-secondary-navy);
}

/* ─── Actions ─── */
.habari-comment__actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.875rem;
    margin-top: 0.35rem;
    padding-top: 0.35rem;
    border-top: 1px solid var(--habari-dark-100, #f3f4f6);
}

/* Vote : format "+ 1" */
.habari-comment__vote-group {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.82rem;
    color: var(--habari-dark-500, #6b7280);
}

.habari-comment__action-btn {
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    outline: none;
    -webkit-appearance: none !important;
    appearance: none !important;
    box-shadow: none !important;
    cursor: pointer;
    color: var(--habari-dark-500, #6b7280);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0;
    font-size: 0.8rem;
    line-height: 1;
    font-family: inherit;
    transition: color 0.15s;
}

.habari-comment__action-btn:hover {
    color: var(--habari-secondary-navy);
}

.habari-comment__action-btn--active { color: var(--habari-primary-brand); font-weight: 600; }
.habari-comment__action-btn--like.habari-comment__action-btn--active   { color: var(--habari-success-500, #22c55e); }
.habari-comment__action-btn--dislike.habari-comment__action-btn--active { color: var(--habari-primary-brand); }
.habari-comment__action-btn--delete  { color: var(--habari-primary-brand); }
.habari-comment__action-btn--delete:hover  { color: #6b0000; }
.habari-comment__action-btn--report  { color: var(--habari-dark-400, #9ca3af); }
.habari-comment__action-btn--reply   { color: var(--habari-secondary-navy); font-weight: 600; }

.habari-comment__vote-count {
    font-size: 0.8rem;
    min-width: 1ch;
}

.habari-comment__anchor-link {
    color: var(--habari-dark-400);
    text-decoration: none;
    font-size: 0.8rem;
    margin-left: auto;
}

.habari-comment__anchor-link:hover {
    color: var(--habari-secondary-navy);
}

/* Collapse threads */
.habari-comment__replies-toggle {
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    cursor: pointer;
    color: var(--habari-secondary-navy);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-family: inherit;
    -webkit-appearance: none !important;
}

.habari-comment__replies-wrap {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
}

.habari-comment__replies-wrap[hidden] {
    display: none;
}

/* Formulaire de réponse inline */
.habari-comment__reply-form-wrap {
    margin-top: 0.5rem;
    display: none;
}

/* ============================================================
   Formulaire de commentaire
   ============================================================ */

.habari-comment-form-wrap {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--habari-dark-200);
}

.habari-comment-form-wrap--reply {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
    margin-top: 0.75rem;
}

/* Ligne avatar + formulaire */
.habari-comment-form__row {
    display: flex;
    gap: 0.875rem;
    align-items: flex-start;
}

/* Avatar dans le formulaire */
.habari-comment__avatar--form {
    margin-top: 0.3rem;
}

.habari-comment-form__body {
    flex: 1;
    min-width: 0;
}

/* Toolbar admin */
.habari-comment-form__toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.1rem;
    padding: 0.35rem 0.5rem;
    background: var(--habari-dark-50, #f9fafb);
    border: 1px solid var(--habari-dark-200, #e5e7eb);
    border-bottom: none;
}

.habari-toolbar-btn {
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    font-size: 0.8rem;
    font-family: inherit;
    color: var(--habari-dark-600, #4b5563);
    line-height: 1.4;
    display: inline-flex;
    align-items: center;
    transition: background 0.1s, color 0.1s;
}

.habari-toolbar-btn:hover {
    background: var(--habari-dark-200, #e5e7eb) !important;
    color: var(--habari-secondary-navy);
}

.habari-toolbar-link-bar {
    display: none;
    width: 100%;
    padding: 0.3rem 0.5rem;
    background: var(--habari-dark-50, #f9fafb);
    border: 1px solid var(--habari-dark-200, #e5e7eb);
    border-top: 1px solid var(--habari-dark-200, #e5e7eb);
    gap: 0.4rem;
    align-items: center;
    box-sizing: border-box;
}
.habari-toolbar-link-bar input[type="url"] {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--habari-dark-200, #e5e7eb);
    border-radius: 0;
    padding: 0.2rem 0.5rem;
    font-size: 0.8rem;
    font-family: inherit;
    outline: none;
    background: #fff;
    margin: 0;
}
.habari-toolbar-link-bar input[type="url"]:focus {
    border-color: var(--habari-secondary-navy);
}
.habari-toolbar-link-bar button {
    border-radius: 0;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    border: none;
    padding: 0.2rem 0.7rem;
    font-size: 0.8rem;
}

.habari-toolbar-sep {
    width: 1px;
    height: 1.1rem;
    background: var(--habari-dark-200, #e5e7eb);
    display: inline-block;
    margin: 0 0.25rem;
    align-self: center;
}

.habari-comment-form__replying-to {
    font-size: 0.85rem;
    color: var(--habari-dark-500);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.habari-comment-form__cancel-reply {
    background: none !important;
    border: none !important;
    cursor: pointer;
    color: var(--habari-primary-brand);
    font-size: 0.8rem;
    padding: 0;
    text-decoration: underline;
    font-family: inherit;
    -webkit-appearance: none !important;
}

.habari-comment-form__textarea {
    width: 100%;
    min-height: 100px;
    border: 1px solid var(--habari-dark-300, #d1d5db);
    padding: 0.75rem;
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
    background: #fff;
    transition: border-color 0.15s;
    display: block;
}

.habari-comment-form__textarea:focus {
    outline: none;
    border-color: var(--habari-secondary-navy);
}

.habari-comment-form__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.4rem;
}

.habari-comment-form__counter {
    font-size: 0.75rem;
    color: var(--habari-dark-400);
}

.habari-comment-form__counter--warn {
    color: var(--habari-primary-brand);
    font-weight: 700;
}

.habari-comment-form__upsell {
    margin: 0.5rem 0 0;
    padding: 0.6rem 0.75rem;
    background: #fff8e6;
    border-left: 3px solid var(--habari-primary-brand);
    font-size: 0.8rem;
    color: var(--habari-dark-700, #333);
    line-height: 1.5;
}

/* Emoji picker */
.habari-comment-form__emoji-btn {
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0.15rem;
    transition: transform 0.1s;
    -webkit-appearance: none !important;
}

.habari-comment-form__emoji-btn:hover {
    transform: scale(1.2);
}

.habari-comment-form__emoji-picker {
    position: absolute;
    z-index: 100;
    background: #fff;
    border: 1px solid var(--habari-dark-200);
    padding: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    max-width: 320px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.habari-comment-form__emoji-picker button {
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    cursor: pointer;
    font-size: 1.3rem;
    padding: 0.15rem;
    transition: transform 0.1s;
    line-height: 1;
    -webkit-appearance: none !important;
}

.habari-comment-form__emoji-picker button:hover {
    transform: scale(1.3);
}

.habari-comment-form__field {
    position: relative;
}

.habari-comment-form__actions {
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.habari-comment-form__submit {
    background: var(--habari-secondary-navy) !important;
    color: #fff !important;
    border: 2px solid var(--habari-secondary-navy) !important;
    border-radius: 0 !important;
    padding: 0.5rem 1.25rem;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    font-family: inherit;
    -webkit-appearance: none !important;
}

.habari-comment-form__submit:hover {
    background: transparent !important;
    color: var(--habari-secondary-navy) !important;
}

.habari-comment-form__submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.habari-comment-form__feedback {
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}

.habari-comment-form__feedback--error {
    background: var(--habari-warning-50, #fef2f2);
    color: var(--habari-primary-brand);
    border-left: 3px solid var(--habari-primary-brand);
}

.habari-comment-form__feedback--success {
    background: var(--habari-success-50, #f0fdf4);
    color: var(--habari-success-700, #15803d);
    border-left: 3px solid var(--habari-success-500, #22c55e);
}

/* Neutralisation globale UIkit / navigateur */
.habari-comments button {
    border-radius: 0 !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

/* ============================================================
   Mon Compte — liste commentaires LM+
   ============================================================ */

.habari-account-comment-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--habari-dark-200, #e5e7eb);
}

.habari-account-comment-item:last-child {
    border-bottom: none;
}

.habari-account-comment-item__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
    font-size: 0.8rem;
}

.habari-account-comment-item__post {
    font-weight: 700;
    color: var(--habari-secondary-navy);
    text-decoration: none;
}

.habari-account-comment-item__post:hover {
    text-decoration: underline;
}

.habari-account-comment-item__date,
.habari-account-comment-item__edited {
    color: var(--habari-dark-400);
}

.habari-account-comment-item__status {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.1rem 0.35rem;
}

.habari-account-comment-item__status--approved { background: #dcfce7; color: #15803d; }
.habari-account-comment-item__status--pending  { background: #fef9c3; color: #a16207; }
.habari-account-comment-item__status--rejected { background: #fee2e2; color: #b91c1c; }

.habari-account-comment-item__content {
    font-size: 0.9rem;
    color: var(--habari-dark-700, #374151);
    margin: 0 0 0.35rem;
    white-space: pre-line;
}

.habari-account-comment-item__link {
    font-size: 0.8rem;
    color: var(--habari-secondary-navy);
    text-decoration: none;
}

.habari-account-comment-item__link:hover {
    text-decoration: underline;
}

/* ============================================================
   Responsive — aligné sur breakpoints.css
   Mobile : max 639px | Tablette : 640–959px | Desktop : ≥ 960px
   ============================================================ */

/* ── Mobile (< 640px) ─────────────────────────────────────── */
@media (max-width: 639px) {

    /* En-tête compteur + tri */
    .habari-comments__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    /* Gap réduit entre colonne gauche et contenu principal */
    .habari-comment {
        gap: 0.5rem;
    }

    /* Barre supérieure S'abonner / Connexion */
    .habari-comments__topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Indentation de réponse réduite */
    .habari-comment--reply {
        margin-left: 0.5rem;
    }

    /* Colonne gauche : largeur fixe, direction colonne */
    .habari-comment__left {
        width: 36px;
        flex-direction: column;
        align-items: center;
        gap: 0.25rem;
    }

    /* Avatar compact sur mobile */
    .habari-comment__avatar {
        width: 32px;
        height: 32px;
        font-size: 0.7rem;
    }

    /* Groupe de votes en colonne dans le left panel (évite le débordement horizontal) */
    .habari-comment__left .habari-comment__vote-group {
        flex-direction: column;
        gap: 0;
        width: 100%;
        align-items: center;
    }

    /* Boutons + / — compacts dans la colonne gauche : pleine largeur, pas de min-width */
    .habari-comment__left .habari-comment__action-btn--like,
    .habari-comment__left .habari-comment__action-btn--dislike {
        min-width: unset !important;
        width: 100%;
        min-height: 1.75rem;
        justify-content: center;
        padding: 0.1rem 0 !important;
        font-size: 0.85rem !important;
    }

    /* Compteur de votes dans la colonne gauche */
    .habari-comment__left .habari-comment__vote-count {
        font-size: 0.7rem;
        min-width: unset;
        line-height: 1.2;
    }

    /* Réponses : colonne encore plus étroite */
    .habari-comment--reply .habari-comment__left {
        width: 28px;
    }
    .habari-comment--reply .habari-comment__avatar {
        width: 24px;
        height: 24px;
        font-size: 0.6rem;
    }

    /* Cibles tactiles — uniquement dans la barre d'actions (pas dans le left panel) */
    .habari-comment__actions .habari-comment__action-btn--like,
    .habari-comment__actions .habari-comment__action-btn--dislike {
        min-width: 2.75rem;
        min-height: 2.75rem;
    }

    /* Grille d'images — miniatures plus petites */
    .habari-comment__img-thumb {
        width: 80px;
        height: 80px;
    }

    /* Aperçu lien — passage en colonne */
    .habari-comment__link-preview {
        max-width: 100%;
        flex-direction: column;
    }
    .habari-comment__link-preview__img {
        width: 100%;
        height: 130px;
        flex-shrink: 0;
    }

    /* Picker emoji contenu dans l'écran */
    .habari-comment-form__emoji-picker {
        max-width: 90vw;
    }

    /* Textarea moins haute sur mobile */
    .habari-comment-form__textarea {
        min-height: 70px;
    }

    /* Meta du formulaire (compteur + emoji) en colonne */
    .habari-comment-form__meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }

    /* Accès restreint — CTA pleine largeur */
    .habari-comments__access-required {
        flex-wrap: wrap;
    }
    .habari-comments__cta-btn {
        margin-left: 0;
        width: 100%;
        text-align: center;
        padding: 0.5rem 0.85rem;
    }
}

/* ── Tablette (640–959px) ─────────────────────────────────── */
@media (min-width: 640px) and (max-width: 959px) {

    /* Indentation intermédiaire */
    .habari-comment--reply {
        margin-left: 1.5rem;
    }

    /* Cibles tactiles accessibles */
    .habari-comment__action-btn--like,
    .habari-comment__action-btn--dislike {
        min-width: 2.75rem;
        min-height: 2.75rem;
    }

    /* Grille d'images */
    .habari-comment__img-thumb {
        width: 100px;
        height: 100px;
    }

    /* Aperçu lien — largeur adaptée */
    .habari-comment__link-preview {
        max-width: 100%;
    }
}

/* Toast de notification */
.habari-comment-toast {
    font-family: inherit;
}

/* ============================================================
   Barre supérieure (S'abonner / Connexion)
   ============================================================ */

.habari-comments__topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--habari-dark-100, #f3f4f6);
}

.habari-comments__topbar-left,
.habari-comments__topbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.habari-comments__subscribe-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: none !important;
    border: 1px solid var(--habari-dark-300, #d1d5db) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
    font-family: inherit;
    font-weight: 600;
    color: var(--habari-dark-600, #374151);
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.15s, color 0.15s;
    -webkit-appearance: none;
    appearance: none;
}

.habari-comments__subscribe-btn:hover,
.habari-comments__subscribe-btn:focus {
    border-color: var(--habari-secondary-navy) !important;
    color: var(--habari-secondary-navy);
    text-decoration: none;
}

.habari-comments__subscribe-btn.is-subscribed {
    border-color: var(--habari-secondary-navy) !important;
    color: var(--habari-secondary-navy);
}

.habari-comments__subscribe-dropdown {
    min-width: 200px;
}

.habari-subscribe-option--unsub {
    color: var(--habari-primary-brand) !important;
}

.habari-comments__login-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--habari-secondary-navy);
    text-decoration: none;
    transition: opacity 0.15s;
}

.habari-comments__login-link:hover {
    opacity: 0.75;
    text-decoration: none;
}

/* ============================================================
   Textarea wrap (pour positionner le bouton image)
   ============================================================ */

.habari-comment-form__textarea-wrap {
    position: relative;
}

.habari-comment-form__textarea-wrap .habari-comment-form__textarea {
    padding-right: 2.5rem;
}

.habari-comment-form__image-btn {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0.2rem;
    cursor: pointer;
    color: var(--habari-dark-400, #9ca3af);
    line-height: 1;
    display: flex;
    align-items: center;
    transition: color 0.15s;
    -webkit-appearance: none;
    appearance: none;
}

.habari-comment-form__image-btn:hover {
    color: var(--habari-secondary-navy);
}

/* ============================================================
   Vote format "+ N —" (ajustements)
   ============================================================ */

.habari-comment__vote-group {
    gap: 0.15rem;
}

.habari-comment__vote-count {
    font-size: 0.82rem;
    font-weight: 600;
    min-width: 1.5ch;
    text-align: center;
    color: var(--habari-dark-600, #374151);
}

/* Zone de clic suffisante pour les boutons + et — */
.habari-comment__action-btn--like,
.habari-comment__action-btn--dislike {
    min-width: 1.75rem;
    min-height: 1.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem 0.35rem !important;
    font-size: 1rem !important;
    font-weight: 700;
    line-height: 1;
}

/* ============================================================
   Badge Auteur — dark background confirmé
   ============================================================ */

.habari-comment__badge--author {
    background: var(--habari-secondary-navy);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.15rem 0.5rem;
    line-height: 1.5;
    display: inline-block;
}

/* ============================================================
   Tri "Plus anciens d'abord" — label + chevron dans un bouton
   ============================================================ */

.habari-comments__sort-oldest {
    font-size: 0.78rem;
    padding: 0.35rem 0.4rem;
}

.habari-sort-oldest-label {
    font-size: 0.78rem;
}

.habari-comments__sort-oldest.habari-comments__sort-btn--active .habari-sort-oldest-label {
    color: var(--habari-primary-brand);
}

/* Accès restreint — remplace le formulaire pour les inscrits sur contenu abonné */
.habari-comments__access-required {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .85rem 1rem;
    background: var(--habari-dark-50);
    color: var(--habari-dark-600);
    font-size: .875rem;
}

.habari-comments__cta-btn {
    margin-left: auto;
    padding: .35rem .85rem;
    background: var(--habari-primary-brand);
    color: #fff;
    font-size: .8rem;
    font-weight: 600;
    text-decoration: none;
}

.habari-comments__cta-btn:hover {
    opacity: .88;
    color: #fff;
}
