/* RailWeb communities: the directory and each community's page. Builds on the dashboard's styles. */

.sign-in-link {
  margin-left: auto;
}

.section-title {
  margin: 0 0 12px;
  font: 750 22px/1.2 var(--display);
}

/* ------------------------------------------------------------ the directory */

.community-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}

.community-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 14px;
  height: 100%;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.community-card:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.055);
}

.community-icon,
.community-initial {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  border: 1px solid var(--line-strong);
  background: var(--night-2);
  object-fit: cover;
}

.community-initial,
.profile-initial {
  display: grid;
  place-items: center;
  color: var(--haze);
  font: 800 28px/1 var(--display);
}

.community-name {
  display: -webkit-box;
  overflow: hidden;
  font: 750 19px/1.25 var(--display);
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.community-blurb {
  display: -webkit-box;
  margin: 5px 0 10px;
  overflow: hidden;
  color: var(--haze);
  font-size: 14.5px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.community-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.state[data-state="closed"] {
  color: var(--haze);
}

.host {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
}

.host h2 {
  margin: 0 0 4px;
}

.host p {
  max-width: 62ch;
  margin: 0;
  color: var(--haze);
}

.mine {
  margin-bottom: 26px;
}

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

.mine-list a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: inherit;
  text-decoration: none;
}

.mine-list a:hover {
  border-color: var(--line-strong);
}

.mine-list img,
.mine-list .mini-initial {
  width: 32px;
  height: 32px;
  border-radius: 10px;
}

.mine-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ------------------------------------------------------------ one community */

.back {
  margin: 0 0 18px;
}

.back a {
  color: var(--haze);
  font-weight: 650;
  text-decoration: none;
}

.back a::before {
  content: "\2190\00a0";
}

.back a:hover {
  color: var(--moon);
}

.profile-head {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 26px);
  margin-bottom: 26px;
}

.profile-icon {
  flex: 0 0 auto;
  width: clamp(80px, 12vw, 112px);
  height: clamp(80px, 12vw, 112px);
  border-radius: 28px;
  border: 1px solid var(--line-strong);
  background: var(--night-2);
  object-fit: cover;
}

.profile-initial {
  font-size: 46px;
}

.profile-title {
  min-width: 0;
}

.profile-title h1 {
  margin: 0 0 10px;
  font: 800 clamp(32px, 5.2vw, 52px)/1 var(--display);
  font-stretch: 86%;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
}

.profile-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 0;
}

.manage-link {
  color: var(--haze);
  font-size: 14.5px;
  font-weight: 650;
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  align-items: start;
  gap: 18px;
}

.profile-layout .card h2 {
  margin: 0 0 10px;
  font: 750 20px/1.2 var(--display);
}

.prose {
  max-width: 68ch;
  margin: 0;
  color: var(--moon);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.prose[data-empty="true"] {
  color: var(--dim);
}

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

.railroad-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: inherit;
  font-weight: 700;
  text-decoration: none;
}

.railroad-list a:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
}

.join {
  position: sticky;
  top: 18px;
}

.join p {
  margin: 0 0 14px;
  color: var(--haze);
}

.join .state {
  margin-bottom: 12px;
}

.apply-form {
  display: grid;
  gap: 14px;
}

.apply-form .field-name {
  font-weight: 650;
}

.join-note {
  padding: 10px 14px;
  border-left: 3px solid var(--line-strong);
  color: var(--moon);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.join .button {
  width: 100%;
}

.join .text-button {
  margin-top: 10px;
}

@media (max-width: 860px) {
  .profile-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .join {
    position: static;
    order: -1;
  }
}

@media (max-width: 560px) {
  .sign-in-link {
    display: inline-block;
  }
}

/* The community's live map, on its page */
.live-map {
  position: relative;
  margin: 4px 0 16px;
  overflow: hidden;
  border: 1px solid var(--line-strong, rgba(196, 176, 255, 0.28));
  border-radius: 16px;
  background: #140c2e;
}

.live-map[hidden] {
  display: none;
}

.live-map iframe {
  display: block;
  width: 100%;
  height: min(60vh, 440px);
  border: 0;
}

.live-map-open {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 7px 14px;
  border: 1px solid rgba(196, 176, 255, 0.28);
  border-radius: 999px;
  background: rgba(17, 10, 40, 0.86);
  color: #f6f1ff;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
}

.live-map-open:hover {
  border-color: #f0287f;
}
