/* Association for Metabolic Health — site styles
   Colours: NHS identity set (placeholders until the trustees agree the brand). */
:root {
  --text: #212B32;
  --text-2: #4C6272;
  --blue: #005EB8;
  --blue-dark: #003087;
  --pale: #F0F4F5;
  --box: #E8EDEE;
  --border: #D8DDE0;
  --white: #FFFFFF;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", Arial, Helvetica, sans-serif;
  --wrap: 1000px;
  --gutter: 24px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 110px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--white);
  color: var(--text);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.6;
}
img { max-width: 100%; display: block; }
a { color: var(--blue); }
a:hover { color: var(--blue-dark); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid #FFEB3B;
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--text);
}

.wrap { max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: 88px 0; }
.section--pale { background: var(--pale); }
.section--navy { background: var(--blue-dark); color: var(--white); }

.eyebrow {
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
}
.section--navy .eyebrow { color: #A6C8EE; }

h1, h2, h3 { margin: 0; font-weight: 400; }
h1, h2 { font-weight: 600; }
h1 {
  font-family: var(--serif);
  font-size: clamp(36px, 6vw, 64px);
  line-height: 1.12;
  letter-spacing: -0.01em;
  max-width: 15em;
}
h2 {
  font-family: var(--serif);
  font-size: clamp(30px, 4vw, 40px);
  line-height: 1.2;
}
.lead { font-size: clamp(18px, 2vw, 20px); color: var(--text-2); max-width: 36em; }
p { margin: 0 0 16px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--pale);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 96px; gap: 16px; padding-top: 10px; padding-bottom: 10px; }
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-decoration: none; color: var(--text); }
/* The logo file has a white background; multiply lets the header colour show through it. */
.brand-logo { height: 64px; width: auto; mix-blend-mode: multiply; }
.brand-name { display: block; font-family: var(--serif); font-size: 18px; line-height: 1.2; }
.brand-sub { display: block; font-size: 12px; color: var(--text-2); }
.nav ul { list-style: none; display: flex; gap: 28px; margin: 0; padding: 0; }
.nav a { font-size: 15px; text-decoration: none; color: var(--blue); }
.nav a:hover { text-decoration: underline; }
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font: 600 14px var(--sans);
  color: var(--blue);
  cursor: pointer;
}

.nav-toggle { min-width: 44px; min-height: 44px; }
.nav-bars { display: block; width: 24px; margin: 0 auto; }
.nav-bars span { display: block; height: 2px; margin: 5px 0; background: var(--blue); border-radius: 2px; transition: transform 0.2s, opacity 0.2s; }
.nav-toggle[aria-expanded="true"] .nav-bars span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-bars span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-bars span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
/* ---------- Buttons ---------- */
.buttons { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }
.btn {
  display: inline-block;
  padding: 13px 22px;
  border-radius: 6px;
  border: 2px solid var(--blue);
  font: 600 16px var(--sans);
  text-decoration: none;
  text-align: center;
  cursor: pointer;
}
.btn--solid { background: var(--blue); color: var(--white); }
.btn--solid:hover { background: var(--blue-dark); border-color: var(--blue-dark); color: var(--white); }
.btn--outline { background: transparent; color: var(--blue); }
.btn--outline:hover { background: rgba(0, 94, 184, 0.06); }
.btn[disabled] { opacity: 0.6; cursor: wait; }

/* ---------- Welcome ---------- */
.hero { padding: 96px 0 104px; }
.hero h1 { margin-bottom: 28px; }
/* Opening statements run the full content width, lining up with the sections below. */
.hero .lead, .contact-hero .lead { max-width: none; }

/* ---------- Purpose ---------- */
.purpose { display: grid; grid-template-columns: 1fr 1.6fr; gap: 48px; }
.purpose-text { font-size: 19px; color: var(--text-2); }
/* A white section that sits next to another white section gets a dividing line. */
.section--divided { border-bottom: 1px solid var(--border); }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 28px; }
.card { background: var(--box); border-radius: 10px; padding: 24px; }
.card .eyebrow { font-size: 13px; margin-bottom: 10px; }
.card p { font-family: var(--serif); font-size: 20px; line-height: 1.45; margin: 0; }

/* ---------- Values ---------- */
.section-intro { margin-top: 18px; color: var(--text-2); }
.values {
  list-style: none;
  margin: 44px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  column-gap: 36px;
  border-top: 1px solid var(--border);
}
.values li { padding: 28px 0; border-bottom: 1px solid var(--border); }
/* Five values: three across the first row, two wider ones on the second. */
.values li { grid-column: span 2; }
.values li:nth-child(n+4) { grid-column: span 3; }
.value-num { font-family: var(--serif); font-size: 15px; color: var(--blue); margin-bottom: 12px; }
.values h3 { font-size: 19px; font-weight: 600; line-height: 1.35; margin-bottom: 10px; }
.values p { font-size: 16px; color: var(--text-2); margin: 0; }

/* ---------- Trustees ---------- */
.trustees {
  list-style: none;
  margin: 44px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
}
/* Keep zoomed photos inside their own box so they never widen the page on phones. */
.trustees li { min-width: 0; overflow: hidden; }
.trustees img { width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 10px; background: var(--border); }
/* Trustee photo framing: each photo is zoomed so every face is the same size, with the eyes at the
   same height. Remove a photo's rule when it is replaced with a new, consistently framed photo. */
.trustees img[src*="kim-andrews"] { transform: scale(1.8405); transform-origin: 46.35% 16.79%; clip-path: inset(7.67% 24.5% 38% 21.17% round 5.4px); border-radius: 0; }
.trustees img[src*="ruth-tapsell"] { transform: scale(1.6667); transform-origin: 43.75% 8.75%; clip-path: inset(3.5% 22.5% 36.5% 17.5% round 6px); border-radius: 0; }
.trustees img[src*="helen-gowers"] { transform: scale(1.4118); transform-origin: 44.57% 22.86%; clip-path: inset(6.67% 16.17% 22.5% 13% round 7.1px); border-radius: 0; }
.trustees img[src*="david-sogan"] { transform: scale(1.165); transform-origin: 0% 75.3%; clip-path: inset(10.67% 14.17% 3.5% 0% round 8.6px); border-radius: 0; }
.trustee-name { font-weight: 600; font-size: 16px; margin: 14px 0 2px; line-height: 1.35; }
.trustee-role { font-size: 14px; color: var(--text-2); margin: 0; }
.small-note { margin-top: 36px; font-size: 15px; color: var(--text-2); }

/* ---------- Forms ---------- */
.signup { display: grid; grid-template-columns: 1fr 1.05fr; gap: 56px; align-items: start; }
.signup h2 { color: var(--white); margin-bottom: 20px; }
.signup-text p { color: #E8EDEE; font-size: 18px; }
.form-card { background: var(--white); color: var(--text); border-radius: 12px; padding: 28px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%;
  padding: 11px 12px;
  border: 2px solid #AEB7BD;
  border-radius: 6px;
  font: 16px var(--sans);
  color: var(--text);
  background: var(--white);
}
.field textarea { min-height: 150px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #768692; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text-2); margin: 4px 0 20px; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--blue); }
.form-card .btn { width: 100%; }
.form-msg { margin: 14px 0 0; font-size: 15px; }
.form-msg.is-error { color: #D5281B; }
.field-error { margin: 6px 0 0; font-size: 14px; color: #D5281B; }
.field-error:empty { display: none; }
.check + .field-error { margin: -14px 0 16px; }
.form-loading { margin: 0; color: var(--text-2); }
.form-done p { font-family: var(--serif); font-size: 20px; line-height: 1.5; margin: 0 0 10px; }
.form-done:focus { outline: none; }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: #D5281B; }

/* ---------- Contact page ---------- */
.contact-hero { padding: 72px 0 48px; }
.contact-body { padding: 0 0 96px; background: var(--pale); }
.contact-body .form-card { max-width: 640px; border: 1px solid var(--border); }

/* ---------- Useful links page ---------- */
.links-section { padding-top: 56px; }
.links-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.link-card { display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--border); border-radius: 10px; padding: 26px 26px 22px; }
/* An odd card out at the end spans the full width rather than sitting alone. */
.link-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
.link-region { margin: 0 0 8px; font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); }
.link-card h2 { font-size: 24px; line-height: 1.25; margin-bottom: 12px; }
.link-card p:not(.link-region) { font-size: 16px; color: var(--text-2); margin-bottom: 18px; }
.link-card a { margin-top: auto; font-weight: 600; font-size: 16px; overflow-wrap: anywhere; }
.nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 4px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* ---------- Footer ---------- */
.site-footer { background: var(--text); color: #D8DDE0; padding: 48px 0; font-size: 14px; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 40px; }
.footer-name { font-family: var(--serif); font-size: 18px; color: var(--white); margin-bottom: 8px; }
.site-footer p { margin: 0 0 6px; }
.footer-links { text-align: right; }
.footer-links a { color: var(--white); }
.disclaimer { max-width: none; }

/* ---------- Tablet ---------- */
@media (max-width: 960px) {
  .trustees { grid-template-columns: repeat(3, 1fr); }
  .values { grid-template-columns: repeat(2, 1fr); }
  .values li, .values li:nth-child(n+4) { grid-column: span 1; }
  .values li:last-child { grid-column: 1 / -1; }
  .purpose, .signup { grid-template-columns: 1fr; gap: 32px; }
}

/* ---------- Mobile ---------- */
@media (max-width: 720px) {
  :root { --gutter: 16px; }
  body { font-size: 17px; }
  .section { padding: 56px 0; }
  .hero { padding: 56px 0 64px; }
  .site-header .wrap { min-height: 76px; }
  .brand-logo { height: 50px; }
  .brand-name { font-size: 16px; }
  .brand-sub { font-size: 11px; }
  .nav-toggle { display: block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--pale); border-bottom: 1px solid var(--border); }
  .nav.is-open { display: block; }
  .nav ul { flex-direction: column; gap: 0; padding: 8px var(--gutter) 16px; }
  .nav a { display: block; padding: 12px 0; font-size: 17px; border-bottom: 1px solid var(--border); }
  .buttons { flex-direction: column; }
  .btn { width: 100%; }
  .cards { grid-template-columns: 1fr; }
  .links-grid { grid-template-columns: 1fr; }
  .link-card { padding: 20px; }
  .values { grid-template-columns: 1fr; }
  .values li:last-child { grid-column: auto; }
  .trustees { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .form-card { padding: 20px; }
  .site-footer .wrap { flex-direction: column; gap: 20px; }
  .footer-links { text-align: left; }
  .contact-hero { padding: 48px 0 32px; }
}
