/* ==========================================================================
   Colors and fonts.
   Both come from _data/theme.yml: change them there, not here.
   ========================================================================== */

:root {
  color-scheme: light;  /* light mode only, even on devices set to dark mode */

  --brand: #003071;          /* main color: hero, bands, buttons */
  --on-brand: #ffffff;
  --accent: #da7638;       /* highlights, accent buttons */
  --ink: #000000;            /* announcement band, text on accent and light colors */
  --light: #e5e5e5;         /* light bands */

  /* Worked out from the colors above */
  --brand-deep: color-mix(in srgb, var(--brand) 70%, #000);       /* footer, button hover */
  --accent-on-brand: color-mix(in srgb, var(--accent) 70%, #fff); /* small accent text on the main color, easier to read */
  --on-brand-soft: color-mix(in srgb, var(--on-brand) 75%, var(--brand-deep)); /* small print in the footer */

  --paper: #ffffff;    /* page background */
  --text: #000000;
  --muted: #595959;
  --link: #003071;
  --rule: #e5e5e5;
  --focus: var(--link);

  --display: Futura, "Futura PT", Jost, "Century Gothic", sans-serif;  /* page titles, headings, site name, FAQ questions */
  --body: Futura, "Futura PT", Jost, "Century Gothic", sans-serif;          /* all other text, including the menu and buttons */
}

/* ==========================================================================
   Base
   ========================================================================== */

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

html { -webkit-text-size-adjust: 100%; }

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--body);
}

main { flex: 1; }

h1, h2, h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.1;
  text-wrap: balance;
}

p { margin: 0 0 1em; }

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

img { display: block; max-width: 100%; height: auto; }

:where(ul[class], ol[class]) { margin: 0; padding: 0; list-style: none; }

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

.skip-link { position: absolute; left: -999rem; }
.skip-link:focus { left: 1rem; top: 1rem; z-index: 10; padding: 0.5rem 1rem; background: var(--paper); }

/* ==========================================================================
   Layout: centered column and full-width colored bands
   ========================================================================== */

.wrap { width: min(100% - 2.5rem, 68rem); margin-inline: auto; }
.wrap--narrow { width: min(100% - 2.5rem, 44rem); }

.band { padding-block: clamp(2.75rem, 6vw, 4.5rem); }
.band--paper { background: var(--paper); color: var(--text); }
.band--brand { --focus: var(--accent); background: var(--brand); color: var(--on-brand); }
.band--accent { --focus: var(--ink); background: var(--light); color: var(--ink); }

.section-title { margin-bottom: 1.5rem; font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.5rem); }
.section-title--center { text-align: center; }
.band--accent .section-title { color: var(--brand); }

.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem 1.5rem; margin-bottom: 1.5rem; }
.section-head .section-title { margin-bottom: 0; }
.section-head a { color: var(--brand); font-weight: 600; }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  border-radius: 4px;
  background: var(--brand);
  color: var(--on-brand);
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
}
.btn:hover { background: var(--brand-deep); }

.btn--wide { display: block; padding-block: 0.95rem; font-size: 1.125rem; }

.btn--light { background: var(--on-brand); color: var(--brand); }
.btn--accent { background: var(--accent); color: var(--ink); }
.btn--light:hover, .btn--accent:hover { background: var(--ink); color: var(--on-brand); }

/* ==========================================================================
   Header, menu and search box
   ========================================================================== */

.site-header { border-bottom: 1px solid var(--rule); background: var(--paper); }
.site-header__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1.5rem; padding-block: 0.75rem; }

.brand { display: flex; align-items: center; gap: 0.6rem; color: var(--text); font: 700 1.3rem/1.1 var(--display); text-decoration: none; }
.brand__logo { width: auto; height: 2.75rem; }
.brand__mark { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 50%; background: var(--brand); color: var(--on-brand); }

.site-nav__list { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1.5rem; }
.site-nav__list a { display: inline-block; padding-block: 0.5rem; color: var(--text); font-size: 0.95rem; font-weight: 600; text-decoration: none; }
.site-nav__list a:hover,
.site-nav__list a[aria-current] { color: var(--link); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.4em; }

.site-search { display: flex; }
.site-search input { width: 9.5rem; padding: 0.4rem 0.6rem; border: 1px solid var(--muted); border-right: 0; border-radius: 4px 0 0 4px; background: var(--paper); color: var(--text); font: inherit; font-size: 0.95rem; }
.site-search button { display: grid; place-items: center; padding: 0 0.65rem; border: 0; border-radius: 0 4px 4px 0; background: var(--brand); color: var(--on-brand); cursor: pointer; }

.nav-toggle { display: none; padding: 0.45rem 0.9rem; border: 1px solid var(--muted); border-radius: 4px; background: none; color: var(--text); font: inherit; font-size: 0.95rem; font-weight: 600; cursor: pointer; }

@media (max-width: 58rem) {
  .site-nav { flex-basis: 100%; }
  .site-nav__list { flex-direction: column; align-items: stretch; gap: 0; }
  .site-nav__list li { border-top: 1px solid var(--rule); }
  .site-nav__list a { display: block; padding-block: 0.8rem; }
  .site-search { padding-block: 0.8rem; }
  .site-search input { flex: 1; width: auto; }

  /* The menu collapses behind the button only when JavaScript is running. */
  .js .nav-toggle { display: block; }
  .js .site-nav { display: none; }
  .js .site-nav.is-open { display: block; }
}

/* ==========================================================================
   Home page
   ========================================================================== */

.hero {
  --focus: var(--accent);
  --hero-tint: color-mix(in srgb, var(--brand) 84%, transparent);
  padding-block: clamp(4rem, 13vw, 9rem);
  background-color: var(--brand);
  background-image: linear-gradient(var(--hero-tint), var(--hero-tint)), var(--hero-image, none);
  background-position: center;
  background-size: cover;
  color: var(--on-brand);
  text-align: center;
}
.hero__title { max-width: 20ch; margin-inline: auto; font-size: clamp(2.25rem, 1.1rem + 5vw, 4.5rem); line-height: 1.04; }

.announcement { --focus: var(--accent); padding-block: 2rem; background: var(--ink); color: var(--on-brand); text-align: center; }
.announcement p { margin: 0; font-family: var(--display); line-height: 1.2; }
.announcement__title { font-size: clamp(1.4rem, 1.05rem + 1.5vw, 2rem); font-weight: 700; }
.announcement__text { font-size: clamp(1.3rem, 1rem + 1.3vw, 1.8rem); font-weight: 500; }
.announcement .btn { margin-top: 1.1rem; }

.intro { display: grid; gap: 1.25rem 3rem; margin-bottom: 2rem; }
.intro__lead { margin: 0; color: var(--link); font-size: clamp(1.2rem, 1.05rem + 0.7vw, 1.5rem); font-weight: 500; line-height: 1.35; }
@media (min-width: 52rem) {
  .intro { grid-template-columns: 1fr 1fr; }
}

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 2rem; }
.feature { display: block; color: var(--brand); font-weight: 600; text-align: center; text-decoration: none; }
.feature img { width: 100%; aspect-ratio: 4 / 5; margin-bottom: 0.75rem; object-fit: cover; }
.feature:hover .feature__title { text-decoration: underline; }
@media (max-width: 34rem) {
  .feature img { aspect-ratio: 3 / 2; }
}

.resource-list { display: grid; gap: 1.25rem; max-width: 52rem; margin-inline: auto; }
.resource-list li { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 0.5rem 2rem; }
.resource__label { color: var(--accent); font: 600 clamp(1.4rem, 1.1rem + 1.2vw, 1.9rem)/1.15 var(--display); }
@media (max-width: 40rem) {
  .resource-list li { grid-template-columns: 1fr; }
}

.post-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1.5rem; }
.post-card { background: #fff; color: var(--ink); }
.post-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.post-card__body { padding: 1.25rem 1.25rem 1.5rem; }
.post-card__date { margin-bottom: 0.4rem; color: color-mix(in srgb, var(--ink) 65%, #fff); font-size: 0.875rem; }
.post-card__title { margin-bottom: 0.5rem; font-size: 1.45rem; }
.post-card__title a { color: var(--brand); text-decoration: none; }
.post-card__title a:hover { text-decoration: underline; }
.post-card__summary { margin: 0; font-size: 0.975rem; }

.closing { text-align: center; }
.closing .section-title { margin-bottom: 1.25rem; }

/* ==========================================================================
   Inner pages: title band and readable text column
   ========================================================================== */

.page-head { --focus: var(--accent); padding-block: clamp(2.25rem, 6vw, 4rem); background: var(--brand); color: var(--on-brand); }
.page-head h1 { font-size: clamp(2rem, 1.3rem + 3vw, 3.25rem); }
.page-head__meta { margin: 0.75rem 0 0; color: var(--accent-on-brand); font-weight: 500; }

.prose { max-width: 68ch; }
.prose > :last-child { margin-bottom: 0; }
.prose h2 { margin: 2em 0 0.5em; font-size: 1.75rem; }
.prose h3 { margin: 1.6em 0 0.4em; font-size: 1.35rem; }
.prose > :first-child { margin-top: 0; }
.prose ul, .prose ol { margin: 0 0 1em; padding-left: 1.3em; }
.prose li + li { margin-top: 0.3em; }
.prose img { margin-block: 1.5rem; }
.prose blockquote { margin: 1.5em 0; padding-left: 1rem; border-left: 4px solid var(--accent); }
.prose blockquote > :last-child { margin-bottom: 0; }

.post-cover { width: 100%; margin-bottom: 2rem; }
.back-link { margin: 2.5rem 0 0; font-weight: 600; }

/* Updates list */
.post-list li { display: grid; grid-template-columns: 1fr auto; align-items: start; gap: 1.25rem; padding-block: 1.5rem; border-top: 1px solid var(--rule); }
.post-list li:first-child { padding-top: 0; border-top: 0; }
.post-list h2 { margin-bottom: 0.35rem; font-size: 1.6rem; }
.post-list h2 a { text-decoration: none; }
.post-list h2 a:hover { text-decoration: underline; }
.post-list__meta { margin-bottom: 0.5rem; color: var(--muted); font-size: 0.9rem; }
.post-list__summary { margin: 0; }
.post-list img { width: 9rem; aspect-ratio: 4 / 3; object-fit: cover; }
@media (max-width: 34rem) {
  .post-list li { grid-template-columns: 1fr; }
  .post-list img { order: -1; width: 100%; aspect-ratio: 16 / 9; }
}

/* FAQ */
.faq { border-top: 1px solid var(--rule); }
.faq:last-of-type { border-bottom: 1px solid var(--rule); }
.faq summary { position: relative; padding: 1rem 2.5rem 1rem 0; font: 600 1.3rem/1.25 var(--display); list-style: none; cursor: pointer; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; top: 0.7rem; right: 0.25rem; color: var(--link); font-size: 1.6rem; }
.faq[open] summary::after { content: "\2212"; }
.faq .prose { padding-bottom: 1.25rem; }
.faq-more { margin: 2rem 0 0; }
.faq-section + .faq-section { margin-top: 2.75rem; }
.faq-section__title { margin-bottom: 0.75rem; color: var(--brand); font-size: 1.75rem; }
.faq-references { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); color: var(--muted); font-size: 0.9rem; }
.faq-references .faq-section__title { font-size: 1.25rem; }
.faq-references ol { margin: 0; padding-left: 1.5rem; }
.faq-references li { margin-bottom: 0.35rem; }

/* Source numbers in the text, like ¹ linking to a reference */
sup { line-height: 0; }
sup a { padding-inline: 0.1em; font-weight: 600; text-decoration: none; }
sup a:hover { text-decoration: underline; }

/* Contact details */
.contact-list { margin: 2rem 0 0; border-top: 1px solid var(--rule); }
.contact-list div { display: grid; grid-template-columns: 8rem 1fr; gap: 1rem; padding-block: 1rem; border-bottom: 1px solid var(--rule); }
.contact-list dt { color: var(--muted); font-weight: 600; }
.contact-list dd { margin: 0; overflow-wrap: anywhere; }

/* Search page */
.search-form label { display: block; margin-bottom: 0.5rem; font-weight: 600; }
.search-form input { width: 100%; padding: 0.8rem 1rem; border: 2px solid var(--muted); border-radius: 4px; background: var(--paper); color: var(--text); font: inherit; font-size: 1.25rem; }
.search-status { min-height: 1.6em; margin: 1.25rem 0 0; color: var(--muted); }
.search-results li { padding-block: 1.25rem; border-top: 1px solid var(--rule); }
.search-results a { font: 700 1.4rem/1.2 var(--display); text-decoration: none; }
.search-results a:hover { text-decoration: underline; }
.search-results__kind { margin: 0.2rem 0 0.4rem; color: var(--muted); font-size: 0.875rem; }
.search-results__snippet { margin: 0; }
mark { padding: 0 0.1em; background: var(--accent); color: var(--ink); }

/* Grad unions page: filter box and table */
.union-filter { margin: 2rem 0 1rem; }
.union-filter label { display: block; margin-bottom: 0.5rem; font-weight: 600; }
.union-filter input { width: 100%; max-width: 32rem; padding: 0.7rem 0.9rem; border: 2px solid var(--muted); border-radius: 4px; background: var(--paper); color: var(--text); font: inherit; font-size: 1.1rem; }
.union-filter__status { margin: 0.6rem 0 0; color: var(--muted); font-size: 0.9rem; }
.union-filter__empty { margin: 1rem 0 0; color: var(--muted); }

.union-table { width: 100%; border-collapse: collapse; font-size: 0.975rem; }
.union-table th, .union-table td { padding: 0.75rem 1rem 0.75rem 0; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
.union-table thead th { border-bottom: 2px solid var(--brand); color: var(--brand); font: 700 1rem/1.2 var(--display); text-transform: uppercase; letter-spacing: 0.03em; }
.union-table tbody th { font-weight: 600; }
.union-table tbody tr:hover { background: color-mix(in srgb, var(--light) 50%, transparent); }
.union-table td:last-child, .union-table thead th:last-child { padding-right: 0; white-space: nowrap; }
.union-table__short { color: var(--muted); white-space: nowrap; }
.union-table__none { color: var(--muted); font-style: italic; }

/* On phones each row becomes a small card with labels */
@media (max-width: 40rem) {
  .union-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .union-table tbody tr { display: block; padding-block: 0.9rem; border-bottom: 1px solid var(--rule); }
  .union-table tbody th, .union-table tbody td { display: grid; grid-template-columns: 6.5rem 1fr; gap: 0.75rem; padding: 0.15rem 0; border: 0; }
  .union-table tbody th::before, .union-table tbody td::before { content: attr(data-label); color: var(--muted); font-size: 0.85rem; font-weight: 600; }
  .union-table tbody tr[hidden] { display: none; }
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer { --focus: var(--accent); padding-block: 2.25rem; background: var(--brand-deep); color: var(--on-brand); }
.site-footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 3rem; }
.site-footer__list { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.site-footer__list a { color: var(--accent-on-brand); font-weight: 600; text-decoration: none; }
.site-footer__list a:hover { text-decoration: underline; }
.site-footer__legal { margin: 1.5rem auto 0; color: var(--on-brand-soft); font-size: 0.875rem; }
