.communities-page__layout {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  align-items: start;
}

.communities-directory__header {
  margin-bottom: 22px;
}

.communities-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.communities-overview article {
  display: grid;
  place-items: center;
  min-height: 110px;
  padding: 16px;
  text-align: center;
  background: #eef9fc;
  border: 1px solid rgba(0, 146, 191, 0.18);
  border-radius: 10px;
}

.communities-overview strong {
  color: #004a6a;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1;
}

.communities-overview span {
  color: #50677a;
  font-weight: 800;
}

.communities-directory__link {
  display: grid;
  align-content: center;
  gap: 4px;
}

.communities-directory__link small {
  color: #607789;
  font-size: 0.84rem;
  font-weight: 700;
}

.communities-directory__link:hover small,
.communities-directory__link:focus-visible small {
  color: rgba(255, 255, 255, 0.84);
}

.community-detail {
  overflow: hidden;
}

.community-detail__header {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(20, 35, 58, 0.1);
}

.community-detail__header h2,
.community-members h2 {
  margin: 0;
  color: #073d52;
  font-size: clamp(1.55rem, 2.4vw, 2.2rem);
  line-height: 1.15;
}

.community-detail__header p:last-child {
  max-width: 78ch;
  margin-bottom: 0;
  color: #50677a;
  line-height: 1.7;
}

.community-detail__feed {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 30px;
}

.community-detail__feed article,
.community-members li {
  background: #ffffff;
  border: 1px solid rgba(20, 35, 58, 0.12);
  border-radius: 10px;
  box-shadow: 0 14px 30px rgba(20, 35, 58, 0.06);
}

.community-detail__feed article {
  display: flex;
  min-height: 220px;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
}

.community-detail__feed span {
  align-self: flex-start;
  min-height: 28px;
  padding: 5px 10px;
  color: #004a6a;
  background: #eef9fc;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.community-detail__feed h3 {
  margin: 0;
  color: #14233a;
  font-size: 1.06rem;
  line-height: 1.35;
}

.community-detail__feed time {
  color: #637488;
  font-size: 0.9rem;
  font-weight: 700;
}

.community-detail__feed a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin-top: auto;
  padding: 9px 14px;
  color: #ffffff;
  background: #004a6a;
  border: 1px solid #004a6a;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 800;
}

.community-detail__feed a:hover,
.community-detail__feed a:focus-visible {
  background: #0092bf;
  border-color: #0092bf;
}

.community-detail__feed a:focus-visible {
  outline: 3px solid #f6c343;
  outline-offset: 3px;
}

.community-members header {
  margin-bottom: 18px;
}

.community-members ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.community-members li {
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  border-left: 5px solid #0092bf;
}

.community-members strong {
  color: #073d52;
  font-size: 1rem;
}

.community-members span {
  color: #004a6a;
  font-weight: 800;
}

.community-members small {
  color: #607789;
  font-size: 0.88rem;
}

@media (max-width: 1100px) {
  .communities-page__layout {
    grid-template-columns: 1fr;
  }

  .communities-overview,
  .community-detail__feed {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .communities-overview,
  .community-detail__feed,
  .community-members ul,
  .communities-directory__list {
    grid-template-columns: 1fr;
  }
}
