/* eResonate — groups-home.css · the Groups home and its "What you can do in
   Groups" popup (25 Sep 2026). Loaded after social.css. Everything is scoped to
   #groupsView or .gh-intro, so nothing else on the site moves. */

/* The site's right-hand rail steps aside here too, as it does on a group page:
   it repeated your groups list and put trending tags beside the thing you came
   to find (groups-home.js). */
.app-grid.gh-wide { grid-template-columns: minmax(0, 1fr); }
.app-grid.gh-wide > .app-side { display: none; }

#groupsView { max-width: 1120px; }

/* -------------------------------------------------------------- the header */
#groupsView .gh-hero {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 18px 28px; flex-wrap: wrap;
  padding: 26px 28px; margin-bottom: 8px; border: 1px solid var(--border); border-radius: 18px;
  background:
    radial-gradient(90% 160% at 100% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 62%),
    var(--bg-card);
}
#groupsView .gh-herotext { flex: 1 1 420px; min-width: 0; }
#groupsView .gh-hero .view-title { font-size: var(--title-page); line-height: 1.1; margin: 0 0 8px; }
#groupsView .gh-hero .view-sub { font-size: 1.02rem; line-height: 1.55; margin: 0; max-width: 60ch; color: var(--text-muted); }
#groupsView .gh-introlink {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; padding: 4px 0; background: none; border: 0; cursor: pointer;
  font: 600 0.95rem 'DM Sans', sans-serif; color: var(--accent-text, var(--accent)); text-decoration: underline; text-underline-offset: 3px;
}
#groupsView .gh-heroacts { display: flex; gap: 10px; flex-wrap: wrap; }
#groupsView .gh-bigbtn {
  min-height: 48px; padding: 0 22px; border-radius: 12px; font-size: 1rem;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
}

/* --------------------------------------------------------- section titles */
#groupsView .d-section {
  font: 700 1.25rem/1.2 'Outfit', sans-serif; letter-spacing: 0; text-transform: none; color: var(--text);
  margin: 30px 0 12px;
}
#groupsView .gh-sechead { display: flex; align-items: baseline; gap: 10px; margin: 30px 0 12px; }
#groupsView .gh-sechead .d-section { margin: 0; }
#groupsView .gh-count { color: var(--text-muted); font-size: 0.95rem; }
#groupsView .gd-sub {
  font: 600 0.95rem 'DM Sans', sans-serif; letter-spacing: 0; text-transform: none; color: var(--text-muted);
  margin: 18px 0 10px;
}

/* ----------------------------------------------------------- invitations */
#groupsView .gd-invites { gap: 10px; }
#groupsView .gd-inv-row {
  gap: 14px; padding: 14px 16px; border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-card));
}
#groupsView .gd-inv-row .mg-emoji { width: 44px; height: 44px; }
#groupsView .gd-inv-main b { font: 700 1.02rem 'Outfit', sans-serif; }
#groupsView .gd-inv-main small { font-size: 0.88rem; }
#groupsView .gd-inv-acts .btn { min-height: 40px; padding: 0 16px; border-radius: 10px; font-size: 0.92rem; }

/* ------------------------------------------------ your groups, as tiles */
#groupsView .my-groups {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px;
  border: 0; border-radius: 0; background: none; overflow: visible;
}
#groupsView .mg-row, #groupsView .mg-row + .mg-row {
  gap: 12px; min-height: 72px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-card);
}
#groupsView button.mg-row:hover { background: var(--bg-card); border-color: var(--accent); }
#groupsView button.mg-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#groupsView .mg-emoji {
  width: 46px; height: 46px; border-radius: 12px; font-size: 1.5rem; overflow: hidden;
  display: flex; align-items: center; justify-content: center; background: var(--surface-hover);
}
#groupsView .mg-emoji img { width: 100%; height: 100%; object-fit: cover; }
#groupsView .mg-name { font-size: 1rem; }
#groupsView .mg-meta { font-size: 0.85rem; margin-top: 2px; }
#groupsView .mg-badge { font-size: 0.62rem; }
#groupsView .mg-go { font-size: 1rem; }
#groupsView .mg-rule { display: none; }
/* beyond the first eight until "Show all" (groups-home.js) */
#groupsView .my-groups .gh-extra { display: none; }
#groupsView .my-groups.gh-all .gh-extra { display: flex; }
#groupsView .gh-showall {
  grid-column: 1 / -1; justify-self: start; min-height: 40px; padding: 0 16px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg-card); color: var(--text); cursor: pointer; font: 600 0.92rem 'DM Sans', sans-serif;
}
#groupsView .gh-showall:hover { border-color: var(--accent); }
/* nothing joined yet */
#groupsView .mg-empty {
  grid-column: 1 / -1; padding: 26px 20px; border: 1px dashed var(--border); border-radius: 16px; background: var(--bg-card);
}
#groupsView .mg-empty-line { font-size: 1.1rem; }
#groupsView .mg-empty-sub { font-size: 0.95rem; margin: 6px 0 14px; }
#groupsView .mg-empty-btn { font-size: 0.95rem; min-height: 44px; padding: 0 18px; border-radius: 12px; }

/* ------------------------------------------------------ finding a group */
#groupsView .gd-head { align-items: flex-end; margin: 30px 0 12px; }
#groupsView .gd-head .d-section { margin: 0; }
#groupsView .gd-search, #groupsView .gd-sort { min-height: 46px; border-radius: 12px; font-size: 1rem; }
#groupsView .gd-search {
  padding: 0 16px 0 44px; margin-bottom: 12px;
  background: var(--field-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%238a90a8' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 16px 50%;
}
#groupsView .gd-sort { padding: 0 12px; }
#groupsView .gd-chips { gap: 8px; margin-bottom: 8px; scrollbar-width: none; }
#groupsView .gd-chips::-webkit-scrollbar { display: none; }
#groupsView .gd-chip { min-height: 38px; padding: 0 14px; font-size: 0.9rem; }

/* the sideways rows: a frame with ‹ › buttons, soft edges while there is more
   to see, and cards that settle into place (groups-home.js) */
#groupsView .gh-railwrap { position: relative; margin-bottom: 18px; }
#groupsView .gh-railwrap .gd-rail {
  margin-bottom: 0; padding: 4px 2px 10px; scroll-snap-type: x proximity;
  /* a card settles just inside the soft edge, so the edge shows only a peek of the next one */
  scroll-padding-inline: 58px;
  scrollbar-width: none; overscroll-behavior-x: contain;
}
#groupsView .gh-railwrap .gd-rail::-webkit-scrollbar { display: none; }
#groupsView .gh-railwrap .gd-rail > * { scroll-snap-align: start; }
#groupsView .gh-railwrap.can-next .gd-rail {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent);
          mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent);
}
#groupsView .gh-railwrap.can-prev .gd-rail {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 56px);
          mask-image: linear-gradient(to right, transparent, #000 56px);
}
#groupsView .gh-railwrap.can-prev.can-next .gd-rail {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 56px, #000 calc(100% - 56px), transparent);
          mask-image: linear-gradient(to right, transparent, #000 56px, #000 calc(100% - 56px), transparent);
}
#groupsView .gh-railbtn {
  /* over the cards' pictures, not their names */
  position: absolute; top: 24px; z-index: 2; width: 44px; height: 44px; border-radius: 50%;
  display: none; align-items: center; justify-content: center; padding: 0; cursor: pointer;
  background: var(--bg-card); color: var(--text); border: 1px solid var(--border); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  transition: transform 0.12s, border-color 0.12s;
}
#groupsView .gh-railbtn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
#groupsView .gh-railbtn:hover, #groupsView .gh-railbtn:focus-visible { border-color: var(--accent); color: var(--accent-text, var(--accent)); transform: scale(1.06); outline: none; }
#groupsView .gh-railbtn.prev { left: -10px; }
#groupsView .gh-railbtn.next { right: -10px; }
@media (hover: hover) and (pointer: fine) {
  #groupsView .gh-railwrap.can-prev .gh-railbtn.prev, #groupsView .gh-railwrap.can-next .gh-railbtn.next { display: flex; }
}

/* cards: the whole card opens the group; one clear button to join */
#groupsView .gd-rail { grid-auto-columns: minmax(250px, 280px); gap: 12px; }
#groupsView .groups-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
#groupsView .gd-card { display: flex; flex-direction: column; cursor: pointer; border-radius: 16px; }
#groupsView .gd-card .gc-banner { height: 84px; }
#groupsView .gd-card .gc-emoji { width: 50px; height: 50px; bottom: -18px; border-radius: 13px; }
#groupsView .gd-card .gc-body { display: flex; flex-direction: column; flex: 1; padding: 26px 16px 16px; }
#groupsView .gd-card .gc-name { display: block; font: 700 1.08rem 'Outfit', sans-serif; color: var(--text); text-decoration: none; }
#groupsView .gd-card a.gc-name:hover { text-decoration: underline; }
#groupsView .gd-card .gc-members { font-size: 0.86rem; margin: 3px 0 8px; }
#groupsView .gd-card .gd-why { font-size: 0.86rem; }
#groupsView .gd-card .gc-blurb {
  font-size: 0.92rem; min-height: 0; margin-bottom: 14px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
#groupsView .gd-card .gc-actions { margin-top: auto; }
#groupsView .gd-card .gc-actions .grp-join {
  flex: 1; min-height: 42px; border-radius: 10px; font-size: 0.95rem; padding: 0 14px;
}
#groupsView .gd-card .gc-actions .grp-join:not(.joined):not(.pending):not(.locked) {
  background: linear-gradient(135deg, var(--accent), var(--accent2, var(--accent))); border-color: transparent; color: var(--on-accent, #fff);
}
#groupsView .gd-card .gc-open { display: none; }
#groupsView .gd-empty { padding: 26px 20px; border-radius: 16px; font-size: 0.97rem; }
#groupsView .gd-more { min-height: 44px; padding: 0 20px; border-radius: 12px; }

/* ------------------------------------------------------------------ phones */
@media (max-width: 640px) {
  #groupsView .gh-hero { padding: 20px 18px; border-radius: 16px; }
  #groupsView .gh-hero .view-sub { font-size: 0.97rem; }
  #groupsView .gh-heroacts { width: 100%; flex-wrap: nowrap; }
  #groupsView .gh-heroacts .gh-bigbtn { flex: 1 1 auto; min-width: 0; padding: 0 14px; }
  #groupsView .d-section, #groupsView .gh-sechead { margin-top: 24px; }
  #groupsView .my-groups { grid-template-columns: minmax(0, 1fr); }
  #groupsView .gd-inv-row { flex-wrap: wrap; }
  #groupsView .gd-inv-acts { width: 100%; justify-content: stretch; }
  #groupsView .gd-inv-acts .btn { flex: 1; }
  #groupsView .groups-grid { grid-template-columns: minmax(0, 1fr); }
  #groupsView .gd-rail { grid-auto-columns: minmax(240px, 78vw); }
  /* narrower soft edges on a phone: swipe, no buttons */
  #groupsView .gh-railwrap .gd-rail { scroll-padding-inline: 22px; }
  #groupsView .gh-railwrap.can-next .gd-rail {
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 26px), transparent);
            mask-image: linear-gradient(to right, #000 calc(100% - 26px), transparent);
  }
  #groupsView .gh-railwrap.can-prev .gd-rail {
    -webkit-mask-image: linear-gradient(to right, transparent, #000 26px);
            mask-image: linear-gradient(to right, transparent, #000 26px);
  }
  #groupsView .gh-railwrap.can-prev.can-next .gd-rail {
    -webkit-mask-image: linear-gradient(to right, transparent, #000 26px, #000 calc(100% - 26px), transparent);
            mask-image: linear-gradient(to right, transparent, #000 26px, #000 calc(100% - 26px), transparent);
  }
}

/* =========================================== "What you can do in Groups" */
.gh-intro {
  position: fixed; inset: 0; z-index: 320; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(4, 8, 18, 0.62); backdrop-filter: blur(6px);
}
.gh-intro[hidden] { display: none; }
.gh-intro-card {
  position: relative; width: min(760px, 100%); max-height: calc(100dvh - 40px); display: flex; flex-direction: column;
  border-radius: 20px; background: var(--bg-card); border: 1px solid var(--border);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35); color: var(--text); overflow: hidden;
}
/* the list scrolls; the box and the two buttons stay in view */
.gh-intro-body { overflow-y: auto; padding: 30px 30px 4px; min-height: 0; }
.gh-intro-x {
  position: absolute; z-index: 1; top: 14px; right: 14px; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text-muted); font-size: 1.1rem; cursor: pointer;
}
.gh-intro-x:hover, .gh-intro-x:focus-visible { color: var(--text); border-color: var(--accent); outline: none; }
.gh-intro-kicker { font: 700 0.8rem 'DM Sans', sans-serif; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-text, var(--accent)); margin: 0 0 6px; }
.gh-intro h2 { font: 800 1.7rem/1.15 'Outfit', sans-serif; margin: 0 48px 8px 0; }
.gh-intro-lead { color: var(--text-muted); font-size: 1rem; line-height: 1.55; margin: 0 0 22px; max-width: 58ch; }
.gh-intro-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.gh-intro-grid li {
  display: flex; gap: 14px; align-items: flex-start; padding: 14px; border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 5%, var(--bg-card)); border: 1px solid var(--border);
}
.gh-intro-ico {
  flex: none; width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent-text, var(--accent));
}
.gh-intro-ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.gh-intro-grid b { display: block; font: 700 1.02rem 'Outfit', sans-serif; margin-bottom: 3px; }
.gh-intro-grid .gh-intro-txt { display: block; color: var(--text-muted); font-size: 0.9rem; line-height: 1.45; }
.gh-intro-foot { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin: 18px 30px 0; padding: 16px 0 22px; border-top: 1px solid var(--border); }
.gh-intro-never { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 0.95rem; color: var(--text-muted); cursor: pointer; }
.gh-intro-never input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.gh-intro-acts { display: flex; gap: 10px; flex-wrap: wrap; }
.gh-intro-acts .btn { min-height: 46px; padding: 0 20px; border-radius: 12px; font-size: 0.98rem; display: inline-flex; align-items: center; justify-content: center; }
@media (max-width: 640px) {
  .gh-intro { padding: 0; align-items: flex-end; }
  .gh-intro-card { width: 100%; max-height: 92dvh; border-radius: 20px 20px 0 0; }
  .gh-intro-body { padding: 24px 18px 4px; }
  .gh-intro h2 { font-size: 1.4rem; }
  .gh-intro-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .gh-intro-grid li { padding: 12px; }
  .gh-intro-foot { flex-direction: column; align-items: stretch; gap: 8px; margin: 10px 18px 0; padding: 12px 0 18px; }
  .gh-intro-acts { display: grid; grid-template-columns: 1fr 1fr; }
}
