/* The Community (bbPress) in the v2 look. The loops are this theme's (bbpress/), so these rules style the kit-like
   markup they print; what bbPress still prints itself (forms, notices, pagination) is restyled here too, because
   bbPress's own stylesheet is off. Tokens only. */

/* ---------- the hero ---------- */
.ats-forum-hero{ padding-block:40px 32px; }
.ats-forum-hero .ats-forum-title{ font-size:clamp(28px, 4vw, 44px); max-inline-size:28ch; text-wrap:balance; }
.ats-forum-hero .ma-chero-meta .avatar{ inline-size:28px; block-size:28px; border-radius:50%; }
.ats-forum-search{ margin-inline:auto; max-inline-size:640px; }
.m2-hero-below .ats-forum-search + .ats-forum-stats{ margin-block-start:32px; }
.m2-hero:not(.m2-align-center) .ats-forum-search{ margin-inline:0; }

/* ---------- forum cards ---------- */
.ats-forums{ display:grid; grid-template-columns:repeat(auto-fill, minmax(280px, 1fr)); gap:16px; margin:0; padding:0; list-style:none; }
.ats-forum-card{ position:relative; display:flex; flex-direction:column; gap:12px; padding:20px; border:1px solid var(--ats-border); border-radius:var(--ats-radius-lg); background:var(--ats-surface); transition:border-color .15s, translate .15s; }
.ats-forum-card:hover{ border-color:color-mix(in oklab, var(--ats-accent) 45%, var(--ats-border)); }
@media (hover: hover){ .ats-forum-card:hover{ translate:0 -2px; } }
.ats-forum-card-link{ position:absolute; inset:0; border-radius:inherit; z-index:1; }
.ats-forum-card-link:focus-visible{ outline:2px solid var(--ats-accent-text); outline-offset:2px; }
.ats-forum-card-head{ display:flex; align-items:center; gap:12px; }
.ats-forum-ic{ display:grid; place-items:center; flex:none; inline-size:36px; block-size:36px; border-radius:var(--ats-radius-md); background:color-mix(in oklab, var(--ats-accent) 12%, transparent); color:var(--ats-accent-text); }
.ats-forum-card-title{ margin:0; font-family:var(--ats-font-display); font-size:17px; line-height:1.25; font-weight:600; color:var(--ats-fg); }
.ats-forum-card-text{ margin:0; color:var(--ats-muted-strong); font-size:var(--ats-text-ui); line-height:1.5; }
.ats-forum-chips{ display:flex; flex-wrap:wrap; gap:6px; margin:0; padding:0; list-style:none; position:relative; z-index:2; }
.ats-chip{ display:inline-flex; align-items:center; min-block-size:28px; padding:0 10px; border-radius:999px; border:1px solid var(--ats-border); color:var(--ats-muted-strong); font-size:12px; text-decoration:none; background:var(--ats-bg); transition:color .15s, border-color .15s; }
a.ats-chip:hover{ color:var(--ats-fg); border-color:var(--ats-border-strong); }
.ats-chip.is-more{ color:var(--ats-muted); }
.ats-forum-card-foot{ display:flex; align-items:flex-end; justify-content:space-between; gap:12px; margin-block-start:auto; padding-block-start:12px; border-block-start:1px solid var(--ats-border); }
.ats-forum-figs{ display:flex; gap:20px; margin:0; }
.ats-forum-figs dt{ color:var(--ats-muted); font-size:11px; text-transform:uppercase; letter-spacing:.05em; }
.ats-forum-figs dd{ margin:2px 0 0; font-size:18px; color:var(--ats-fg); font-variant-numeric:tabular-nums; }
.ats-forum-last{ position:relative; z-index:2; display:flex; align-items:center; gap:6px; margin:0; color:var(--ats-muted); font-size:12px; }
.ats-forum-last img{ border-radius:50%; }
.ats-forum-last a{ color:var(--ats-muted-strong); text-decoration:none; }
.ats-forum-last a:hover{ color:var(--ats-fg); }
.ats-forum-h2{ margin:32px 0 14px; font-family:var(--ats-font-display); font-size:20px; color:var(--ats-fg); }
.ats-forum-h2:first-child{ margin-block-start:0; }

/* ---------- topic rows ---------- */
.ats-topics{ border:1px solid var(--ats-border); border-radius:var(--ats-radius-lg); background:var(--ats-surface); overflow:hidden; }
.ats-topics-head, .ats-topic-row{ display:grid; grid-template-columns:minmax(0, 1fr) 84px 84px 160px; gap:16px; align-items:center; padding:14px 18px; }
.ats-topics-head{ color:var(--ats-muted); font-size:11px; font-weight:600; letter-spacing:.05em; text-transform:uppercase; border-block-end:1px solid var(--ats-border); }
.ats-topics-head > :nth-child(2), .ats-topics-head > :nth-child(3), .ats-topic-num{ text-align:end; }
.ats-topics-list{ margin:0; padding:0; list-style:none; }
.ats-topic-row{ border-block-end:1px solid var(--ats-border); transition:background-color .15s; }
.ats-topic-row:last-child{ border-block-end:0; }
.ats-topic-row:hover{ background:var(--ats-overlay-1); }
.ats-topic-main{ display:flex; gap:12px; align-items:flex-start; min-inline-size:0; }
.ats-topic-main .avatar{ flex:none; inline-size:36px; block-size:36px; border-radius:50%; }
.ats-topic-copy{ min-inline-size:0; display:grid; gap:4px; }
.ats-topic-title-row{ display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin:0; }
.ats-topic-title{ color:var(--ats-fg); font-weight:600; font-size:15px; line-height:1.35; text-decoration:none; overflow-wrap:anywhere; }
.ats-topic-title:hover{ color:var(--ats-accent-text); }
.ats-topic-meta{ display:flex; flex-wrap:wrap; gap:4px 10px; margin:0; color:var(--ats-muted); font-size:12px; }
.ats-topic-meta a{ color:var(--ats-muted-strong); text-decoration:none; }
.ats-topic-meta a:hover{ color:var(--ats-fg); }
.ats-topic-num-inline{ display:none; }
.ats-topic-pages{ display:flex; flex-wrap:wrap; gap:4px; font-size:12px; }
.ats-topic-pages .page-numbers{ display:inline-grid; place-items:center; min-inline-size:24px; block-size:24px; padding:0 6px; border-radius:6px; border:1px solid var(--ats-border); color:var(--ats-muted-strong); text-decoration:none; }
.ats-topic-num{ color:var(--ats-fg); font-size:15px; font-variant-numeric:tabular-nums; }
.ats-topic-last{ display:grid; gap:2px; font-size:12px; color:var(--ats-muted); min-inline-size:0; }
.ats-topic-last a{ color:var(--ats-muted-strong); text-decoration:none; }
.ats-topic-last a:hover{ color:var(--ats-fg); }
.ats-topic-last span{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ats-topic-row.sticky, .ats-topic-row.super-sticky{ background:color-mix(in oklab, var(--ats-accent) 5%, transparent); }
@media (max-width: 760px){
  .ats-topics-head{ display:none; }
  .ats-topic-row{ grid-template-columns:minmax(0, 1fr); gap:6px; padding:14px; }
  .ats-topic-num, .ats-topic-last{ display:none; }
  .ats-topic-num-inline{ display:inline; }
}

/* ---------- the thread ---------- */
.ats-thread, .ats-thread ul{ display:grid; gap:12px; margin:0; padding:0; list-style:none; }
.ats-thread ul{ margin-block-start:12px; padding-inline-start:24px; border-inline-start:2px solid var(--ats-border); }
.ats-post{ padding:18px 20px; border:1px solid var(--ats-border); border-radius:var(--ats-radius-lg); background:var(--ats-surface); }
.ats-post.is-lead{ border-color:color-mix(in oklab, var(--ats-accent) 35%, var(--ats-border)); }
.ats-post.is-team{ box-shadow:inset 3px 0 0 var(--ats-accent); }
.ats-post-head{ display:flex; align-items:center; gap:12px; margin-block-end:12px; }
.ats-post-head .avatar{ flex:none; inline-size:40px; block-size:40px; border-radius:50%; }
.ats-post-who{ display:flex; flex-wrap:wrap; align-items:center; gap:8px; min-inline-size:0; }
.ats-post-name{ font-weight:600; color:var(--ats-fg); }
.ats-post-ip{ color:var(--ats-muted); font-size:11px; font-family:var(--ats-font-mono); }
.ats-post-date{ margin-inline-start:auto; flex:none; color:var(--ats-muted); font-size:12px; text-decoration:none; }
.ats-post-date:hover{ color:var(--ats-fg); }
.ats-post-body{ color:var(--ats-fg); font-size:15px; line-height:1.65; overflow-wrap:anywhere; }
.ats-post-body > :first-child{ margin-block-start:0; }
.ats-post-body > :last-child{ margin-block-end:0; }
.ats-post-body p{ margin:0 0 .9em; }
.ats-post-body a{ color:var(--ats-accent-text); text-underline-offset:3px; }
.ats-post-body img{ max-inline-size:100%; block-size:auto; border-radius:var(--ats-radius-md); }
.ats-post-body blockquote{ margin:0 0 .9em; padding:10px 14px; border-inline-start:3px solid var(--ats-border-strong); background:var(--ats-bg); border-radius:0 var(--ats-radius-md) var(--ats-radius-md) 0; color:var(--ats-muted-strong); }
.ats-post-body :where(pre, code){ font-family:var(--ats-font-mono); font-size:13px; background:var(--ats-bg); border-radius:6px; }
.ats-post-body pre{ padding:12px; overflow-x:auto; }
.ats-post-body code{ padding:1px 5px; }
.ats-post-foot{ display:flex; flex-wrap:wrap; gap:10px; margin-block-start:12px; padding-block-start:10px; border-block-start:1px solid var(--ats-border); font-size:12px; }
.ats-post-foot a{ color:var(--ats-muted-strong); text-decoration:none; }
.ats-post-foot a:hover{ color:var(--ats-fg); }
.ats-post-foot .bbp-admin-links{ display:flex; flex-wrap:wrap; gap:10px; color:var(--ats-border-strong); }
@media (max-width: 640px){ .ats-post{ padding:14px; } .ats-thread ul{ padding-inline-start:12px; } }

/* ---------- tools, notices, pagination, forms (bbPress's own markup) ---------- */
#bbpress-forums{ font-family:var(--ats-font-body); color:var(--ats-fg); }
.ats-forum-tools{ display:flex; justify-content:flex-end; gap:8px; margin-block-end:12px; }
.ats-forum-tools:empty{ display:none; }
.ats-forum-tools a{ display:inline-flex; align-items:center; min-block-size:32px; padding:0 12px; border-radius:var(--ats-radius-md); border:1px solid var(--ats-border); color:var(--ats-muted-strong); font-size:13px; font-weight:500; text-decoration:none; }
.ats-forum-tools a:hover{ color:var(--ats-fg); border-color:var(--ats-border-strong); }
#bbpress-forums .bbp-template-notice, .bbp-template-notice{ margin:0 0 16px; padding:12px 16px; border:1px solid var(--ats-border); border-radius:var(--ats-radius-md); background:var(--ats-surface); color:var(--ats-muted-strong); font-size:14px; }
.bbp-template-notice p, .bbp-template-notice ul{ margin:0; padding:0; list-style:none; }
.bbp-template-notice.error{ border-color:color-mix(in oklab, var(--ats-danger) 50%, var(--ats-border)); color:var(--ats-fg); }
.bbp-template-notice a{ color:var(--ats-accent-text); }
.bbp-pagination{ display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; margin:16px 0; color:var(--ats-muted); font-size:13px; }
.bbp-pagination-links{ display:flex; flex-wrap:wrap; gap:4px; }
.bbp-pagination-links .page-numbers{ display:inline-grid; place-items:center; min-inline-size:36px; block-size:36px; padding:0 10px; border-radius:var(--ats-radius-md); border:1px solid var(--ats-border); color:var(--ats-muted-strong); text-decoration:none; font-variant-numeric:tabular-nums; }
.bbp-pagination-links a.page-numbers:hover{ color:var(--ats-fg); border-color:var(--ats-border-strong); }
.bbp-pagination-links .page-numbers.current{ background:var(--ats-accent); border-color:var(--ats-accent); color:var(--ats-accent-ink); font-weight:600; }
.bbp-pagination-links .page-numbers.dots{ border-color:transparent; }
#bbpress-forums fieldset.bbp-form{ margin:24px 0 0; padding:20px; border:1px solid var(--ats-border); border-radius:var(--ats-radius-lg); background:var(--ats-surface); }
#bbpress-forums fieldset.bbp-form legend{ padding:0 6px; font-family:var(--ats-font-display); font-weight:600; color:var(--ats-fg); }
#bbpress-forums fieldset.bbp-form fieldset{ border:0; padding:0; margin:0; }
#bbpress-forums .bbp-form label{ display:block; margin:12px 0 6px; color:var(--ats-muted-strong); font-size:14px; font-weight:500; }
#bbpress-forums .bbp-form :where(input[type=text], input[type=email], input[type=url], input[type=password], select, textarea){
  inline-size:100%; min-block-size:44px; padding:0 12px; box-sizing:border-box; border-radius:var(--ats-radius-md); border:1px solid var(--ats-border-field); background:var(--ats-bg); color:var(--ats-fg); font:inherit; font-size:16px; }
#bbpress-forums .bbp-form textarea{ min-block-size:160px; padding-block:10px; line-height:1.5; }
#bbpress-forums .bbp-form :where(input, select, textarea):focus-visible{ outline:2px solid var(--ats-accent-text); outline-offset:1px; border-color:var(--ats-accent); }
#bbpress-forums .bbp-form .form-allowed-tags, #bbpress-forums .bbp-form .bbp-allowed-tags{ color:var(--ats-muted); font-size:12px; }
#bbpress-forums .bbp-form :where(code){ font-family:var(--ats-font-mono); font-size:11px; }
#bbpress-forums .bbp-submit-wrapper{ display:flex; justify-content:flex-end; margin-block-start:12px; }
#bbpress-forums .bbp-submit-wrapper button, #bbpress-forums .bbp-form .button.submit{ min-block-size:44px; padding:0 20px; border-radius:var(--ats-radius-md); border:0; background:var(--ats-accent); color:var(--ats-accent-ink); font:600 15px/1 var(--ats-font-body); cursor:pointer; transition:scale .15s; }
#bbpress-forums .bbp-submit-wrapper button:active{ scale:.96; }
#bbpress-forums .bbp-form .quicktags-toolbar{ background:var(--ats-bg); border-color:var(--ats-border); border-radius:var(--ats-radius-md) var(--ats-radius-md) 0 0; }
#bbpress-forums .bbp-form .quicktags-toolbar input.button{ background:var(--ats-surface); color:var(--ats-fg); border:1px solid var(--ats-border); border-radius:6px; min-block-size:28px; }
#bbpress-forums .bbp-the-content-wrapper textarea{ border-start-start-radius:0; border-start-end-radius:0; }
#bbpress-forums .bbp-no-reply, #bbpress-forums .bbp-no-topic, #bbpress-forums #bbp-user-wrapper{ color:var(--ats-fg); }
#bbpress-forums .bbp-topic-tags{ margin-block-start:16px; color:var(--ats-muted); font-size:13px; }
#bbpress-forums .bbp-topic-tags a{ color:var(--ats-muted-strong); }
.bbp-login-form, .bbp-form .bbp-login-form{ color:var(--ats-fg); }
