/* gf-public.css: Group Finder's public pages.

   Two pages load it: a server's public page (groups_public_server.html) and
   the all-servers board (groups_board.html). Anyone with the link can open
   them, logged in or not.

   Self-contained. It builds on the tokens of the public site (landing.css
   and tokens.css: --text, --muted, --border, --surface, --depth, --gold,
   --cyan, --green and the font roles) and follows the visitor's theme through
   them, as the public nav and footer on the same page do. It loads none of
   the dashboard's sheets, and every class here starts with gfpub- so nothing
   collides with them or with home.css.

   /static/ is cached for a year: every edit of this file bumps the ?v= tag in
   _groups_public.html.

   A comment in a stylesheet ends at the first star followed by a slash. Never
   write that pair inside one. */

.gfpub-page {
  --gfpub-violet: #6a4bf0;
  --gfpub-grad: linear-gradient(100deg, var(--cyan), var(--gold) 52%, var(--gfpub-violet));
  --gfpub-glow: 0 0 0 1px rgba(59, 130, 246, 0.22), 0 14px 44px -18px rgba(106, 75, 240, 0.55);
  --gfpub-soft: var(--overlay-soft, rgba(255, 255, 255, 0.03));
  --gfpub-line2: var(--border2, rgba(96, 128, 210, 0.26));
  --gfpub-panel: var(--depth);
  --gfpub-card: rgba(13, 15, 26, 0.9);
  --gfpub-field: var(--surface);
  --gfpub-accent-text: var(--gold-light);
  /* White on this blue is 5.17 to 1. The public nav's own button uses it for
     the same reason: white on --gold is only 3.68 to 1 in the dark theme. */
  --gfpub-solid: #2563eb;
  --gfpub-solid-hover: #3b82f6;
  --gfpub-amber: #ffb454;
  --gfpub-amber-dim: rgba(255, 180, 84, 0.13);
  --gfpub-amber-line: rgba(255, 180, 84, 0.38);
  --gfpub-green-dim: rgba(107, 203, 139, 0.15);
  --gfpub-green-line: rgba(107, 203, 139, 0.36);
  --gfpub-red-dim: rgba(224, 90, 90, 0.15);
  --gfpub-red-line: rgba(224, 90, 90, 0.38);
  --gfpub-from: #b9a4f5;
  --gfpub-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239698b0' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");

  /* The public nav is fixed and 64px tall. body is a column (home.css), so
     this fills the space down to the footer on a short page. */
  position: relative;
  flex: 1 0 auto;
  padding-top: 64px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  /* A soft light behind the header. Transparent everywhere else, so the
     site's starfield (behind the body) stays visible. */
  background: radial-gradient(80% 440px at 50% 64px, rgba(59, 130, 246, 0.14), transparent 70%);
}
[data-theme="light"] .gfpub-page {
  --gfpub-glow: 0 0 0 1px rgba(59, 130, 246, 0.24), 0 14px 36px -20px rgba(106, 75, 240, 0.4);
  --gfpub-card: rgba(247, 249, 253, 0.94);
  --gfpub-accent-text: var(--gold);
  --gfpub-solid-hover: #1d4ed8;
  --gfpub-amber: #a85a00;
  --gfpub-amber-dim: rgba(217, 119, 6, 0.1);
  --gfpub-amber-line: rgba(180, 83, 9, 0.34);
  --gfpub-green-dim: rgba(63, 163, 99, 0.14);
  --gfpub-green-line: rgba(45, 127, 74, 0.32);
  --gfpub-red-dim: rgba(184, 70, 63, 0.14);
  --gfpub-red-line: rgba(184, 70, 63, 0.34);
  --gfpub-from: #6a4bd0;
}

.gfpub-in {
  max-width: 1040px;
  margin: 0 auto;
  padding: 26px clamp(16px, 4vw, 32px) 56px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.gfpub-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
/* The icon shapes and the ring's colours. Kept in the page but out of sight;
   not display none, which would switch the ring's gradient off. It sits
   INSIDE .gfpub-page: the gradient's stops read that root's own tokens. */
.gfpub-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.gfpub-ico {
  display: inline-block;
  width: 17px;
  height: 17px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.gfpub-grad-a { stop-color: var(--cyan); }
.gfpub-grad-b { stop-color: var(--gold); }
.gfpub-grad-c { stop-color: var(--gfpub-violet); }

/* ── the header ─────────────────────────────────────────────────────────── */
.gfpub-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
}
.gfpub-head-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  flex: none;
  border-radius: 20px;
  background: var(--gfpub-grad);
  box-shadow: var(--gfpub-glow);
  color: #fff;
  font: 700 28px var(--font-display);
  object-fit: cover;
}
.gfpub-head-icon .gfpub-ico { width: 30px; height: 30px; }
.gfpub-head-art { display: block; width: 68px; height: auto; flex: none; border-radius: 16px; }
.gfpub-head h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(24px, 3.4vw, 34px);
  font-weight: 600;
  line-height: 1.1;
  color: var(--text);
  overflow-wrap: anywhere;
}
.gfpub-head p { margin: 4px 0 0; color: var(--muted); font-size: 14.5px; }

/* ── buttons: the mono capitals of the brand ────────────────────────────── */
.gfpub-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 33px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--gfpub-soft);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.67rem;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, filter 0.15s;
}
.gfpub-btn:hover { border-color: var(--gold-dim); color: var(--text); }
.gfpub-btn:focus-visible,
.gfpub-chipbtn:focus-visible,
.gfpub-go:focus-visible,
.gfpub-clear:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 2px; }
.gfpub-btn-solid { background: var(--gfpub-solid); border-color: var(--gfpub-solid); color: #fff; }
.gfpub-btn-solid:hover { background: var(--gfpub-solid-hover); border-color: var(--gfpub-solid-hover); color: #fff; }
.gfpub-btn-brand {
  border-color: transparent;
  background: var(--gfpub-grad);
  box-shadow: var(--gfpub-glow);
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
}
.gfpub-btn-brand:hover { border-color: transparent; color: #fff; filter: brightness(1.08); }

/* ── a message from one of the older join forms ─────────────────────────── */
.gfpub-flash {
  margin: 0;
  padding: 10px 14px;
  border: 1px solid var(--gfpub-green-line);
  border-radius: 9px;
  background: var(--gfpub-green-dim);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}
.gfpub-flash.gfpub-is-error { border-color: var(--gfpub-red-line); background: var(--gfpub-red-dim); }

/* ── the filter card ────────────────────────────────────────────────────── */
.gfpub-panel {
  margin: 0;
  padding: 14px 20px 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--gfpub-panel);
}
.gfpub-filters {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}
.gfpub-filters.gfpub-is-board { grid-template-columns: minmax(0, 1.3fr) repeat(3, minmax(0, 1fr)) auto; }
.gfpub-field { min-width: 0; }
.gfpub-label {
  display: block;
  margin: 0 0 7px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 600;
  line-height: 1.55;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.gfpub-input,
.gfpub-select {
  display: block;
  width: 100%;
  height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background-color: var(--gfpub-field);
  color: var(--text);
  font: 400 16px var(--font-body);
  -webkit-appearance: none;
  appearance: none;
}
.gfpub-input::placeholder { color: var(--muted); opacity: 0.75; }
/* A native list keeps the theme: its own colours here, and the page's
   color-scheme (set with the theme) for the list the browser draws. */
.gfpub-select {
  padding-right: 34px;
  background-image: var(--gfpub-chevron);
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
  text-overflow: ellipsis;
}
.gfpub-select option { background-color: var(--surface); color: var(--text); }
.gfpub-input:hover,
.gfpub-select:hover { border-color: var(--gfpub-line2); }
.gfpub-input:focus,
.gfpub-select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-bg), 0 0 0 1px var(--gold-dim);
  outline: 2px solid transparent;
}
.gfpub-field-go .gfpub-btn { min-height: 40px; padding-inline: 16px; }
.gfpub-field-go .gfpub-ico { width: 15px; height: 15px; }

.gfpub-levels { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; margin-top: 12px; }
.gfpub-levels-set { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.gfpub-mono {
  margin-right: 2px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.gfpub-chipbtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 27px;
  padding: 4px 11px;
  border: 1px solid var(--gfpub-line2);
  border-radius: 999px;
  background: var(--gfpub-soft);
  color: var(--text);
  font: 600 12.5px var(--font-body);
  cursor: pointer;
}
.gfpub-chipbtn:hover { border-color: var(--gold-dim); color: var(--gfpub-accent-text); }
.gfpub-chipbtn.gfpub-is-on { border-color: var(--gold); background: var(--gold-bg); color: var(--gfpub-accent-text); }
.gfpub-clear { margin-left: auto; color: var(--gfpub-accent-text); font-size: 13px; font-weight: 600; }
.gfpub-clear:hover,
.gfpub-go:hover { text-decoration: underline; }

/* ── the line above the cards ───────────────────────────────────────────── */
.gfpub-resultline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px 18px;
  flex-wrap: wrap;
  /* The prototype's rhythm: room above the count, the cards close under it. */
  margin: 29px 0 13px;
  color: var(--muted);
  font-size: 13.5px;
}
.gfpub-resultline b { color: var(--text); }

/* ── a group, as a card ─────────────────────────────────────────────────── */
.gfpub-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr));
  gap: 12px;
}
.gfpub-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  /* The cards of a row are equally tall: the room left over goes above the
     action, so the buttons of a row sit on one line. */
  grid-template-rows: 1fr auto;
  gap: 14px;
  align-items: start;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--gfpub-card);
}
.gfpub-card:hover { border-color: var(--gfpub-line2); }
.gfpub-card-main { min-width: 0; }
.gfpub-card-t {
  display: flex;
  align-items: center;
  gap: 4px 8px;
  flex-wrap: wrap;
  margin: 0 0 3px;
  color: var(--text);
  font: 700 16px/1.55 var(--font-body);
  overflow-wrap: anywhere;
}
.gfpub-chips { display: flex; gap: 4px 10px; flex-wrap: wrap; align-items: center; margin: 0 0 6px; }
.gfpub-chip {
  display: inline-block;
  max-width: 100%;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--gfpub-soft);
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gfpub-card-sub {
  display: flex;
  gap: 4px 10px;
  flex-wrap: wrap;
  align-items: center;
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 13.5px;
}
.gfpub-card-sub > span { display: inline-flex; align-items: center; gap: 5px; min-width: 0; max-width: 100%; }
.gfpub-card-sub b { color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.gfpub-card-sub .gfpub-ico { width: 14px; height: 14px; }
.gfpub-av {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex: none;
  border-radius: 50%;
  background: #6b7a99;
  color: #fff;
  font: 700 9.5px var(--font-body);
}
.gfpub-av .gfpub-ico { width: 12px; height: 12px; }
.gfpub-av-1 { background: #9b7fe8; }
.gfpub-av-2 { background: #e0669b; }
.gfpub-av-3 { background: #e05a5a; }
.gfpub-av-4 { background: #c98a2b; }
.gfpub-av-5 { background: #2f9e86; }
.gfpub-av-6 { background: #4f86e8; }

.gfpub-from {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 2px 7px;
  border: 1px solid rgba(155, 127, 232, 0.45);
  border-radius: 4px;
  background: rgba(155, 127, 232, 0.1);
  color: var(--gfpub-from);
  font: 700 9.5px var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.gfpub-from .gfpub-ico { width: 11px; height: 11px; }
.gfpub-from-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.gfpub-roles { display: flex; gap: 6px; flex-wrap: wrap; }
.gfpub-role {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 2px 9px;
  border: 1px solid var(--gfpub-line2);
  border-radius: 999px;
  background: var(--gfpub-soft);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.gfpub-role b { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--text); font-weight: 650; }
.gfpub-role.gfpub-is-open { border-color: var(--gold-dim); background: var(--gold-bg); color: var(--gfpub-accent-text); }
.gfpub-role.gfpub-is-open b { color: var(--gfpub-accent-text); }
.gfpub-role.gfpub-is-full { opacity: 0.72; }
.gfpub-spots { margin: 0; color: var(--text); font-size: 13.5px; font-weight: 600; }

.gfpub-card-acts { grid-column: 1 / -1; display: flex; gap: 6px; align-items: stretch; }
.gfpub-card-acts .gfpub-btn { flex: 1; }

/* the ring: how many of the spots are taken */
.gfpub-fill { position: relative; width: 52px; height: 52px; flex: none; }
.gfpub-fill svg { display: block; width: 100%; height: 100%; transform: rotate(-90deg); }
.gfpub-fill-track { fill: none; stroke: var(--gfpub-line2); stroke-width: 5; }
/* The brand gradient, or plain blue should the gradient not be found. */
.gfpub-fill-arc { fill: none; stroke: url(#gfpub-fill-grad) var(--gold); stroke-width: 5; stroke-linecap: round; }
.gfpub-fill.gfpub-is-full .gfpub-fill-arc { stroke: var(--green); }
/* Nobody in yet: a rounded line of no length would still draw a dot. */
.gfpub-fill.gfpub-is-none .gfpub-fill-arc { stroke: none; }
.gfpub-fill-in {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.05;
}
.gfpub-fill-in b {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
/* Up to four characters ("3/5", "4/10") fit at the size above. Five ("16/20",
   "38/40": a group holds 2 to 40 people) would touch the ring, so they are
   set smaller. */
.gfpub-fill.gfpub-is-long .gfpub-fill-in b { font-size: 11.5px; }
.gfpub-fill-in small {
  margin-top: 1px;
  color: var(--muted);
  font: 600 8px var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* a pixel badge: "Full", "You asked" */
.gfpub-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border: 1px solid var(--gfpub-amber-line);
  border-radius: 4px;
  background: var(--gfpub-amber-dim);
  color: var(--gfpub-amber);
  font: 600 0.62rem/1.3 var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.gfpub-badge-px { width: 6px; height: 6px; flex: none; background: currentColor; }

/* ── nothing to show ────────────────────────────────────────────────────── */
.gfpub-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 26px 18px;
  border: 1px dashed var(--gfpub-line2);
  border-radius: 9px;
  color: var(--muted);
  text-align: center;
}
.gfpub-empty img { display: block; width: 104px; height: auto; filter: drop-shadow(0 10px 22px rgba(52, 196, 244, 0.25)); }
.gfpub-empty b { color: var(--text); font-family: var(--font-display); font-size: 17px; font-weight: 600; }
.gfpub-empty p { max-width: 46ch; margin: 0; font-size: 14px; }

/* ── the line under the cards ───────────────────────────────────────────── */
.gfpub-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px 8px;
  flex-wrap: wrap;
  margin: 8px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.gfpub-foot img { display: block; width: 20px; height: 20px; }
.gfpub-foot a { color: inherit; }
.gfpub-foot a.gfpub-go,
.gfpub-go { color: var(--gfpub-accent-text); font-weight: 600; }

/* ── narrower screens ───────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .gfpub-filters,
  .gfpub-filters.gfpub-is-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gfpub-field-go { grid-column: 1 / -1; }
  .gfpub-field-go .gfpub-btn { width: 100%; }
}
@media (max-width: 640px) {
  .gfpub-head { grid-template-columns: auto minmax(0, 1fr); }
  .gfpub-head > .gfpub-btn { grid-column: 1 / -1; }
  .gfpub-card-acts .gfpub-btn { min-height: 38px; }
}
@media (max-width: 480px) {
  .gfpub-filters,
  .gfpub-filters.gfpub-is-board { grid-template-columns: minmax(0, 1fr); }
  .gfpub-panel { padding: 14px 16px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .gfpub-btn { transition: none; }
}
