/* Self-hosted fonts, copied from FXPRISM (wayfinder). No third-party
   font request, so the CSP can stay 'self'-only. */
@font-face {
  font-family: "Fraunces";
  src: url("/fonts/fraunces-latin.woff2") format("woff2");
  font-weight: 400 600;
  font-display: swap;
}

@font-face {
  font-family: "Nunito Sans";
  src: url("/fonts/nunito-sans-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

/* FXPRISM palette. --fx (Fragile X awareness teal) is identity only:
   the wordmark, never a link or control. --pine is the interface colour. */
:root {
  color-scheme: light;

  --paper: #fcfdff;
  --wash: #e8f2f8;
  --wash-deep: #d7e8f2;
  --ink: #17394b;
  --ink-soft: #4a6b7c;
  --pine: #26685a;
  --pine-deep: #1d5145;
  --trail: #e8834a;
  --trail-ink: #a8501f;
  --edge: #6e97ac;
  --alert: #a3271f;
  --fx: #006f7d;

  --radius: 20px;
  --radius-sm: 14px;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --shadow: 0 1px 2px rgba(23, 57, 75, 0.05), 0 12px 28px -18px rgba(23, 57, 75, 0.35);
  --column: 70ch;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background:
    radial-gradient(120% 60% at 50% 0%, var(--wash) 0%, transparent 70%),
    radial-gradient(90% 50% at 50% 100%, #eef7f3 0%, transparent 70%),
    var(--paper);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

a {
  color: var(--pine);
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--pine-deep);
}

:focus-visible {
  outline: 3px solid var(--trail-ink);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--paper);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
}

.skip-link:focus {
  top: 1rem;
}

/* ---------- header ---------- */

.site-header,
main,
.site-footer {
  width: 100%;
  max-width: calc(var(--column) + 2rem);
  margin: 0 auto;
  padding-inline: 1rem;
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding-top: 1.25rem;
}

.wordmark {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.01em;
}

.wordmark-fx {
  color: var(--fx);
  font-weight: 600;
}

.search-form {
  display: flex;
  gap: 0.5rem;
  flex: 1 1 18rem;
  max-width: 26rem;
}

.search-form input {
  flex: 1;
  min-width: 0;
  font: inherit;
  padding: 0.5rem 0.9rem;
  border: 1.5px solid var(--edge);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
}

.button {
  font: inherit;
  font-weight: 700;
  padding: 0.5rem 1rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--pine);
  color: var(--paper);
  cursor: pointer;
}

.button:hover {
  background: var(--pine-deep);
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.1rem;
  list-style: none;
  margin: 1rem 0 0;
  padding: 0 0 0.75rem;
  border-bottom: 1px solid var(--wash-deep);
}

.site-nav a {
  text-decoration: none;
  font-weight: 600;
}

.site-nav a[aria-current="page"] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--trail);
  text-decoration-thickness: 2px;
}

/* ---------- content ---------- */

main {
  padding-block: 2rem 3rem;
  /* DOIs, URLs and long author lists must wrap, never push the page
     wider than a phone. */
  overflow-wrap: anywhere;
}

main:focus {
  outline: none;
}

h1,
h2,
h3,
.display {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.2;
  color: var(--ink);
}

h1,
.display {
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  margin: 0 0 1rem;
}

h2 {
  font-size: 1.35rem;
  margin: 2rem 0 0.6rem;
}

.lede {
  font-size: 1.15rem;
  color: var(--ink-soft);
}

.eyebrow {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--trail-ink);
  margin: 0 0 0.4rem;
}

.card {
  background: var(--paper);
  border: 1px solid var(--wash-deep);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.4rem;
}

.plain-words {
  border-left: 4px solid var(--pine);
}

.plain-words h2 {
  margin-top: 0;
}

.meta {
  color: var(--ink-soft);
}

pre.citation {
  white-space: pre-wrap;
  font-family: var(--font-body);
  background: var(--wash);
  border-radius: var(--radius-sm);
  padding: 1rem;
}

.item-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.9rem;
}

.item-list li {
  padding: 0.9rem 1.1rem;
  background: var(--paper);
  border: 1px solid var(--wash-deep);
  border-radius: var(--radius-sm);
}

.item-list .item-title {
  font-weight: 700;
  font-size: 1.05rem;
}

.item-list .meta {
  display: block;
  font-size: 0.92rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
}

.chips a {
  display: inline-block;
  padding: 0.25rem 0.8rem;
  border: 1.5px solid var(--edge);
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
}

.disclaimer {
  margin-top: 2.5rem;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

/* ---------- footer ---------- */

.site-footer {
  padding-block: 1.5rem 2.5rem;
  border-top: 1px solid var(--wash-deep);
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.site-footer p {
  margin: 0.3rem 0;
}

/* ---------- search (Pagefind UI) ---------- */

#search {
  --pagefind-ui-scale: 0.9;
  --pagefind-ui-primary: var(--pine);
  --pagefind-ui-text: var(--ink);
  --pagefind-ui-background: var(--paper);
  --pagefind-ui-border: var(--edge);
  --pagefind-ui-tag: var(--wash);
  --pagefind-ui-border-radius: 14px;
  --pagefind-ui-font: var(--font-body);
  margin-block: 1.5rem;
}

#search mark {
  background: #fbe3d4;
  color: var(--ink);
  padding-inline: 0.1em;
  border-radius: 3px;
}

/* After-survey pages */
.project-section {
  margin-block: 2rem;
}

.project figure {
  margin: 1.25rem 0;
}

.project figure img {
  display: block;
  max-width: 100%;
  height: auto;
  background: var(--paper);
  border: 1px solid var(--wash-deep);
  border-radius: var(--radius-sm);
}

.project figcaption {
  margin-top: 0.5rem;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.project figcaption .meta {
  display: block;
}

.link-list li {
  margin-block: 0.4rem;
}

.paper-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.9rem;
}

.paper-list li {
  padding: 0.9rem 1.1rem;
  background: var(--paper);
  border: 1px solid var(--wash-deep);
  border-radius: var(--radius-sm);
}

.paper-list .item-title {
  font-weight: 700;
  font-size: 1.05rem;
}

.paper-list p {
  margin-block: 0.4rem;
}

.paper-list .meta {
  display: block;
  font-size: 0.92rem;
}
