/* ================================
   Brand theme and layout
   ================================ */
:root {
  --green-primary: #004225;
  --green-light: #6D8B74;
  --offwhite: #F9F9F9;
  --white: #FFFFFF;
  --charcoal: #222222;
  --grey: #B8B8B8;

  --font-main: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", sans-serif;
  --font-accent: "Merriweather", serif;

  --radius: 12px;
  --shadow-soft: 0 4px 16px rgba(0, 0, 0, 0.1);
  --transition: all 0.2s ease-in-out;
}

/* Reset and base styles */
* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: var(--font-main);
  color: var(--charcoal);
  background-color: var(--white);
  line-height: 1.7;
  scroll-behavior: smooth;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* Typography: single, authoritative set */
h1, h2, h3 {
  font-weight: 700;
  color: var(--green-primary);
}

h1 {
  font-size: clamp(26px, 4vw, 42px);
  margin: 1rem 0;
}

h2 {
  font-size: clamp(22px, 3vw, 28px);
  margin: 2rem 0 1rem;
}

h3 {
  font-size: clamp(16px, 2.5vw, 20px);
  margin: 1.25rem 0 0.75rem;
}

h4 {
  font-size: clamp(15px, 2vw, 18px);
  font-weight: 500;
  color: var(--charcoal);
  margin: 1rem 0;
}

p { max-width: 75ch; margin-bottom: 1rem; }

/* Buttons */
.btn {
  background: var(--green-primary);
  color: var(--white);
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius);
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
}

.btn:hover,
.btn:focus {
  background: var(--white);
  color: var(--green-primary);
  border: 1px solid var(--green-primary);
}

/* Header */
.site-header { position: sticky; top: 0; z-index: 1000; }

/* merged navbar rule (keeps your current layout) */
.navbar {
  display: flex;
  justify-content: flex-start; /* previously overridden; now the single source of truth */
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
}

.nav-left,
.nav-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-left { flex: 0 0 auto; max-width: 75%; }
.nav-right { margin-left: auto; }

/* Header links (non-buttons) */
.navbar a:not(.btn) {
  text-decoration: none;
  font-weight: 500;
  color: var(--charcoal);
  transition: var(--transition);
  font-size: 1rem; /* consolidated here so it’s not repeated later */
}

.navbar a:not(.btn):hover,
.navbar a:not(.btn):focus { color: var(--green-primary); }

.navbar a.active {
  color: var(--green-primary);
  border-bottom: 2px solid var(--green-primary);
  padding-bottom: 4px;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--offwhite);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  font-size: 1rem;
}

.nav-toggle:focus { outline: 2px solid var(--green-light); outline-offset: 2px; }

/* Header button (Home) */
.navbar a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  min-height: 44px;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  background: var(--green-primary);
  color: #ffffff;
  border: 1px solid transparent;
  border-radius: var(--radius);
  text-decoration: none;
  transition: var(--transition);
}

.navbar a.btn:hover,
.navbar a.btn:focus {
  background: #ffffff;
  color: var(--green-primary);
  border-color: var(--green-primary);
}

/* Header colour variants */
[data-skin="white"] .site-header {
  background: var(--white);
  border-bottom: 1px solid var(--offwhite);
  box-shadow: var(--shadow-soft);
}

[data-skin="offwhite"] .site-header {
  background: var(--offwhite);
  border-bottom: 1px solid var(--offwhite);
  box-shadow: var(--shadow-soft);
}

/* Course embed wrapper */
.course-embed {
  position: relative;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

.course-embed iframe { width: 100%; height: 100%; border: 0; }

/* Footer */
footer {
  background: var(--offwhite);
  color: var(--charcoal);
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.9rem;
  border-top: 1px solid var(--offwhite);
}

/* Shared interior layout */
.section { margin: 2.5rem 0; }

/* keep only supportive styles here; headings inherit from h2/h3 above */
.section-head p { color: var(--charcoal); opacity: 0.85; margin: 0; }

/* two column content blocks */
.twocol {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 860px) {
  .twocol { grid-template-columns: 1.1fr 0.9fr; }
}

.intro-image {
  display: flex;
  justify-content: center;
  align-items: center;
}

.intro-image img {
  width: 100%;
  max-width: 420px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}


/* simple cards for content blocks */
.card {
  background: var(--white);
  border: 1px solid var(--offwhite);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 1.2rem;
}

.card.tint { background: #f3f7f5; border-color: #dde6e2; }

/* programme list and button row */
.proglist { margin: 0; padding-left: 1.25rem; }
.proglist li { margin: 0.3rem 0; }

.btnrow {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

/* Responsive */
@media (max-width: 900px) {
  .nav-toggle { display: block; }

  .nav-left {
    position: fixed;
    inset: 64px 0 auto 0;
    background: var(--white);
    border-top: 1px solid var(--offwhite);
    box-shadow: var(--shadow-soft);
    padding: 1rem 1.5rem;
    display: none;
    flex-direction: column;
    gap: 1rem;
  }
  .nav-left.open { display: flex; }

  .navbar { padding: 1rem; }
  .btn { padding: 0.6rem 1rem; }
}

/* 1) Let intro text run the full container width */
.section-head p,
.container > p {
  max-width: none;
  margin-bottom: 1rem; /* keeps breathing room */
}

/* 2) Make both cards start at the same vertical position */
.card > :first-child {
  margin-top: 0;
}

/* 3) Add clear space under the bullet list before the button */
.proglist {
  margin-bottom: 1.25rem;
}

/* Optional: if you see any vertical misalignment in grid rows */
.twocol { align-items: start; }

/* Ensure equal height cards in two-column layout */
.twocol.equal {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  align-items: stretch; /* ensures equal height rows */
}

.twocol.equal .card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.twocol.equal .card .btnrow {
  margin-top: auto; /* pushes button row to the bottom */
}

/* Media card: icon left, content right */
.card.media {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 1.25rem;
  align-items: center;
}

/* icon well */
.media-ill {
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  border-radius: 12px;
  background: #f0f6f3; /* subtle tint so it balances visually */
  border: 1px solid #dde6e2;
  box-shadow: var(--shadow-soft);
}

.media-ill svg {
  width: 76px;
  height: 76px;
  display: block;
}

/* text area */
.media-body p {
  margin: 0;
}

/* stack on small screens */
@media (max-width: 640px) {
  .card.media {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .media-ill {
    width: 80px;
    height: 80px;
  }
  .media-ill svg {
    width: 64px;
    height: 64px;
  }
}

.media-ill img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
}

/* make figure images fill the grid column and align with text top */
.twocol {
  align-items: start;
}

.twocol .media-ill {
  width: 100%;
  max-width: none;
  display: flex;
  align-items: flex-start; /* ensures image aligns with top of text column */
}

.twocol .media-ill img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
}

.twocol .media-body h2 {
  margin-top: 0; /* removes default top margin pushing the text down */
}

/* force two side-by-side cards on wider screens */
@media (min-width: 860px) {
  .twocol.equal {
    display: grid;
    grid-template-columns: 1fr 1fr !important;
    gap: 1.5rem;
    align-items: start;
  }
}

/* full-width row inside a two-column grid */
.twocol .span-all {
  grid-column: 1 / -1;
  margin-top: 1rem;
}

.hero-image {
  width: 100%;
  margin: 0 0 2rem 0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.hero-image img {
  width: 100%;
  height: auto;
  max-height: 400px; /* adjust if you want more or less height */
  object-fit: cover;
  display: block;
}

