/* ===================================================================
   Community Data Hub — Styles
   =================================================================== */

/* ── Hero ────────────────────────────────────────────────────────── */
.cdh-hero {
  background: linear-gradient(135deg, #1a5276 0%, #2e86c1 100%);
  color: #fff;
  padding: 2.5rem 1.5rem 2rem;
  text-align: center;
}

.cdh-hero-inner {
  max-width: 700px;
  margin: 0 auto;
}

.cdh-hero h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: #fff;
}

.cdh-hero-desc {
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0;
  color: #fff;
}

/* ── Geography tip ───────────────────────────────────────────────── */
.cdh-tip {
  max-width: 900px;
  margin: 1rem auto;
  padding: 0.75rem 1.25rem;
  background: #fffde7;
  border-left: 3px solid #f9a825;
  border-radius: 0 6px 6px 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #000;
}

/* ── Filter bar ──────────────────────────────────────────────────── */
.cdh-filter-bar {
  max-width: 900px;
  margin: 1rem auto 0.5rem;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.cdh-filter-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #000;
  margin-right: 0.25rem;
}

.cdh-chip {
  display: inline-block;
  padding: 0.3rem 0.85rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid #ccc;
  background: #fff;
  color: #000;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  user-select: none;
}

.cdh-chip:hover {
  border-color: #2e86c1;
  color: #2e86c1;
}

.cdh-chip--active {
  background: #2e86c1;
  color: #fff;
  border-color: #2e86c1;
}

.cdh-chip--active:hover {
  background: #1a5276;
  border-color: #1a5276;
  color: #fff;
}

/* ── Card grid ───────────────────────────────────────────────────── */
.cdh-grid {
  max-width: 900px;
  margin: 1rem auto;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

/* ── Card ────────────────────────────────────────────────────────── */
.cdh-card {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.cdh-card:hover {
  border-color: #90caf9;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.cdh-card--expanded {
  grid-column: 1 / -1;
  border-color: #2e86c1;
  border-width: 2px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* Card header (always visible) */
.cdh-card-header {
  padding: 0.875rem 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
}

.cdh-card--expanded .cdh-card-header {
  background: #f0f7ff;
}

.cdh-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
  background: #f5f5f5;
}

.cdh-card-info {
  flex: 1;
  min-width: 0;
}

.cdh-card-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: #000;
  margin: 0;
}

.cdh-card-desc {
  font-size: 0.8rem;
  color: #000;
  margin: 0.2rem 0 0;
  line-height: 1.4;
}

.cdh-card-tags {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}

.cdh-tag {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
}

.cdh-card-chevron {
  flex-shrink: 0;
  font-size: 0.8rem;
  color: #000;
  margin-top: 0.2rem;
  transition: transform 0.2s;
}

.cdh-card--expanded .cdh-card-chevron {
  color: #2e86c1;
  transform: rotate(180deg);
}

/* Card detail (expanded only) */
.cdh-card-detail {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.cdh-card--expanded .cdh-card-detail {
  max-height: 800px;
}

.cdh-card-detail-inner {
  padding: 0 1rem 1rem;
  border-top: 1px solid #e0e0e0;
}

.cdh-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 0.875rem;
}

.cdh-detail-section-label {
  font-weight: 700;
  font-size: 0.78rem;
  color: #1a5276;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.4rem;
}

.cdh-detail-section-body {
  font-size: 0.82rem;
  color: #000;
  line-height: 1.6;
}

/* Notes callout */
.cdh-notes {
  margin-top: 0.75rem;
  background: #fffde7;
  border-left: 3px solid #f9a825;
  padding: 0.625rem 0.875rem;
  border-radius: 0 6px 6px 0;
}

.cdh-notes-label {
  font-weight: 700;
  font-size: 0.78rem;
  color: #000;
  margin-bottom: 0.25rem;
}

.cdh-notes-body {
  font-size: 0.8rem;
  color: #000;
  line-height: 1.5;
}

/* Phase 2 embed slot — hidden until embed_type is set */
.cdh-embed-slot {
  display: none;
  margin-top: 0.75rem;
  background: #f5f5f5;
  border: 1px dashed #ccc;
  border-radius: 6px;
  padding: 1.25rem;
  text-align: center;
  color: #000;
  font-size: 0.78rem;
}

/* Visit button */
.cdh-visit-row {
  margin-top: 0.75rem;
  text-align: right;
}

.cdh-visit-btn {
  display: inline-block;
  background: #2e86c1;
  color: #fff;
  padding: 0.5rem 1.25rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s;
}

.cdh-visit-btn:hover {
  background: #1a5276;
  color: #fff;
}

/* ── Empty state ─────────────────────────────────────────────────── */
.cdh-empty {
  max-width: 900px;
  margin: 2rem auto;
  text-align: center;
  font-size: 0.95rem;
  color: #000;
}

/* ── Footer ──────────────────────────────────────────────────────── */
.cdh-footer {
  max-width: 900px;
  margin: 2rem auto 1rem;
  padding: 0 1rem;
  text-align: center;
}

.cdh-footer-inner {
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #000;
}

.cdh-footer-inner a {
  color: #2e86c1;
  text-decoration: none;
  font-weight: 600;
}

.cdh-footer-inner a:hover {
  text-decoration: underline;
}

/* ── Utility ─────────────────────────────────────────────────────── */
.hidden {
  display: none !important;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .cdh-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .cdh-hero {
    padding: 1.5rem 1rem 1.25rem;
  }

  .cdh-hero h1 {
    font-size: 1.35rem;
  }

  .cdh-hero-desc {
    font-size: 0.85rem;
  }

  .cdh-detail-grid {
    grid-template-columns: 1fr;
  }

  .cdh-card-title {
    font-size: 0.85rem;
  }

  .cdh-card-desc {
    font-size: 0.78rem;
  }
}
