/* =============================================================
 * Comments Section — yevv.mmarchak.website
 * Light academic theme matching the main site palette.
 * ============================================================= */

/* ── Section wrapper ─────────────────────────────────────── */
.comments-section {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border);
}

.comments-section > h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    color: var(--ink);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.comments-count {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    background: var(--teal);
    color: #fff;
    padding: 2px 9px;
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.03em;
    vertical-align: middle;
}

/* ── Comment list ────────────────────────────────────────── */
.comment-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

/* ── Individual comment card ─────────────────────────────── */
.comment-card {
    background: #fff;
    border: 1px solid var(--border);
    border-left: 4px solid var(--teal);
    border-radius: 0 4px 4px 0;
    padding: 14px 18px;
    animation: comment-in 0.25s ease;
}

@keyframes comment-in {
    from { opacity: 0; transform: translateY(5px); }
    to   { opacity: 1; transform: translateY(0); }
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.5rem;
}

.comment-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--teal);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Playfair Display', serif;
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
    text-transform: uppercase;
}

.comment-author {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--ink);
}

.comment-date {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: var(--muted);
    margin-left: auto;
}

.comment-body {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--ink);
    white-space: pre-line;
    word-break: break-word;
}

/* ── Empty / loading states ──────────────────────────────── */
.comments-empty {
    text-align: center;
    padding: 2rem;
    color: var(--muted);
    font-size: 0.92rem;
    border: 1px dashed var(--border);
    border-radius: 4px;
    background: var(--section-bg);
}

.comments-loading {
    text-align: center;
    padding: 1.5rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.comments-loading::after {
    content: '';
    display: inline-block;
    width: 13px;
    height: 13px;
    margin-left: 8px;
    border: 2px solid var(--teal);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Comment form wrapper ────────────────────────────────── */
.comment-form-wrapper {
    background: var(--section-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 24px 28px;
}

.comment-form-wrapper h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    color: var(--ink);
    margin: 0 0 1.2rem;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

/* ── Form layout ─────────────────────────────────────────── */
.cf-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

@media (max-width: 560px) {
    .cf-row { grid-template-columns: 1fr; }
}

.cf-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.cf-field label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.cf-field input,
.cf-field textarea {
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: 3px;
    color: var(--ink);
    font-size: 0.92rem;
    font-family: 'Source Serif 4', Georgia, serif;
    padding: 0.5rem 0.7rem;
    transition: border-color 0.15s;
    resize: vertical;
}

.cf-field input:focus,
.cf-field textarea:focus {
    outline: none;
    border-color: var(--teal);
    background: #fff;
}

.cf-field input.error,
.cf-field textarea.error {
    border-color: var(--accent);
}

.cf-field .field-error {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.73rem;
    color: var(--accent);
    display: none;
}

.cf-field .field-error.visible {
    display: block;
}

/* ── Captcha row ─────────────────────────────────────────── */
.cf-captcha {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.9rem;
    flex-wrap: wrap;
}

.cf-captcha label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    white-space: nowrap;
}

.cf-captcha .captcha-question {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ink);
    background: var(--highlight);
    border: 1px solid var(--gold);
    border-radius: 3px;
    padding: 4px 12px;
    letter-spacing: 0.05em;
}

.cf-captcha input[type="number"] {
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: 3px;
    color: var(--ink);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    padding: 4px 10px;
    width: 120px;
    transition: border-color 0.15s;
}

.cf-captcha input[type="number"]:focus {
    outline: none;
    border-color: var(--teal);
    background: #fff;
}

.cf-captcha input[type="number"].error {
    border-color: var(--accent);
}

.cf-captcha .field-error {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.73rem;
    color: var(--accent);
    display: none;
}

.cf-captcha .field-error.visible {
    display: block;
}

/* ── Honeypot — invisible to users, visible to bots ─────── */
.cf-honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

/* ── Submit row ──────────────────────────────────────────── */
.cf-submit-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.cf-submit-row .cf-note {
    font-size: 0.8rem;
    color: var(--muted);
    flex: 1;
}

.cf-submit-btn {
    background: var(--ink);
    color: var(--paper);
    border: none;
    border-radius: 3px;
    padding: 0.55rem 1.4rem;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: 'Source Serif 4', Georgia, serif;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.cf-submit-btn:hover:not(:disabled) {
    background: var(--teal);
}

.cf-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Status messages ─────────────────────────────────────── */
.cf-status {
    margin-top: 0.85rem;
    padding: 10px 14px;
    border-radius: 3px;
    font-size: 0.88rem;
    display: none;
}

.cf-status.success {
    display: block;
    background: #f0f8f0;
    border: 1px solid #82c382;
    border-left: 4px solid #27ae60;
    color: #1e6b3a;
}

.cf-status.error {
    display: block;
    background: #fff0f0;
    border: 1px solid #e74c3c;
    border-left: 4px solid var(--accent);
    color: #922b21;
}

/* ── Cooldown countdown ──────────────────────────────────── */
.cf-cooldown {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--muted);
    text-align: right;
    margin-top: 0.4rem;
    min-height: 1.1em;
}
