/* --- MODERN COMMENTS SYSTEM --- */

/* Wrapper */
.comments-area {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 1px solid var(--color-border);
}

.comments-title,
.comment-reply-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: var(--color-primary);
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
}

/* List Reset */
.comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comment-list li {
    margin-bottom: 2rem;
}

/* --- COMMENT CARD LAYOUT --- */
.comment-body-wrapper {
    display: flex;
    gap: 1.5rem;
}

/* Avatar */
.comment-avatar img {
    border-radius: 50%;
    width: 60px;
    height: 60px;
    object-fit: cover;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 3px solid var(--color-white);
}

/* Content Card */
.comment-content-card {
    flex: 1;
    background: var(--color-white);
    padding: 1.5rem;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.02);
}

/* Speech Bubble Arrow */
.comment-content-card::before {
    content: '';
    position: absolute;
    top: 20px;
    left: -8px;
    width: 16px;
    height: 16px;
    background: var(--color-white);
    transform: rotate(45deg);
}

/* Meta Data */
.comment-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-bg);
}

.comment-author b {
    font-size: 1.1rem;
    color: var(--color-primary);
}

.comment-metadata {
    font-size: 0.85rem;
    color: var(--color-text-light);
}

.comment-metadata a {
    color: inherit;
    text-decoration: none;
}

/* Text */
.comment-text-flow p {
    margin-bottom: 1rem;
    line-height: 1.7;
    font-size: 1rem;
}

.comment-text-flow p:last-child {
    margin-bottom: 0;
}

/* Reply Button */
.reply-wrapper {
    margin-top: 1rem;
    text-align: right;
}

.comment-reply-link {
    display: inline-flex;
    align-items: center;
    background: var(--color-bg);
    color: var(--color-primary);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.comment-reply-link:hover {
    background: var(--color-primary);
    color: var(--color-white);
    text-decoration: none;
}

/* --- THREADED COMMENTS (NESTING) --- */
.comment-list .children {
    list-style: none;
    padding-left: 0;
    margin-left: 3rem;
    /* Indent */
    margin-top: 2rem;
    position: relative;
}

/* Thread Connector Line */
.comment-list .children::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 0;
    bottom: 40px;
    width: 2px;
    background: var(--color-border);
    opacity: 0.5;
}

/* Responsive Threading */
@media (max-width: 600px) {
    .comment-body-wrapper {
        flex-direction: column;
        gap: 1rem;
    }

    .comment-avatar {
        display: flex;
        align-items: center;
        gap: 1rem;
    }

    .comment-avatar::after {
        content: attr(data-author);
        /* Could use JS to inject author name here for mobile, but simplified for now */
    }

    .comment-content-card::before {
        display: none;
    }

    .comment-list .children {
        margin-left: 1rem;
    }

    .comment-list .children::before {
        left: -0.5rem;
    }
}


/* --- COMMENT FORM --- */
.comment-respond {
    background: var(--color-bg);
    padding: 3rem;
    border-radius: var(--border-radius-lg);
    margin-top: 3rem;
}

.comment-form {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.comment-form-group {
    margin-bottom: 0.5rem;
}

.comment-form-group.half {
    flex: 1 1 calc(50% - 1rem);
}

.comment-form-group.full {
    flex: 1 1 100%;
}

.comment-form input,
.comment-form textarea {
    border: none;
    background: var(--color-white);
    padding: 1rem;
    border-radius: var(--border-radius-md);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.01);
    transition: all 0.3s ease;
}

.comment-form input:focus,
.comment-form textarea:focus {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.05);
}

.form-submit {
    flex: 1 1 100%;
    text-align: right;
    margin-top: 1rem;
}