/* ---------- Variables ---------- */
:root {
  --black: #000000;
  --blue-dark: #123f72;
  --blue-light: #1f5ea8;
  --white: #ffffff;
  --max-width: 1192px;
  --sidebar-width: 298px;
  --gutter: 20px;
  --font: "Open Sans", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  color: #222;
  background: var(--white);

  /* Sticky footer: page is at least as tall as the window */
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

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

address { font-style: normal; }

a { color: inherit; }

/* Centred content column used by full-width bars */
.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Black bar ---------- */
.topbar {
  background: var(--black);
  padding: 8px 0;
}

.logo-link { display: inline-block; line-height: 0; }

.logo-top { height: 56px; width: auto; }

/* ---------- Dark blue department heading ---------- */
.dept-banner {
  background: var(--blue-dark);
  color: var(--white);
  padding: 32px 0 40px;
}

.dept-title {
  margin: 0;
  font-size: clamp(1.6rem, 4.5vw, 2.5rem);
  font-weight: 300;
  line-height: 1.2;
}

/* ---------- Main layout ---------- */
.page {
  display: grid;
  flex: 1 0 auto; /* takes up spare height, pushing the footer down */
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  grid-template-columns: minmax(0, 1fr) var(--sidebar-width);
  grid-template-areas:
    "band aside"
    "body aside";
  grid-template-rows: auto 1fr;
}

/* Light blue band holding name and role */
.band {
  grid-area: band;
  background: var(--blue-light);
  color: var(--white);
  padding: 24px var(--gutter) 28px;
}

.band h1 {
  margin: 0 0 36px;
  font-size: clamp(1.75rem, 4vw, 2.1rem);
  font-weight: 300;
  line-height: 1.2;
}

.role {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.35;
}

/* Light blue sidebar running down the right-hand side */
.sidebar {
  grid-area: aside;
  background: var(--blue-light);
  color: var(--white);
  padding: 110px var(--gutter) 40px;
}

.portrait {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.sidebar h2 {
  margin: 48px 0 0;
  padding-bottom: 14px;
  font-size: 1.4rem;
  font-weight: 300;
  border-bottom: 1px solid rgba(255, 255, 255, 0.75);
}

.contact {
  margin: 24px 0 0;
  font-size: 0.875rem;
  line-height: 1.5;
}

.contact dt { font-weight: 700; margin-top: 14px; }
.contact dt:first-child { margin-top: 0; }
.contact dd { margin: 0; overflow-wrap: anywhere; }

/* White body area */
.body {
  grid-area: body;
  background: var(--white);
  min-height: 420px;
  padding: var(--gutter);
}

/* ---------- Lower dark blue strip ---------- */
.lower-blue {
  background: var(--blue-dark);
  height: 40px;
}

/* ---------- Black footer ---------- */
.footer {
  background: var(--black);
  color: var(--white);
  padding: 28px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  gap: 40px;
}

.logo-footer { display: block; height: 96px; width: auto; flex: none; }

.footer-address {
  font-size: 0.875rem;
  line-height: 1.5;
}

/* ---------- Small screens ---------- */
@media (max-width: 800px) {
  .page {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "band"
      "aside"
      "body";
    grid-template-rows: auto;
  }

  .band h1 { margin-bottom: 20px; }

  .sidebar { padding-top: 8px; }

  /* Keep the portrait a sensible size when stacked */
  .portrait { max-width: 258px; }

  .sidebar h2 { margin-top: 32px; }

  .body { min-height: 200px; }

  .topbar { padding: 6px 0; }
  .logo-top { height: 48px; }
  .dept-banner { padding: 24px 0 28px; }

  .lower-blue { height: 24px; }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }
}
