/* Community discovery: search, results, then optional help. */
:root {
  --space-small: 8px;
  --space-medium: 12px;
  --space-panel: 16px;
  --space-section: 20px;
}
.community-page {
  max-width: 1000px;
  margin: 0 auto;
}
.community-page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.community-page .community-page-heading h1 {
  flex-shrink: 0;
  font-size: 26px;
  letter-spacing: -0.9px;
  margin: 0;
}
.community-discovery-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(48%, 440px);
  min-width: 0;
}
#find-community.community-search {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  gap: 10px;
  margin: 0;
  padding: 0 0 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--white);
}
.community-search:focus-within {
  box-shadow: 0 0 0 2px #19345520;
  border-color: var(--brand);
}
.community-search > span {
  display: flex;
  color: var(--muted);
}
.community-search svg {
  width: 20px;
  height: 20px;
}
.community-search input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  font-size: 15px;
}
.community-search input:focus-visible {
  outline-offset: 0;
}
.community-search button {
  min-height: 44px;
  padding-inline: 16px;
  border-radius: 8px;
}
.community-search-submit-icon {
  display: none;
}
.community-location-trigger {
  position: relative;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 12px;
  background: transparent;
}
.community-location-trigger svg {
  width: 23px;
  height: 23px;
}
.community-location-trigger.has-location::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
}
.community-section {
  margin: 12px 0 0;
}
.community-section-heading h2,
.community-discover > h2:not(.sr-only) {
  font-size: 16px;
  margin: 0 0 12px;
}
.community-section-heading h2 > span {
  margin-left: 6px;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
}
.community-result-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 0 0 12px;
  border-bottom: 1px solid var(--line);
}
.community-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}
.community-filters button {
  min-height: 44px;
  padding: 8px 0 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
}
.community-filters button[aria-pressed="true"] {
  color: var(--brand);
  border-bottom-color: var(--brand);
}
.community-filters button:hover {
  color: var(--brand);
}
.community-result-count {
  padding-bottom: 6px;
  font-size: 12px;
  color: var(--muted);
}
.community-cards {
  display: grid;
  gap: 12px;
}
.community-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: start;
  gap: 20px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  min-width: 0;
}
.community-avatar {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  background: var(--brand-soft);
  color: var(--brand);
  border: 1px solid var(--line);
  border-radius: 14px;
  font-family: Georgia, serif;
  font-size: 24px;
  letter-spacing: -1px;
}
.community-card:nth-child(3n + 2) .community-avatar {
  background: #eee6d9;
  border-color: #e4d9c8;
  color: #785c3a;
}
.community-card:nth-child(3n) .community-avatar {
  background: #e1e9eb;
  border-color: #d2dfe2;
  color: #3c6069;
}
.community-card-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.community-card h3 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.2px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.community-role {
  font-size: 11px;
  background: var(--brand-soft);
  border-radius: 5px;
  color: var(--brand);
  padding: 3px 7px;
}
.community-role.pending {
  background: #f5ecdc;
  color: #805b2d;
}
.community-place {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.community-place span {
  padding-inline: 3px;
}
.community-description {
  margin: 12px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.community-access {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
}
.community-access svg {
  flex-shrink: 0;
}
.community-card-actions {
  display: flex;
  align-self: center;
  flex-direction: column;
  gap: 8px;
  min-width: 175px;
}
.community-card-actions button,
.community-card-actions a {
  min-height: 44px;
}
.community-card-actions .primary {
  justify-content: space-between;
  padding-inline: 16px;
}
.community-manage {
  background: transparent;
  font-size: 12px;
  flex-wrap: wrap;
}
.community-action-note {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
}
.community-directory-footer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 24px;
  margin-top: 18px;
  font-size: 12px;
  color: var(--muted);
}
.community-directory-footer > p {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0 6px;
  margin: 0;
}
.community-joining summary {
  cursor: pointer;
  min-height: 44px;
  padding-block: 14px;
  color: var(--brand);
  font-weight: 550;
}
.community-joining ol {
  padding-left: 18px;
  max-width: 440px;
  margin: 0 0 12px;
  line-height: 1.7;
}
.community-joining li + li {
  margin-top: 8px;
}
.community-text-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: inherit;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
}
.community-text-action:hover {
  background: transparent;
  text-decoration: underline;
}
.community-utilities {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.community-utilities button {
  min-height: 44px;
  font-size: 12px;
  background: transparent;
}
.community-empty {
  padding: 24px 0;
}
.community-empty > span {
  display: none;
}
.community-empty h3 {
  font-size: 16px;
  margin: 0 0 8px;
}
.community-empty p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.6;
}
.community-location-current {
  padding: 12px 14px;
  margin: 16px 0;
  background: var(--brand-soft);
  border-radius: 8px;
}
.community-location-current strong {
  display: block;
  margin-bottom: 4px;
}
.community-location-current p,
.community-location-intro {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.city-dialog #locate-communities {
  width: 100%;
  min-height: 44px;
  margin-bottom: 16px;
}
.community-location-status {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}
.community-location-status:empty {
  display: none;
}
.community-footnote {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
  margin: 14px 0 0;
}
@media (max-width: 600px) {
  .community-page-heading {
    gap: 10px;
  }
  .community-page .community-page-heading h1 {
    font-size: 22px;
    letter-spacing: -0.6px;
    margin: 0;
  }
  .community-discovery-bar {
    flex: 1;
    width: auto;
    gap: 6px;
  }
  #find-community.community-search {
    gap: 0;
    padding-left: 8px;
  }
  .community-search > span,
  .community-search-label {
    display: none;
  }
  .community-search input {
    font-size: 16px;
  }
  .community-search button {
    flex: 0 0 44px;
    width: 44px;
    padding: 0;
  }
  .community-search-submit-icon {
    display: flex;
  }
  .community-filters {
    gap: 16px;
  }
  .community-filters button {
    font-size: 12px;
  }
  .community-result-count {
    font-size: 11px;
  }
  .community-card {
    grid-template-columns: 44px minmax(0, 1fr);
    padding: 18px;
    gap: 16px 12px;
  }
  .community-avatar {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    font-size: 19px;
  }
  .community-card h3 {
    font-size: 17px;
  }
  .community-description {
    margin-block: 10px;
  }
  .community-card-actions {
    grid-column: 1 / -1;
    min-width: 0;
  }
  .community-directory-footer {
    margin-top: 10px;
  }
}

@media (max-width: 360px) {
  .community-page .community-page-heading h1 {
    font-size: 18px;
  }
  .community-page-heading {
    gap: 6px;
  }
  #find-community.community-search {
    padding-left: 6px;
  }
}
