/* UWO 2027 — Cardiff University brand colours (brand.cardiff.ac.uk/colour):
   primary red #E4251B, white, black #121212 and its 10% greys.
   Marr Sans isn't licensed for the web here, so a system sans stack stands in.
   Red text only on white; never red on black. */
:root {
  --red: #E4251B;
  --red-dark: #B81D15;
  --black: #121212;
  --grey-90: #333333;
  --grey-70: #666666;
  --grey-30: #CCCCCC;
  --grey-20: #E5E5E5;
  --grey-10: #F2F2F2;
  --white: #FFFFFF;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 4px;
  --wrap: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--black);
  background: var(--white);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--red-dark); text-underline-offset: 0.15em; }
a:hover { color: var(--black); }
:focus-visible { outline: 3px solid var(--black); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 0.6em; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 1.5rem; }
p, ul, ol { margin: 0 0 1em; }
sub { line-height: 0; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--black); color: var(--white); padding: 0.5rem 1rem; z-index: 10;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

/* Header */
.site-header { border-top: 6px solid var(--red); background: var(--white); border-bottom: 1px solid var(--grey-20); }
.header-inner { display: flex; align-items: center; gap: 1.5rem; padding-top: 0.75rem; padding-bottom: 0.75rem; }
.brand img { height: 64px; width: auto; }
.header-meta { display: flex; flex-direction: column; font-size: 0.9375rem; line-height: 1.35; color: var(--grey-90); }
.header-dates { font-weight: 700; color: var(--black); }

.site-nav { background: var(--black); }
.site-nav ul { list-style: none; display: flex; flex-wrap: wrap; margin: 0 auto; padding: 0 calc(1.25rem - 0.75rem); }
.site-nav a {
  display: block; padding: 0.8rem 0.75rem; color: var(--white); text-decoration: none;
  font-size: 0.9375rem; font-weight: 500; border-bottom: 3px solid transparent;
}
.site-nav a:hover { border-bottom-color: var(--white); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--red); font-weight: 700; }

.nav-toggle {
  display: none; margin-left: auto; align-items: center; gap: 0.5rem;
  background: none; border: 2px solid var(--black); border-radius: var(--radius);
  padding: 0.45rem 0.75rem; font: inherit; font-weight: 700; color: var(--black); cursor: pointer;
}
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
  display: block; width: 18px; height: 2px; background: currentColor; position: relative;
}
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }

/* Main */
.site-main { flex: 1; padding: 2.5rem 0 4rem; }
.page-title {
  font-size: clamp(2rem, 4vw, 2.75rem); margin-bottom: 1.5rem;
  padding-bottom: 0.75rem; border-bottom: 4px solid var(--red); display: inline-block;
}
.prose { max-width: 46rem; }
.prose h2 { margin-top: 1.75rem; }
.prose h2:first-child { margin-top: 0; }
.lead { font-size: 1.25rem; line-height: 1.5; }
.note { font-size: 0.9375rem; color: var(--grey-90); }

.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 2.5rem; align-items: start; }
.two-col.even { grid-template-columns: 1fr 1fr; }
.two-col .prose { max-width: none; }

.card {
  background: var(--grey-10); border-top: 4px solid var(--red);
  padding: 1.5rem; border-radius: 0 0 var(--radius) var(--radius);
}
.card h2 { font-size: 1.3rem; }
.card > :last-child { margin-bottom: 0; }
address.card { font-style: normal; margin-bottom: 1.25rem; }

/* Buttons */
.btn {
  display: inline-block; padding: 0.7rem 1.2rem; border-radius: var(--radius);
  background: var(--red); color: var(--white); border: 2px solid var(--red);
  font-weight: 700; text-decoration: none; line-height: 1.3;
}
.btn:hover { background: var(--black); border-color: var(--black); color: var(--white); }
.btn-outline { background: var(--white); color: var(--black); border-color: var(--black); }
.btn-outline:hover { background: var(--black); color: var(--white); }
.btn-light { background: var(--white); color: var(--black); border-color: var(--white); }
.btn-light:hover { background: var(--black); border-color: var(--black); color: var(--white); }
.btn-ghost { background: transparent; color: var(--white); border-color: var(--white); }
.btn-ghost:hover { background: var(--white); color: var(--black); border-color: var(--white); }
.btn.is-soon, .btn.is-soon:hover {
  background: var(--grey-20); border-color: var(--grey-30); color: var(--grey-90); cursor: not-allowed;
}
.btn-block { display: block; text-align: center; }
.btn small { font-weight: 400; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.action-card .btn { display: block; text-align: center; }

/* Home hero: red flood fill with white text, logo on white */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  margin-bottom: 3rem; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--grey-20);
}
.hero-text { background: var(--red); color: var(--white); padding: clamp(1.75rem, 4vw, 3rem); }
.hero-text h1 { font-size: clamp(2.1rem, 4.5vw, 3.25rem); margin-bottom: 0.5em; }
.hero-text h1 span { display: block; font-size: 0.62em; margin-top: 0.3em; }
.hero-text .lead { margin-bottom: 1.75rem; }
.eyebrow { font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.875rem; margin-bottom: 1rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.hero-art { background: var(--white); display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
body.home .brand img { height: 52px; }

/* Key dates */
.dates { list-style: none; padding: 0; margin: 0; }
.dates li { display: flex; flex-direction: column; padding: 0.7rem 0 0.7rem 1rem; border-left: 3px solid var(--grey-30); }
.dates li + li { margin-top: 0.15rem; }
.dates time { font-weight: 700; }
.dates span { color: var(--grey-90); font-size: 0.9375rem; }
.dates li.is-event { border-left-color: var(--red); }
.dates li.is-event time { color: var(--red-dark); }

/* People */
.committee { display: grid; grid-template-columns: 1fr 2fr; gap: 2rem; align-items: start; }
.people { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.9rem 2rem; }
.committee .card:last-child .people { grid-template-columns: 1fr 1fr; }
.people li { display: flex; flex-direction: column; }
.people span { color: var(--grey-90); font-size: 0.9375rem; }

.steps { padding-left: 1.4rem; }
.steps li { margin-bottom: 0.4rem; padding-left: 0.25rem; }
.steps li::marker { font-weight: 700; color: var(--red-dark); }

/* Map */
.map { margin: 0; }
.map iframe { width: 100%; height: 380px; border: 1px solid var(--grey-30); border-radius: var(--radius); display: block; }
.map figcaption { font-size: 0.8125rem; color: var(--grey-70); margin-top: 0.4rem; }

/* Footer: white on black (never red text on black) */
.site-footer { background: var(--black); color: var(--white); padding: 2.5rem 0 2rem; font-size: 0.9375rem; }
.site-footer a { color: var(--white); }
.site-footer a:hover { color: var(--grey-30); }
.footer-inner { display: grid; grid-template-columns: 2fr 2fr 1fr; gap: 2rem; }
.footer-title { font-weight: 700; margin-bottom: 0.4rem; border-top: 3px solid var(--red); padding-top: 0.6rem; display: inline-block; }

/* Tablet */
@media (max-width: 960px) {
  .two-col, .two-col.even, .committee { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; }
  .hero-art { order: -1; padding: 1rem 1.5rem; }
  .hero-art img { max-height: 260px; width: auto; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

/* Phone (md breakpoint): collapsible menu */
@media (max-width: 767px) {
  .header-meta { display: none; }
  .js .nav-toggle { display: inline-flex; }
  .js .site-nav { display: none; }
  .js .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; padding: 0.25rem 0; }
  .site-nav a { padding: 0.75rem 1.25rem; border-bottom: none; border-left: 4px solid transparent; }
  .site-nav ul.wrap { padding: 0; }
  .site-nav a[aria-current="page"] { border-left-color: var(--red); }
  .brand img, body.home .brand img { height: 48px; }
  .committee .card:last-child .people { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .map iframe { height: 300px; }
}

@media print {
  .site-nav, .nav-toggle, .hero-actions, .map iframe { display: none; }
  .hero-text { background: none; color: var(--black); }
}

/* Map / directions links with brand icons */
.btn-icon { display: inline-flex; align-items: center; gap: 0.5rem; }
.btn-icon svg { flex: none; }
.w3w { display: inline-block; margin-top: 0.5rem; font-weight: 700; color: #E11F26; text-decoration: none; }
.w3w:hover { text-decoration: underline; color: var(--black); }

/* Committee photo cards */
.committee-group + .committee-group { margin-top: 2.5rem; }
.people-grid {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1.25rem;
}
.person {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  background: var(--grey-10); border-top: 4px solid var(--red);
  border-radius: 0 0 var(--radius) var(--radius); padding: 1.5rem 1rem 1.25rem;
}
.person .avatar {
  width: 112px; height: 112px; border-radius: 50%; object-fit: cover;
  margin-bottom: 0.9rem; background: var(--grey-20); border: 3px solid var(--white);
  box-shadow: 0 0 0 1px var(--grey-30);
}
.avatar-initials {
  display: flex; align-items: center; justify-content: center;
  background: var(--red) !important; color: var(--white); font-size: 2.25rem; font-weight: 700; letter-spacing: 0.02em;
}
.person strong { font-size: 1.0625rem; line-height: 1.3; }
.person strong a { color: var(--black); text-decoration-color: var(--red); }
.person strong a:hover { color: var(--red-dark); }
.person > span:not(.avatar) { color: var(--grey-90); font-size: 0.9375rem; line-height: 1.35; margin-top: 0.2rem; }
@media (max-width: 767px) {
  .people-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
  .person { padding: 1.1rem 0.6rem 1rem; }
  .person .avatar { width: 88px; height: 88px; }
  .avatar-initials { font-size: 1.75rem; }
}
