:root {
  /* Refined warm-neutral palette: blue remains functional; terracotta is editorial. */
  --site-outer: #e8e4dd;
  --site-surface: #fcfaf6;
  --site-rail: #f0ece5;
  --site-rail-rule: #d9d3c9;
  --site-footer: #e8e4dd;
  --site-text: #302b28;
  --site-navigation-text: #403d38;
  --site-control-border: #8a8379;
  --site-surface-hover: #e7e2da;
  --brand-blue-deep: #164c74;
  --prose-measure: 52rem;
  --prose-line-height: 1.6;
  --body-text-size: 17px;
  --metadata-text-size: .9rem;
  --label-text-size: .8rem;
  --content-rule: #d4cec4;
  --content-surface: #f4f0e9;
  --content-surface-padding: 1rem 1.1rem 1.15rem;
  --content-surface-padding-generous: 1.25rem;
  --catalogue-entry-padding: 1.1rem 0 1.2rem;
  --editorial-blue: #1f5f8b;
  --editorial-accent: #874432;
  --editorial-heading: #302b28;
  --editorial-link: #315d7b;
  --editorial-muted: #625d57;
  --editorial-entry-padding: .9rem;
  --editorial-entry-rule: 2px solid var(--editorial-accent);
  --editorial-section-rule-offset: .45rem;
  --editorial-section-rule: 1px solid var(--content-rule);
  --editorial-grid-columns: repeat(2, minmax(0, 1fr));
  --editorial-grid-column-gap: 2.25rem;
  --editorial-grid-row-gap: 1.5rem;
  --editorial-grid-gap: var(--editorial-grid-row-gap) var(--editorial-grid-column-gap);
}

/* Primer supplies the base document styles; these semantic overrides keep the
 * site palette explicit and make warm surfaces consistent across templates. */
body,
.site-main.markdown-body {
  color: var(--site-text);
}

.site-main.markdown-body :is(h1, h2, h3, h4, h5, h6) {
  color: var(--editorial-heading);
}

.site-main.markdown-body a {
  color: var(--editorial-link);
}

/*
 * Shared open editorial grids. Individual pages retain their own widths,
 * margins, opening-rule assignment and responsive column changes.
 */
.about-activity-grid,
.about-gateway-grid,
.research-tile-grid,
.outreach-activity-grid,
.projects-list,
.school-list,
.mobility-list,
.partner-grid {
  display: grid;
  grid-template-columns: var(--editorial-grid-columns);
  align-items: start;
  gap: var(--editorial-grid-gap);
}

/* Quiet section dividers used by the comparable structured landing pages. */
.education-section > h2,
.projects-section > h2,
.research-content h2,
.previous-projects-section > h3 {
  padding-bottom: var(--editorial-section-rule-offset);
  border-bottom: var(--editorial-section-rule);
}

/* Keeps an inline directional arrow with the final word without preventing normal link wrapping. */
.link-arrow {
  white-space: nowrap;
}

/* Shared hook for explicit action links; individual components retain their established spacing and weight. */
.action-link .link-arrow {
  white-space: nowrap;
}

/* A consistent, high-contrast focus treatment for keyboard users. */
:where(a, button, summary, select, input, textarea):focus-visible {
  outline: 3px solid var(--editorial-blue);
  outline-offset: 3px;
}

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

/* Quiet, reusable orientation for detail pages within a collection. */
.parent-context {
  margin: 0 0 1.1rem;
  font-size: var(--metadata-text-size);
  line-height: 1.4;
}

.parent-context a {
  color: var(--editorial-muted);
  font-weight: 600;
  text-decoration: none;
}

.parent-context a:hover,
.parent-context a:focus-visible {
  color: var(--editorial-blue);
  text-decoration: underline;
}

/* Related material is intentionally lighter than the detail-page body. */
.related-content {
  max-width: var(--prose-measure);
  margin-top: 3rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--content-rule);
}

.related-content h2 {
  margin: 0 0 .75rem;
  font-size: 1.35rem;
  line-height: 1.3;
}

.related-content ul {
  margin: 0;
  padding-left: 1.15rem;
}

.related-content li + li {
  margin-top: .45rem;
}

.related-content li > span,
.related-event-meta {
  color: var(--editorial-muted);
  font-size: var(--metadata-text-size);
}

.local-contents {
  max-width: var(--prose-measure);
  margin: 1.5rem 0 2.25rem;
}

.local-contents strong {
  display: block;
  margin-bottom: .35rem;
  color: var(--editorial-accent);
  font-size: var(--label-text-size);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.local-contents__columns {
  display: grid;
  grid-template-columns:
    fit-content(calc(50% - 1.125rem))
    fit-content(calc(50% - 1.125rem));
  justify-content: start;
  gap: .35rem 2.25rem;
}

.local-contents ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.local-contents li + li {
  margin-top: .35rem;
}

@media (max-width: 767px) {
  .local-contents__columns {
    grid-template-columns: 1fr;
    gap: .35rem;
  }
}

/* Ordinary body copy uses a slightly smaller shared size; component metadata keeps its own type scale. */
:where(.site-main.markdown-body) p:not([class]),
:where(.site-main.markdown-body) .education-prose,
:where(.site-main.markdown-body) .entry-description,
:where(.site-main.markdown-body) .opportunity-description {
  font-size: var(--body-text-size);
}

/* News and event date/location lines are metadata rather than body copy. */
.news-post > p:first-of-type,
.event-page > p:first-of-type {
  font-size: 1.125rem;
}

/* Compact, bullet-free directories used for institutional listings. */
.organisation-directory {
  margin: 1rem 0;
  list-style: none;
}

.member-columns .organisation-directory {
  margin-left: 0;
  padding-left: 0;
}

.organisation-directory li + li {
  margin-top: .4rem;
}

/* Strategy tables are deliberately editorial: readable on wide screens and
 * scrollable rather than compressed on the narrowest viewports. */
.strategy-page {
  max-width: 64rem;
}

.strategy-page > p {
  max-width: var(--prose-measure);
  line-height: var(--prose-line-height);
}

.strategy-page > h2 {
  margin-top: 3rem;
}

.strategy-table-wrapper {
  max-width: 64rem;
  margin-top: 1.5rem;
  overflow-x: auto;
}

.strategy-table {
  width: 100%;
  min-width: 42rem;
  border-collapse: collapse;
  font-size: var(--body-text-size);
  line-height: var(--prose-line-height);
}

.strategy-table th,
.strategy-table td {
  padding: .9rem 1rem;
  border-bottom: 1px solid var(--content-rule);
  text-align: left;
  vertical-align: top;
}

.strategy-table thead th {
  color: var(--editorial-muted);
  font-size: var(--metadata-text-size);
  font-weight: 600;
}

.strategy-table tbody th {
  width: 34%;
  color: var(--editorial-heading);
  font-weight: 700;
}

/* Ordinary page prose remains aligned with the full-width page structure. */
.site-main:not(.network-partnerships-page) > p,
.site-main > blockquote,
.long-form-content > p,
.long-form-content > blockquote,
.news-post > p,
.news-post > blockquote,
.opportunities-page > p,
.network-partnerships-page > h1 + p,
.network-partnerships-page > h2:first-of-type + p {
  max-width: var(--prose-measure);
  line-height: var(--prose-line-height);
}

/* Lists in these long-form page types are part of the sustained narrative. */
.long-form-content > ul,
.long-form-content > ol,
.news-post > ul,
.news-post > ol,
.event-page > ul,
.event-page > ol,
.site-main.markdown-body > ul,
.site-main.markdown-body > ol {
  max-width: var(--prose-measure);
  font-size: var(--body-text-size);
  line-height: var(--prose-line-height);
}

/* Reusable publication listing, preserving the original EAALG publication treatment. */
.publication-listing {
  margin-bottom: 1.35rem;
}

.site-main .publication-listing__citation {
  margin-bottom: .25rem;
}

.publication-listing__meta {
  margin-top: 0;
  color: var(--editorial-muted);
  font-size: .92em;
}

@media (max-width: 767px) {
  .site-main h1 {
    font-size: 1.875rem;
  }
}
