.ax-community-page {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}
.ax-community-page main { flex: 1; }

.community-cover .home-opening {
  min-height: clamp(240px, 23vw, 345px);
  padding-block: clamp(32px, 4vw, 60px);
}
.community-cover h1 {
  font-size: clamp(2.15rem, 5vw, 4.2rem);
  letter-spacing: -.035em;
}
.community-cover .home-actions { margin-top: 22px; }
.community-cover .home-photo { object-position: 60% 56%; }

.community-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 clamp(14px, 2vw, 28px);
  padding-block: 4px;
  border-bottom: 1px solid var(--rule);
  color: var(--green);
}
.community-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.community-links a:hover { text-decoration: underline; }

.community-layout {
  grid-template-columns: minmax(0, 1.14fr) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 80px);
  padding-block-start: clamp(26px, 4vw, 60px);
}
.community-layout section { min-width: 0; }
.community-layout p { word-break: keep-all; overflow-wrap: anywhere; }
.community-layout .small { color: var(--muted); font-size: .89rem; }

.community-compose { padding: clamp(18px, 3vw, 38px); }
.community-intro { margin-top: 6px; color: var(--muted); }
.community-import {
  margin-block: 20px 22px;
  padding-block: 4px;
  border-block: 1px solid var(--gold);
}
.community-import summary {
  align-content: center;
  min-height: 46px;
  color: var(--green);
  font-weight: 700;
}
.community-import[open] { padding-bottom: 16px; }
.community-import p + button { margin-top: 10px; }
.community-import .button { white-space: normal; }
.community-layout :is(form, #draft-editor, .community-import) > label:not(.consent),
.community-layout legend {
  display: block;
  margin-block-start: 14px;
  color: var(--green);
  font-weight: 700;
}
.community-layout fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.community-layout legend { margin: 0 0 5px; padding: 0; }
.community-types { display: flex; flex-wrap: wrap; gap: 5px 8px; }
.community-types label {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  cursor: pointer;
}
.community-types label:has(:checked) {
  border-color: var(--green);
  background: var(--active);
  color: var(--green);
  font-weight: 600;
}
.community-layout input:is([type="checkbox"], [type="radio"]) {
  flex: none;
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  accent-color: var(--green);
}
.community-layout :is(input[type="text"], textarea) {
  display: block;
  width: 100%;
  min-height: 44px;
  margin: 5px 0 8px;
  padding: 9px 11px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--ivory);
  color: var(--ink);
  font: inherit;
  caret-color: var(--green);
}
.community-layout textarea { resize: vertical; }
.community-layout :is(input[type="text"], textarea)::placeholder { color: var(--muted); }
.community-layout input[type="file"] {
  display: block;
  max-width: 100%;
  min-height: 44px;
  margin: 5px 0;
  color: var(--ink);
  font-size: .89rem;
}
.community-layout input[type="file"]::file-selector-button {
  min-height: 44px;
  margin-inline-end: 8px;
  padding-inline: 8px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--ivory);
  color: var(--green);
  font: inherit;
  cursor: pointer;
}
.community-layout .consent {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-block: 16px 14px;
  padding-block: 2px;
  font-size: .94rem;
  cursor: pointer;
}
.community-layout .consent input { margin-top: .24rem; }
#voice-status, .community-layout [role="status"] { margin-top: 6px; }
.community-layout [role="status"]:empty { margin: 0; }
#result { color: var(--green); font-weight: 600; }

.community-preview {
  margin-top: 12px;
  padding: clamp(12px, 2vw, 20px);
  border: 1px solid var(--panel-border, var(--rule));
  background: var(--ivory);
}
.community-preview h3 { font-size: 1.14rem; overflow-wrap: anywhere; }
.community-preview .post-body { max-height: 16rem; overflow: auto; scrollbar-color: var(--rule) var(--ivory); }
.community-preview .post-body + p { margin-block: 9px 12px; }

#posts-status:not(:empty), .community-posts {
  margin-top: 14px;
  border-top: 1px solid var(--gold);
}
#posts-status:not(:empty) { padding-block: 14px; color: var(--muted); }
.community-post {
  padding-block: 15px 20px;
  border-bottom: 1px solid var(--rule);
  overflow-wrap: anywhere;
}
.community-post h3 {
  margin-block: 3px 6px;
  color: var(--green);
  font-size: clamp(1.14rem, 1.9vw, 1.45rem);
}
.community-post h3 a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
}
.community-post h3 a:hover { text-decoration: underline; }
.community-post time { font-variant-numeric: tabular-nums; }
.community-post-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 8px;
  margin-top: 12px;
}
.post-body { white-space: pre-wrap; overflow-wrap: anywhere; }

@media (max-width: 780px) {
  .community-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
}
@media (max-width: 710px) {
  .community-cover .home-opening { min-height: 265px; }
  .community-cover .home-photo {
    inset: 0 0 0 auto;
    width: 76%;
    height: 100%;
    opacity: .37;
    mask-image: linear-gradient(to right, transparent, #000 53%);
  }
  .community-cover .home-actions { margin-top: 15px; }
}

/* Local moderation page. */
body:not(.ax-community-page) main { font-size: 18px; }
body:not(.ax-community-page) label { display: block; margin-top: 10px; }
body:not(.ax-community-page) :is(input[type="password"], textarea) {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 8px 0;
  padding: 10px;
  border: 1px solid #819b8d;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
}
body:not(.ax-community-page) details.review {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid #9bb2a3;
  border-radius: 8px;
  overflow-wrap: anywhere;
}
body:not(.ax-community-page) summary { cursor: pointer; font-weight: 700; font-size: 18px; }
body:not(.ax-community-page) button { min-height: 44px; margin: 4px 4px 4px 0; font-size: 17px; }
body:not(.ax-community-page) button:disabled { opacity: .6; }
body:not(.ax-community-page) pre {
  max-height: 350px;
  overflow: auto;
  padding: 8px;
  border: 1px solid #aab9b0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 13px;
}
body:not(.ax-community-page) .small { font-size: 14px; }

/* Set the direct writing view before the composer module is ready. */
.community-writing .ax-community-page > :is(.skip, .site-header, .site-footer),
.community-writing :is(.community-cover, .community-links, #published),
.community-writing #write:not([data-editing]) :is(.community-import, #draft-editor) {
  display: none;
}
.community-writing .community-layout {
  grid-template-columns: minmax(0, 1fr);
  max-width: 42rem;
}
