* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background: #f2eadc;
  color: #2f2418;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[hidden] {
  display: none !important;
}

a {
  color: #087ca7;
  text-underline-offset: 0.1em;
}

.groups-access {
  display: grid;
  place-items: center;
  min-height: 60vh;
  padding: 1.5rem;
}

.groups-access-card {
  width: min(100%, 38rem);
  border: 1px solid #d6c6ae;
  border-left: 4px solid #b86f49;
  padding: clamp(1.2rem, 4vw, 2rem);
  background: #fffaf1;
  box-shadow: 0 8px 24px rgb(0 0 0 / 10%);
}

.groups-access-card p {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.1rem, 2.6vw, 1.4rem);
  line-height: 1.45;
}

.groups-access-card a {
  color: #87492f;
}

.groups-header {
  border-bottom: 1px solid #e5d8c3;
  padding: 0.9rem clamp(1rem, 4vw, 3.75rem) 0.85rem;
  background: #fffaf1;
}

.groups-header h1 {
  margin: 0 0 0.25rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.45rem, 2.4vw, 1.9rem);
  font-weight: 500;
  letter-spacing: -0.02em;
}

.intro {
  max-width: 70ch;
  margin: 0;
  color: #6f5a42;
  font-size: 0.92rem;
  line-height: 1.45;
}

main {
  padding: clamp(1rem, 3vw, 1.75rem) 0 3rem;
}

.groups-summary {
  margin: 0 clamp(1rem, 4vw, 3.75rem) 0.75rem;
  color: #6f5a42;
  font-size: 0.85rem;
  font-weight: 650;
}

.groups-section + .groups-section {
  margin-top: 2rem;
}

.groups-section h2,
.groups-section-note {
  margin-right: clamp(1rem, 4vw, 3.75rem);
  margin-left: clamp(1rem, 4vw, 3.75rem);
}

.groups-section h2 {
  margin-top: 0;
  margin-bottom: 0.6rem;
  color: #53644b;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.groups-section-note {
  margin-top: -0.35rem;
  margin-bottom: 0.7rem;
  color: #6f5a42;
  font-size: 0.85rem;
}

/* The size and build of an OI Connect card: a cap, then the name. */
.group-card {
  all: unset;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow: hidden;
  border: 1px solid #d6c6ae;
  border-radius: 6px;
  background: #fffaf1;
  cursor: pointer;
  transition: transform 0.13s ease, box-shadow 0.13s ease, border-color 0.13s ease;
}

.group-card:hover {
  border-color: #b86f49;
  box-shadow: 0 8px 24px rgb(47 36 24 / 10%);
  transform: translateY(-3px);
}

.group-card:focus-visible {
  outline: 2px solid #8a6a43;
  outline-offset: 2px;
}

.group-card-cap {
  display: grid;
  place-content: center;
  aspect-ratio: 1.6;
  border-bottom: 1px solid #e5d8c3;
  padding: 1rem;
  background: #f1e4d8;
  color: #87492f;
  text-align: center;
}

[data-section="caring-groups"] .group-card-cap {
  background: #e8ebdf;
  color: #4e5b3f;
}

[data-section="service-groups"] .group-card-cap,
[data-section="plum-village-movements"] .group-card-cap {
  background: #f4e3e8;
  color: #7e4257;
}

.group-card-name {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.group-card-count {
  padding: 0.75rem 1rem 0.35rem;
  color: #6f5a42;
  font-size: 0.85rem;
  font-weight: 650;
}

.group-card-count:last-child {
  padding-bottom: 0.9rem;
}

.group-card-number {
  color: #2f2418;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
  font-weight: 400;
}

.group-card-description {
  display: -webkit-box;
  margin: 0 1rem 1rem;
  overflow: hidden;
  color: #6f5a42;
  font-size: 0.88rem;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.group-lightbox {
  width: min(calc(100vw - 2rem), 44rem);
  max-height: min(calc(100dvh - 2rem), 40rem);
  border: 1px solid #d6c6ae;
  border-radius: 8px;
  padding: 0;
  background: #fffaf1;
  box-shadow: 0 24px 60px rgb(47 36 24 / 35%);
  color: #2f2418;
}

.group-lightbox[open] {
  display: flex;
  flex-direction: column;
}

.group-lightbox::backdrop {
  background: rgb(47 36 24 / 45%);
}

.group-lightbox-head {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.1rem 1.25rem 0;
}

.group-lightbox-kind {
  margin: 0 0 0.3rem;
  color: #53644b;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.group-lightbox h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.group-lightbox-close {
  all: unset;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  color: #5a3e1f;
  cursor: pointer;
  font-size: 1.6rem;
  line-height: 1;
}

.group-lightbox-close:hover {
  background: #f2e6d2;
}

.group-lightbox-close:focus-visible {
  outline: 2px solid #8a6a43;
}

.group-lightbox-description,
.group-lightbox-count {
  margin: 0.5rem 1.25rem 0;
  color: #6f5a42;
  font-size: 0.9rem;
  line-height: 1.45;
}

.group-lightbox-count {
  font-size: 0.8rem;
  font-weight: 650;
}

.group-lightbox-site {
  margin-left: 0.6rem;
  font-weight: 400;
}

.group-lightbox-body {
  margin-top: 0.9rem;
  border-top: 1px solid #e5d8c3;
  overflow-y: auto;
}

.group-members {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
  gap: 0.1rem 1.5rem;
  margin: 0;
  padding: 0.75rem 1.25rem 1.1rem;
  list-style: none;
}

.group-members li {
  padding: 0.3rem 0;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.group-members .member-name {
  font-weight: 600;
}

.member-extra {
  display: block;
  color: #6f5a42;
  font-size: 0.8rem;
}

.group-empty {
  margin: 0;
  padding: 0.9rem 1.25rem 1.1rem;
  color: #6f5a42;
  font-size: 0.88rem;
}

@media (prefers-reduced-motion: reduce) {
  .group-card {
    transition: none;
  }

  .group-card:hover {
    transform: none;
  }
}
