/* ==========================================================================
   Communities page
   ========================================================================== */

/* Header styling (only affects this page because this file is page-scoped) */
.dv-box > h2{
  margin: 4px 0 2px;
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: .3px;
  color: var(--ink);
  font-weight: 800;
  position: relative;
}
.dv-box > h2::after{
  content: "";
  display: block;
  width: 64px;
  height: 3px;
  margin-top: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--link), transparent 75%);
}
.dv-box > p.muted{
  margin: 6px 0 10px;
  color: var(--muted);
}
.dv-box > p.muted small{
  font-size: .96rem;
  line-height: 1.35;
  opacity: .95;
}

/* Grid */
.community-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin: 12px 0;
}

/* Card */
.community-card{
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  height: 100%;
  transition: border-color .12s, box-shadow .12s, transform .12s, background .12s;
}

/* Clickable content */
.community-card a{
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 64px;
  color: inherit;
  text-decoration: none;
}

/* IMPORTANT: allow grid children to shrink so long lines wrap instead of overlapping */
.community-card a > *{ min-width: 0; }

/* Icon (no artificial background) */
.community-card img{
  display: block;
  width: 64px;
  height: 64px;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: 6px;
  border: 0;                  /* no border tile */
  background: transparent;    /* no white tile */
  box-shadow: none;
}

/* Text column */
.community-meta{ min-width: 0; display: flex; flex-direction: column; }
.community-meta h3{
  margin: 0 0 .25rem;
  font-size: 1rem;
  line-height: 1.25;
  color: var(--ink);
  /* wrap naturally – no ellipsis */
  white-space: normal;
  overflow-wrap: anywhere;
}
.community-meta p{
  margin: 0;
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.4;
  /* no clamping: show full blurb */
  display: block;
  overflow: visible;
}

/* Hover / focus */
.community-card:hover,
.community-card:focus-within{
  transform: translateY(-1px);
  border-color: color-mix(in oklab, var(--link) 35%, var(--line));
  box-shadow: 0 3px 14px rgba(0,0,0,.12);
}
.community-card a:focus-visible{
  outline: 2px solid var(--link);
  outline-offset: 2px;
  border-radius: 6px;
  text-decoration: none;
}

/* Small screens */
@media (max-width: 520px){
  .community-card{ padding: 10px; }
  .community-card a{ grid-template-columns: 52px 1fr; gap: 10px; min-height: 52px; }
  .community-card img{ width: 52px; height: 52px; border-radius: 5px; }
  .community-meta h3{ font-size: .98rem; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  .community-card{ transition: none; }
}
