/* ========================= community.css ========================= */
.comm-wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

/* Hero */
.comm-hero {
  padding: clamp(44px, 7vw, 80px) 0 clamp(28px, 4.5vw, 44px);
  text-align: center;
}
.comm-eyebrow {
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--brand);
  margin-bottom: 14px;
}
.comm-hero h1 {
  margin: 0 auto 16px;
  max-width: 820px;
}
.comm-lead {
  max-width: 720px;
  margin: 0 auto 28px;
  font-size: clamp(16px, 1.5vw, 19px);
  color: var(--muted);
}
.comm-cta {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Stats strip */
.comm-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  max-width: 780px;
  margin: 34px auto 0;
}
.comm-stat {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px 16px;
  box-shadow: var(--shadow-soft);
  text-align: center;
}
.comm-stat b {
  display: block;
  font-family: var(--font-head);
  font-size: clamp(22px, 2.8vw, 30px);
  color: var(--h2_colour);
  line-height: 1.15;
}
.comm-stat span {
  font-size: 13px;
  color: var(--muted);
}

/* Sections */
.comm-section {
  padding: clamp(32px, 5vw, 56px) 0;
}
.comm-head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto clamp(24px, 4vw, 36px);
}
.comm-head h2 {
  margin: 0 0 10px;
}
.comm-head p {
  margin: 0;
  color: var(--muted);
}

/* Repo Toolbar (auto-shown when 2+ repos exist) */
.comm-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 24px;
}
.comm-toolbar[hidden] {
  display: none;
}
.comm-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.comm-filter-pill {
  border: 0;
  border-radius: 999px;
  padding: 8px 16px;
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  background: var(--surface);
  color: var(--muted);
  box-shadow: var(--shadow-soft);
  transition: transform var(--transition), box-shadow var(--transition), color var(--transition);
}
.comm-filter-pill:hover {
  transform: translateY(-1px);
  color: var(--ink);
}
.comm-filter-pill.is-active {
  background: var(--brand);
  color: #ffffff;
  box-shadow: var(--shadow-soft);
}
[data-theme="dark"] .comm-filter-pill.is-active {
  color: #10201D;
}
.comm-search-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.comm-search {
  min-width: 230px;
  padding: 10px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  box-shadow: var(--shadow-inset);
  outline: none;
}
.comm-search::placeholder {
  color: var(--muted);
}
.comm-count {
  font-size: 13px;
  color: var(--muted);
}

/* Scalable Multi-Repo Grid */
.comm-repo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr));
  gap: 24px;
  align-items: start;
}
.comm-repo-grid.is-single {
  grid-template-columns: 1fr;
  max-width: 1020px;
  margin: 0 auto;
}

.comm-repo-card {
  background: var(--surface);
  border-radius: 24px;
  padding: clamp(22px, 3.5vw, 34px);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), box-shadow var(--transition);
}
.comm-repo-card:hover {
  transform: translateY(-3px);
}

.comm-proj-header {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.comm-proj-logo {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  border-radius: 18px;
  background: var(--surface-bright);
  box-shadow: var(--shadow-soft);
  padding: 9px;
  display: grid;
  place-items: center;
}
.comm-proj-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.comm-monogram {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 24px;
  color: var(--brand);
}
.comm-proj-title {
  flex: 1;
  min-width: 200px;
}
.comm-proj-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}
.comm-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--muted);
}
.comm-pill--cat {
  background: rgba(15, 118, 110, 0.12);
  color: #0F766E;
}
.comm-pill--status {
  background: rgba(52, 168, 83, 0.14);
  color: #15803d;
}
.comm-pill--featured {
  background: rgba(79, 70, 229, 0.12);
  color: #4338ca;
}
[data-theme="dark"] .comm-pill--cat {
  background: rgba(45, 212, 191, 0.16);
  color: #5EEAD4;
}
[data-theme="dark"] .comm-pill--status {
  background: rgba(74, 222, 128, 0.16);
  color: #86efac;
}
[data-theme="dark"] .comm-pill--featured {
  background: rgba(129, 140, 248, 0.18);
  color: #a5b4fc;
}

.comm-proj-title h3 {
  margin: 0 0 4px;
  font-size: clamp(21px, 2.3vw, 28px);
}
.comm-proj-title h3 a {
  color: var(--h3_colour);
}
.comm-proj-title h3 a:hover {
  color: var(--brand);
}
.comm-proj-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
}

.comm-overview {
  font-size: 15.5px;
  line-height: 1.68;
  color: var(--ink);
  margin: 0 0 18px;
}

.comm-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 20px;
}
.comm-badge {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}
.comm-badge--accent {
  background: rgba(15, 118, 110, 0.12);
  color: #0F766E;
}
[data-theme="dark"] .comm-badge--accent {
  background: rgba(45, 212, 191, 0.16);
  color: #5EEAD4;
}

/* Collapsible Features & Quick Start drawer */
.comm-details {
  margin: 0 0 22px;
  border-radius: var(--radius);
  background: var(--bg-soft);
  box-shadow: var(--shadow-inset);
  padding: 14px 18px;
}
.comm-details__summary {
  cursor: pointer;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 15px;
  color: var(--brand);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.comm-details__summary::-webkit-details-marker {
  display: none;
}
.comm-details__summary::after {
  content: "+";
  font-size: 18px;
  line-height: 1;
}
.comm-details[open] .comm-details__summary::after {
  content: "−";
}
.comm-details__body {
  margin-top: 16px;
}

/* Feature grid inside repo card */
.comm-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.comm-feature-card {
  background: var(--surface);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow-soft);
}
.comm-feature-card h4 {
  margin: 0 0 6px;
  font-size: 15.5px;
  color: var(--h4_colour);
}
.comm-feature-card p {
  margin: 0;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.55;
}

/* Quick Start code block */
.comm-quickstart {
  margin-top: 4px;
}
.comm-quickstart__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.comm-quickstart__top h4 {
  margin: 0;
  font-size: 15.5px;
}
.comm-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 0;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  background: var(--surface);
  color: var(--brand);
  box-shadow: var(--shadow-soft);
  transition: transform var(--transition), box-shadow var(--transition);
}
.comm-copy-btn:hover {
  transform: translateY(-1px);
}
.comm-copy-btn:active {
  box-shadow: var(--shadow-inset);
}
.comm-code {
  margin: 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: #161c26;
  color: #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.6;
  overflow-x: auto;
}

/* Project action bar */
.comm-actions {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.comm-empty {
  grid-column: 1 / -1;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
  color: var(--muted);
  box-shadow: var(--shadow-soft);
}

/* Contribution / Ways to Participate grid */
.comm-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.comm-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), box-shadow var(--transition);
}
.comm-card:hover {
  transform: translateY(-4px);
}
.comm-card__icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--bg-soft);
  box-shadow: var(--shadow-inset);
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  color: var(--brand);
}
.comm-card h3 {
  margin: 0 0 8px;
  font-size: 19px;
}
.comm-card p {
  margin: 0 0 18px;
  font-size: 14.5px;
  color: var(--muted);
}
.comm-card a.comm-link {
  margin-top: auto;
  font-weight: 600;
  color: var(--brand);
}
.comm-card a.comm-link::after {
  content: " →";
}

/* License & Brand Notice callout */
.comm-notice {
  background: var(--surface);
  border-radius: var(--radius);
  padding: clamp(22px, 3.5vw, 32px);
  box-shadow: var(--shadow-soft);
  border-left: 4px solid var(--brand);
}
.comm-notice h3 {
  margin: 0 0 10px;
  font-size: 19px;
}
.comm-notice p {
  margin: 0 0 10px;
  font-size: 14.5px;
  color: var(--muted);
}
.comm-notice p:last-child {
  margin-bottom: 0;
}

/* Connect Banner */
.comm-banner {
  background: var(--surface);
  border-radius: 24px;
  padding: clamp(28px, 5vw, 48px);
  box-shadow: var(--shadow-soft);
  text-align: center;
}
.comm-banner h2 {
  margin: 0 0 12px;
}
.comm-banner p {
  max-width: 620px;
  margin: 0 auto 24px;
  color: var(--muted);
}

@media (max-width: 640px) {
  .comm-proj-header {
    gap: 14px;
  }
  .comm-proj-logo {
    width: 60px;
    height: 60px;
    flex-basis: 60px;
  }
  .comm-repo-card {
    padding: 20px;
  }
}
