/*
 * Search results (search.php) and "Page not found" (404.php; the shared
 * .page-hero with a glass card, .nf-*), 2026 redesign: on search, a compact
 * soft hero (not full screen, so results show straight away), the
 * pill search box (components.css .site-search), result cards and the
 * "Popular pages" cards (template-parts/start-routes.php). Scoped to main.sx;
 * the heading rules are prefixed with the pages' body class (community-page).
 * community.css is not loaded here.
 */

.sx {
  color: var(--ink-strong);
  font-family: var(--font-ui);
}

.sx .wrap {
  width: min(var(--max-wide), calc(100% - 42px));
}

.sx :focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
  box-shadow: none;
}

/* Hero ---------------------------------------------------------------------- */
.sx-hero {
  position: relative;
  overflow: hidden;
  padding: 40px 0 96px;
  background: var(--surface-soft);
}

.sx-hero .page-blur.is-violet {
  left: auto;
  right: 18%;
  top: -80px;
}

.sx-hero .page-blur.is-orange {
  right: -40px;
  top: 40px;
}

.sx-hero-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}

.sx-hero .page-breadcrumb {
  margin-bottom: 28px;
}

.community-page .sx-hero h1 {
  max-width: 900px;
  margin: 0;
  color: var(--ink-strong);
  font-family: var(--font-display);
  font-size: var(--text-hero);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.03em;
}

.sx-term {
  color: var(--purple);
  overflow-wrap: anywhere;
}

.sx-lead {
  max-width: 640px;
  margin: 0;
  color: var(--muted-ui);
  font-size: var(--text-ui-xl);
  line-height: 1.6;
}

.sx-hero .site-search {
  width: 100%;
  margin-top: 8px;
}

/* Results --------------------------------------------------------------------- */
.sx-results {
  padding: 96px 0;
  background: #fff;
}

.sx-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 980px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sx-result {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 24px 28px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-xl);
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.sx-result:hover {
  border-color: var(--line-control);
  box-shadow: var(--shadow-card);
}

/* Kind of result: Page purple, News story cyan, Event orange, Newsletter night. */
.sx-kind {
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--purple-tint-ui);
  color: var(--purple);
  font-size: var(--text-ui-2xs);
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.sx-kind.is-cyan { background: var(--cyan-tint); color: var(--cyan-ink); }
.sx-kind.is-orange { background: var(--orange-wash); color: var(--orange-ink); }
.sx-kind.is-night { background: var(--night-deep); color: #fff; }

.community-page .sx-result h3,
.community-page .sx-route h3 {
  margin: 0;
  color: var(--ink-strong);
  font-family: var(--font-display);
  font-size: var(--text-ui-step);
  font-weight: 700;
  line-height: 1.3;
}

.sx-result h3 a,
.sx-route h3 a {
  color: inherit;
  transition: color .15s ease;
}

/* The whole card opens the result. */
.sx-result h3 a::after,
.sx-route h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.sx-result:hover h3 a,
.sx-route:hover h3 a {
  color: var(--purple);
}

.sx-result h3 a:focus-visible,
.sx-route h3 a:focus-visible {
  outline: none;
}

.sx-result:has(h3 a:focus-visible),
.sx-route:has(h3 a:focus-visible) {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.community-page .sx-result p,
.community-page .sx-route p {
  margin: 0;
  color: var(--muted-ui);
  font-size: var(--text-ui);
  line-height: 1.6;
}

.sx-open {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  color: var(--purple);
  font-size: var(--text-ui-sm);
  font-weight: 700;
}

.sx-open svg {
  width: 14px;
  height: 14px;
}

/* Page links (pill, as on the News and Events pages). */
.sx-pages ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 40px 0 0;
  padding: 0;
  list-style: none;
}

.sx-pages a,
.sx-pages span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: var(--ds-button-sm);
  padding: 0 16px;
  border: 1px solid var(--line-control);
  border-radius: var(--radius-pill);
  background: #fff;
  color: var(--ink-strong);
  font-size: var(--text-ui-sm);
  font-weight: 700;
}

.sx-pages a:hover {
  border-color: var(--purple);
  color: var(--purple);
}

.sx-pages .current {
  border-color: var(--purple);
  background: var(--purple);
  color: #fff;
}

.sx-pages .dots {
  border-color: transparent;
}

/* No result. */
.sx-none {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 980px;
  margin: 0;
  padding: 22px 24px;
  border-radius: var(--radius-xl);
  background: var(--surface-soft);
  color: var(--muted-ui);
  font-size: var(--text-ui-md);
  line-height: 1.55;
}

.sx-none strong {
  color: var(--ink-strong);
}

.sx-none-icon {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: var(--ds-icon-sm);
  height: var(--ds-icon-sm);
  border-radius: var(--radius-round);
  background: var(--purple-tint-ui);
  color: var(--purple);
}

.sx-none-icon svg {
  width: 20px;
  height: 20px;
}

.sx-results:has(.sx-none) {
  padding-bottom: 0;
}

/* Popular pages ----------------------------------------------------------------- */
.sx-start {
  padding: 96px 0;
  background: #fff;
}

.sx-head {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 32px;
}

.sx-label {
  color: var(--purple);
  font-size: var(--text-ui-xs);
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.community-page .sx-head h2 {
  max-width: none;
  margin: 0;
  color: var(--ink-strong);
  font-family: var(--font-display);
  font-size: var(--text-section);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.02em;
}

.sx-routes {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sx-route {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 28px 26px 26px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-xl);
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.sx-route:hover {
  border-color: var(--line-control);
  box-shadow: var(--shadow-card);
}

.sx-route-icon {
  display: grid;
  place-items: center;
  width: var(--ds-icon-md);
  height: var(--ds-icon-md);
  margin-bottom: 8px;
  border-radius: var(--radius-ui);
  background: var(--purple-tint);
  color: var(--purple);
}

.sx-route:nth-child(2) .sx-route-icon { background: var(--cyan-tint); color: var(--cyan-ink); }
.sx-route:nth-child(3) .sx-route-icon { background: var(--orange-tint); color: var(--orange-deep); }

.sx-route-icon svg {
  width: 24px;
  height: 24px;
}

.sx-route .sx-open {
  margin-top: auto;
  padding-top: 6px;
}

/* Page not found (404.php): the shared .page-hero, with its glass card ------------ */
.community-page .nf-hero h1 {
  max-width: none;
  margin: 0;
  color: var(--ink-strong);
  font-family: var(--ds-font-display);
  font-size: var(--text-hero);
  font-weight: var(--ds-weight-bold);
  line-height: 1.05;
  letter-spacing: -.035em;
}

.nf-hero .page-hero-text {
  padding-top: 0;
}

.nf-hero .site-search {
  width: 100%;
  max-width: 620px;
}

.nf-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--muted-ui);
  font-size: var(--text-ui);
}

.nf-note svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--purple);
}

.nf-note a {
  color: var(--purple);
  font-weight: var(--ds-weight-bold);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.nf-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* "4 (compass) 4": Sora digits; the 0 is a three-colour ring with a needle. */
.nf-code {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .06em;
  margin: -6px 0 6px;
  color: var(--purple);
  font-family: var(--ds-font-display);
  font-size: 128px;
  font-weight: var(--ds-weight-bold);
  line-height: 1;
  letter-spacing: -.04em;
}

.nf-code span:last-child {
  color: var(--night-deep);
}

.nf-compass {
  width: .8em;
  height: .8em;
  flex-shrink: 0;
}

.nf-arc {
  fill: none;
  stroke-width: 13;
  stroke-linecap: round;
  stroke-dasharray: 84 216;
  transform: rotate(-90deg);
  transform-origin: 60px 60px;
}

.nf-arc.is-purple { stroke: var(--purple); }
.nf-arc.is-orange { stroke: var(--join); stroke-dashoffset: -100; }
.nf-arc.is-cyan { stroke: var(--highlight); stroke-dashoffset: -200; }

/* The needle searches, then settles (no motion when reduced motion is asked for). */
.nf-needle {
  transform: rotate(38deg);
  transform-origin: 60px 60px;
  animation: nf-search 3.2s ease-in-out 1 both;
}

@keyframes nf-search {
  0% { transform: rotate(-60deg); }
  30% { transform: rotate(80deg); }
  55% { transform: rotate(10deg); }
  75% { transform: rotate(50deg); }
  100% { transform: rotate(38deg); }
}

@media (prefers-reduced-motion: reduce) {
  .nf-needle {
    animation: none;
  }
}

.nf-asked {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0 0 6px;
  padding: 12px 14px;
  border-radius: var(--ds-radius-sm);
  background: rgba(255, 255, 255, .7);
}

.nf-asked code {
  min-width: 0;
  color: var(--ink-strong);
  font-size: var(--text-ui-sm);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.nf-suggest {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nf-suggest a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 12px 12px 16px;
  border-radius: var(--ds-radius-sm);
  background: rgba(255, 255, 255, .7);
  color: var(--ink-strong);
  transition: background-color .15s ease, box-shadow .15s ease;
}

.nf-suggest a:hover {
  background: #fff;
  box-shadow: var(--shadow-card);
  color: var(--ink-strong);
}

.nf-suggest-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}

.nf-suggest .sx-kind {
  padding: 2px 10px;
  font-size: var(--text-ui-3xs);
}

.nf-suggest b {
  font-family: var(--ds-font-display);
  font-size: var(--text-ui-md);
  line-height: 1.3;
}

.nf-suggest-go {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-round);
  background: var(--purple);
  color: #fff;
  transition: transform .15s ease;
}

.nf-suggest a:hover .nf-suggest-go {
  transform: translateX(2px);
}

.nf-suggest-go svg {
  width: 16px;
  height: 16px;
}

/* Responsive ------------------------------------------------------------------ */
@media (max-width: 1100px) {
  .sx-routes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .sx-hero {
    padding: 24px 0 36px;
  }

  .sx-hero-inner {
    gap: 14px;
  }

  .sx-hero .page-breadcrumb {
    margin-bottom: 12px;
  }

  .sx-lead {
    font-size: var(--text-ui-md);
  }

  /* Field and button on their own rows, full width. */
  .sx-hero .site-search-field {
    flex-basis: 100%;
  }

  .sx-hero .site-search .pill-button {
    justify-content: center;
    width: 100%;
  }

  .sx-results,
  .sx-start {
    padding: 40px 0 44px;
  }

  .sx-result {
    padding: 18px 20px;
  }

  .community-page .sx-result h3,
  .community-page .sx-route h3 {
    font-size: var(--text-ui-lg);
  }

  .community-page .sx-result p,
  .community-page .sx-route p {
    font-size: var(--text-ui-sm);
  }

  .sx-none {
    padding: 16px;
    font-size: var(--text-ui-sm);
  }

  .sx-label {
    font-size: var(--text-ui-3xs);
  }

  .community-page .sx-head h2 {
    font-size: var(--text-section-sm);
  }

  .sx-routes {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .sx-route {
    padding: 20px;
  }

  .nf-hero .site-search-field {
    flex-basis: 100%;
  }

  .nf-hero .site-search .pill-button {
    justify-content: center;
    width: 100%;
  }

  .nf-note {
    align-items: flex-start;
    font-size: var(--text-ui-sm);
  }

  .nf-card {
    padding: 22px;
  }

  .nf-code {
    font-size: 96px;
  }

  .nf-suggest b {
    font-size: var(--text-ui);
  }
}
