/* ============================================================================
   DagM8 · views/community.css  —  the Community / Group home (DAG profile)
   ----------------------------------------------------------------------------
   Screen-specific layer for views/community.js. Reuses the dagm8.css token +
   component layer first (.feed .card .post .actions .composer .ava-sq
   .ava-circle-lg .avatar .rail-heading .ico .btn). Only the community-only
   pieces — the breadcrumb, group header, the Chats tile grid, and the bright
   yellow sticky-note — live here. All prefixed `.community-`.
   ========================================================================= */

/* ---- breadcrumb : Academic / Physics / PHY-101 ----------------------- */
.community-crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2);
  margin-bottom: var(--s4);
  font-size: 12px; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--muted);
}
.community-crumbs__sep { color: var(--muted-2); font-weight: 600; }

/* ---- group header : big DAG avatar + name + code --------------------- */
.community-head {
  display: flex; align-items: center; gap: var(--s4);
  margin-bottom: var(--s4);
}
.community-head__ava { width: 56px; height: 56px; font-size: 16px; letter-spacing: .02em; }
.community-head__name {
  font-size: 22px; font-weight: 800; letter-spacing: -.01em; color: var(--ink);
}
.community-head__code {
  margin: 2px 0 0; font-size: 12px; font-weight: 600; color: var(--muted);
}

.community-desc {
  margin: 0 0 var(--s6);
  font-size: 14.5px; color: var(--ink-2);
}

/* ---- Chats section : label row + Request chat + tile grid ------------ */
.community-chats__bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s3); margin-bottom: var(--s4);
}
.community-chats__title { font-size: 15px; font-weight: 600; color: var(--muted); }

.community-request {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 6px; border: 0; background: none; border-radius: var(--r-sm);
  color: var(--cyan); font-weight: 600; font-size: 13.5px;
  transition: color var(--t);
}
.community-request:hover { color: var(--cyan-700); }
.community-request .ico { color: currentColor; }

/* the tiles wrap; two per row in the 660px feed, one per row on phones */
.community-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--s4);
}
.community-tile {
  display: flex; flex-direction: column; align-items: center; gap: var(--s3);
  padding: var(--s6) var(--s4) var(--s5);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-card); box-shadow: var(--shadow-card);
  text-align: center;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}
.community-tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-pop);
  border-color: transparent;
}
.community-tile__ava {
  width: 76px; height: 76px; border-radius: var(--r-lg);
  font-size: 18px; letter-spacing: .04em;
}
.community-tile__name {
  max-width: 100%;
  font-weight: 700; font-size: 13.5px; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---- Top Publications : the yellow sticky-note ----------------------- */
/* `white-space: pre-line` renders the "\n\n" the data carries between
   "Current emotion:" and "I need money." as the blank line in the comp. */
.community-sticky {
  margin: var(--s2) var(--s5) var(--s4);
  padding: var(--s4) var(--s4) var(--s5);
  background: var(--yellow);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 2px;
  box-shadow: 6px 6px 0 rgba(31, 36, 48, .16);
  font-weight: 800; font-size: 19px; line-height: 1.28; letter-spacing: -.01em;
  white-space: pre-line;
}

/* ---- responsive ----------------------------------------------------- */
/* The shell hides .rail--right below 1180px. For the DAG profile we instead
   flow Top Publications full-width beneath the main column so the panel
   survives on tablet + phone. Scoped to .community-rail so other screens keep
   the shell default. (community.css loads after dagm8.css → wins the cascade.) */
@media (max-width: 1180px) {
  .community-rail {
    display: block;
    position: static;
    height: auto;
    grid-column: 1 / -1;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 560px) {
  /* match the shell's tighter feed gutters for the sticky's side margins */
  .community-sticky { margin-left: var(--s4); margin-right: var(--s4); }
  .community-head__name { font-size: 20px; }
}
