/* Extracted from templates/communities/communities_directory.html (Phase 3.1). Page-local styles; global rules belong in the design system sheets. */
/* ── Page ─────────────────────────────────────────────────────── */
.comm-page { padding-bottom: 3rem; }

/* ── Hero ─────────────────────────────────────────────────────── */
.comm-hero {
  background: linear-gradient(135deg, #0f2942 0%, #17517a 55%, #1e6b8a 100%);
  border-radius: 16px;
  padding: 2.75rem 2.25rem;
  margin-bottom: 1.75rem;
  position: relative;
  overflow: hidden;
}
.comm-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.07) 1px, transparent 1px);
  background-size: 22px 22px;
  pointer-events: none;
}
.comm-hero-inner { position: relative; }
.comm-hero-title {
  margin: 0 0 0.35rem;
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.025em;
}
.comm-hero-sub {
  margin: 0 0 0.9rem;
  color: rgba(255,255,255,0.72);
  font-size: 1rem;
}
.comm-hero-bottom {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.comm-hero-badge {
  display: inline-block;
  background: rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.9);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 999px;
  padding: 0.25rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 600;
  backdrop-filter: blur(6px);
}
.comm-hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255,255,255,0.18);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  backdrop-filter: blur(6px);
  transition: background 0.15s, border-color 0.15s;
}
.comm-hero-cta:hover {
  background: rgba(255,255,255,0.28);
  border-color: rgba(255,255,255,0.45);
  color: #fff;
  text-decoration: none;
}

/* ── Controls ─────────────────────────────────────────────────── */
.comm-controls {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
  align-items: center;
}
.comm-search-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
  display: flex;
  align-items: center;
}
.comm-search-ico {
  position: absolute;
  left: 0.9rem;
  color: var(--text-muted, #9ca3af);
  pointer-events: none;
  flex-shrink: 0;
}
.comm-search-inp {
  width: 100%;
  padding: 0.7rem 2.5rem 0.7rem 2.6rem;
  border: 1.5px solid var(--border, #e5e7eb);
  border-radius: 10px;
  font-size: 0.95rem;
  background: var(--bg-card, #fff);
  color: var(--text-heading, #111);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
.comm-search-inp:focus {
  border-color: #2d6a8a;
  box-shadow: 0 0 0 3px rgba(45,106,138,0.12);
}
.comm-search-clear {
  position: absolute;
  right: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-muted, #f3f4f6);
  border: none;
  border-radius: 999px;
  width: 20px; height: 20px;
  cursor: pointer;
  color: var(--text-muted, #6b7280);
  padding: 0;
}
.comm-search-clear:hover { background: #e5e7eb; }

/* Pills */
.comm-pills { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.comm-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.48rem 0.95rem;
  border: 1.5px solid var(--border, #e5e7eb);
  border-radius: 999px;
  background: var(--bg-card, #fff);
  color: var(--text-muted, #6b7280);
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.comm-pill:hover { border-color: #2d6a8a; color: #2d6a8a; }
.comm-pill--active { background: #0f2942; border-color: #0f2942; color: #fff; }

/* ── Results meta ─────────────────────────────────────────────── */
.comm-results-meta {
  font-size: 0.82rem;
  color: var(--text-muted, #9ca3af);
  margin-bottom: 0.9rem;
  min-height: 1.2em;
}

/* ── Grid ─────────────────────────────────────────────────────── */
.comm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
  gap: 1.25rem;
}

/* ── Card ─────────────────────────────────────────────────────── */
.comm-card {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}
.comm-card:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  transform: translateY(-3px);
  border-color: #b8d4e4;
}

/* Banner */
.comm-card-banner {
  position: relative;
  height: 120px;
  background: var(--bg-muted, #f3f4f6);
  flex-shrink: 0;
}
.comm-card-banner-img { width: 100%; height: 100%; object-fit: cover; }
.comm-card-banner-bg {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #0f2942 0%, #17517a 50%, #1e8a72 100%);
}

/* Verified badge on banner */
.comm-verified-pill {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(21,128,61,0.88);
  color: #fff;
  border-radius: 999px;
  padding: 0.22rem 0.55rem;
  font-size: 0.7rem;
  font-weight: 600;
  backdrop-filter: blur(4px);
}
.comm-gated-pill {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(217,119,6,0.88);
  color: #fff;
  border-radius: 999px;
  padding: 0.22rem 0.55rem;
  font-size: 0.7rem;
  font-weight: 600;
  backdrop-filter: blur(4px);
}

/* Logo avatar — overflows banner into body */
.comm-card-logo-wrap {
  position: absolute;
  top: 94px; /* banner_height - logo_height/2 = 120 - 26 */
  left: 1rem;
  width: 52px; height: 52px;
  border-radius: 10px;
  background: var(--bg-card, #fff);
  border: 2.5px solid var(--bg-card, #fff);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
  z-index: 1;
}
.comm-card-logo { width: 100%; height: 100%; object-fit: cover; }
.comm-card-initial {
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #0f2942, #2d6a8a);
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
}

/* Card body */
.comm-card-body {
  padding: 2rem 1rem 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.comm-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}
.comm-card-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-heading, #111);
  line-height: 1.25;
}
.comm-type-pill {
  display: inline-block;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.comm-type-facility   { background: #eff6ff; color: #1d4ed8; }
.comm-type-association { background: #f0fdf4; color: #15803d; }

.comm-card-loc {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted, #6b7280);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.comm-card-desc {
  font-size: 0.83rem;
  color: var(--text-muted, #6b7280);
  margin: 0;
  line-height: 1.45;
  flex: 1;
}

/* Footer row */
.comm-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border, #f3f4f6);
}
.comm-card-followers {
  font-size: 0.78rem;
  color: var(--text-muted, #9ca3af);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.comm-card-cta {
  font-size: 0.78rem;
  color: #2d6a8a;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.comm-card:hover .comm-card-cta { opacity: 1; }

/* ── Empty state ──────────────────────────────────────────────── */
.comm-empty {
  text-align: center;
  padding: 4.5rem 1rem;
  color: var(--text-muted, #9ca3af);
  background: var(--bg-card, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 14px;
}
.comm-empty-icon { margin-bottom: 1rem; }
.comm-empty h3 { margin: 0 0 0.4rem; color: var(--text-heading, #111); font-size: 1.1rem; }
.comm-empty p  { margin: 0 0 1.5rem; font-size: 0.9rem; }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 600px) {
  .comm-hero { padding: 1.75rem 1.25rem; }
  .comm-hero-title { font-size: 1.6rem; }
  .comm-controls { flex-direction: column; align-items: stretch; }
  .comm-pills { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; -webkit-overflow-scrolling: touch; }
  .comm-grid { grid-template-columns: 1fr; }
}
