:root {
  --green: #22c55e;
  --green-dark: #16a34a;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --bg: #fafafa;
  --card-bg: #ffffff;
  --radius: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

/* ---------- Header ---------- */
.site-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.logo { order: 1; display: flex; align-items: center; gap: 10px; }
.logo-stack { display: flex; flex-direction: column; line-height: 1.1; gap: 2px; }
.logo-img { height: 46px; width: auto; display: block; }
.logo-tag { font-size: 11px; color: var(--muted); }

/* ---------- Header search (moved out of the filter bar) ---------- */
.header-search {
  order: 3;
  flex: 1 1 100%;
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: white;
}
.header-search input {
  flex: 1;
  min-width: 0;
  border: none;
  padding: 11px 18px;
  font-size: 14.5px;
  background: transparent;
}
.header-search input:focus { outline: none; }
.header-search-btn {
  flex-shrink: 0;
  width: 46px;
  border: none;
  border-left: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.header-search-btn:hover { background: #f3f4f6; }
.header-search-btn svg { width: 18px; height: 18px; }

.nav-toggle {
  order: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 34px;
  height: 34px;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

.main-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border-bottom: 1px solid var(--border);
  flex-direction: column;
  padding: 8px 20px 16px;
}
.main-nav.open { display: flex; }

.nav-link {
  padding: 12px 0;
  font-size: 15px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.nav-link:last-child { border-bottom: none; }
.nav-link.active { color: var(--green-dark); font-weight: 600; }

/* Shown only in the header on wider screens (see the desktop nav media
   query below) — on mobile, adding a group happens via the hero button
   or the "Add Group" link in the menu instead. */
.header-add-btn { display: none; }

/* Desktop-only heading bar: the hero (with its own <h1>) is hidden on wider
   screens (see .hero { display: none; } in the desktop media query below),
   so this shows the same page heading text there instead — hidden here on
   mobile since the hero's own heading already covers it there. */
.page-heading-bar {
  display: none;
  background: var(--bg);
}
.page-heading-bar h2 {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 20px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
  padding: 18px 20px;
  text-align: center;
}
.hero-inner { max-width: 640px; margin: 0 auto; }
.hero h1 { font-size: 24px; margin: 0 0 10px; line-height: 1.3; }
.hero p { color: var(--muted); margin: 0 0 20px; font-size: 15px; }

.btn-primary {
  background: var(--green);
  color: white;
  border: none;
  padding: 13px 24px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.btn-primary:hover { background: var(--green-dark); }
.btn-primary:active { transform: scale(0.97); }
.btn-large { padding: 14px 30px; font-size: 15.5px; }
.btn-primary.full-width { width: 100%; border-radius: 999px; margin-top: 6px; }

/* ---------- Container ---------- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}

/* ---------- Filters section (light green band around the dropdown filter box) ---------- */
.container-filterbar { padding-top: 4px; padding-bottom: 0; }
.filters-section {
  background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
  padding: 20px 0 8px;
}
.filters-inner { padding-top: 0; padding-bottom: 4px; }

/* ---------- Filters ---------- */
.filter-bar {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filter-bar input,
.filter-bar select {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14.5px;
  background: white;
  width: 100%;
}

.select-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

/* ---------- Category pills ---------- */
.categories {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 16px;
  scrollbar-width: thin;
}
.categories::-webkit-scrollbar { height: 5px; }
.categories::-webkit-scrollbar-thumb { background: var(--border); border-radius: 5px; }

.category-pill {
  border: 1px solid var(--border);
  background: white;
  color: var(--text);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13.5px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.category-pill.active, .category-pill:hover {
  background: var(--green);
  color: white;
  border-color: var(--green);
}
.category-pill:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.category-pill:disabled:hover {
  background: white;
  color: var(--text);
  border-color: var(--border);
}

/* ---------- Category picker (Add/Edit Group forms — choose up to 3) ----------
   Reuses .category-pill's look; wraps onto multiple lines instead of the
   nav bar's horizontal scroll, since it sits inside a form, not the header. */
.category-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.category-picker-count {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 400;
  margin: 6px 0 0;
}

/* ---------- "Showing groups tagged: X" banner (shown after clicking a tag) ---------- */
.active-tag-banner[hidden] { display: none; }
.active-tag-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
  color: var(--green-dark);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13.5px;
  margin: -4px 0 16px;
}
.active-tag-banner strong { text-transform: capitalize; }
.active-tag-banner button {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--green-dark);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
}
.active-tag-banner button:hover { color: #0f5132; }


/* ---------- Group cards ---------- */
.groups-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

/* On a single phone-width column, the group cards had the same generous
   16px left/right container padding used everywhere else on the site,
   which reads as a lot of wasted grey margin down both edges once cards
   are already stacked full-width. Tightened just for these card-grid
   containers — the homepage grid, the homepage's Latest/Trending
   showcases, and the Related-groups grid on a group's own page — and only
   below the 2-column breakpoint, so nothing else (forms, legal pages,
   filter bar) is affected. */
@media (max-width: 559px) {
  .container-results,
  .homepage-showcase,
  .container-detail {
    padding-left: 8px;
    padding-right: 8px;
  }
}

@media (min-width: 560px) {
  .groups-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 860px) {
  .groups-grid { grid-template-columns: repeat(3, 1fr); }
  .filter-bar { flex-direction: row; align-items: center; flex-wrap: nowrap; }
  .select-row {
    display: flex;
    flex-wrap: nowrap;
    flex: 1 1 0;
    gap: 10px;
  }
  .select-row select { flex: 1 1 0; min-width: 0; }
  .find-group-btn { flex-shrink: 0; white-space: nowrap; }
}

.group-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.group-card:hover { box-shadow: 0 6px 18px rgba(0,0,0,0.06); transform: translateY(-2px); }

.card-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.card-icon {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: #ecfdf5;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.card-icon-img {
  width: 42px; height: 42px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #ecfdf5;
}
/* Long group names wrap onto a 2nd line instead of stretching the card
   wider than the others in its row; a name still too long for 2 lines
   gets cut off with an ellipsis (…) instead of a 3rd line. */
.card-title {
  margin: 0;
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.3;
  flex: 1 1 0;
  min-width: 0;
  max-height: 2.6em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.group-card p.desc {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.4;
  height: 4.2em;
  overflow: hidden;
}
.read-more-link {
  color: var(--green-dark);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.read-more-link:hover { text-decoration: underline; }

.group-meta { display: flex; gap: 6px; flex-wrap: wrap; }
/* The custom-tags row on a card stays on one line, however many tags or
   however long they are — extra ones are simply clipped instead of
   wrapping onto a 2nd line and making the card taller. */
.tags-row { flex-wrap: nowrap; overflow: hidden; }
.tags-row .tag { flex-shrink: 0; }
.tag {
  background: #f3f4f6;
  color: var(--muted);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  line-height: 1;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.tag-icon {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.tag-icon svg {
  width: 12px;
  height: 12px;
  display: block;
  flex-shrink: 0;
}
.tag-clickable { cursor: pointer; }
.tag-clickable:hover { background: #e5e7eb; }

.tag-custom {
  background: #dcfce7;
  color: var(--muted);
  text-transform: capitalize;
}
.tag-custom.tag-clickable:hover { background: #bbf7d0; }

/* Country is free-typed on the submit form, so it can come in as "india",
   "INDIA", etc. — always show it with a capital first letter on the badge,
   no matter how it was typed or stored. */
.tag-country { text-transform: capitalize; }

.card-actions {
  margin-top: auto;
  display: flex;
  gap: 8px;
}

.join-link {
  flex: 0 0 65%;
  text-align: center;
  background: var(--green);
  color: white;
  text-decoration: none;
  padding: 11px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
}
.join-link:hover { background: var(--green-dark); }

.share-box {
  flex: 1;
  display: flex;
  min-width: 0;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.share-icon {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border: none;
  font-family: inherit;
  cursor: pointer;
}
.share-icon svg { width: 18px; height: 18px; }
.share-icon + .share-icon { border-left: 1.5px solid var(--border); }

.share-whatsapp { color: #25D366; }
.share-whatsapp:hover { background: #e9fbf0; }

.share-generic { color: var(--text); }
.share-generic:hover { background: #f3f4f6; }

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 60px 20px;
  font-size: 14.5px;
}

/* ---------- Modal ---------- */
.modal-overlay[hidden] {
  display: none !important;
}
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 60;
}
@media (min-width: 640px) {
  .modal-overlay { align-items: center; padding: 20px; }
}

.modal {
  background: white;
  border-radius: 18px 18px 0 0;
  width: 100%;
  max-width: 460px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 22px;
}
@media (min-width: 640px) {
  .modal { border-radius: var(--radius); }
}

.modal-header { display: flex; justify-content: space-between; align-items: center; }
.modal-header h2 { margin: 0; font-size: 18px; }
.modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--muted); line-height: 1; }
.modal-note { color: var(--muted); font-size: 13px; margin: 6px 0 4px; }

/* Small icon next to the close (×) button on the "Add Your WhatsApp Group"
   popup that links to add.html — lets someone switch from the small popup
   version of this form to the full, roomier page if they'd rather fill it
   in there. */
.modal-header-actions { display: flex; align-items: center; gap: 10px; }
.modal-fullpage-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  color: var(--green-dark);
  background: #ecfdf5;
  border-radius: 6px;
  flex-shrink: 0;
}
.modal-fullpage-link:hover { background: #d1fae5; }
.modal-fullpage-link svg { width: 15px; height: 15px; }

/* A plain (non-popup) card for a form that lives on its own page instead of
   a modal — used by add.html so the same form styling works whether it's
   shown as a popup or as a full page. */
.page-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}

/* ---------- "Before You Join" rules modal (group.html) ---------- */
.rules-list {
  margin: 12px 0;
  padding-left: 20px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text);
}
.rules-list li { margin-bottom: 8px; }
.rules-list li:last-child { margin-bottom: 0; }
.rules-agree-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  cursor: pointer;
}
.rules-agree-check input { margin-top: 2px; flex-shrink: 0; }
.rules-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.rules-modal-actions .btn-primary {
  flex: 1;
  text-align: center;
  border: none;
}
.rules-modal-actions .btn-primary:disabled {
  background: #d1d5db;
  cursor: not-allowed;
}
.rules-cancel-btn {
  flex: 1;
  background: white;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  font-family: inherit;
}
.rules-cancel-btn:hover { background: #f9fafb; }

#addGroupForm label, #reportForm label, #lookupForm label, #editGroupForm label, #adminAddGroupForm label { display: block; font-size: 13px; font-weight: 600; margin-top: 12px; }
#addGroupForm input, #addGroupForm textarea, #addGroupForm select,
#reportForm input, #reportForm textarea, #reportForm select,
#lookupForm input, #editGroupForm input, #editGroupForm textarea, #editGroupForm select,
#adminAddGroupForm input, #adminAddGroupForm textarea, #adminAddGroupForm select {
  width: 100%; margin-top: 6px; padding: 11px 12px;
  border: 1px solid var(--border); border-radius: 10px;
  font-size: 14px; font-family: inherit;
}
#addGroupForm textarea, #reportForm textarea, #editGroupForm textarea, #adminAddGroupForm textarea { resize: vertical; min-height: 60px; }
/* The standalone Add Group page (add.html) has more room than the popup
   version of this form, so its Description box starts taller. */
.add-page #fDescription { min-height: 160px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-row label { margin-top: 0; }
/* ---------- Referral code (Add Group form) ---------- */
.referral-toggle-wrap { margin-top: 14px; }
.referral-toggle-link {
  background: none;
  border: none;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}
.referral-box { margin-top: 10px; max-width: 220px; }
.referral-box label { margin-top: 0; }

.form-disclaimer {
  font-size: 12.5px;
  color: var(--muted);
  margin: 10px 0 0;
  line-height: 1.5;
}
.form-disclaimer a {
  color: var(--green-dark);
  text-decoration: underline;
  font-weight: 600;
}

/* ---------- Report a group page (report.html) ---------- */
.report-container { max-width: 480px; }
.report-title { font-size: 21px; margin: 26px 0 4px; }
.report-groupname { color: var(--green-dark); font-size: 14.5px; font-weight: 700; margin: 0 0 2px; }
#reportForm button[type="submit"] { margin-top: 20px; }

/* ---------- Tags chip input (Add Group form) ---------- */
.tag-input-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: white;
}
.tag-input-box:focus-within { border-color: var(--green); }
#addGroupForm .tag-input-box input {
  flex: 1 1 100px;
  min-width: 100px;
  margin-top: 0;
  padding: 4px 2px;
  border: none;
}
#addGroupForm .tag-input-box input:focus { outline: none; }
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #ecfdf5;
  color: var(--green-dark);
  padding: 4px 6px 4px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  white-space: nowrap;
}
.tag-chip button {
  background: none;
  border: none;
  color: var(--green-dark);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 2px;
}

/* ---------- Country / State / City search-as-you-type ---------- */
.autocomplete-wrap { position: relative; }
#addGroupForm input:disabled, #adminAddGroupForm input:disabled {
  background: #f3f4f6;
  color: var(--muted);
  cursor: not-allowed;
}
.suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin: 4px 0 0;
  padding: 4px;
  list-style: none;
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
  max-height: 190px;
  overflow-y: auto;
  z-index: 80;
}
.suggestions[hidden] { display: none; }
.suggestions li {
  padding: 9px 10px;
  border-radius: 7px;
  font-size: 13.5px;
  cursor: pointer;
}
.suggestions li:hover,
.suggestions li.highlighted {
  background: #ecfdf5;
}

/* ---------- Group detail page (group.html) ---------- */

/* Plain centered text for the loading / not-found states. */
.state-message {
  max-width: 1000px;
  margin: 60px auto;
  text-align: center;
  padding: 20px;
  color: var(--muted);
}
.state-message h1 { color: var(--text); font-size: 22px; margin: 0 0 8px; }

/* The whole detail view now sits inside a proper card, like the rest of
   the site, instead of floating directly on the page background. Wider
   than a typical text column so it doesn't feel like a long, narrow strip. */
.detail-card {
  position: relative;
  max-width: 1000px;
  margin: 28px auto;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
}
@media (min-width: 600px) {
  .detail-card { padding: 32px 48px; }
}

.detail-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  margin: 0 0 20px;
}
.detail-icon-img {
  width: 104px; height: 104px;
  border-radius: 50%;
  object-fit: cover;
  background: #ecfdf5;
  box-shadow: 0 0 0 1px var(--border);
  flex-shrink: 0;
}
.detail-icon {
  width: 104px; height: 104px;
  border-radius: 50%;
  background: #ecfdf5;
  display: flex; align-items: center; justify-content: center;
  font-size: 46px;
  box-shadow: 0 0 0 1px var(--border);
  flex-shrink: 0;
}
.detail-icon-img[hidden], .detail-icon[hidden] { display: none; }
#dTags, #dCustomTags { justify-content: center; }
.detail-name { margin: 0 0 10px; font-size: 24px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.25; }
.detail-posted {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12.5px;
  margin: -10px 0 16px;
  /* This is sometimes a real link (to that year's own page) and sometimes
     plain text, depending on whether the group has a posted date — kept
     looking identical either way, on purpose, since it's not meant to read
     as a promoted link anywhere on the page. */
  text-decoration: none;
}
.detail-posted svg { width: 14px; height: 14px; flex-shrink: 0; }
.detail-desc {
  color: var(--text);
  font-size: 15px;
  line-height: 1.65;
  margin: 0 0 20px;
  white-space: pre-wrap;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  background: var(--bg);
}
#dJoinBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  margin: 6px auto 0;
}
.detail-note {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
  margin: 18px 0 0;
  padding: 12px 14px;
  background: var(--bg);
  border-radius: 10px;
}

/* "Group Rules" info button under the Join button — opens the same rules
   overlay shown before joining, just so a visitor can check it any time. */
.rules-info-btn {
  display: flex;
  width: fit-content;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: var(--muted);
  margin: 18px 0 0 auto;
}
.rules-info-btn:hover { color: var(--text); }
.rules-info-btn svg { width: 20px; height: 20px; }
.rules-info-btn svg { width: 15px; height: 15px; }
#dCustomTags:not(:empty) { margin: -8px 0 18px; }

/* ---------- Like + Report buttons (group.html) ---------- */
.action-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.like-btn, .report-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
}
.like-btn { color: var(--text); }
.like-btn:hover { background: #f9fafb; }

/* The share box reuses the homepage card's .share-box/.share-icon styles —
   just sized down to sit flush with the pill-shaped Like/Report buttons. */
.action-row .share-box { flex: 0 0 auto; border-radius: 999px; }
.action-row .share-icon { padding: 9px 14px; }
.heart-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #9ca3af;
  stroke-width: 2;
  transition: fill 0.15s ease, stroke 0.15s ease, transform 0.15s ease;
}
.like-btn.liked { border-color: #fecdd3; background: #fff1f2; }
.like-btn.liked .heart-icon { fill: #ef4444; stroke: #ef4444; transform: scale(1.08); }
.like-btn.liked span { color: #e11d48; }

/* Liking still works and is still counted in the database — the number
   itself just isn't shown to visitors. */
#likeCount { display: none; }

.report-btn { color: var(--muted); margin-left: auto; }
.report-btn:hover { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.report-btn svg { width: 15px; height: 15px; }

/* Small round icon-only button that takes the owner to edit.html (with
   their group's slug already filled in) — sits quietly among the
   Like/Share/Report icons instead of a separate text link. */
.edit-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
}
.edit-icon-btn:hover { background: #f9fafb; color: var(--green-dark); border-color: var(--green); }
.edit-icon-btn svg { width: 16px; height: 16px; }

/* Edit icon shown in the top-right corner of the group page's card, near
   the group photo, instead of down with Like/Share/Report. */
.edit-icon-btn-corner {
  position: absolute;
  top: 16px;
  right: 16px;
}
@media (min-width: 600px) {
  .edit-icon-btn-corner { top: 22px; right: 22px; }
}

/* ---------- Related groups (group.html) ---------- */
#relatedSection { max-width: 1000px; margin: 8px auto 0; padding-top: 28px; border-top: 1px solid var(--border); }

/* ---------- Latest Groups / Trending Groups (homepage — each shown only
   when its own switch is turned on in the admin panel) — reuses
   .related-title and .groups-grid so both match the rest of the site
   automatically. ---------- */
.homepage-showcase { margin: 8px auto 24px; }
.related-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 19px;
  font-weight: 700;
  margin: 0 0 16px;
}
.related-title svg { width: 19px; height: 19px; color: var(--green-dark); flex-shrink: 0; }
.related-card-link {
  display: contents;
  color: inherit;
  text-decoration: none;
}
.load-more-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  margin: 22px auto 0;
  padding-left: 30px;
  padding-right: 30px;
}
.load-more-btn svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ---------- Desktop nav ---------- */
@media (min-width: 760px) {
  .nav-toggle { display: none; }
  .header-inner { flex-wrap: nowrap; }
  .header-search { order: 2; flex: 1 1 320px; max-width: 380px; }
  .main-nav {
    order: 4;
    display: flex !important;
    position: static;
    flex-direction: row;
    border: none;
    padding: 0;
    gap: 22px;
  }
  .nav-link { padding: 0; border-bottom: none; }
  .hero h1 { font-size: 30px; }

  /* The "+ Add Your Group" button lives in the header on wider screens,
     right before the nav links, instead of its own hero band. */
  .header-add-btn {
    display: inline-flex;
    align-items: center;
    order: 3;
    padding: 10px 20px;
    font-size: 14px;
    white-space: nowrap;
  }
  .hero { display: none; }
  .page-heading-bar { display: block; }
}

/* ---------- Success message after submitting a group (index.html) ---------- */
.edit-code-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 12px 0;
  padding: 14px 16px;
  background: #ecfdf5;
  border: 1px dashed var(--green-dark);
  border-radius: 10px;
}
.edit-code-value {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--green-dark);
  font-family: monospace;
}
/* The group link box reuses the same style, but the text itself is much
   longer than a 4-digit code — smaller, not bold, and free to wrap. */
.edit-code-value.link-value {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: normal;
  font-family: inherit;
  word-break: break-all;
  text-decoration: none;
}
.edit-code-copy-btn {
  background: white;
  border: 1px solid var(--green-dark);
  color: var(--green-dark);
  font-weight: 600;
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
}
.edit-code-copy-btn:hover { background: #ecfdf5; }

/* ---------- Edit My Group page (edit.html) ---------- */
.form-error {
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13.5px;
  margin-top: 14px;
}
.form-success {
  color: var(--green-dark);
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13.5px;
  margin-top: 14px;
  font-weight: 600;
}

/* Deleting a group is tucked away at the very bottom of the edit form,
   deliberately quiet — a plain text link, not a button that competes with
   "Save Changes" for attention. */
.delete-group-section {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.delete-group-link {
  background: none;
  border: none;
  color: #b91c1c;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  text-decoration: underline;
}
.delete-group-link:hover { color: #7f1d1d; }
