/* ================================================================
   IBSA Educational Program – Landing Page Styles
   Responsive: Desktop (≥ 768 px) + Mobile (< 768 px)
   Accessibility: WCAG 2.1 AA
   Font: Montserrat (Google Fonts, loaded in HTML)
   ================================================================ */

/* ----------------------------------------------------------------
   1. CSS Custom Properties
   ---------------------------------------------------------------- */
:root {
  /* Brand colours (extracted from Figma) */
  --clr-primary:        #002F6C;   /* navy blue */
  --clr-text:           #393938;   /* dark charcoal */
  --clr-white:          #FFFFFF;
  --clr-footer-bg:      #8298B2;   /* mid blue-grey */
  --clr-footer-bottom:  #6883A6;   /* darker blue-grey */
  --clr-border:         #E9EBF4;   /* header bottom border */
  --clr-card-bg:        rgba(255, 255, 255, 0.65);

  /* Typography */
  --font-family: 'Montserrat', sans-serif;

  /* Spacing */
  --container-max:     1440px;
  --container-pad:     16px;
  --header-height:     70px;

  /* Radius */
  --radius-sm: 4px;

  /* Shadows (from Figma DROP_SHADOW effects) */
  --card-shadow:
    0 2px  4px rgba(0, 0, 0, 0.04),
    0 7px  7px rgba(0, 0, 0, 0.03),
    0 16px 10px rgba(0, 0, 0, 0.02),
    0 28px 11px rgba(0, 0, 0, 0.01);
}


/* ----------------------------------------------------------------
   2. Reset & Base
   ---------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--clr-text);
  background-color: var(--clr-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

address {
  font-style: normal;
}

ul {
  list-style: none;
}

/* ----------------------------------------------------------------
   3. Skip Link  (WCAG 2.4.1 – Bypass Blocks)
   ---------------------------------------------------------------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  z-index: 9999;
  padding: 8px 20px;
  background: var(--clr-primary);
  color: var(--clr-white);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 var(--radius-sm) 0;
  transition: top 0.15s;
}

.skip-link:focus {
  top: 0;
  outline: 3px solid var(--clr-white);
  outline-offset: -3px;
}


/* ----------------------------------------------------------------
   4. Shared Button Styles
   ---------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

/* Focus ring – visible for keyboard nav (WCAG 2.4.7) */
.btn:focus-visible {
  outline: 2px solid var(--clr-primary);
  outline-offset: 3px;
}

/* Primary – solid navy */
.btn--primary {
  background-color: var(--clr-primary);
  border-color: var(--clr-primary);
  color: var(--clr-white);
  font-weight: 700;
}

.btn--primary:hover {
  opacity: 0.85;
}

/* Secondary – outlined */
.btn--secondary {
  background-color: var(--clr-white);
  border-color: var(--clr-primary);
  color: var(--clr-primary);
}

.btn--secondary:hover {
  background-color: rgba(0, 47, 108, 0.05);
}


/* ----------------------------------------------------------------
   5. Site Header
   ---------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background-color: var(--clr-white);
  border-bottom: 1px solid var(--clr-border);
}

.site-header__nav {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-header__logo a {
  display: inline-flex;
  align-items: center;
}

.site-header__logo img {
  height: 46px;
  width: auto;
}

/* Focus ring on logo link */
.site-header__logo a:focus-visible {
  outline: 2px solid var(--clr-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}


/* ----------------------------------------------------------------
   6. Hero Section
   ---------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 618px;
  flex: 1;
  background-image: url('../assets/images/Banner-Image.png');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
}

/* White overlay – light wash to keep text legible over the illustration */
.hero__overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.30);
  pointer-events: none;
}

/* Content wrapper */
.hero__content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 60px var(--container-pad) 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
}

/* ---- Hero headline text ---- */
.hero__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  width: 100%;
}

.hero__title {
  font-size: 24px;
  font-weight: 800;
  line-height: 28px;
  color: var(--clr-primary);
  text-transform: uppercase;
  letter-spacing: 0;
}

.hero__subtitle {
  font-size: 18px;
  font-weight: 600;
  line-height: 22px;
  color: var(--clr-primary);
}

.hero__description {
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  color: var(--clr-text);
  max-width: 932px;
}

.hero__description strong {
  font-weight: 700;
}

/* ---- Cards grid ---- */
.hero__cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  width: 100%;
  max-width: 932px;
}


/* ----------------------------------------------------------------
   7. Programme Card
   ---------------------------------------------------------------- */
.card {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 40px 24px;
  background: var(--clr-card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius-sm);
  box-shadow: var(--card-shadow);
}

/* Card header: title + subtitle */
.card__header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: center;
}

.card__title {
  font-size: 24px;
  font-weight: 800;
  line-height: 32px;
  color: var(--clr-primary);
  text-transform: uppercase;
}

.card__subtitle {
  font-size: 18px;
  font-weight: 600;
  line-height: 28px;
  color: var(--clr-primary);
}

/* Horizontal rule divider */
.card__divider {
  border: none;
  border-top: 2px solid rgba(255, 255, 255, 0.80);
}

/* Body copy */
.card__description {
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
  color: var(--clr-text);
  text-align: center;
  flex: 1;              /* push footer to bottom */
}

.card__description strong {
  font-weight: 700;
}

/* CTA area */
.card__footer {
  display: flex;
  justify-content: center;
  padding-top: 10px;
}

.card__footer .btn {
  min-width: 180px;
}


/* ----------------------------------------------------------------
   8. Site Footer
   ---------------------------------------------------------------- */
.site-footer__info {
  background-color: var(--clr-footer-bg);
  padding: 48px 0;
}

.site-footer__container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

/* Info band inner layout */
.site-footer__info .site-footer__container {
  display: flex;
  align-items: flex-start;
  gap: 48px;
}

/* Brand column */
.site-footer__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.site-footer__tagline {
  font-size: 15px;
  font-weight: 600;
  color: var(--clr-white);
  letter-spacing: 0.02em;
  text-align: center;
}

/* Headquarters column */
.site-footer__hq-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--clr-white);
  margin-bottom: 8px;
}

.site-footer__hq address {
  font-size: 14px;
  font-weight: 400;
  line-height: 24px;
  color: var(--clr-white);
}

.site-footer__hq address a {
  color: var(--clr-white);
  text-decoration: underline;
}

.site-footer__hq address a:hover {
  opacity: 0.8;
}

/* Bottom bar */
.site-footer__bottom {
  background-color: var(--clr-footer-bottom);
  padding: 20px 0;
}

.site-footer__bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.site-footer__copyright {
  font-size: 12px;
  font-weight: 400;
  color: var(--clr-white);
}

/* Legal nav links */
.site-footer__legal ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 0;
}

.site-footer__legal li + li::before {
  content: '';
  display: inline-block;
  width: 1px;
  height: 12px;
  background-color: rgba(255, 255, 255, 0.4);
  margin: 0 12px;
  vertical-align: middle;
}

.site-footer__legal a {
  font-size: 12px;
  font-weight: 600;
  color: var(--clr-white);
  transition: opacity 0.2s;
}

.site-footer__legal a:hover {
  text-decoration: underline;
}

.site-footer__legal a:focus-visible {
  outline: 2px solid var(--clr-white);
  outline-offset: 2px;
  border-radius: 2px;
}


/* ----------------------------------------------------------------
   9. Invite Code Portal Modal
   ---------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--container-pad);
  background-color: rgba(0, 47, 108, 0.55);
}

.modal-overlay[hidden] {
  display: none;
}

.modal {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 40px 32px;
  background-color: var(--clr-white);
  border-radius: var(--radius-sm);
  box-shadow: var(--card-shadow);
}

.modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--clr-primary);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.modal__close:hover {
  background-color: rgba(0, 47, 108, 0.08);
}

.modal__close:focus-visible {
  outline: 2px solid var(--clr-primary);
  outline-offset: 2px;
}

.modal__title {
  font-size: 20px;
  font-weight: 800;
  line-height: 26px;
  color: var(--clr-primary);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.modal__subtitle {
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  color: var(--clr-text);
  margin-bottom: 24px;
}

.modal__buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal__buttons .btn {
  width: 100%;
}


/* Cookie consent is managed by OneTrust */


/* ----------------------------------------------------------------
   10. Responsive — Tablet (< 1024 px)
   ---------------------------------------------------------------- */
@media (max-width: 1023px) {
  .hero__content {
    padding: 50px var(--container-pad) 60px;
    gap: 32px;
  }

  .hero__cards {
    max-width: 700px;
  }
}


/* ----------------------------------------------------------------
   11. Responsive — Mobile (< 768 px)
   ---------------------------------------------------------------- */
@media (max-width: 767px) {

  /* Header */
  .site-header__logo img {
    /* Show only the diamond + short name on small screens */
    max-width: 200px;
  }

  /* Hero */
  .hero {
    min-height: auto;
    background-position: 70% center;
  }

  .hero__content {
    padding: 40px 16px 56px;
    gap: 28px;
  }

  .hero__title {
    font-size: 22px;
    line-height: 28px;
  }

  .hero__subtitle {
    font-size: 16px;
    line-height: 20px;
  }

  /* Cards: single column, full width */
  .hero__cards {
    grid-template-columns: 1fr;
    max-width: 100%;
    gap: 16px;
  }

  .card {
    padding: 32px 20px;
    gap: 16px;
  }

  .card__title {
    font-size: 20px;
    line-height: 28px;
  }

  .card__subtitle {
    font-size: 16px;
    line-height: 24px;
  }

  .card__description {
    font-size: 15px;
    line-height: 22px;
  }

  .card__footer .btn {
    min-width: 0;
    width: 100%;
  }

  /* Footer info */
  .site-footer__info .site-footer__container {
    flex-direction: column;
    gap: 28px;
  }

  /* Footer bottom */
  .site-footer__bottom-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .site-footer__legal ul {
    gap: 8px 0;
  }

  .site-footer__legal li + li::before {
    display: none;
  }

  .site-footer__legal ul {
    flex-direction: column;
    align-items: flex-start;
  }

}


/* ----------------------------------------------------------------
   12. Reduced Motion – respect OS preference (WCAG 2.3.3)
   ---------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


/* ----------------------------------------------------------------
   13. High Contrast  (WCAG 1.4.3 – min 4.5:1 for normal text)
       All primary-on-white pairings: #002F6C on #fff → 10.3:1 ✓
       White on #002F6C → 10.3:1 ✓
       White on #8298B2 → 3.7:1 (large text / UI component, AA pass)
       White on #6883A6 → 4.6:1 ✓
   ---------------------------------------------------------------- */
