.community-feed { min-width: 0; }
.community-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 16px 24px;
  padding-bottom: clamp(14px, 2vw, 22px);
  border-bottom: 1px solid var(--rule);
}
.community-filter {
  display: inline-block;
  min-width: 0;
  max-width: 100%;
}
.community-feed .community-filter select {
  display: block;
  max-width: 100%;
  min-height: 46px;
  padding: 9px 44px 9px 16px;
  appearance: none;
  color: var(--text);
  border: 1px solid var(--input-border);
  border-radius: var(--control-radius);
  background-color: var(--panel);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='m1 1.5 5 5 5-5' fill='none' stroke='%237c7c7c' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: right 16px center;
  background-repeat: no-repeat;
  background-size: 12px 8px;
  font: 500 .9375rem / 1.35 Geist, system-ui, sans-serif;
  cursor: pointer;
}
.community-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 38px) clamp(10px, 2.1vw, 28px);
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 800px) {
  .community-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.community-item { min-width: 0; }
.community-tile {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1vw, 13px);
  height: 100%;
  color: var(--text);
  text-decoration: none;
}
.community-preview {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 1;
  border-radius: 8px;
  background: var(--panel-raised);
}
@media (min-width: 800px) {
  .community-preview { aspect-ratio: 4 / 3; }
}
.community-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.community-video-mark {
  display: grid;
  position: absolute;
  top: 8px;
  right: 8px;
  place-items: center;
  width: 27px;
  height: 27px;
  border: 1px solid rgb(255 255 255 / 58%);
  border-radius: 50%;
  background: rgb(0 0 0 / 76%);
  color: white;
}
.community-video-mark svg { width: 14px; height: 14px; }
.community-copy {
  display: grid;
  align-content: start;
  gap: 5px;
}
.community-byline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16px;
  align-items: start;
  column-gap: 6px;
  font-size: clamp(.8125rem, 1vw, .95rem);
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.community-platform { color: var(--muted); }
.community-platform svg { display: block; width: 16px; height: 16px; }
.community-excerpt {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
  font-size: clamp(.875rem, 1.1vw, 1rem);
  line-height: 1.4;
}
.community-copy time { color: var(--muted); font-size: .77rem; line-height: 1.4; }
.community-tile:not(:has(.community-preview:not([hidden]))) .community-copy {
  padding: clamp(12px, 2vw, 22px);
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--panel);
  gap: 10px;
}
.community-tile:not(:has(.community-preview:not([hidden]))) .community-excerpt { -webkit-line-clamp: 5; }
.community-tile:is(:hover, :focus-visible) .community-excerpt { text-decoration: underline; text-underline-offset: .18em; }
.community-empty { color: var(--muted); }
.community-more,
.community-archive summary {
  display: flex;
  width: max-content;
  max-width: 100%;
  justify-content: center;
  align-items: center;
  min-height: 46px;
  margin: clamp(18px, 2.6vw, 32px) auto 0;
  padding: 10px 12px;
  border: 0;
  background: none;
  color: var(--muted);
  font: 700 .875rem / 1.35 Geist, system-ui, sans-serif;
  text-decoration: underline;
  text-underline-offset: .23em;
  list-style: none;
  cursor: pointer;
}
.community-archive summary::-webkit-details-marker { display: none; }
.community-more:hover, .community-archive summary:hover { color: var(--text); }
.community-archive .community-grid { margin-top: 20px; }

.community-dialog-open { overflow: hidden; }
.community-dialog {
  box-sizing: border-box;
  width: min(650px, calc(100% - 28px));
  max-width: none;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 16px;
  background: var(--panel);
  color: var(--text);
  overflow: hidden;
}
.community-dialog[open] { display: flex; flex-direction: column; }
.community-dialog::backdrop { background: rgb(0 0 0 / 76%); }
.community-dialog-head,
.community-dialog-foot { flex: none; padding: 12px clamp(14px, 2.3vw, 24px); }
.community-dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--rule);
}
.community-dialog-head h3 { font-size: clamp(1.05rem, 2vw, 1.28rem); line-height: 1.22; }
.community-dialog-byline { margin-top: 3px; color: var(--muted); font-size: .8125rem; }
.community-close {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--input-border);
  border-radius: 50%;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}
.community-close:hover { background: var(--panel-raised); }
.community-dialog-body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.community-dialog-media:empty { display: none; }
.community-dialog-media { background: #0d0d0d; }
.community-dialog-media iframe {
  display: block;
  width: 100%;
  border: 0;
  aspect-ratio: 16 / 9;
}
.community-dialog-media[data-platform="instagram"] iframe,
.community-dialog-media[data-platform="facebook"][data-type="photo"] iframe {
  height: min(74vh, 650px);
  height: min(74dvh, 650px);
  min-height: min(420px, 62vh);
}
.community-dialog-media img { width: 100%; max-height: 64vh; object-fit: contain; }
.community-dialog-caption {
  padding: 16px clamp(14px, 2.3vw, 24px);
  white-space: pre-line;
  overflow-wrap: anywhere;
  line-height: 1.5;
}
.community-dialog-foot {
  border-top: 1px solid var(--rule);
  background: var(--panel);
  padding-block: 5px;
}
.community-original {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--accent-text);
  font-weight: 700;
  font-size: .875rem;
}
@media (max-width: 599px) {
  .community-heading { display: grid; gap: 12px; }
  .community-filter { justify-self: start; }
  .community-dialog {
    width: calc(100% - 16px);
    max-height: calc(100dvh - 16px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    border-radius: 12px;
  }
}
@media (forced-colors: active) {
  .community-feed .community-filter select { appearance: auto; background-image: none; }
}
