/* ==========================================================================
   Russell Education Foundation: site styles
   Built on the brand tokens in tokens.css (loaded first on every page).
   Use the var(--...) colours below; please don't add new hex colours.
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  /* Room for the fixed header when jumping to a section (e.g. #what-we-do) */
  scroll-padding-top: 150px;
}
@media (min-width: 720px) { html { scroll-padding-top: 110px; } }

body {
  margin: 0;
  /* Beige page background with a mild paper texture (fine grain and a few
     faint fibres). The texture image is a seamless 256px tile whose average
     colour is exactly --parchment. To remove the texture, delete the two
     background-image / background-size lines; the plain beige remains. */
  background-color: var(--parchment);
  background-image: url("../assets/paper-texture.png");
  background-size: 256px 256px;
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 17px;
  line-height: 27px;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--heading);
  margin: 0 0 var(--space-3);
}
h1 { font-weight: 600; font-size: 30px; line-height: 36px; }
h2 { font-weight: 600; font-size: 26px; line-height: 32px; }
h3 { font-weight: 600; font-size: 22px; line-height: 28px; }

@media (min-width: 720px) {
  h1 { font-size: 36px; line-height: 42px; }   /* heading-1 */
  h2 { font-size: 28px; line-height: 34px; }   /* heading-2 */
}

p, ul, ol, dl { margin: 0 0 var(--space-3); }
p:last-child { margin-bottom: 0; }

a {
  color: var(--action);
  text-decoration: underline;
  text-underline-offset: 3px;
}
a:hover { color: var(--gold-ink); }

/* Visible keyboard focus on everything: 2px outline, offset 2px */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.lead { font-size: 20px; line-height: 30px; }
.small { font-size: 14px; line-height: 21px; }
.muted { color: var(--ink-muted); }

/* Text for screen readers only */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}
@media (min-width: 720px) { .container { padding: 0 var(--space-5); } }
@media (min-width: 1100px) { .container { padding: 0 var(--space-6); } }

.narrow { max-width: 720px; }

.section { padding: var(--space-6) 0; }
@media (min-width: 720px) { .section { padding: var(--space-7) 0; } }
.section--parchment { background: transparent; }   /* lets the paper texture show */
/* Sections share the beige background, so don't double the space between them */
.section + .section { padding-top: 0; }

.section-intro { max-width: 640px; margin-bottom: var(--space-5); }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: var(--space-3);
  top: -100px;
  background: var(--action);
  color: var(--on-action);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  z-index: 20;   /* above the fixed header */
}
.skip-link:focus { top: var(--space-3); color: var(--on-action); }

/* ---------- Header (navy band, data-theme="dark" in the HTML) ---------- */
.site-header {
  background: var(--navy);
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  /* Stays fixed at the top of the screen while the page scrolls */
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  padding-top: var(--space-3);
  padding-bottom: var(--space-3);
}

/* Logo lockup: the "Russell" wordmark file, with "Education Foundation"
   set beside it in the brand descriptor style (spaced capitals). */
.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
}
.brand img { height: 56px; width: auto; }
.brand__descriptor {
  padding: var(--space-1) 0 var(--space-1) var(--space-3);
  border-left: 1px solid var(--gold);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  line-height: 19px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-ink);
}
@media (min-width: 720px) {
  .brand__descriptor { font-size: 14px; line-height: 21px; }
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a {
  display: inline-block;
  padding: var(--space-2) 0;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}
.site-nav a:hover { color: var(--gold-ink); text-decoration: underline; }
.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

/* ---------- Gold rule (signature divider) ---------- */
.rule {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  max-width: 240px;
  margin: 0 0 var(--space-4);
}
.rule::before, .rule::after {
  content: '';
  flex: 1;
  height: 1.5px;
  background: var(--gold);
}
.rule i {
  width: 8px;
  height: 8px;
  background: var(--red);
  transform: rotate(45deg);
  flex: none;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-text);
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--action);
  background: var(--action);
  color: var(--on-action);
  text-decoration: none;
}
.btn:hover { color: var(--on-action); filter: brightness(1.08); }
.btn--secondary { background: transparent; color: var(--action); }
.btn--secondary:hover { color: var(--action); }

/* ---------- Hero (navy band) ----------
   The hero uses data-theme="dark" in the HTML, so the tokens switch to
   their navy-ground values (light gold, ivory text, gold buttons). */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--navy);
  color: var(--ink);
}
.hero__watermark {
  position: absolute;
  left: -140px;
  bottom: -170px;
  width: 620px;
  height: 560px;
  fill: var(--royal-blue);
  opacity: 0.6;
  pointer-events: none;
}
.hero__inner {
  position: relative;
  display: grid;
  gap: var(--space-4);
  padding-top: var(--space-6);
  padding-bottom: var(--space-6);
}
.hero__mark { width: 220px; justify-self: center; }   /* centred on phones */
.hero .rule { margin-left: auto; margin-right: auto; }   /* centred under the R on phones */
.hero h1 {
  color: var(--heading);
  font-weight: 500;
  font-size: 40px;
  line-height: 44px;
  margin-bottom: var(--space-3);
}
.hero .lead { max-width: 34em; margin-bottom: var(--space-5); }

@media (min-width: 720px) {
  .hero h1 { font-size: 52px; line-height: 58px; }
}
@media (min-width: 900px) {
  .hero__inner {
    grid-template-columns: minmax(0, 1fr) 280px;
    align-items: center;
    gap: var(--space-6);
    padding-top: var(--space-7);
    padding-bottom: var(--space-7);
    min-height: 460px;
  }
  .hero__text { order: 1; }
  .hero__mark { order: 2; width: 280px; justify-self: end; }
  .hero .rule { margin-left: 0; margin-right: 0; }   /* left-aligned above the headline on desktop */
  .hero h1 { font-size: 64px; line-height: 68px; }   /* display-xl */
  .hero__watermark { left: auto; right: 180px; bottom: -260px; width: 760px; height: 690px; }
}

/* ---- Gilt R shimmer: copied exactly from reference/gilt-r-shimmer.html ---- */
.gilt-r { display:block; width:100%; height:auto; overflow:visible; }
.gilt-r__shine {
  animation: gilt-shimmer 9s ease-in-out 1.5s infinite;
  transform: translateX(0);
}
@keyframes gilt-shimmer {
  0%   { transform: translateX(0); }
  25%  { transform: translateX(440px); }  /* one slow pass of light... */
  100% { transform: translateX(440px); }  /* ...then a long rest */
}
@media (prefers-reduced-motion: reduce) {
  .gilt-r__shine { animation: none; opacity: 0; }
}
/* ---- end of shimmer block ---- */

/* ---------- Page title band (inner pages) ---------- */
/* Navy band (data-theme="dark" in the HTML), joining up with the header */
.page-title {
  background: var(--navy);
  color: var(--ink);
  padding: var(--space-6) 0 var(--space-6);
}
.page-title h1 { margin-bottom: var(--space-3); }
.page-title .lead { max-width: 36em; color: var(--ink); }

/* ---------- Cards: What we do, values ---------- */
.cards {
  display: grid;
  gap: var(--space-5);
  list-style: none;
  margin: 0;
  padding: 0;
}
@media (min-width: 720px) { .cards--3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 720px) { .cards--2 { grid-template-columns: repeat(2, 1fr); } }

.card {
  border-top: 1.5px solid var(--gold);
  padding-top: var(--space-4);
}
.card h3 { margin-bottom: var(--space-2); }
.status {
  display: block;
  margin-top: var(--space-3);
  font-size: 14px;
  line-height: 21px;
  font-weight: 600;
  color: var(--gold-ink);
}

/* ---------- Hairline gold frame (stay in touch, notices) ---------- */
.frame {
  border: 1px solid var(--gold);
  background: transparent;   /* gold hairline only, on the beige */
  padding: var(--space-5) var(--space-4);
}
@media (min-width: 720px) { .frame { padding: var(--space-6); } }
.frame .email {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  line-height: 30px;
  word-break: break-word;
}
@media (min-width: 720px) { .frame .email { font-size: 28px; line-height: 34px; } }

/* Notice box (e.g. "draft" on the privacy page) */
.notice {
  border: 1px solid var(--gold);
  border-left-width: 4px;
  background: transparent;
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-5);
}
.notice strong { color: var(--heading); }

/* ---------- Prose (long text pages) ---------- */
/* Long text: keep lines readable, aligned left with the rest of the page */
.prose > * { max-width: 720px; }
.prose h2 { margin-top: var(--space-6); }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: var(--space-5); }
.prose ul { padding-left: 1.25em; }
.prose li { margin-bottom: var(--space-2); }

/* ---------- Legal details list ---------- */
.details {
  display: grid;
  grid-template-columns: 1fr;
  margin: 0;
  border-top: 1px solid var(--line);
}
.details > div {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--line);
}
@media (min-width: 560px) {
  .details > div { grid-template-columns: 220px 1fr; gap: var(--space-4); }
}
.details dt { font-weight: 600; color: var(--ink-muted); font-size: 14px; }
.details dd { margin: 0; }

/* ---------- Footer (navy band, data-theme="dark") ---------- */
.site-footer {
  background: var(--navy);
  color: var(--ink);
  padding: var(--space-6) 0 var(--space-5);
  font-size: 14px;
  line-height: 21px;
}
.site-footer__grid {
  display: grid;
  gap: var(--space-5);
}
@media (min-width: 720px) {
  .site-footer__grid { grid-template-columns: 1.2fr 1fr 0.8fr; align-items: start; }
}
.site-footer__logo { width: 200px; }
.site-footer h2 {
  font-family: var(--font-display);
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-ink);
  margin: 0 0 var(--space-3);
}
.site-footer p { margin: 0 0 var(--space-2); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: var(--space-2); }
.site-footer a { color: var(--ink); }
.site-footer a:hover { color: var(--gold-ink); }
.site-footer__base {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
}

/* ---------- 404 ---------- */
.not-found { text-align: left; }
.not-found .btn { margin-top: var(--space-3); }

/* ---------- Paper texture on the navy bands ----------
   Same paper as the beige, in navy: a seamless 256px tile whose average
   colour is exactly --navy. To remove it, delete this block. */
.site-header,
.hero,
.page-title,
.site-footer {
  background-color: var(--navy);
  background-image: url("../assets/paper-texture-navy.png");
  background-size: 256px 256px;
}

/* ---------- Publications list (founder page) ---------- */
.prose .pubs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-5);
}
.pubs .card p { margin-bottom: var(--space-2); }
