/* =====================================================================
   GINEERS — common.css
   Shared by EVERY page: fonts, colours, header, footer, buttons.
   Change something here once and it changes on the whole site.
   Each template also loads its own file (landing.css, level2.css, ...).
   ===================================================================== */

/* ---------- Fonts (files live in /src/fonts/ — see fonts/README.txt) ---------- */
@font-face {
  font-family: "Roboto";
  src: local("Roboto"), local("Roboto-Regular"),
       url("../fonts/Roboto-Regular.woff2") format("woff2"),
       url("../fonts/Roboto-Regular.ttf") format("truetype");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Roboto";
  src: local("Roboto Medium"), local("Roboto-Medium"),
       url("../fonts/Roboto-Medium.woff2") format("woff2"),
       url("../fonts/Roboto-Medium.ttf") format("truetype");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Roboto";
  src: local("Roboto Bold"), local("Roboto-Bold"),
       url("../fonts/Roboto-Bold.woff2") format("woff2"),
       url("../fonts/Roboto-Bold.ttf") format("truetype");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Opal";
  src: local("Opal"),
       url("../fonts/Opal.woff2") format("woff2"),
       url("../fonts/Opal.ttf") format("truetype"),
       url("../fonts/Opal.otf") format("opentype");
  font-weight: 400 700; font-style: normal; font-display: swap;
}

/* ---------- Colours & sizes (edit here) ---------- */
:root {
  --blue-light: #0096ea;   /* logo light blue  (C89 M43 Y0 K0)  */
  --blue-dark:  #003d7e;   /* logo dark blue   (from GineersLogo.pdf; readme said #003d73) */
  --blue-ink:   #002a57;   /* darker shade for hover / footer */
  --blue-tint:  #e8f4fc;   /* very light blue backgrounds */
  --red:        #c8102e;   /* accent red (improvised) — 5.9:1 on white */
  --white:      #ffffff;
  --black:      #000000;
  --text:       #111111;   /* body text: ~19:1 contrast on white */
  --text-soft:  #333333;   /* secondary text: still 12:1 */
  --line:       #c9d3de;

  --font-body:    "Roboto", "Segoe UI", Arial, Helvetica, sans-serif;
  --font-heading: "Opal", "Roboto", "Segoe UI", Arial, Helvetica, sans-serif;

  --max-width: 1240px;
  --radius: 10px;
  --shadow: 0 6px 22px rgba(0, 42, 87, 0.12);
  --header-h: 96px;
}

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

html {
  font-size: 112.5%;            /* 18px base — large, easy to read */
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}
@media (min-width: 1400px) { html { font-size: 118.75%; } } /* 19px on big screens */

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--white);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

main { flex: 1 0 auto; }

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

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--blue-dark);
  line-height: 1.25;
  margin: 0 0 0.6em;
  font-weight: 700;
}
h1 { font-size: clamp(2rem, 3.2vw, 2.75rem); }
h2 { font-size: clamp(1.6rem, 2.5vw, 2.1rem); }
h3 { font-size: 1.4rem; }
p  { margin: 0 0 1em; }

a { color: var(--blue-dark); text-underline-offset: 3px; }
a:hover { color: var(--blue-light); }

/* Very visible keyboard focus for accessibility */
:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
  border-radius: 4px;
}

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

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--blue-dark); color: var(--white);
  padding: 12px 20px; z-index: 1000; font-weight: 700;
}
.skip-link:focus { left: 12px; top: 12px; color: var(--white); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--white);
  border-top: 6px solid var(--blue-light);
  box-shadow: 0 2px 0 var(--blue-tint), 0 4px 18px rgba(0, 42, 87, 0.08);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  min-height: var(--header-h);
  gap: 24px;
}
.logo { display: inline-flex; align-items: center; }
.logo img { width: 230px; height: auto; }

.main-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; align-items: center; gap: 6px;
}
.main-nav a {
  display: block;
  padding: 10px 16px;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  border-radius: 8px;
  transition: background .15s, color .15s;
}
.main-nav a:hover { background: var(--blue-tint); color: var(--blue-dark); }
.main-nav a[aria-current="page"] {
  color: var(--blue-dark);
  box-shadow: inset 0 -3px 0 var(--blue-light);
  border-radius: 0;
}
.main-nav .nav-login {
  background: var(--blue-dark); color: var(--white);
  margin-left: 10px; padding: 10px 22px;
}
.main-nav .nav-login:hover { background: var(--blue-light); color: var(--white); }

.nav-toggle {
  display: none;
  background: none; border: 2px solid var(--blue-dark); border-radius: 8px;
  color: var(--blue-dark); font: inherit; font-weight: 700;
  padding: 8px 14px; cursor: pointer;
}
.nav-toggle .bars { display: inline-block; width: 22px; vertical-align: middle; margin-right: 8px; }
.nav-toggle .bars span { display: block; height: 3px; background: currentColor; margin: 4px 0; border-radius: 2px; }

@media (max-width: 900px) {
  :root { --header-h: 78px; }
  .logo img { width: 180px; }
  .nav-toggle { display: inline-flex; align-items: center; }
  .main-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--white);
    border-bottom: 4px solid var(--blue-light);
    box-shadow: var(--shadow);
    display: none;
  }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; align-items: stretch; padding: 10px 20px 20px; gap: 2px; }
  .main-nav a { padding: 14px 12px; font-size: 1.15rem; }
  .main-nav .nav-login { margin: 10px 0 0; text-align: center; }
}

/* ---------- Section navigation (used by Landing / Level 2 / Level 3) ---------- */
.section-nav {
  background: var(--blue-tint);
  border-bottom: 1px solid var(--line);
}
.section-nav ul {
  list-style: none; margin: 0 auto; padding: 18px 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px;
}
.section-nav a {
  display: block;
  padding: 10px 18px;
  font-size: 1.05rem; font-weight: 500;
  color: var(--blue-dark);
  background: var(--white);
  border: 2px solid transparent;
  border-radius: 999px;
  text-decoration: none;
  transition: border-color .15s, background .15s, color .15s;
}
.section-nav a:hover { border-color: var(--blue-light); color: var(--blue-dark); }
.section-nav a[aria-current="page"] {
  background: var(--blue-dark); color: var(--white); border-color: var(--blue-dark);
}
.section-nav .back-link {
  background: transparent; font-weight: 700; color: var(--blue-dark);
  border-color: var(--blue-dark);
}
.section-nav .back-link:hover { background: var(--blue-dark); color: var(--white); }

/* ---------- Breadcrumb ---------- */
.breadcrumb { font-size: 0.95rem; color: var(--text-soft); margin: 28px 0 8px; }
.breadcrumb ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumb li + li::before { content: "›"; margin-right: 6px; color: var(--text-soft); }
.breadcrumb a { color: var(--blue-dark); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 22px;
  font: inherit; font-weight: 700; font-size: 1rem;
  text-decoration: none;
  border-radius: 8px;
  border: 2px solid var(--blue-dark);
  background: var(--white); color: var(--blue-dark);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.btn:hover { background: var(--blue-dark); color: var(--white); }
.btn-primary { background: var(--blue-dark); color: var(--white); }
.btn-primary:hover { background: var(--blue-light); border-color: var(--blue-light); color: var(--white); }
.btn-red { background: var(--red); border-color: var(--red); color: var(--white); }
.btn-red:hover { background: #9e0b23; border-color: #9e0b23; color: var(--white); }

.slogan {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--red);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  letter-spacing: .5px;
}

/* ---------- Footer ---------- */
.site-footer {
  flex-shrink: 0;
  margin-top: 72px;
  background: var(--blue-dark);
  color: var(--white);
  border-top: 6px solid var(--blue-light);
  font-size: 1rem;
}
.site-footer a { color: var(--white); }
.site-footer a:hover { color: #9fd8ff; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1.2fr;
  gap: 32px;
  align-items: center;
  padding: 44px 28px;
}
.footer-contact address { font-style: normal; line-height: 1.75; }
.footer-contact strong { font-size: 1.15rem; }
.footer-contact a { text-decoration: none; }
.footer-contact a:hover { text-decoration: underline; }
.footer-old { text-align: center; }
.footer-old a {
  display: inline-block;
  padding: 12px 22px;
  border: 2px solid rgba(255,255,255,.7);
  border-radius: 8px;
  text-decoration: none; font-weight: 500;
}
.footer-old a:hover { background: var(--white); color: var(--blue-dark); }
.footer-old small { display: block; margin-top: 10px; opacity: .9; font-size: .9rem; }
.footer-links ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px 26px;
}
.footer-links a { text-decoration: none; font-weight: 500; font-size: 1.05rem; }
.footer-links a:hover { text-decoration: underline; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.25);
  padding: 16px 28px; font-size: .9rem; opacity: .9;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
}
.footer-logo { width: 150px; }

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr; text-align: center; }
  .footer-links ul { justify-content: center; }
  .footer-bottom { justify-content: center; text-align: center; }
}

/* ---------- Helpers ---------- */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.page-intro { max-width: 820px; font-size: 1.15rem; color: var(--text-soft); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
