/* SA Education Hub — Main Stylesheet */

/* Ad placeholder — hidden site-wide until AdSense is approved.
   Delete this rule to reveal every ad slot at once. */
.ad-placeholder {
  display: none !important;
}

/* -----------------------------------------------------------------------
   Custom Properties
----------------------------------------------------------------------- */
:root {
  --green:        #163020;
  --green-mid:    #1e4430;
  --green-light:  #e8f2ec;
  --gold:         #c9a52c;
  --gold-dark:    #a8861e;
  --gold-light:   #fef9ee;
  --cream:        #f9f0d8;
  --text:         #1a1a1a;
  --text-muted:   #6b7280;
  --border:       #e5e7eb;
  --bg:           #ffffff;
  --bg-alt:       #f8f9fa;
  --radius:       10px;
  --radius-lg:    16px;
  --radius-xl:    24px;
  --shadow:       0 2px 8px rgba(0,0,0,.08);
  --shadow-md:    0 4px 20px rgba(0,0,0,.12);
  --shadow-lg:    0 12px 40px rgba(0,0,0,.16);
  --transition:   200ms ease;
  --font:         'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --container:    1240px;
}

/* -----------------------------------------------------------------------
   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);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-dark); text-decoration: underline; }
a:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 3px; }
ul { list-style: none; }
button { cursor: pointer; font-family: inherit; }

/* -----------------------------------------------------------------------
   Skip Link
----------------------------------------------------------------------- */
.skip-link {
  position: absolute; top: -100%; left: 1rem; z-index: 9999;
  background: var(--green); color: #fff;
  padding: .5rem 1rem; border-radius: 0 0 var(--radius) var(--radius);
}
.skip-link:focus { top: 0; }

/* -----------------------------------------------------------------------
   Container
----------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/* -----------------------------------------------------------------------
   Typography
----------------------------------------------------------------------- */
h1,h2,h3,h4,h5,h6 { line-height: 1.2; font-weight: 700; color: var(--text); }
h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); }
h4 { font-size: 1.1rem; }
p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

/* -----------------------------------------------------------------------
   HEADER
----------------------------------------------------------------------- */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  min-height: 130px;
}

.site-branding { flex-shrink: 0; }
.site-title-link { display: flex; align-items: center; gap: .6rem; text-decoration: none; }
.site-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--green);
  letter-spacing: -.02em;
}
.site-title:hover { color: var(--green); }
.site-tagline { display: none; }
.custom-logo { height: 108px; width: auto; }

/* Primary Nav */
.primary-nav { display: flex; align-items: center; justify-content: flex-end; flex: 1; }
.nav-menu { display: flex; align-items: center; gap: .1rem; }
.nav-menu li { position: relative; }
.nav-menu > li > a {
  display: block;
  padding: .55rem 1rem;
  font-size: .9375rem;
  font-weight: 500;
  color: var(--text);
  border-radius: var(--radius);
  transition: color var(--transition);
  text-decoration: none;
  position: relative;
}
.nav-menu > li > a::after {
  content: '';
  position: absolute;
  bottom: 2px; left: 50%; right: 50%;
  height: 2.5px;
  background: var(--gold);
  border-radius: 2px;
  transition: left var(--transition), right var(--transition);
}
.nav-menu > li > a:hover,
.nav-menu > .current-menu-item > a,
.nav-menu > .current-page-ancestor > a { color: var(--green); }
.nav-menu > li > a:hover::after,
.nav-menu > .current-menu-item > a::after,
.nav-menu > .current-page-ancestor > a::after { left: 1rem; right: 1rem; }

/* Dropdown */
.nav-menu .sub-menu {
  position: absolute; top: calc(100% + 4px); left: 0;
  min-width: 200px; background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-md); opacity: 0; pointer-events: none;
  transform: translateY(6px);
  transition: opacity var(--transition), transform var(--transition); z-index: 300;
}
.nav-menu li:hover > .sub-menu,
.nav-menu li:focus-within > .sub-menu { opacity: 1; pointer-events: auto; transform: translateY(0); }
.nav-menu .sub-menu a { display: block; padding: .55rem 1rem; font-size: .9rem; color: var(--text); border-radius: 0; }
.nav-menu .sub-menu a:hover { background: var(--gold-light); color: var(--green); }

/* Mobile toggle */
.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 42px; height: 42px; background: none; border: 1px solid var(--border);
  padding: 8px; border-radius: var(--radius);
}
.nav-toggle:hover { background: var(--bg-alt); }
.nav-toggle__bar { display: block; width: 100%; height: 2px; background: var(--text); border-radius: 2px; transition: transform var(--transition), opacity var(--transition); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* -----------------------------------------------------------------------
   HERO
----------------------------------------------------------------------- */
.hero {
  background: var(--green);
  position: relative;
  overflow: hidden;
  padding: 5.5rem 0 150px;
}

/* Dotted circle / background pattern */
.hero::before {
  content: "";
  position: absolute;
  top: 40px;
  right: 60px;
  width: 260px;
  height: 260px;
  background-image: radial-gradient(circle, rgba(255,255,255,0.14) 1.5px, transparent 1.5px);
  background-size: 18px 18px;
  border-radius: 50%;
  opacity: 0.65;
  pointer-events: none;
  z-index: 1;
}

.hero::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 122px;
  background: linear-gradient(to right, #c9a52c, #f7e27e, #c9a52c);
  clip-path: polygon(0 100%, 100% 39%, 100% 100%, 0 100%);
  z-index: 2;
}

.hero-cut {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 110px;
  background: #ffffff;
  clip-path: polygon(0 100%, 100% 45%, 100% 100%, 0 100%);
  z-index: 3;
}

.hero__inner {
  position: relative; z-index: 5;
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 3rem;
  align-items: center;
}

.hero__content { max-width: 680px; }

.hero__title {
  font-size: clamp(2rem, 4.5vw, 3.1rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.12;
  margin-bottom: 1rem;
  letter-spacing: -.025em;
}

.hero__subtitle {
  font-size: clamp(1rem, 1.8vw, 1.18rem);
  color: rgba(255,255,255,.8);
  margin-bottom: 2.25rem;
}

.hero__actions {
  display: flex; gap: 1rem; flex-wrap: wrap;
  margin-bottom: 3rem;
}

/* Stats row */
.hero__stats { display: flex; gap: 0; flex-wrap: wrap; }
.stat {
  display: flex; align-items: center; gap: .875rem;
  padding-right: 2.25rem; margin-right: 2.25rem;
  border-right: 1px solid rgba(255,255,255,.2);
}
.stat:last-child { border-right: none; margin-right: 0; padding-right: 0; }
.stat__icon { flex-shrink: 0; color: var(--gold); }
.stat__info { display: flex; flex-direction: column; }
.stat__number { font-size: 1.9rem; font-weight: 800; color: #fff; line-height: 1; }
.stat__label { font-size: .8125rem; color: rgba(255,255,255,.65); margin-top: .1rem; }

/* Decorative circle on right */
.hero__visual {
  position: relative; display: flex;
  align-items: center; justify-content: center;
}
.hero__circle-outer {
  width: 360px; height: 360px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.18);
  display: flex; align-items: center; justify-content: center;
}
.hero__circle-inner {
  width: 260px; height: 260px; border-radius: 50%;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
}
.hero__ad-slot {
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.45); font-size: .75rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
}

/* Institution-type quick tabs, anchored at the bottom of the hero */
.hero__type-tabs {
  position: relative; z-index: 5;
  display: flex; flex-wrap: wrap; gap: .6rem;
  margin-top: 2.75rem; padding-bottom: 2.5rem;
}
.hero__type-tabs a {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .6rem 1.25rem; border-radius: 999px;
  font-size: .875rem; font-weight: 600;
  color: #fff; background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.25);
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.hero__type-tabs a:hover {
  background: var(--gold); border-color: var(--gold);
  color: var(--green); text-decoration: none;
}
.hero__type-tabs a:first-child {
  background: var(--gold); border-color: var(--gold); color: var(--green);
}

/* -----------------------------------------------------------------------
   BUTTONS
----------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .7rem 1.5rem;
  font-size: .9375rem; font-weight: 700;
  border-radius: var(--radius); border: 2px solid transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
  white-space: nowrap; line-height: 1.2; cursor: pointer; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.btn--gold { background: var(--gold); color: var(--green); border-color: var(--gold); font-weight: 800; }
.btn--gold:hover { background: var(--gold-dark); border-color: var(--gold-dark); color: var(--green); }

.btn--outline-white { background: transparent; color: #fff; border-color: #fff; }
.btn--outline-white:hover { background: #fff; color: var(--green); }

.btn--primary { background: var(--green); color: #fff; border-color: var(--green); }
.btn--primary:hover { background: var(--green-mid); border-color: var(--green-mid); color: #fff; }

.btn--outline { background: transparent; color: var(--green); border-color: var(--green); }
.btn--outline:hover { background: var(--green); color: #fff; }

.btn--ghost { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn--ghost:hover { background: var(--bg-alt); color: var(--text); }

.btn--sm { padding: .4rem .9rem; font-size: .875rem; }
.btn--lg { padding: .9rem 2.25rem; font-size: 1.0625rem; }
.btn--full { width: 100%; justify-content: center; }

/* -----------------------------------------------------------------------
   FEATURE CARDS (Search Institutions / Find Bursaries / Explore Courses)
----------------------------------------------------------------------- */
.section--features {
  position: relative;
  z-index: 10;
  margin-top: -120px;
  padding: 0 0 4.5rem;
  background: transparent;
}

.features-intro {
  text-align: center;
  margin-bottom: 2.75rem;
}
.features-intro h2 { color: var(--green); margin-bottom: .5rem; }
.features-intro p { color: var(--text-muted); max-width: 520px; margin-inline: auto; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.feature-card {
  background: #fff;
  border-radius: 18px;
  padding: 34px 26px 30px;
  border: 1px solid rgba(201, 165, 44, 0.25);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.09);
  text-align: left;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  text-decoration: none; color: var(--text);
  display: flex; flex-direction: column;
  align-items: flex-start; gap: 1rem;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.13);
  border-width: 2px;
  border-color: rgba(201, 165, 44, 0.55);
  text-decoration: none; color: var(--text);
}

.feature-card__icon-wrap {
  width: 74px;
  height: 74px;
  border-radius: 18px;
  border-radius: 50%;
  background: #f4f1e8;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
}
.feature-card__icon-wrap svg { color: #163020; }

.feature-card__title { font-size: 20px; font-weight: 800; margin: 0 0 10px; color: #1a1a1a; }
.feature-card__desc { font-size: 14px; color: #6b7280; line-height: 1.65; flex: 1; margin: 0; }

.feature-card__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  font-size: 14px;
  font-weight: 700;
  color: #c9a52c;
  text-decoration: none;
}
.feature-card:hover .feature-card__link { color: #a8861e; }
.feature-card__link-arrow { transition: transform 0.25s ease; }
.feature-card:hover .feature-card__link-arrow { transform: translateX(4px); }

/* -----------------------------------------------------------------------
   SECTIONS
----------------------------------------------------------------------- */
.section { padding: 4.5rem 0; }
.section--alt { background: var(--bg-alt); }
.section--dark { background: var(--green); color: #fff; }
.section--cta { padding: 3.5rem 0; background: var(--bg-alt); }

.section__header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: 2.25rem; flex-wrap: wrap;
}
.section__title { margin: 0; }
.section__link { font-weight: 600; font-size: .9375rem; color: var(--gold); white-space: nowrap; }
.section__link:hover { color: var(--gold-dark); }

/* -----------------------------------------------------------------------
   CATEGORY CARDS
----------------------------------------------------------------------- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 1rem;
}
.cat-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: .5rem;
  padding: 1.5rem 1.25rem;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); text-decoration: none; color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  position: relative;
}
.cat-card:hover { border-color: var(--gold); box-shadow: var(--shadow-md); transform: translateY(-2px); text-decoration: none; color: var(--text); }
.cat-card--accent { border-color: var(--gold); background: var(--gold-light); }
.cat-card__icon { color: var(--gold); }
.cat-card__label { font-weight: 700; font-size: .9375rem; }
.cat-card__desc { font-size: .8125rem; color: var(--text-muted); flex: 1; }
.cat-card__arrow { position: absolute; top: 1.1rem; right: 1.1rem; font-size: 1rem; color: var(--gold); opacity: 0; transition: opacity var(--transition); }
.cat-card:hover .cat-card__arrow { opacity: 1; }

/* -----------------------------------------------------------------------
   INSTITUTION CARDS
----------------------------------------------------------------------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; }
.card-grid--3 { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }

/* Home page only: one fixed row of cards per section, no wrap to a 2nd row */
.home .card-grid,.home .card-grid--3 { grid-template-columns: repeat(3, 1fr); }
.home .news-grid { grid-template-columns: repeat(4, 1fr); }
.inst-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow var(--transition), transform var(--transition); }
.inst-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.inst-card__thumb { display: flex; align-items: center; justify-content: center; height: 200px; overflow: hidden; background: var(--bg-alt); padding: 1.5rem; }
.inst-card__thumb img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; transition: transform .4s ease; }
.inst-card:hover .inst-card__thumb img { transform: scale(1.04); }
.inst-card__thumb--placeholder { display: flex; align-items: center; justify-content: center; color: var(--border); }
.inst-card__body { padding: 1.25rem; display: flex; flex-direction: column; flex: 1; gap: .6rem; }
.inst-card__badges { display: flex; flex-wrap: wrap; gap: .3rem; }
.inst-card__title { font-size: 1rem; margin: 0; }
.inst-card__title a { color: var(--text); }
.inst-card__title a:hover { color: var(--green); text-decoration: none; }
.inst-card__location { display: flex; align-items: center; gap: .35rem; font-size: .8125rem; color: var(--text-muted); }
.inst-card__rebrand { font-size: .75rem; color: #1e40af; font-weight: 600; margin: -.25rem 0 .5rem; }
.inst-card__excerpt { font-size: .875rem; color: var(--text-muted); flex: 1; }
.inst-card__footer { display: flex; gap: .5rem; margin-top: auto; padding-top: .75rem; border-top: 1px solid var(--border); flex-wrap: wrap; }

/* -----------------------------------------------------------------------
   BADGES
----------------------------------------------------------------------- */
.badge { display: inline-block; padding: .2rem .65rem; font-size: .73rem; font-weight: 600; border-radius: 999px; line-height: 1.4; white-space: nowrap; }
.badge--type { background: #e2ede7; color: var(--green); }
.badge--sponsored { background: var(--gold); color: #fff; }
.badge--success { background: #d1fae5; color: #065f46; }
.badge--warning { background: #fef3c7; color: #92400e; }
.badge--danger { background: #fee2e2; color: #991b1b; }
.badge--neutral { background: var(--bg-alt); color: var(--text-muted); }

/* -----------------------------------------------------------------------
   OPEN APPLICATIONS
----------------------------------------------------------------------- */
.pulse-dot { display: inline-block; width: 10px; height: 10px; background: #16a34a; border-radius: 50%; margin-right: .5rem; animation: pulse 2s infinite; vertical-align: middle; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(22,163,74,.5)}70%{box-shadow:0 0 0 8px rgba(22,163,74,0)}100%{box-shadow:0 0 0 0 rgba(22,163,74,0)} }
.open-apps-list { display: flex; flex-direction: column; gap: .85rem; }
.open-app-item { display: flex; align-items: center; gap: 1rem; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; transition: box-shadow var(--transition); }
.open-app-item:hover { box-shadow: var(--shadow); }
.open-app-item__thumb { flex-shrink: 0; width: 60px; height: 60px; border-radius: var(--radius); overflow: hidden; background: var(--bg-alt); display: flex; align-items: center; justify-content: center; color: var(--border); padding: .35rem; }
.open-app-item__thumb img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.open-app-item__info { flex: 1; min-width: 0; }
.open-app-item__title { font-size: .9375rem; margin: 0 0 .25rem; }
.open-app-item__title a { color: var(--text); }
.open-app-item__title a:hover { color: var(--green); text-decoration: none; }
.open-app-item__meta { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.meta-text { display: flex; align-items: center; gap: .2rem; font-size: .8rem; color: var(--text-muted); }
.open-app-item__actions { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; flex-wrap: wrap; }
.open-badge { font-size: .7rem; }

/* -----------------------------------------------------------------------
   BURSARY CARDS
----------------------------------------------------------------------- */
.burs-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.375rem; display: flex; flex-direction: column; gap: .65rem; transition: box-shadow var(--transition), transform var(--transition); }
.burs-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.burs-card--expired { opacity: .6; }
.burs-card__header { display: flex; flex-wrap: wrap; gap: .3rem; }
.burs-card__title { font-size: 1rem; margin: 0; }
.burs-card__title a { color: var(--text); }
.burs-card__title a:hover { color: var(--green); text-decoration: none; }
.burs-card__provider { font-size: .875rem; color: var(--text-muted); }
.burs-card__amount { display: flex; align-items: center; gap: .35rem; font-size: .875rem; font-weight: 700; color: var(--green); }
.burs-card__excerpt { font-size: .875rem; color: var(--text-muted); flex: 1; }
.burs-card__footer { display: flex; align-items: center; gap: .75rem; margin-top: auto; padding-top: .75rem; border-top: 1px solid var(--border); flex-wrap: wrap; }
.burs-card__deadline { display: flex; align-items: center; gap: .3rem; font-size: .8rem; color: var(--text-muted); flex: 1; }
.burs-card__deadline.expired { color: #dc2626; }

/* -----------------------------------------------------------------------
   NEWS GRID
----------------------------------------------------------------------- */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }
.news-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow var(--transition), transform var(--transition); }
.news-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.news-card--featured { grid-column: span 2; flex-direction: row; align-self: start; }
@media (max-width: 640px) {
  .news-card--featured { grid-column: span 1; flex-direction: column; }
  .news-card--featured .news-card__thumb { width: 100%; aspect-ratio: auto; height: 200px; }
}
.news-card__thumb { display: flex; align-items: center; justify-content: center; overflow: hidden; background: var(--bg-alt); padding: 1rem; }
.news-card--featured .news-card__thumb { width: 44%; flex-shrink: 0; aspect-ratio: 4 / 3; }
.news-card:not(.news-card--featured) .news-card__thumb { height: 180px; }
.news-card__thumb img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; transition: transform .4s ease; }
.news-card:hover .news-card__thumb img { transform: scale(1.04); }
.news-card__body { padding: 1.25rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.news-card__date { font-size: .8rem; color: var(--text-muted); }
.news-card__title { font-size: 1rem; margin: 0; }
.news-card__title a { color: var(--text); }
.news-card__title a:hover { color: var(--green); text-decoration: none; }
.news-card__excerpt { font-size: .875rem; color: var(--text-muted); flex: 1; }
.news-card__read-more { font-size: .875rem; font-weight: 600; color: var(--gold); margin-top: auto; }

/* -----------------------------------------------------------------------
   CTA BANNER
----------------------------------------------------------------------- */
.cta-banner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    background: var(--green);
    border-radius: var(--radius-xl);
    padding: 3rem 3.5rem;
    text-align: center;

    width: 100%;
    margin: 0 auto;
}

.cta-banner__text {
    max-width: 760px;
    width: 100%;
    text-align: center;
    margin: 0 auto;
}

.cta-banner__text h2 {
    color: #fff;
    text-align: center;
}

.cta-banner__text p {
    color: rgba(255,255,255,.8);
    margin: .5rem auto 0;
    text-align: center;
}

.cta-banner__actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-top: 1.5rem;
}
/* -----------------------------------------------------------------------
   PAGE LAYOUT
----------------------------------------------------------------------- */
.page-wrap { display: grid; grid-template-columns: 1fr 300px; gap: 2.5rem; padding-top: 2.5rem; padding-bottom: 3rem; align-items: start; }
.content-area { min-width: 0; }
.content-area--wide { grid-column: 1 / -1; }
.archive-header { margin-bottom: 2rem; }
.archive-title { margin-bottom: .5rem; }
.archive-desc { color: var(--text-muted); font-size: 1.05rem; }
.archive-filters { margin-bottom: 1.75rem; }
.filter-form { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.filter-select { padding: .55rem .875rem; border: 1px solid var(--border); border-radius: var(--radius); font-family: inherit; font-size: .9rem; background: var(--bg); color: var(--text); cursor: pointer; }
.filter-select:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
.post-list { display: flex; flex-direction: column; gap: 1.5rem; }
.post-item { display: grid; grid-template-columns: 220px 1fr; gap: 1.25rem; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; transition: box-shadow var(--transition); }
.post-item:hover { box-shadow: var(--shadow-md); }
.post-item__thumb { display: flex; align-items: center; justify-content: center; overflow: hidden; background: var(--bg-alt); padding: 1rem; min-width: 0; }
.post-item__thumb img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.post-item__body { padding: 1.25rem 1.25rem 1.25rem 0; display: flex; flex-direction: column; gap: .5rem; }
.post-item__meta { font-size: .8rem; color: var(--text-muted); display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.meta-sep { color: var(--border); }
.post-item__title { font-size: 1.1rem; margin: 0; }
.post-item__title a { color: var(--text); }
.post-item__title a:hover { color: var(--green); text-decoration: none; }
.post-item__excerpt { font-size: .875rem; color: var(--text-muted); flex: 1; }

/* -----------------------------------------------------------------------
   SINGLE
----------------------------------------------------------------------- */
.single-layout { display: grid; grid-template-columns: 1fr 280px; gap: 2rem; align-items: start; }
.single-institution__header,.single-bursary__header { margin-bottom: 1.5rem; }
.single-institution__badges,.single-bursary__badges { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .75rem; }
.single-institution__title,.single-bursary__title { margin-bottom: .5rem; }
.single-institution__location { display: flex; align-items: center; gap: .35rem; color: var(--text-muted); font-size: .9375rem; }
.single-bursary__provider { color: var(--text-muted); }
.single-post__meta { font-size: .875rem; color: var(--text-muted); margin-bottom: .5rem; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.single-post__title { font-size: clamp(1.5rem, 3.5vw, 2.25rem); margin-bottom: 0; }
.single-post__footer { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.single-post__tags { font-size: .875rem; color: var(--text-muted); }
.single-post__tags a { color: var(--gold); }
.page-article__featured-image,.single-post__image,.single-institution__image,.single-bursary__image { margin-bottom: 2rem; border-radius: var(--radius-lg); overflow: hidden; }
.single-institution__image { background: var(--bg-alt); display: flex; align-items: center; justify-content: center; padding: 2rem; }
.single-institution__image img { max-width: 100%; height: auto; }
.entry-content { font-size: 1.0125rem; line-height: 1.8; }
.entry-content h2,.entry-content h3,.entry-content h4 { margin-top: 1.75rem; margin-bottom: .75rem; }
.entry-content p { margin-bottom: 1.25rem; }
.entry-content ul,.entry-content ol { padding-left: 1.5rem; margin-bottom: 1.25rem; }
.entry-content ul { list-style: disc; }
.entry-content ol { list-style: decimal; }
.entry-content li { margin-bottom: .4rem; }
.entry-content a { color: var(--gold); }
.entry-content img { border-radius: var(--radius); margin: 1rem 0; }
.entry-content blockquote { border-left: 4px solid var(--gold); padding: 1rem 1.25rem; margin: 1.5rem 0; background: var(--gold-light); border-radius: 0 var(--radius) var(--radius) 0; font-style: italic; }
.entry-content table { width: 100%; border-collapse: collapse; margin-bottom: 1.25rem; font-size: .9rem; }
.entry-content th,.entry-content td { padding: .6rem .85rem; border: 1px solid var(--border); text-align: left; }
.entry-content th { background: var(--bg-alt); font-weight: 600; }
.single-bursary__sidebar { position: sticky; top: 80px; align-self: start; }
.info-card { background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; }
.info-card__title { font-size: 1rem; margin-bottom: 1rem; padding-bottom: .75rem; border-bottom: 1px solid var(--border); }
.info-card__closed-note { font-size: .875rem; color: var(--text-muted); margin-top: 1rem; font-style: italic; }
.info-list { display: flex; flex-direction: column; gap: .75rem; margin-bottom: 1.5rem; }
.info-list__item { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; font-size: .875rem; }
.info-list dt { color: var(--text-muted); font-weight: 500; }
.info-list dd { font-weight: 600; color: var(--text); }
.disclaimer-box { background: #fffbeb; border: 1px solid #fde68a; border-radius: var(--radius); padding: .875rem 1rem; margin-top: 1rem; font-size: .8125rem; color: #92400e; line-height: 1.5; }
.disclaimer-box p { margin: 0; }
.disclaimer-box--sponsored { background: var(--gold-light); border-color: rgba(201,165,44,.4); color: var(--green-mid); }
.rebrand-notice { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: var(--radius); padding: .875rem 1rem; margin-bottom: 1.25rem; font-size: .875rem; color: #1e40af; line-height: 1.5; }
.rebrand-notice p { margin: 0; font-weight: 500; }
.eligibility-text { font-size: .9375rem; line-height: 1.7; }
.text--danger { color: #dc2626; }
.post-navigation { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.nav-links { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.nav-previous,.nav-next { display: flex; flex-direction: column; }
.nav-next { align-items: flex-end; text-align: right; }
.nav-label { font-size: .8rem; color: var(--text-muted); }
.nav-title { font-weight: 600; font-size: .9375rem; color: var(--gold); }
.page-links { display: flex; align-items: center; gap: .5rem; margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.page-links__label { font-size: .875rem; color: var(--text-muted); }

/* -----------------------------------------------------------------------
   SEARCH & PAGINATION
----------------------------------------------------------------------- */
.search-form-wrap { margin-bottom: 2rem; }
.search-count { color: var(--text-muted); margin-bottom: 1.5rem; }
.post-type-label { font-weight: 600; color: var(--green); background: var(--green-light); padding: .1rem .5rem; border-radius: 4px; font-size: .8rem; }
.search-form { display: flex; gap: .5rem; }
.search-form label { flex: 1; }
.search-field { width: 100%; padding: .65rem .875rem; border: 1px solid var(--border); border-radius: var(--radius); font-family: inherit; font-size: .9375rem; background: var(--bg); color: var(--text); }
.search-field:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
.search-submit { padding: .65rem 1.25rem; background: var(--green); color: #fff; border: none; border-radius: var(--radius); font-weight: 600; font-size: .9375rem; transition: background var(--transition); }
.search-submit:hover { background: var(--green-mid); }
.pagination { margin-top: 2.5rem; display: flex; justify-content: center; }
.nav-links { display: flex; gap: .4rem; align-items: center; }
.page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 38px; padding: 0 .75rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: .9rem; color: var(--text); text-decoration: none; transition: background var(--transition), border-color var(--transition), color var(--transition); }
.page-numbers:hover,a.page-numbers:hover { background: var(--gold-light); border-color: var(--gold); color: var(--green); text-decoration: none; }
.page-numbers.current { background: var(--green); border-color: var(--green); color: #fff; font-weight: 700; }
.page-numbers.dots { border: none; pointer-events: none; }

/* -----------------------------------------------------------------------
   404 & NO RESULTS
----------------------------------------------------------------------- */
.error-404 { max-width: 580px; margin: 5rem auto; text-align: center; padding: 2rem 1rem; }
.error-404__code { display: block; font-size: clamp(5rem, 15vw, 9rem); font-weight: 900; color: var(--green-light); line-height: 1; margin-bottom: .5rem; -webkit-text-stroke: 2px var(--green); }
.error-404__title { margin-bottom: 1rem; }
.error-404__message { color: var(--text-muted); margin-bottom: 2rem; }
.error-404__search { margin-bottom: 2rem; }
.error-404__links h2 { font-size: 1.1rem; margin-bottom: 1rem; }
.error-404__grid { display: flex; gap: .75rem; flex-wrap: wrap; justify-content: center; }
.no-results { text-align: center; padding: 4rem 2rem; }
.no-results h2 { margin-bottom: .75rem; }
.no-results p { color: var(--text-muted); margin-bottom: 1.5rem; }

/* -----------------------------------------------------------------------
   SIDEBAR
----------------------------------------------------------------------- */
.sidebar { min-width: 0; }
.sidebar-inner { display: flex; flex-direction: column; gap: 1.5rem; }
.widget { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; }
.widget--accent { background: var(--gold-light); border-color: #f0d98b; }
.widget--ad { display: flex; align-items: center; justify-content: center; min-height: 250px; background: #fafafa; border: 2px dashed #dddddd; border-radius: 16px; color: #888888; font-size: 14px; }
.widget-title { font-size: .9375rem; margin-bottom: .875rem; padding-bottom: .625rem; border-bottom: 1px solid var(--border); }
.widget--accent .widget-title { border-color: #f0d98b; }
.widget-list { display: flex; flex-direction: column; gap: .4rem; }
.widget-list li a { display: block; font-size: .875rem; color: var(--text); padding: .3rem 0; transition: color var(--transition); }
.widget-list li a:hover { color: var(--green); text-decoration: none; }
.widget-meta { font-size: .78rem; color: var(--text-muted); }
.expired-item a { text-decoration: line-through; opacity: .55; }
.widget-link { display: block; margin-top: .75rem; font-size: .875rem; font-weight: 600; color: var(--gold); }

/* -----------------------------------------------------------------------
   FOOTER
----------------------------------------------------------------------- */
.site-footer { background: #0d1f16; color: #d1d5db; padding-top: 3.5rem; }
.footer-grid { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 2.5rem; padding-bottom: 2.5rem; border-bottom: 1px solid rgba(255,255,255,.07); }
.footer-col--brand .footer-about { font-size: .875rem; line-height: 1.65; margin-top: .75rem; color: #9ca3af; }
.footer-site-name { font-size: 1.25rem; font-weight: 800; color: #fff; text-decoration: none; }
.footer-logo { display: inline-block; background: #fff; padding: .5rem .75rem; border-radius: 8px; line-height: 0; }
.footer-logo .custom-logo { height: 40px; width: auto; }
.footer-heading { font-size: .8125rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #fff; margin-bottom: 1rem; }
.footer-links { display: flex; flex-direction: column; gap: .45rem; }
.footer-links a { font-size: .875rem; color: #9ca3af; transition: color var(--transition); text-decoration: none; }
.footer-links a:hover { color: var(--gold); text-decoration: none; }
.footer-nav { padding: 1.25rem 0; border-bottom: 1px solid rgba(255,255,255,.07); }
.footer-menu { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.footer-menu a { font-size: .875rem; color: #9ca3af; transition: color var(--transition); text-decoration: none; }
.footer-menu a:hover { color: var(--gold); }
.footer-disclaimer { background: rgba(0,0,0,.25); border-radius: var(--radius); padding: .875rem 1rem; margin: 1.25rem 0; font-size: .8125rem; color: #9ca3af; line-height: 1.55; }
.footer-disclaimer p { margin: 0; }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 0; border-top: 1px solid rgba(255,255,255,.05); flex-wrap: wrap; gap: .5rem; }
.footer-copyright,.footer-credit,.footer-legal { font-size: .8125rem; color: #6b7280; margin: 0; }
.footer-legal a { color: #9ca3af; text-decoration: none; }
.footer-legal a:hover { color: var(--gold); text-decoration: underline; }
.footer-legal span { margin: 0 .4rem; }

/* -----------------------------------------------------------------------
   RESPONSIVE
----------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__visual { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-col--brand { grid-column: span 2; }
  .single-layout { grid-template-columns: 1fr; }
  .single-bursary__sidebar { position: static; }
}
@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .custom-logo { height: 60px; }
  .site-header__inner { min-height: 84px; }
  .primary-nav { position: absolute; top: 84px; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-md); display: none; flex-direction: column; align-items: stretch; padding: .75rem 1.5rem; }
  .primary-nav.is-open { display: flex; }
  .nav-menu { flex-direction: column; align-items: stretch; gap: .1rem; }
  .nav-menu > li > a::after { display: none; }
  .nav-menu > li > a { padding: .7rem .75rem; }
  .nav-menu .sub-menu { position: static; opacity: 1; pointer-events: auto; transform: none; box-shadow: none; border: none; border-left: 2px solid var(--gold-light); margin-left: 1rem; display: none; }
  .nav-menu li.is-open > .sub-menu { display: block; }
  .site-header { position: relative; }
  .hero { padding: 3.5rem 0 120px; }
  .hero__stats { flex-wrap: wrap; gap: 1.5rem; }
  .stat { border-right: none; padding-right: 0; margin-right: 0; }
  .hero__type-tabs { flex-direction: column; align-items: stretch; }
  .hero__type-tabs a { width: 100%; padding: .75rem 1.25rem; }
  .page-wrap { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .post-item { grid-template-columns: 1fr; }
  .post-item__thumb { height: 200px; }
  .post-item__body { padding: 1rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-col--brand { grid-column: span 2; }
  .cta-banner { flex-direction: column; text-align: center; border-radius: var(--radius-lg); padding: 2rem; }
  .cta-banner__actions { justify-content: center; }
  .hero::after { height: 94px; clip-path: polygon(0 100%, 100% 34%, 100% 100%, 0 100%); }
  .section--features { margin-top: -45px; padding-bottom: 3.5rem; padding-inline: 1rem; }
  .feature-grid { grid-template-columns: 1fr; }
  .hero-cut { height: 85px; }
  .home .card-grid,.home .card-grid--3 { grid-template-columns: repeat(2, 1fr); }
  .home .news-grid { grid-template-columns: repeat(2, 1fr); }
  .home .news-card--featured { grid-column: span 2; }
}
@media (max-width: 520px) {
  .category-grid { grid-template-columns: 1fr 1fr; }
  .card-grid,.card-grid--3,.news-grid { grid-template-columns: 1fr; }
  .news-card--featured { flex-direction: column; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-col--brand { grid-column: span 1; }
  .hero__actions { flex-direction: column; }
  .section--features { margin-top: -45px; }
  .feature-grid { grid-template-columns: 1fr; }
  .filter-form { flex-direction: column; align-items: stretch; }
}

/* -----------------------------------------------------------------------
   BURSARIES
----------------------------------------------------------------------- */
.bursary-hero { margin-bottom: 2rem; }
.bursary-hero__title { margin-bottom: .5rem; }
.bursary-hero__desc { color: var(--text-muted); font-size: 1.05rem; max-width: 62ch; margin-bottom: 1.5rem; }
.bursary-search { position: relative; max-width: 520px; margin-bottom: 1.5rem; }
.bursary-search input[type="search"] { width: 100%; padding: .8rem 1rem .8rem 2.75rem; border: 1px solid var(--border); border-radius: var(--radius); font-family: inherit; font-size: .95rem; background: var(--bg); color: var(--text); }
.bursary-search input[type="search"]:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
.bursary-search svg { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }

.filter-tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.25rem; }
.filter-tabs a { display: inline-flex; align-items: center; padding: .5rem 1rem; border-radius: 999px; border: 1px solid var(--border); font-size: .875rem; font-weight: 600; color: var(--text-muted); background: var(--bg); transition: all var(--transition); }
.filter-tabs a:hover { border-color: var(--green); color: var(--green); text-decoration: none; }
.filter-tabs a.is-active { background: var(--green); border-color: var(--green); color: #fff; }

.bursary-filters-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.75rem; }
.bursary-filters-row .filter-form { flex: 1; }
.sort-select-wrap { display: flex; align-items: center; gap: .5rem; font-size: .875rem; color: var(--text-muted); white-space: nowrap; }

.badge--info { background: #dbeafe; color: #1e40af; }
.badge--gov { background: #e0e7ff; color: #3730a3; }

.burs-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow var(--transition), transform var(--transition); }
.burs-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.burs-card--closed { opacity: .65; }
.burs-card__thumb { display: flex; align-items: center; justify-content: center; height: 200px; overflow: hidden; background: var(--bg-alt); padding: 1.5rem; }
.burs-card__thumb img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; transition: transform .4s ease; }
.burs-card:hover .burs-card__thumb img { transform: scale(1.04); }
.burs-card__thumb--placeholder { color: var(--border); }
.burs-card__body { padding: 1.25rem 1.375rem 1.375rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.burs-card__badges { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .1rem; }
.burs-card__title { font-size: 1.05rem; margin: 0; line-height: 1.35; }
.burs-card__title a { color: var(--text); }
.burs-card__title a:hover { color: var(--green); text-decoration: none; }
.burs-card__provider { font-size: .8125rem; color: var(--text-muted); font-weight: 500; }
.burs-card__meta { display: flex; flex-wrap: wrap; gap: .3rem .9rem; font-size: .8rem; color: var(--text-muted); }
.burs-card__meta span { display: flex; align-items: center; gap: .3rem; }
.burs-card__excerpt { font-size: .875rem; color: var(--text-muted); flex: 1; }
.burs-card__footer { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: auto; padding-top: .9rem; border-top: 1px solid var(--border); flex-wrap: wrap; }
.burs-card__deadline { display: flex; align-items: center; gap: .3rem; font-size: .8rem; color: var(--text-muted); }
.burs-card__deadline.is-urgent { color: #b45309; font-weight: 600; }
.burs-card__deadline.is-closed { color: #dc2626; }

.single-bursary__meta-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; padding: 1rem 1.25rem; background: var(--bg-alt); border-radius: var(--radius-lg); margin-bottom: 1.75rem; font-size: .9rem; }
.single-bursary__meta-bar strong { color: var(--text); }
.single-bursary__section { margin-bottom: 1.75rem; }
.single-bursary__section h2 { font-size: 1.15rem; margin-bottom: .6rem; }
.single-bursary__section .entry-content { font-size: .9375rem; line-height: 1.7; }
.verified-box { background: var(--green-light); border: 1px solid #cfe3d7; border-radius: var(--radius); padding: .875rem 1rem; margin-top: 1rem; font-size: .8125rem; color: var(--green-mid); line-height: 1.5; }
.verified-box p { margin: 0; }

@media (max-width: 720px) {
  .bursary-filters-row { flex-direction: column; align-items: stretch; }
  .filter-tabs { gap: .4rem; }
  .filter-tabs a { padding: .4rem .8rem; font-size: .8125rem; }
  .burs-card__thumb { height: 160px; padding: 1rem; }
}

/* -----------------------------------------------------------------------
   NEWS — Related Content Cards
----------------------------------------------------------------------- */
.related-content-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .85rem; margin-top: 1rem; }
.related-content-card {
  display: flex; flex-direction: column; gap: .35rem;
  padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-alt); text-decoration: none; color: inherit;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
a.related-content-card:hover { border-color: var(--gold); box-shadow: var(--shadow); transform: translateY(-2px); }
.related-content-card--static { cursor: default; }
.related-content-card__label { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--gold-dark); }
.related-content-card__title { font-weight: 700; color: var(--text); line-height: 1.3; }
.related-content-card__cta { font-size: .8125rem; color: var(--green); font-weight: 600; margin-top: auto; }

/* -----------------------------------------------------------------------
   APS CALCULATOR
----------------------------------------------------------------------- */
.aps-hero { background: var(--green); padding: 3.5rem 0 3rem; text-align: center; }
.aps-hero__title { color: #fff; font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; margin-bottom: .75rem; letter-spacing: -.02em; }
.aps-hero__intro { color: rgba(255,255,255,.85); max-width: 700px; margin: 0 auto; font-size: 1.0625rem; line-height: 1.6; }

.aps-container { max-width: 860px; }
.aps-calculator-section { padding-top: 3rem; }

.aps-form { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 2rem; }
.aps-form__title { margin-bottom: .35rem; }
.aps-form__desc { color: var(--text-muted); font-size: .9375rem; margin-bottom: 1.5rem; }

.aps-table-wrap { overflow-x: auto; }
.aps-form-table { width: 100%; border-collapse: collapse; min-width: 460px; }
.aps-form-table thead th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); padding: 0 0 .5rem; }
.aps-row td { padding: .45rem 0; vertical-align: top; }
.aps-row__subject { width: 68%; padding-right: 1rem; }
.aps-row__pct { width: 32%; }
.aps-row__label { display: none; }
.aps-select, .aps-pct-input {
  width: 100%; padding: .65rem .8rem; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: .9375rem; font-family: inherit; background: var(--bg); color: var(--text);
}
.aps-select:focus, .aps-pct-input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(22,48,32,.08); }
.aps-row__fixed { display: inline-flex; align-items: center; padding: .65rem 0; color: var(--text-muted); font-weight: 600; font-size: .9375rem; }

.aps-form-error { background: #fee2e2; color: #991b1b; border-radius: var(--radius); padding: .75rem 1rem; margin: 1rem 0 0; font-size: .875rem; }
.aps-form__submit { margin-top: 1.5rem; width: 100%; justify-content: center; }

/* Loading / calculation state */
.aps-loading { text-align: center; padding: 3rem 1rem; }
.aps-loading__spinner {
  width: 46px; height: 46px; border-radius: 50%;
  border: 4px solid var(--green-light); border-top-color: var(--green);
  margin: 0 auto 1.25rem; animation: aps-spin 0.8s linear infinite;
}
@keyframes aps-spin { to { transform: rotate(360deg); } }
.aps-loading__message { font-weight: 700; color: var(--green); font-size: 1.0625rem; margin-bottom: 1.75rem; }
.aps-loading__ad, .aps-ad-slot {
  display: flex; align-items: center; justify-content: center;
  min-height: 100px; background: var(--bg-alt); border: 1px dashed var(--border); border-radius: var(--radius);
  color: var(--text-muted); font-size: .8125rem; margin-top: 1rem;
}
.aps-ad-slot { margin-top: 2rem; min-height: 120px; }

/* Results */
.aps-results { margin-top: 2rem; }
.aps-result-summary { display: flex; margin-bottom: 1.75rem; }
.aps-score-card {
  background: var(--green); border: 1px solid var(--green); border-radius: var(--radius-lg);
  padding: 1.5rem 2.25rem; box-shadow: var(--shadow);
  text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 100%; max-width: 300px;
}
.aps-score-card__label { color: rgba(255,255,255,.75); font-size: .8125rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.aps-score-card__value { color: #fff; font-size: 3rem; font-weight: 800; line-height: 1.1; margin: .35rem 0; }
.aps-score-card__max { font-size: 1.25rem; font-weight: 600; color: rgba(255,255,255,.6); }
.aps-score-card__band { color: var(--gold); font-weight: 700; font-size: .9375rem; }

.aps-note { background: var(--gold-light); border: 1px solid rgba(201,165,44,.3); border-radius: var(--radius); padding: .875rem 1rem; font-size: .875rem; color: var(--text); line-height: 1.55; margin-bottom: 1.25rem; }
.aps-note--methodology { background: var(--bg-alt); border-color: var(--border); color: var(--text-muted); }
.aps-note--warn { background: #fef3c7; border-color: #f59e0b; color: #78350f; }

.aps-table { width: 100%; border-collapse: collapse; min-width: 520px; margin-bottom: 1.75rem; }
.aps-table th, .aps-table td { text-align: left; padding: .65rem .75rem; border-bottom: 1px solid var(--border); font-size: .875rem; }
.aps-table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); border-bottom: 2px solid var(--border); }
.aps-table__excluded { opacity: .6; }

.aps-match-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.25rem; margin-bottom: 2rem; }
.aps-match-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; display: flex; flex-direction: column; gap: .6rem; }
.aps-match-card h4 { margin: 0; font-size: 1.0625rem; }
.aps-match-card p { margin: 0; font-size: .875rem; color: var(--text-muted); line-height: 1.55; }
.aps-match-card__actions { margin-top: auto; padding-top: .5rem; }

.aps-programme-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; display: flex; flex-direction: column; gap: .6rem; }
.aps-programme-card--strong { border-color: rgba(6,95,70,.35); }
.aps-programme-card--possible { border-color: rgba(30,64,175,.3); }
.aps-programme-card--close { border-color: rgba(146,64,14,.3); }
.aps-programme-card h4 { margin: 0; font-size: 1.0625rem; }
.aps-programme-card__institution { margin: 0; font-size: .875rem; color: var(--text-muted); }
.aps-programme-card__institution a { color: inherit; text-decoration: underline; }
.aps-programme-card__meta { margin: 0; font-size: .8125rem; color: var(--text-muted); }

.aps-compare-table { width: 100%; border-collapse: collapse; min-width: 320px; font-size: .875rem; }
.aps-compare-table th, .aps-compare-table td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--border); }
.aps-compare-table thead th { font-size: .6875rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); border-bottom: 2px solid var(--border); }
.aps-compare-table__note td { font-size: .8125rem; color: var(--text-muted); font-style: italic; border-bottom: 1px solid var(--border); padding-top: 0; }

.aps-check { display: inline-block; font-weight: 700; margin-left: .3rem; }
.aps-check--yes { color: #065f46; }
.aps-check--no { color: #991b1b; }
.aps-check--na { color: var(--text-muted); }

.aps-note--small { font-size: .8125rem; margin-bottom: 0; }

.aps-close-extra { margin-top: -.5rem; }
.aps-view-more-btn { display: block; margin: 0 auto 2rem; }

.aps-alternatives h4 { margin: 1.5rem 0 .75rem; }
.aps-alternatives { background: var(--green-light); border-radius: var(--radius-lg); padding: 1.75rem; margin-top: 1rem; }
.aps-alternatives--emphasis { background: var(--gold-light); border: 1px solid rgba(201,165,44,.35); }
.aps-alternatives h3 { margin-top: 0; }
.aps-pathways-list, .aps-improve-list { padding-left: 1.25rem; margin: 1rem 0 0; }
.aps-pathways-list li, .aps-improve-list li { margin-bottom: .6rem; font-size: .9375rem; line-height: 1.55; }

/* Supporting SEO content */
.aps-support h2 { margin-top: 2.25rem; }
.aps-support h2:first-child { margin-top: 0; }
.aps-support p, .aps-support li { color: var(--text-muted); line-height: 1.7; }
.aps-support ul { padding-left: 1.25rem; }
.aps-source-note, .aps-verified-note { font-size: .8125rem; color: var(--text-muted); font-style: italic; margin-top: .5rem; }

.aps-faq { margin-top: 1rem; }
.aps-faq__item { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: .25rem 1.1rem; margin-bottom: .65rem; }
.aps-faq__question { cursor: pointer; font-weight: 700; padding: .9rem 0; color: var(--text); }
.aps-faq__answer p { margin: 0 0 .9rem; color: var(--text-muted); }

.aps-related { padding-top: 0; }

@media (max-width: 720px) {
  .aps-score-card { max-width: 100%; }
  .aps-row__subject, .aps-row__pct { width: 100%; display: block; }
  .aps-form-table, .aps-row, .aps-row td { display: block; width: 100%; }
  .aps-row { margin-bottom: .9rem; padding-bottom: .9rem; border-bottom: 1px solid var(--border); }
  .aps-form-table thead { display: none; }
  .aps-row__label { display: block; font-size: .8125rem; font-weight: 600; color: var(--text-muted); margin-bottom: .3rem; }
}

/* -----------------------------------------------------------------------
   COOKIE CONSENT BANNER
----------------------------------------------------------------------- */
.cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 500;
  background: var(--green); border-top: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 -4px 20px rgba(0,0,0,.15);
  transform: translateY(100%); transition: transform .3s ease;
}
.cookie-banner.is-visible { transform: translateY(0); }
.cookie-banner__inner {
  max-width: var(--container); margin-inline: auto; padding: 1.1rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
}
.cookie-banner__text { margin: 0; color: rgba(255,255,255,.85); font-size: .875rem; line-height: 1.5; flex: 1; min-width: 240px; }
.cookie-banner__text a { color: var(--gold); }
.cookie-banner__actions { display: flex; gap: .6rem; flex-shrink: 0; }
.cookie-banner .btn--ghost { color: rgba(255,255,255,.75); border-color: rgba(255,255,255,.25); }
.cookie-banner .btn--ghost:hover { background: rgba(255,255,255,.08); color: #fff; }
@media (prefers-reduced-motion: reduce) {
  .cookie-banner { transition: none; }
}
@media (max-width: 560px) {
  .cookie-banner__inner { flex-direction: column; align-items: stretch; text-align: center; }
  .cookie-banner__actions { justify-content: center; }
}

/* -----------------------------------------------------------------------
   UTILITY
----------------------------------------------------------------------- */
.screen-reader-text { border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; word-wrap: normal !important; }
.screen-reader-text:focus { background-color: var(--bg); clip: auto !important; clip-path: none; color: var(--text); display: block; font-size: .875rem; font-weight: 700; height: auto; left: 5px; line-height: normal; padding: 15px 23px 14px; text-decoration: none; top: 5px; width: auto; z-index: 100000; }
