/* ============================================================================
   Blog Comments - Fluxr Works
   ----------------------------------------------------------------------------
   Styles for the comment list, the comment form messages, and the header
   comment count on the blog-details pages.

   Everything here is scoped under .comments-section or .comments-from so it
   cannot collide with the rest of style.css. Colours are taken from the
   variables already declared at the top of style.css (--orange is the site
   accent, #FF6A3A).
   ========================================================================== */

/* ---------------------------------------------------------------- Section  */

.comments-section {
    --comment-line: rgba(0, 0, 0, .08);
    --comment-muted: #717580;
}

.comments-section .comments-heading {
    display: flex;
    align-items: center;
    gap: 14px;
}

.comments-section .comments-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 28px;
    padding: 0 10px;
    border-radius: 30px;
    background: var(--orange, #FF6A3A);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .5px;
    line-height: 1;
}

/* ------------------------------------------------------------------ States */

.comments-section .comments-state {
    padding: 30px 0;
    color: var(--comment-muted);
    font-size: 15px;
}

.comments-section .comments-state.is-error {
    color: #dc3131;
}

/* Shown only when the widget has no database configured. Disappears on its
   own once SUPABASE_URL and SUPABASE_ANON_KEY are filled in. */
.comments-section .comments-preview-notice {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 35px;
    padding: 16px 20px;
    border: 1px solid #f0d9a8;
    border-radius: 15px;
    background: #fdf6e7;
    color: #7a5a12;
    font-size: 14px;
    line-height: 1.6;
}

.comments-section .comments-preview-notice strong {
    display: block;
    margin-bottom: 3px;
    color: #5e440c;
}

/* ------------------------------------------------------------------- List  */

.comments-section .comments-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.comments-section .comment-item {
    display: flex;
    gap: 20px;
    padding: 30px 0;
    border-top: 1px solid var(--comment-line);
}

.comments-section .comment-item:first-child {
    border-top: 0;
    padding-top: 0;
}

.comments-section .comment-avatar {
    flex: 0 0 auto;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: .5px;
    color: #fff;
    text-transform: uppercase;
    user-select: none;
}

.comments-section .comment-body {
    min-width: 0;
    flex: 1 1 auto;
}

.comments-section .comment-head {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-bottom: 10px;
}

.comments-section .comment-author {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.comments-section .comment-date {
    font-size: 13px;
    color: var(--comment-muted);
}

.comments-section .comment-text {
    margin: 0;
    font-size: 16px;
    line-height: 1.75;
    color: #444;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* Highlight applied for a few seconds to a comment the visitor just posted. */
.comments-section .comment-item.is-new .comment-text {
    color: #1f1f1f;
}

.comments-section .comment-item.is-new {
    animation: fluxrCommentIn .5s ease both;
}

@keyframes fluxrCommentIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}

.comments-section .comment-pending {
    display: inline-block;
    margin-left: 4px;
    padding: 3px 10px;
    border-radius: 30px;
    background: #fdf6e7;
    color: #7a5a12;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .6px;
}

/* -------------------------------------------------------------- Form bits  */

/* Labels are present for screen readers but the design uses placeholders. */
.comments-from .visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* Honeypot. Bots fill it in, people never see it. */
.comments-from .comment-hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none;
}

/* Buttons only match :focus-visible on keyboard navigation, so this never
   shows on a mouse click. Text fields are handled in responsive-fixes.css,
   where the outline is removed entirely. */
.comments-from button:focus-visible {
    outline: 2px solid var(--orange, #FF6A3A);
    outline-offset: 3px;
}

.comments-from input[aria-invalid="true"],
.comments-from textarea[aria-invalid="true"] {
    border-color: #dc3131;
}

.comments-from .comment-field-error {
    display: block;
    margin: 8px 0 0 18px;
    color: #dc3131;
    font-size: 13px;
}

.comments-from .comment-form-message:empty {
    display: none;
}

.comments-from .comment-form-message {
    margin-bottom: 30px;
    padding: 16px 22px;
    border-radius: 15px;
    font-size: 15px;
    line-height: 1.6;
}

.comments-from .comment-form-message.is-success {
    border: 1px solid #b9e6c9;
    background: #eaf8ef;
    color: #1c6b3d;
}

.comments-from .comment-form-message.is-error {
    border: 1px solid #f3c2c2;
    background: #fdeeee;
    color: #a02020;
}

.comments-from button[disabled] {
    opacity: .55;
    cursor: not-allowed;
}

.comments-from button[disabled]:hover {
    background: rgba(221, 221, 221);
    color: #5e5e5e;
}

/* ------------------------------------------------------------- Responsive  */

@media (max-width: 575px) {
    .comments-section .comment-item {
        gap: 15px;
    }

    .comments-section .comment-avatar {
        width: 44px;
        height: 44px;
        font-size: 15px;
    }

    .comments-section .comment-text {
        font-size: 15px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .comments-section .comment-item.is-new {
        animation: none;
    }
}
