/* Community polish (as-6ty.227). Presentation only; loaded after
   community.css so it wins at equal specificity. Behaviour, copy and the
   state machine in community.js are untouched. */

/* Section heads: top-aligned so side-by-side heads share a baseline whatever
   their length, and a heading that wraps in the narrow column no longer
   drags its link down. */
.community-section-heading { align-items: flex-start; margin-bottom: 20px; }
.community-section-heading h2 { font-size: clamp(26px, 2.4vw, 32px); text-wrap: balance; }
.community-section-heading p { line-height: 1.55; }
.community-section-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-top: 2px;
  text-underline-offset: 4px;
}
.community-section-link:hover { text-decoration: underline; }

/* Error panels: a failed feed is routine here, so it is a quiet outlined
   panel, not a red slab. Same tokens, lower intensity. */
.state-error {
  border-color: color-mix(in srgb, var(--danger) 55%, var(--border));
}
.state-panel h2,
.state-panel h3 { font-size: 17px; font-weight: 650; }
.state-panel .state-actions { margin-top: 16px; }

/* Toolbar fields share one rhythm. */
.community-toolbar { gap: 14px; padding: 18px; }
.community-toolbar :is(input, select):hover:not(:focus) { border-color: rgba(239, 240, 244, .3); }
.community-toolbar :focus-visible,
.community-section-link:focus-visible { outline: 2px solid var(--focus-ring, var(--air)); outline-offset: 2px; }

/* Checkbox rows: the whole row is already one 44px label target; the box
   itself is drawn at a size that is easy to see and hit. */
.community-check input,
.terms-check input { width: 20px; height: 20px; flex: 0 0 auto; }
.terms-check input { margin-top: 1px; }
.terms-check label { cursor: pointer; }
.community-check { cursor: pointer; }

@media (max-width: 600px) {
  .community-section-heading { flex-direction: column; gap: 4px; }
  .community-section-heading h2 { font-size: 26px; }
  .community-section-link { min-height: 44px; margin-top: 0; }
  .community-toolbar { padding: 16px; }
}

/* READING theme (as-3azc): community lists on the white page. Gated on
   body.reading. Prose stays in the reading measure; toolbars, grids and cards
   use the shell width. */
body.reading .community-toolbar :is(input, select):hover:not(:focus) { border-color: var(--text-1); }
body.reading .state-error { border-color: var(--danger); }

/* Full-width shell: the three width-capped containers follow the page gutters
   instead of --max, and the masthead drops its glow for a plain rule. */
body.reading .community-subnav-inner,
body.reading .community-masthead-inner,
body.reading .community-section { width: 100%; max-width: none; margin: 0; padding-inline: var(--shell-gutter); }
body.reading .community-masthead-inner { padding-block: clamp(40px, 4.5vw, 80px) clamp(28px, 3vw, 54px); }
body.reading .community-masthead::before { content: none; }
body.reading .community-masthead { background: var(--bg-0); }
body.reading .community-masthead-copy,
body.reading .community-masthead h1,
body.reading .community-masthead-lead { max-width: var(--reading-measure); }
body.reading .community-masthead h1 { font-size: clamp(32px, 2.6vw + 12px, 64px); letter-spacing: -.035em; }
body.reading .community-masthead-lead { font-size: calc(var(--reading-size) * 1.15); color: var(--text-2); }
body.reading .detail-shell { width: 100%; max-width: none; margin: 0; padding-inline: var(--shell-gutter); }
body.reading .detail-shell > * { max-width: var(--reading-measure); }
