/* ============================================================
   TKG Comments — Dark mobile-first theme
   ============================================================ */

/* Section racine */
.tkg-comments {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #2a2a3a;
    font-family: inherit;
    color: #e2e8f0;
}

.tkg-comments__title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #c084fc;
    margin: 0 0 1.5rem;
    letter-spacing: .02em;
}

/* ── Liste ──────────────────────────────────────────────────── */
.tkg-comments__list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

/* ── Commentaire individuel ─────────────────────────────────── */
.tkg-comment {
    display: flex;
    gap: .85rem;
    align-items: flex-start;
}

.tkg-comment__avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid #3a3a4a;
}

.tkg-comment__body {
    flex: 1;
    min-width: 0;
    background: #16162a;
    border: 1px solid #2a2a3a;
    border-radius: 10px;
    padding: .85rem 1rem;
}

.tkg-comment__meta {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex-wrap: wrap;
    margin-bottom: .45rem;
}

.tkg-comment__author {
    font-weight: 700;
    font-size: .9rem;
    color: #c084fc;
}

.tkg-comment__date {
    font-size: .78rem;
    color: #6b7280;
}

.tkg-comment__text {
    font-size: .92rem;
    line-height: 1.6;
    color: #cbd5e1;
    word-break: break-word;
}

.tkg-comment__reply-btn {
    background: none;
    border: none;
    color: #7c3aed;
    cursor: pointer;
    font-size: .8rem;
    padding: .35rem 0;
    margin-top: .35rem;
    transition: color .2s;
}

.tkg-comment__reply-btn:hover {
    color: #c084fc;
}

/* ── Réponses (1 niveau) ────────────────────────────────────── */
.tkg-comment__replies {
    margin-top: 1rem;
    padding-left: 1rem;
    border-left: 2px solid #2a2a3a;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tkg-comment__replies .tkg-comment__body {
    background: #0f0f1e;
}

/* ── Formulaire de réponse inline ───────────────────────────── */
.tkg-reply-form-wrap {
    margin-top: 1rem;
}

.tkg-reply-form-wrap[hidden] {
    display: none;
}

/* ── Formulaire de commentaire ──────────────────────────────── */
.tkg-comment-form {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tkg-comment-form__textarea {
    width: 100%;
    background: #16162a;
    border: 1px solid #2a2a3a;
    border-radius: 8px;
    color: #e2e8f0;
    font-size: .95rem;
    padding: .85rem 1rem;
    resize: vertical;
    min-height: 100px;
    transition: border-color .2s;
    box-sizing: border-box;
    font-family: inherit;
}

.tkg-comment-form__textarea:focus {
    outline: none;
    border-color: #7c3aed;
}

.tkg-comment-form__textarea::placeholder {
    color: #4b5563;
}

/* Turnstile wrapper */
.cf-turnstile {
    align-self: flex-start;
}

.tkg-comment-form__actions {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
}

/* ── Boutons ────────────────────────────────────────────────── */
.tkg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .55rem 1.2rem;
    border-radius: 8px;
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background .2s, color .2s, opacity .2s;
    text-decoration: none;
}

.tkg-btn--primary {
    background: #7c3aed;
    color: #fff;
}

.tkg-btn--primary:hover {
    background: #6d28d9;
}

.tkg-btn--ghost {
    background: transparent;
    color: #6b7280;
    border: 1px solid #2a2a3a;
}

.tkg-btn--ghost:hover {
    background: #1e1e2e;
    color: #e2e8f0;
}

/* ── Connexion invité ───────────────────────────────────────── */
.tkg-comment-login {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: #16162a;
    border: 1px solid #2a2a3a;
    border-radius: 10px;
    text-align: center;
    color: #94a3b8;
    font-size: .93rem;
}

.tkg-comment-login p {
    margin: 0 0 1rem;
}

/* ── Préférences ────────────────────────────────────────────── */
.tkg-comments__prefs {
    margin-top: 1.5rem;
    padding: 1rem 1.2rem;
    background: #0f0f1e;
    border: 1px solid #2a2a3a;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.tkg-prefs-title {
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #4b5563;
    font-weight: 600;
    margin: 0 0 .3rem;
}

.tkg-prefs-label {
    display: flex;
    align-items: center;
    gap: .55rem;
    font-size: .84rem;
    color: #94a3b8;
    cursor: pointer;
    user-select: none;
}

.tkg-prefs-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    accent-color: #7c3aed;
    cursor: pointer;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 480px) {
    .tkg-comment {
        gap: .6rem;
    }

    .tkg-comment__avatar img {
        width: 34px;
        height: 34px;
    }

    .tkg-comment__body {
        padding: .7rem .8rem;
    }

    .tkg-comment__replies {
        padding-left: .6rem;
    }
}
