/* Standalone community pages (/community/, /community/api-credits/ and English twins).
   Layout only, radar-ui tokens; ticket 284 C: page links left and two equal 36px controls right,
   the guide's title and article share one reading column, one line measure for paragraphs and
   lists, section headings with room above them, and a header that wraps cleanly on phones. */
.community-shell { width: min(1180px, calc(100% - 2 * var(--gutter))); margin: 0 auto; }

.community-page-header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--s-2) var(--s-4); padding: var(--s-4) 0; border-bottom: 1px solid var(--line-soft);
}
.community-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px var(--s-2); min-width: 0; font-size: var(--fs-sm); }
.community-crumbs a { display: inline-flex; align-items: center; min-height: 36px; color: var(--text-2); text-decoration: none; }
.community-crumbs a:first-child { color: var(--accent); }
.community-crumbs a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.community-crumbs > span { color: var(--text-3); }
.community-tools { display: inline-flex; align-items: center; gap: var(--s-2); flex: none; margin-left: auto; }
.community-tools > :is(.lang-switch, .community-theme-toggle) {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px; padding: 0 var(--s-3);
  border: 1px solid var(--line); border-radius: var(--r-md); background: transparent; color: var(--text-2);
  font: var(--w-semibold) var(--fs-xs)/1 var(--font-mono); letter-spacing: .04em; text-decoration: none; cursor: pointer;
}
.community-tools > .community-theme-toggle { width: 36px; padding: 0; font-size: var(--fs-md); }
.community-tools > :is(.lang-switch, .community-theme-toggle):hover { border-color: var(--accent-2); background: var(--surface-2); color: var(--accent); }
.community-page-header :is(a, button):focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.community-main { padding: var(--s-8) 0 var(--s-10); }
.community-shell h1 { margin: 0 0 var(--s-4); font-size: clamp(26px, 2vw + 16px, 36px); line-height: 1.2; text-wrap: balance; }
.community-main-index > h1 { margin-bottom: var(--s-2); }
.community-main-index .ck-head { margin-bottom: var(--s-4); }

/* Guide: title and article in one column, so the title is not left of a centred card. */
.community-main-guide { max-width: 780px; margin-inline: auto; }
.standalone-guide { max-width: none; }
.standalone-guide .community-knowledge-card {
  display: block !important; padding: clamp(16px, 3vw, 32px);
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface);
}
#community-notes.standalone-guide .community-knowledge-card :is(p, li) { max-width: none; line-height: 1.8; overflow-wrap: anywhere; }
#community-notes.standalone-guide .community-knowledge-guide h2 { margin: var(--s-8) 0 var(--s-3); font-size: var(--fs-xl); line-height: 1.35; }
#community-notes.standalone-guide .community-knowledge-guide > h2:first-child { margin-top: 0; }
.community-shell figure { padding: var(--s-2) 0; }
.community-shell figcaption { color: var(--text-2); font-size: var(--fs-xs); line-height: 1.7; }
.community-shell img { max-width: 100%; }
.community-shell .community-knowledge-guide { padding: var(--s-4) 0 0; }

.community-shell > footer {
  margin: 0; padding: var(--s-6) 0 var(--s-10); border-top: 1px solid var(--line-soft);
  color: var(--text-3); font: var(--fs-xs)/1.8 var(--font-mono);
}

@media (max-width: 600px) {
  .community-shell { width: calc(100% - 32px); }
  .community-page-header { padding: var(--s-3) 0; }
  .community-main { padding: var(--s-6) 0 var(--s-8); }
  .community-shell :is(ol, ul) { padding-left: 1.4rem; }
}
@media (forced-colors: active) {
  .community-tools > :is(.lang-switch, .community-theme-toggle) { border: 1px solid ButtonText; }
}
