/* CEI 2027 — "Saltire & Heather" theme.
   Keep blue dominant; use heather and green sparingly. */

:root {
  --saltire: #005EB8;      /* primary branding, buttons, links */
  --saltire-dark: #004A92; /* hover state */
  --navy: #16324F;         /* headings, body text, footer */
  --heather: #7A4E82;      /* small accents and highlights */
  --green: #3E6B56;        /* optional environmental accent */
  --mist: #EAF2F8;         /* alternate sections, soft panels */
  --off-white: #FAF9F6;    /* main background */
  --white: #FFFFFF;        /* cards, text on dark backgrounds */

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 10px;
  --shadow: 0 1px 2px rgb(22 50 79 / 0.06), 0 4px 16px rgb(22 50 79 / 0.08);
  --max: 72rem;
}

*, *::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.65;
  color: var(--navy);
  background: var(--off-white);
}

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

h1, h2, h3, h4 { line-height: 1.2; color: var(--navy); margin: 1.6em 0 0.5em; }
h1 { font-size: clamp(2rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 3vw, 1.9rem); }
h3 { font-size: 1.25rem; }

a { color: var(--saltire); text-underline-offset: 0.15em; }
a:hover { color: var(--saltire-dark); }
:focus-visible { outline: 3px solid var(--heather); outline-offset: 2px; }

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

.skip-link {
  position: absolute; left: 1rem; top: -3rem; z-index: 100;
  background: var(--navy); color: var(--white); padding: 0.5rem 1rem; border-radius: var(--radius);
}
.skip-link:focus { top: 1rem; color: var(--white); }

/* ---------- Header ---------- */

.site-header { background: var(--white); border-bottom: 4px solid var(--saltire); }
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 1rem; padding-top: 0.75rem; padding-bottom: 0.75rem;
}
.lockup { display: flex; align-items: center; gap: 1rem; }
.brand { display: flex; align-items: center; gap: 0.85rem; text-decoration: none; color: var(--navy); }
.brand__logo { width: 72px; height: 72px; display: block; }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__title { font-weight: 800; font-size: 1.5rem; color: var(--saltire); letter-spacing: -0.01em; }
.brand__subtitle { font-size: 0.9rem; color: var(--navy); }
.brand:hover .brand__title { color: var(--saltire-dark); }
.lockup__org {
  display: flex; align-items: center; gap: 0.6rem; padding-left: 1rem;
  border-left: 1px solid var(--mist); text-decoration: none; color: var(--navy);
}
.lockup__org a { display: block; line-height: 0; }
.lockup__org img { width: 64px; height: auto; display: block; }
.lockup__org img.lockup__alumni { width: auto; height: 56px; }
.lockup__by { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap; }

/* Nav sits on its own row under the logo lockup */
.site-nav { flex-basis: 100%; border-top: 1px solid var(--mist); padding-top: 0.4rem; }

/* Narrow screens: conference brand on top, "Hosted by CEI" and the menu button below */
@media (max-width: 36rem) {
  .site-header__inner {
    display: grid; grid-template-columns: 1fr auto; align-items: center;
    grid-template-areas: "brand brand" "org toggle" "nav nav"; gap: 0.6rem 1rem;
  }
  .lockup { display: contents; }
  .brand { grid-area: brand; }
  .brand__logo { width: 60px; height: 60px; }
  .lockup__org { grid-area: org; border-left: 0; padding-left: 0; }
  .lockup__org img { width: 48px; }
  .lockup__org img.lockup__alumni { width: auto; height: 44px; }
  .nav-toggle { grid-area: toggle; }
  .site-nav { grid-area: nav; }
}

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem; }
.site-nav a {
  display: block; padding: 0.5rem 0.8rem; border-radius: 6px;
  text-decoration: none; font-weight: 600; color: var(--navy);
}
.site-nav a:hover { background: var(--mist); color: var(--saltire); }
.site-nav a[aria-current="page"] { color: var(--saltire); box-shadow: inset 0 -3px 0 var(--heather); border-radius: 6px 6px 0 0; }

.nav-toggle { display: none; }

@media (max-width: 52rem) {
  .js .nav-toggle {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: none; border: 2px solid var(--saltire); color: var(--saltire);
    border-radius: 6px; padding: 0.4rem 0.75rem; font: inherit; font-weight: 600; 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; }

  .js .site-nav { display: none; }
  .js .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; }
  .site-nav a[aria-current="page"] { box-shadow: inset 4px 0 0 var(--heather); border-radius: 0 6px 6px 0; }
}

/* ---------- Banner (home) and page headers ---------- */

.banner {
  background-color: var(--navy); background-size: cover; background-position: center;
  position: relative;
}
.banner::before { content: ""; position: absolute; inset: 0; background: rgb(22 50 79 / 0.45); }
.banner__inner {
  position: relative; display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; min-height: clamp(14rem, 34vw, 26rem); padding-top: 2rem; padding-bottom: 2rem;
}
.banner__title {
  margin: 0; color: var(--white); text-align: center; font-weight: 800; letter-spacing: -0.01em;
  font-size: clamp(2.25rem, 8vw, 5.5rem); text-shadow: 0 2px 12px rgb(0 0 0 / 0.35);
}
/* Logos sit on white so the CEI logo keeps its original colours */
.banner__logo {
  flex: 0 0 auto; background: var(--white); border-radius: var(--radius); padding: 0.75rem;
  box-shadow: var(--shadow); line-height: 0;
}
.banner__logo img { width: clamp(4.5rem, 14vw, 10rem); height: auto; }
.banner__conf-logo { flex: 0 0 auto; width: clamp(6rem, 18vw, 13rem); height: auto; filter: drop-shadow(0 2px 8px rgb(0 0 0 / 0.45)); }

/* Subtle saltire (diagonal cross) over Saltire blue */
.page-hero {
  color: var(--white); padding: 2.75rem 0 2.25rem;
  background-color: var(--saltire);
  background-image:
    linear-gradient(to top right, transparent 46%, rgb(255 255 255 / 0.07) 46%, rgb(255 255 255 / 0.07) 54%, transparent 54%),
    linear-gradient(to bottom right, transparent 46%, rgb(255 255 255 / 0.07) 46%, rgb(255 255 255 / 0.07) 54%, transparent 54%);
}
.page-hero h1 { color: var(--white); margin: 0; }
.page-hero__intro { font-size: 1.15rem; max-width: 42rem; margin-bottom: 0; }

/* ---------- Buttons ---------- */

.button {
  display: inline-block; padding: 0.7rem 1.3rem; border-radius: 6px; border: 2px solid var(--saltire);
  background: var(--saltire); color: var(--white); font-weight: 700; text-decoration: none;
}
.button:hover { background: var(--saltire-dark); border-color: var(--saltire-dark); color: var(--white); }
.button--light { background: var(--white); border-color: var(--white); color: var(--saltire); }
.button--light:hover { background: var(--mist); border-color: var(--mist); color: var(--saltire-dark); }
.button--outline-light { background: transparent; border-color: var(--white); color: var(--white); }
.button--outline-light:hover { background: rgb(255 255 255 / 0.12); border-color: var(--white); }
.button[aria-disabled="true"] { background: var(--mist); border-color: var(--mist); color: var(--navy); cursor: not-allowed; }

/* ---------- Content ---------- */

.prose { padding-top: 1rem; padding-bottom: 3.5rem; }
.prose > * { max-width: 46rem; }
.prose > .cards, .prose > .photo-pair { max-width: none; }

.section { padding: 3.5rem 0; }
.section--mist { background: var(--mist); }
.section > .container > h2:first-child { margin-top: 0; }

.intro { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: center; font-size: 1.15rem; }
.intro p:first-child { margin-top: 0; }
.intro .photo img { aspect-ratio: 4 / 3; object-fit: cover; object-position: 50% 30%; }
@media (max-width: 52rem) { .intro { grid-template-columns: 1fr; } }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.facts div { border-left: 4px solid var(--heather); padding-left: 0.85rem; }
.facts dt { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; }
.facts dd { margin: 0; font-size: 1.2rem; font-weight: 700; color: var(--saltire); }

.photo { margin: 1.5rem 0; }
.photo img { display: block; width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); }
.photo-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1.25rem; margin: 1.5rem 0; }
.photo-pair .photo { margin: 0; }
.photo-pair--portrait { grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
.photo-pair--portrait img { aspect-ratio: 3 / 4; object-fit: cover; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1.25rem; margin: 1.5rem 0; }
.card {
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.5rem; border-top: 4px solid var(--saltire);
}
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }
.card--heather { border-top-color: var(--heather); }
.card--green { border-top-color: var(--green); }

.callout {
  background: var(--mist); border-left: 4px solid var(--heather);
  border-radius: 0 var(--radius) var(--radius) 0; padding: 1rem 1.25rem; margin: 1.5rem 0;
}
.callout p { margin: 0.25rem 0; }

.tbc {
  display: inline-block; padding: 0 0.45rem; border-radius: 4px;
  background: var(--mist); color: var(--heather); font-weight: 700; font-size: 0.9em;
}

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--white); box-shadow: var(--shadow); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 0.75rem 1rem; border-bottom: 1px solid var(--mist); vertical-align: top; }
th { background: var(--navy); color: var(--white); }
tr:last-child td { border-bottom: 0; }

/* ---------- Footer ---------- */

.site-footer { background: var(--navy); color: var(--white); padding: 3rem 0 1.5rem; font-size: 0.95rem; }
.site-footer a { color: var(--white); }
.site-footer a:hover { color: var(--mist); }
.site-footer ul { list-style: none; margin: 0 0 1rem; padding: 0; }
.site-footer li { margin: 0.3rem 0; }
.site-footer__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 2rem; }
.footer-lockup { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.footer-lockup > img { width: 88px; height: 88px; }
.footer-lockup__org { background: var(--white); border-radius: 8px; padding: 0.4rem; line-height: 0; }
.footer-lockup__org img { width: 64px; height: auto; }
.footer-lockup__org img.footer-lockup__alumni { width: auto; height: 52px; }
.site-footer__title { font-weight: 800; font-size: 1.15rem; margin-top: 0; }
.site-footer__heading {
  margin: 0 0 0.5rem; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em;
  border-bottom: 2px solid var(--heather); display: inline-block; padding-bottom: 0.15rem;
}
.site-footer__social { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }
.site-footer__legal { border-top: 1px solid rgb(255 255 255 / 0.2); margin-top: 2rem; padding-top: 1rem; font-size: 0.85rem; }
.site-footer__legal p { margin: 0; }
