.community-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.75fr) minmax(0, 1.25fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: start;
  padding: 12px 0 48px;
}
.community-compose {
  border-top: 3px solid var(--accent);
  padding-top: 24px;
}
.community-compose h2,
.community-feed h2 {
  font-size: 30px;
  letter-spacing: -0.035em;
}
.community-compose > p {
  color: var(--muted);
}
#community-form {
  display: grid;
  gap: 18px;
}
#community-form label {
  gap: 7px;
}
#community-form small,
#build-photo-help,
#facebook-help {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}
#community-form > button {
  justify-self: start;
}
.community-upload {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.community-upload input {
  padding: 8px;
  font-size: 13px;
}
.build-previews {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.build-previews figure {
  margin: 0;
  min-width: 0;
}
.build-previews img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 4px;
}
.build-previews button {
  width: 100%;
  min-height: 44px;
  padding: 6px;
  font-size: 13px;
}
.community-feed > header {
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.community-post {
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}
.community-post > header {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
}
.builder-initial {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: var(--ink);
  color: var(--surface);
  border-radius: 50%;
  font-weight: 700;
}
.community-post time {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
.community-post h3 {
  font-size: 26px;
  overflow-wrap: anywhere;
}
.community-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 22px 0;
}
.community-gallery[data-count='1'] {
  grid-template-columns: 1fr;
}
.community-gallery a {
  display: block;
  overflow: hidden;
  border-radius: 6px;
  background: var(--surface);
}
.community-gallery img {
  display: block;
  width: 100%;
  height: 240px;
  object-fit: cover;
  transition: transform 0.2s;
}
.community-gallery[data-count='1'] img {
  height: auto;
  max-height: 560px;
  object-fit: contain;
}
.community-gallery a:hover img {
  transform: scale(1.025);
}
.community-legacy-photo {
  display: block;
  width: 100%;
  max-height: 500px;
  object-fit: contain;
  margin: 20px 0;
}
.facebook-post-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  text-decoration: none;
  margin: 20px 0;
  background: var(--surface);
}
.facebook-post-link small,
.facebook-post-link strong,
.facebook-post-link span span {
  display: block;
}
.facebook-post-link small,
.facebook-post-link span span {
  font-size: 12px;
  color: var(--muted);
}
.facebook-post-link strong {
  margin: 4px 0;
}
.facebook-post-link b {
  font-size: 24px;
}
.community-reactions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  color: var(--muted);
}
.build-comment {
  padding: 14px 18px;
  border-left: 2px solid var(--line);
  margin: 12px 0;
  overflow-wrap: anywhere;
}
.build-comment p {
  margin: 4px 0;
}
.community-submissions {
  margin-top: 28px;
  border-top: 1px solid var(--line);
}
.community-submissions > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.community-submissions strong {
  overflow-wrap: anywhere;
}
.community-status {
  color: var(--accent);
  white-space: nowrap;
}
.community-empty {
  padding: 44px 0;
}
.community-empty p {
  color: var(--muted);
}
#community-form-status:empty {
  display: none;
}
#community-form-status[data-error] {
  color: #a42332;
}
#build-lightbox {
  padding: 14px;
  width: min(1000px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  border: 0;
  border-radius: 8px;
  background: var(--surface);
}
#build-lightbox::backdrop {
  background: #0d0d14db;
}
#build-lightbox button {
  display: block;
  margin: 0 0 12px auto;
}
#build-lightbox img {
  display: block;
  max-width: 100%;
  max-height: calc(100dvh - 120px);
  margin: auto;
  object-fit: contain;
}
@media (max-width: 900px) {
  .community-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .community-gallery img {
    height: 220px;
  }
}
@media (max-width: 420px) {
  .community-gallery img {
    height: 150px;
  }
  .community-compose h2,
  .community-feed h2 {
    font-size: 27px;
  }
  .facebook-post-link {
    padding: 16px;
  }
  .community-upload {
    padding: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .community-gallery img {
    transition: none;
  }
}
