/* /core/assets/comments.css — the comments section (core/components/comments.php), 1.15.0 Phase 13;
 * replies, the guest fields, the notice and the trap, 1.17.0 Phase 12.
 *
 * Pushed by Template::commentsBlock(), so it loads with a theme's own components/comments.php too.
 * Every rule is wrapped in :where() (zero specificity), so any rule a theme writes outranks it, and
 * every colour, radius and font reads the theme contract's --cms-* tokens (site/themes/README.md
 * section 6) with a neutral fallback. Scoped under .cms-comments. */

:where(.cms-comments){margin:2.5rem 0 0;padding-top:1.5rem;border-top:1px solid var(--cms-line, rgba(128,128,128,.3));color:var(--cms-text, inherit);font-family:var(--cms-font, inherit)}
:where(.cms-comments__heading){margin:0 0 1rem;font-size:1.25rem;color:var(--cms-ink, inherit)}
:where(.cms-comments__count){font-weight:400;color:var(--cms-muted, inherit)}
:where(.cms-comments__list){list-style:none;margin:0;padding:0}
:where(.cms-comments__item){padding:1rem 0;border-bottom:1px solid var(--cms-line, rgba(128,128,128,.3));scroll-margin-top:1rem}
/* The linked comment's tint fades (core/assets/highlight.css); a theme names its colour as --cms-target-bg. */
:where(.cms-comments__item:target){padding-inline:.75rem;border-radius:var(--cms-radius-sm, .4rem);animation:var(--core-target-fade, cms-target-fade 4s linear)}
:where(.cms-comments__meta){display:flex;flex-wrap:wrap;gap:.25rem .75rem;align-items:baseline;margin:0 0 .4rem;font-size:.9rem}
:where(.cms-comments__author){font-weight:600;color:var(--cms-ink, inherit)}
:where(.cms-comments__meta .person-avatar){align-self:center}
:where(.cms-comments__badge){align-self:center;padding:.1rem .6rem;border:1px solid var(--cms-line, rgba(128,128,128,.3));border-radius:999px;background:var(--cms-accent-wash, rgba(128,128,128,.08));color:var(--cms-accent, inherit);font-size:.75rem;font-weight:600;line-height:1.5;white-space:nowrap}
:where(.cms-comments__date){color:var(--cms-muted, inherit);text-decoration:none}
:where(.cms-comments__body){line-height:1.6;overflow-wrap:anywhere}
:where(.cms-comments__body > :first-child){margin-top:0}
:where(.cms-comments__body > :last-child){margin-bottom:0}
:where(.cms-comments__empty, .cms-comments__note){margin:1rem 0 0;color:var(--cms-muted, inherit)}
:where(.cms-comments__more){margin:1rem 0 0;font-weight:600}
:where(.cms-comments a){color:var(--cms-accent, inherit)}
:where(.cms-comments a:focus-visible, .cms-comments__input:focus-visible, .cms-comments__submit:focus-visible){outline:2px solid var(--cms-accent, #2563eb);outline-offset:2px}
:where(.cms-comments__form){display:grid;gap:.5rem;margin:1.25rem 0 0}
:where(.cms-comments__label){font-weight:600;color:var(--cms-ink, inherit)}
:where(.cms-comments__input){box-sizing:border-box;width:100%;min-height:7rem;padding:.6rem .75rem;border:1px solid var(--cms-line, rgba(128,128,128,.45));border-radius:var(--cms-radius-sm, .4rem);background:var(--cms-surface, transparent);color:inherit;font:inherit;resize:vertical}
:where(.cms-comments__item[data-depth="1"]){margin-inline-start:clamp(1rem, 5vw, 2.5rem);padding-inline-start:.75rem;border-inline-start:2px solid var(--cms-line, rgba(128,128,128,.3))}
/* A thread's replies sit inside its top comment (core/components/comment-items.php, 1.20.0), drawn to look as the flat list
 * did: the line under the top comment, each reply indented, and no second line where the last reply meets the thread's
 * own. An empty list (no replies) takes no room; the item file prints nothing inside it. */
:where(.cms-comments__replies){list-style:none;margin:1rem 0 -1rem;padding:0;border-top:1px solid var(--cms-line, rgba(128,128,128,.3))}
:where(.cms-comments__replies:empty){display:none}
:where(.cms-comments__replies > :last-child){border-bottom:0}
:where(.cms-comments__more-replies){margin-inline-start:clamp(1rem, 5vw, 2.5rem);padding:.75rem 0 1rem .75rem;font-weight:600}
:where(.cms-comments__more-replies[aria-busy="true"]){opacity:.6}
:where(.cms-comments__reply-to){color:var(--cms-muted, inherit)}
:where(.cms-comments__actions){margin:.4rem 0 0;font-size:.9rem}
:where(.cms-comments__actions:empty){display:none}
:where(.cms-comments__notice){margin:0 0 1rem;padding:.6rem .75rem;border-radius:var(--cms-radius-sm, .4rem);background:var(--cms-sunk, rgba(128,128,128,.06))}
/* A picture of the visitor's new comment could not be stored (1.21.0): the comment stands, the sentence says what is missing. */
:where(.cms-comments__notice--error){color:var(--cms-danger, #b42318);font-weight:600}
:where(.cms-comments__replying){margin:0;color:var(--cms-muted, inherit)}
:where(.cms-comments__field){box-sizing:border-box;width:100%;max-width:28rem;padding:.5rem .75rem;border:1px solid var(--cms-line, rgba(128,128,128,.45));border-radius:var(--cms-radius-sm, .4rem);background:var(--cms-surface, transparent);color:inherit;font:inherit}
:where(.cms-comments__field:focus-visible){outline:2px solid var(--cms-accent, #2563eb);outline-offset:2px}
:where(.cms-comments__check){display:flex;gap:.5rem;align-items:center;margin:0}
/* The trap stays out of sight with full specificity, unlike every rule above: a theme rule that
 * outranked it would show a person a field that marks their comment as spam when filled. */
.cms-comments__trap{position:absolute;left:-10000px;width:1px;height:1px;overflow:hidden}
:where(.cms-comments__submit){justify-self:start;padding:.55rem 1rem;border:0;border-radius:var(--cms-radius-sm, .4rem);background:var(--cms-accent, #2563eb);color:var(--cms-accent-contrast, #fff);font:inherit;font-weight:600;cursor:pointer}

/* iOS zooms the page into a field whose text is under 16 px and does not zoom back (owner, 2026-10-16):
   on a touch screen every field is at least 16 px, and a mouse keeps this sheet's sizes. Never
   maximum-scale or user-scalable=no in the viewport tag, which would stop pinch-zoom. */
@media (pointer:coarse){
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]), select, textarea, [contenteditable]:not([contenteditable="false"]){font-size:max(16px, 1em) !important}
    /* A finger's height for Reply and the "more" links, as Report… beside Reply has (report.css). */
    :where(.cms-comments__reply, .cms-comments__more > a, .cms-comments__more-replies > a){display:inline-flex;align-items:center;min-height:44px}
}

/* Hover looks only where there is a mouse (1.20.0): on a touch screen a tapped control kept its hover look until the
   next tap elsewhere. Kept last, as the media queries are, so each still follows the rules it followed before. */
@media (hover:hover){:where(.cms-comments__date:hover){text-decoration:underline}}
