@import url("./styles.css");

body.community-page {
  padding-top: 0;
  overflow: hidden;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

.community-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px var(--page-padding);
  border-bottom: 1px solid var(--border);
  background: rgba(247, 246, 245, 0.95);
  backdrop-filter: blur(8px);
  z-index: 500;
}

.community-header__back {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
}

.community-header__back:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.community-header__text {
  min-width: 0;
}

.community-header__title {
  margin: 0;
  font-size: clamp(0.95rem, 2.5vw, 1.15rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  color: var(--blend);
}

.community-header__summary {
  margin: 4px 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.community-layout {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr min(320px, 34vw);
}

.community-map-wrap {
  position: relative;
  min-height: 0;
}

.community-map {
  width: 100%;
  height: 100%;
  background: #e8e6e4;
  z-index: 1;
}

.community-map__loading {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  margin: 0;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-muted);
  z-index: 450;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.community-map__loading--hidden {
  opacity: 0;
}

.community-marker {
  background: none;
  border: none;
}

.community-marker__dot {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent-deep);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  border: 2px solid #fff;
  box-shadow: 0 2px 10px rgba(93, 88, 87, 0.25);
  transform: translate(-50%, -50%);
}

.community-panel {
  border-left: 1px solid var(--border);
  background: var(--bg);
  overflow-y: auto;
  padding: 16px var(--page-padding);
}

.community-panel__title {
  margin: 0 0 12px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.community-panel__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.community-panel__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  font-size: 0.82rem;
}

.community-panel__item--muted {
  opacity: 0.65;
}

.community-panel__location {
  color: var(--text);
}

.community-panel__count {
  flex: 0 0 auto;
  min-width: 1.75rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
}

.community-panel__empty {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.leaflet-popup-content-wrapper {
  border-radius: 6px;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 0.82rem;
  color: var(--text);
}

@media (max-width: 820px) {
  body.community-page {
    overflow: auto;
    height: auto;
    min-height: 100dvh;
  }

  .community-layout {
    grid-template-columns: 1fr;
    grid-template-rows: min(52vh, 420px) auto;
  }

  .community-panel {
    border-left: 0;
    border-top: 1px solid var(--border);
    max-height: none;
  }
}
