/* =========================================================
   BLOG COMMENTS  (src/styles/blog-comments.css)
   ---------------------------------------------------------
   The thread and compose form under an article, rendered by
   includes/blog-comments-section.php.

   Same defensive notes as blog-article.css: m072224.css sets
   global p/li typography, a colour, and a button reset, so
   every rule here states its own line-height, size, tracking
   and colour, and every button is either .tv-cta or .bc-link.
   ========================================================= */

.bc {
    padding: clamp(1.5rem, 3vw, 2.25rem) 1.5rem clamp(1rem, 2vw, 1.5rem);
}

/* Same column as the article above it (blog-article.css owns the token;
   the fallback keeps this file standalone). The divider rides on this
   block, not on the full-bleed section, so it starts and ends on the
   article's own edges instead of running the width of the page. */
.bc__inner {
    max-width: var(--bp-measure, 47rem);
    margin: 0 auto;
    padding-top: clamp(2.25rem, 4.4vw, 3rem);
    border-top: 1px solid var(--theme-divider, rgba(255, 255, 255, 0.08));
}

/* ── Head ──────────────────────────────────────────────── */
.bc__head {
    margin-bottom: clamp(1.5rem, 3vw, 2rem);
}

.bc__title {
    margin: 0;
    font-size: clamp(1.2rem, 2vw, 1.45rem);
    font-weight: 400;
    line-height: 1.3;
    letter-spacing: 0.01em;
    text-transform: none;
    color: var(--theme-text-strong, #ffffff);
}

.bc__note {
    margin: 0.4rem 0 0;
    font-size: 0.82rem;
    font-weight: 300;
    line-height: 1.5;
    letter-spacing: 0.02em;
    color: var(--theme-text-soft, #989ba3);
}

/* ── Flash / live status ───────────────────────────────── */
.bc-flash,
.bc-status {
    margin: 0 0 1.5rem;
    padding: 0.85rem 1.1rem;
    border: 1px solid var(--theme-border, rgba(255, 255, 255, 0.1));
    border-radius: var(--theme-radius-sm, 0.9rem);
    font-size: 0.92rem;
    font-weight: 400;
    line-height: 1.6;
    letter-spacing: 0.01em;
    color: var(--theme-text-main, #ececef);
}

.bc-flash--ok,
.bc-status--ok {
    border-color: var(--theme-success-border, rgba(34, 197, 94, 0.22));
    background: var(--theme-success-bg, rgba(34, 197, 94, 0.14));
    color: var(--theme-success-text, #9ee6b1);
}

/* Neutral panel, but the text keeps its warning colour — the message is what
   has to read as an error, and it is type, not a container surface. */
.bc-flash--error,
.bc-status--error {
    border-color: var(--theme-border-strong, rgba(255, 255, 255, 0.18));
    background: var(--theme-surface-white-06, rgba(255, 255, 255, 0.06));
    color: #ffc2c2;
}

/* ── Thread ────────────────────────────────────────────── */
.bc-list,
.bc-replies {
    margin: 0;
    padding: 0;
    list-style: none;
}

.bc-list {
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
    margin-bottom: clamp(2rem, 4vw, 2.75rem);
}

.bc-comment {
    padding: 1.15rem 1.25rem;
    border: 1px solid var(--theme-border, rgba(255, 255, 255, 0.09));
    border-radius: var(--theme-radius-md, 1rem);
    background: var(--theme-surface-white-04, rgba(255, 255, 255, 0.04));
    /* beats the global `li` rule */
    line-height: 1.6;
    font-size: 1rem;
    letter-spacing: normal;
    color: var(--theme-text-main, #ececef);
    list-style: none;
}

/* Held for approval. Dashed rather than tinted — the same "not settled yet"
   device .bc-empty uses, so the state reads without colour. */
.bc-comment--pending {
    border-style: dashed;
    border-color: var(--theme-border-strong, rgba(255, 255, 255, 0.18));
    background: var(--theme-surface-white-04, rgba(255, 255, 255, 0.03));
}

.bc-comment__head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.7rem;
}

.bc-comment__avatar {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 2.15rem;
    height: 2.15rem;
    border: 1px solid var(--theme-border, rgba(255, 255, 255, 0.1));
    border-radius: 50%;
    background: var(--theme-surface-white-06, rgba(255, 255, 255, 0.06));
    color: var(--theme-text-main-soft-2, rgba(255, 255, 255, 0.92));
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.04em;
}

.bc-comment__byline {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    margin-right: auto;
    min-width: 0;
}

.bc-comment__name {
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0.01em;
    color: var(--theme-text-strong, #ffffff);
}

.bc-comment__time {
    font-size: 0.74rem;
    font-weight: 400;
    line-height: 1.3;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--theme-text-soft, #989ba3);
}

.bc-comment__badge {
    flex: 0 0 auto;
    padding: 0.26rem 0.6rem;
    border: 1px solid var(--theme-border-strong, rgba(255, 255, 255, 0.18));
    border-radius: var(--theme-radius-pill, 999px);
    color: var(--theme-text-muted, #c4c6cc);
    font-size: 0.64rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    white-space: nowrap;
}

.bc-comment__body {
    /* Aligns the text with the name rather than the avatar. */
    padding-left: 2.9rem;
}

.bc-comment__p {
    margin: 0 0 0.7rem;
    font-size: 0.97rem;
    font-weight: 300;
    line-height: 1.72;
    letter-spacing: 0.008em;
    color: var(--theme-text-muted, #c4c6cc);
}

.bc-comment__p:last-child {
    margin-bottom: 0;
}

.bc-comment__actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-left: 2.9rem;
    margin-top: 0.7rem;
}

.bc-comment__actions:empty {
    display: none;
}

/* ── Replies ───────────────────────────────────────────── */
.bc-replies {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin: 1rem 0 0 2.9rem;
    padding-left: 1.15rem;
    border-left: 1px solid var(--theme-border, rgba(255, 255, 255, 0.1));
}

.bc-comment--reply {
    padding: 0.95rem 1.05rem;
    background: var(--theme-surface-white-04, rgba(255, 255, 255, 0.035));
}

.bc-comment--reply .bc-comment__body,
.bc-comment--reply .bc-comment__actions {
    padding-left: 0;
}

/* ── Text-button ───────────────────────────────────────── */
.bc-link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--theme-text-main-soft-3, rgba(255, 255, 255, 0.9));
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: underline;
    text-underline-offset: 0.24em;
    text-decoration-color: rgba(212, 40, 40, 0.6);
    cursor: pointer;
    transition: color 150ms ease, text-decoration-color 150ms ease;
}

/* The global `button` rule adds margin-top: 2rem and 1.25rem uppercase. */
button.bc-link {
    margin-top: 0;
    font-size: 0.8rem;
    font-weight: 500;
}

.bc-link:hover,
.bc-link:focus-visible {
    color: #ffffff;
    text-decoration-color: #d42828;
}

.bc-link--quiet {
    color: var(--theme-text-soft, #989ba3);
    text-decoration-color: rgba(255, 255, 255, 0.22);
}

.bc-link:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.32);
    outline-offset: 3px;
}

.bc-inline-form {
    display: inline;
    margin: 0;
}

/* ── Empty ─────────────────────────────────────────────── */
.bc-empty {
    margin: 0 0 clamp(2rem, 4vw, 2.75rem);
    padding: 1.5rem;
    border: 1px dashed var(--theme-border, rgba(255, 255, 255, 0.1));
    border-radius: var(--theme-radius-md, 1rem);
    font-size: 0.95rem;
    font-weight: 300;
    line-height: 1.6;
    letter-spacing: 0.01em;
    text-align: center;
    color: var(--theme-text-soft, #989ba3);
}

/* ── Compose form ──────────────────────────────────────── */
.bc-form {
    padding: clamp(1.25rem, 2.4vw, 1.6rem);
    border: 1px solid var(--theme-border, rgba(255, 255, 255, 0.1));
    border-radius: var(--theme-radius-md, 1rem);
    background: var(--theme-surface-white-04, rgba(255, 255, 255, 0.04));
}

.bc-form__replying {
    margin-bottom: 0.9rem;
    padding: 0.55rem 0.85rem;
    border: 1px solid var(--theme-border, rgba(255, 255, 255, 0.1));
    border-radius: var(--theme-radius-sm, 0.9rem);
    background: var(--theme-surface-white-06, rgba(255, 255, 255, 0.06));
    font-size: 0.84rem;
    line-height: 1.5;
    letter-spacing: 0.01em;
    color: var(--theme-text-main, #ececef);
}

.bc-form__replying strong {
    font-weight: 600;
    letter-spacing: inherit;
    color: var(--theme-text-strong, #ffffff);
}

.bc-form__replying .bc-link {
    margin-left: 0.6rem;
}

.bc-form__label {
    display: block;
    margin-bottom: 0.6rem;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--theme-text-muted, #c4c6cc);
}

.bc-form__input {
    display: block;
    width: 100%;
    min-height: 7rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--theme-border, rgba(255, 255, 255, 0.12));
    border-radius: var(--theme-radius-sm, 0.9rem);
    background: rgba(8, 8, 9, 0.5);
    color: var(--theme-text-main, #ececef);
    font-family: inherit;
    font-size: 0.97rem;
    font-weight: 300;
    line-height: 1.7;
    letter-spacing: 0.008em;
    resize: vertical;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.bc-form__input::placeholder {
    color: var(--theme-text-soft, #989ba3);
}

.bc-form__input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.42);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12);
}

.bc-form__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.9rem;
}

.bc-form__count {
    font-size: 0.76rem;
    font-weight: 400;
    line-height: 1.3;
    letter-spacing: 0.06em;
    color: var(--theme-text-soft, #989ba3);
    font-variant-numeric: tabular-nums;
}

.bc-form__count.is-near-limit {
    color: var(--theme-text-accent-soft, #f0c7c7);
}

/* ── Signed-out prompt ─────────────────────────────────── */
.bc-signin {
    padding: clamp(1.5rem, 3vw, 2rem);
    border: 1px solid var(--theme-border, rgba(255, 255, 255, 0.1));
    border-radius: var(--theme-radius-md, 1rem);
    background: var(--theme-surface-white-04, rgba(255, 255, 255, 0.04));
    text-align: center;
}

.bc-signin__text {
    margin: 0 0 1.15rem;
    font-size: 1rem;
    font-weight: 300;
    line-height: 1.6;
    letter-spacing: 0.01em;
    color: var(--theme-text-main, #ececef);
}

.bc-signin__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.7rem;
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 640px) {
    .bc {
        padding-inline: 1rem;
    }

    /* Reclaim the avatar gutter on a narrow screen. */
    .bc-comment__body,
    .bc-comment__actions {
        padding-left: 0;
    }

    .bc-replies {
        margin-left: 0.75rem;
        padding-left: 0.85rem;
    }

    .bc-form__foot {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .bc-form__foot .tv-cta {
        width: 100%;
    }

    .bc-form__count {
        text-align: center;
    }

    .bc-signin__actions {
        flex-direction: column;
    }
}
