/* =========================================================
   JANE MATOVU FOUNDATION — MAIN STYLESHEET
   Preserves the established green + gold JMF colour scheme.
   ========================================================= */

/* ===== COLOUR VARIABLES ===== */
:root {
  --primary-green: #2e7d32;
  --dark-green: #1b5e20;
  --accent-gold: gold;
  --muted-gold: #b8860b;
  --text-dark: #222;
  --text-light: #fff;
  --light-bg: #f4f4f4;
  --section-bg: #f9f9f9;
  --white: #fff;
}

/* ===== GENERAL ===== */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  background: var(--white);
}

section {
  scroll-margin-top: 92px;
}

img {
  max-width: 100%;
}

a {
  color: var(--primary-green);
}

a:focus,
button:focus {
  outline: 3px solid var(--accent-gold);
  outline-offset: 3px;
}

/* ===== STICKY HEADER ===== */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--dark-green);
}

/* ===== NAVIGATION ===== */
.navbar {
  width: min(100%, 1280px);
  min-height: 74px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.8rem;
  padding: 0.7rem 1rem;
  background: var(--dark-green);
  color: var(--text-light);
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 0 0 auto;
  color: white;
  text-decoration: none;
}

.brand-badge {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--accent-gold);
  border-radius: 50%;
  color: var(--accent-gold);
  font-weight: 800;
  font-size: 0.95rem;
}

.brand-name {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
  white-space: nowrap;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  font-size: 0.98rem;
  color: white;
}

.site-brand:hover,
.site-brand:focus {
  color: var(--accent-gold);
  text-decoration: none;
}

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  min-width: 0;
  gap: clamp(0.5rem, 0.8vw, 0.9rem);
  margin: 0;
  padding: 0;
}

.nav-links > li {
  position: relative;
  flex: 0 0 auto;
}

.nav-links > li > a {
  display: block;
  color: white;
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
  font-size: clamp(0.8rem, 0.86vw, 0.94rem);
}

.nav-links > li > a:hover,
.nav-links > li > a:focus {
  color: var(--accent-gold);
}

/* ===== DROPDOWN MENUS ===== */
.submenu {
  list-style: none;
  position: absolute;
  top: calc(100% + 0.45rem);
  left: 0;
  min-width: 220px;
  margin: 0;
  padding: 0.45rem 0;
  background: var(--dark-green);
  border-top: 3px solid var(--accent-gold);
  border-radius: 0 0 8px 8px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  z-index: 1100;
}

.submenu li a {
  display: block;
  padding: 0.65rem 0.9rem;
  color: white;
  text-decoration: none;
  white-space: nowrap;
  font-size: 0.9rem;
}

.submenu li a:hover,
.submenu li a:focus {
  color: var(--accent-gold);
  background: rgba(255, 255, 255, 0.05);
}

.has-submenu:hover > .submenu,
.has-submenu:focus-within > .submenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ===== MOBILE MENU BUTTON ===== */
.menu-toggle {
  display: none;
  margin-left: auto;
  background: none;
  border: 0;
  color: white;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

/* ===== BUTTONS ===== */
.donate-btn,
.btn,
.read-more {
  display: inline-block;
  background: var(--accent-gold);
  color: #111;
  text-decoration: none;
  font-weight: 700;
  border-radius: 6px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.donate-btn {
  flex: 0 0 auto;
  padding: 0.65rem 1rem;
  white-space: nowrap;
}

.btn {
  padding: 0.7rem 1.15rem;
}

.read-more {
  padding: 0.5rem 0.9rem;
}

.donate-btn:hover,
.btn:hover,
.read-more:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.btn-secondary {
  background: white;
  color: var(--dark-green);
}

/* ===== HOME HERO ===== */
.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-align: center;
  padding: 1rem;
}

.home-hero {
  min-height: 85vh;
  background:
    linear-gradient(rgba(0, 0, 0, 0.46), rgba(0, 0, 0, 0.46)),
    url("../images/mum_with_back_to_school_header_pic2.jpeg") center / cover no-repeat;
}

.hero-text {
  max-width: 780px;
  background: rgba(0, 0, 0, 0.34);
  padding: 2rem;
  border-radius: 12px;
}

.hero h1,
.hero h2 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.15;
}

.hero p {
  font-size: 1.12rem;
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--muted-gold);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.hero .eyebrow {
  color: var(--accent-gold);
}

.hero-actions,
.home-cta-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

/* ===== QUOTE ROTATOR ===== */
.quote-section {
  background: var(--dark-green);
  color: white;
  padding: 1.2rem 2rem;
  text-align: center;
}

.quote-section p {
  max-width: 1000px;
  min-height: 2.5rem;
  margin: 0 auto;
  font-size: 1.1rem;
  font-style: italic;
  transition: opacity 0.4s ease;
}

/* ===== UNCLUTTERED HOME STORY ===== */
.home-story {
  max-width: 1180px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.story-row {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 3rem;
  padding: 2.5rem 0;
}

.story-row.reverse .story-copy {
  order: 2;
}

.story-row.reverse .story-image {
  order: 1;
}

.story-copy {
  text-align: left;
}

.story-copy h2 {
  margin: 0.25rem 0 1rem;
  color: var(--dark-green);
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  line-height: 1.18;
}

.story-copy p {
  font-size: 1.05rem;
}

.story-image {
  margin: 0;
}

.story-image img {
  display: block;
  width: 100%;
  height: 380px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}

.text-link {
  color: var(--dark-green);
  font-weight: 700;
  text-decoration: none;
}

.text-link:hover,
.text-link:focus {
  text-decoration: underline;
}

.home-cta {
  background: var(--dark-green);
  color: white;
  padding: 3.5rem 2rem;
  text-align: center;
}

.home-cta > div {
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.home-cta h2 {
  margin-top: 0.25rem;
}

/* ===== DEDICATED PAGE HERO ===== */
.page-hero {
  position: relative;
  min-height: 42vh;
  overflow: hidden;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1rem;
  background: var(--dark-green);
}

/* The same image shown at the top of the article is also used here. */
.page-hero::before {
  content: "";
  position: absolute;
  inset: -10px;
  background: var(--page-image) center / cover no-repeat;
  filter: blur(3px);
  transform: scale(1.035);
  z-index: 0;
}

/* Dark veil keeps the page title readable over the photograph. */
.page-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.46);
  z-index: 1;
}

.page-hero-content {
  position: relative;
  z-index: 2;
  max-width: 900px;
  padding: 1rem 1.25rem;
}

.page-hero h1,
.page-hero h2 {
  margin: 0.2rem 0 0.75rem;
  font-size: clamp(2rem, 4vw, 2.7rem);
}

/* Same representative picture appears again at article top */
.page-feature-image {
  display: block;
  width: min(100%, 900px);
  max-height: 500px;
  margin: 0 auto 2rem;
  object-fit: cover;
  object-position: center;
  border-radius: 12px;
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.16);
}

/* ===== DEDICATED PAGE CONTENT ===== */
.content-page {
  max-width: 980px;
  margin: 0 auto;
  padding: 3rem 2rem;
  text-align: left;
}

.content-page h2,
.content-page h3 {
  color: var(--dark-green);
}

.lead {
  font-size: 1.08rem;
  line-height: 1.8;
}

.section-intro {
  max-width: 900px;
  margin: 0 auto 1rem;
  text-align: left;
  font-size: 1.03rem;
  line-height: 1.8;
}

/* ===== LANDING PAGE LINK PANELS ===== */
.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.link-panel {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.25rem;
  background: var(--section-bg);
  border-top: 4px solid var(--primary-green);
  border-radius: 10px;
  color: var(--text-dark);
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.link-panel strong {
  color: var(--dark-green);
  font-size: 1.15rem;
}

.link-panel:hover,
.link-panel:focus {
  transform: translateY(-2px);
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.09);
}

/* ===== LEGACY/OTHER SECTIONS ===== */
.section,
.image-section {
  padding: 3rem 2rem;
  text-align: center;
}

.light-section {
  background: var(--section-bg);
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.image-grid img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  border-radius: 8px;
}

/* If visible cards are used on any page, keep text low and readable */
.image-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.image-card {
  min-height: 340px;
  background-size: cover;
  background-position: center;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: flex-end;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.image-card::before {
  content: "";
  position: absolute;
  inset: 45% 0 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.84));
}

.image-card-content {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 1.25rem;
  color: white;
  text-align: left;
}

.image-card-content h3 {
  margin: 0 0 0.4rem;
}

.image-card-content p {
  margin: 0 0 0.8rem;
}

/* ===== DONATION CALLOUT ===== */
.partner-donation-message {
  margin: 0 auto 2rem;
  padding: 1rem 1.2rem;
  border-left: 5px solid var(--accent-gold);
  background: var(--section-bg);
  color: var(--text-dark);
  font-weight: 600;
}

/* ===== FAQ ===== */
.faq-section {
  background: var(--section-bg);
  padding: 3rem 1rem;
}

.faq-container {
  max-width: 950px;
  margin: 2rem auto 0;
  text-align: left;
}

.faq-container details {
  background: white;
  margin-bottom: 1rem;
  padding: 1rem 1.2rem;
  border-radius: 10px;
  border-left: 5px solid var(--primary-green);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.faq-container summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--dark-green);
}

/* ===== CONTACT ===== */
.contact-panel {
  padding: 1.5rem;
  background: var(--section-bg);
  border-radius: 10px;
}

/* ===== THREE-COLUMN FOOTER ===== */
.site-footer {
  background: var(--dark-green);
  color: white;
  padding: 2.75rem 2rem 0;
  text-align: left;
}

.footer-grid {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 2.5rem;
}

.footer-column h3 {
  margin-top: 0;
  color: var(--accent-gold);
}

.footer-column p {
  margin: 0.45rem 0;
}

.footer-column ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-column li {
  margin: 0.45rem 0;
}

.footer-column a {
  color: white;
  text-decoration: none;
}

.footer-column a:hover,
.footer-column a:focus {
  color: var(--accent-gold);
  text-decoration: underline;
}

.footer-bottom {
  max-width: 1180px;
  margin: 2rem auto 0;
  padding: 1rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  text-align: center;
}

/* ===== BACK TO TOP ===== */
.back-to-top {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--primary-green);
  color: white;
  text-decoration: none;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  z-index: 1000;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
}

.back-to-top.visible {
  display: flex;
}

.back-to-top:hover {
  background: var(--dark-green);
}

/* ===== TABLET / MOBILE ===== */
/*
  Switch to hamburger before desktop labels have any chance to wrap.
*/
@media (max-width: 1180px) {
  .navbar {
    flex-wrap: wrap;
  }

  .site-brand {
    margin-right: auto;
  }

  .menu-toggle {
    display: block;
  }

  .donate-btn {
    display: none;
  }

  .nav-links {
    display: none;
    order: 3;
    flex-basis: 100%;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding-top: 0.7rem;
  }

  .nav-links.active {
    display: flex;
  }

  .nav-links > li > a {
    padding: 0.55rem 0.4rem;
    text-align: center;
  }

  .submenu {
    position: static;
    min-width: 0;
    width: min(92%, 430px);
    margin: 0.1rem auto 0.55rem;
    padding: 0.2rem 0;
    border-top: 0;
    border-left: 3px solid var(--accent-gold);
    border-radius: 0;
    box-shadow: none;
    background: rgba(0, 0, 0, 0.1);
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .submenu li a {
    text-align: center;
    white-space: normal;
  }
}

@media (max-width: 800px) {
  section {
    scroll-margin-top: 100px;
  }

  .navbar {
    padding: 0.65rem 0.9rem;
  }

  .brand-name {
    font-size: 0.9rem;
  }

  .home-hero {
    min-height: 72vh;
  }

  .hero-text {
    padding: 1.35rem;
  }

  .home-story {
    padding: 2.5rem 1rem;
  }

  .story-row,
  .story-row.reverse {
    grid-template-columns: 1fr;
    gap: 1.3rem;
    padding: 1.75rem 0;
  }

  .story-row.reverse .story-copy,
  .story-row.reverse .story-image {
    order: initial;
  }

  .story-image img {
    height: 300px;
  }

  .content-page {
    padding: 2.25rem 1rem;
  }

  .page-feature-image {
    max-height: 360px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .site-footer {
    text-align: center;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .image-card {
    min-height: 290px;
  }
}

@media (max-width: 520px) {
  .brand-badge {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .brand-name {
    font-size: 0.84rem;
  }

  .hero h1,
  .hero h2 {
    font-size: 1.85rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .story-image img {
    height: 250px;
  }
}


/* ===== FINAL LANDING-PAGE BANNER OVERRIDES ===== */
.page-hero {
  position: relative;
  min-height: 42vh;
  overflow: hidden;
  background: var(--dark-green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1rem;
}

.page-hero::before {
  content: "";
  position: absolute;
  inset: -14px;
  background-image: var(--page-image);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  filter: blur(4px);
  transform: scale(1.05);
  z-index: 0;
}

.page-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.46);
  z-index: 1;
}

.page-hero-content {
  position: relative;
  z-index: 2;
  max-width: 900px;
  padding: 1rem 1.25rem;
}

.page-hero .eyebrow {
  color: var(--accent-gold);
  margin-bottom: 0.4rem;
}

.page-hero h1,
.page-hero h2 {
  color: #fff;
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1.15;
  text-shadow: 0 2px 10px rgba(0,0,0,.35);
}


/* ===== ROBUST HERO IMAGE FIX =====
   Uses a real IMG element instead of CSS-variable-only backgrounds.
   This ensures the banner image renders anywhere the article image renders.
*/
.page-hero {
  position: relative;
  min-height: 42vh;
  overflow: hidden;
  isolation: isolate;
  background: var(--dark-green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1rem;
}

/* Disable older pseudo-element image backgrounds to avoid conflicts. */
.page-hero::before {
  content: none !important;
}

.page-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(0, 0, 0, 0.46);
  pointer-events: none;
}

.page-hero-bg {
  position: absolute;
  z-index: 0;
  inset: -12px;
  width: calc(100% + 24px);
  height: calc(100% + 24px);
  object-fit: cover;
  object-position: center;
  filter: blur(4px);
  transform: scale(1.035);
  pointer-events: none;
  user-select: none;
}

.page-hero-content,
.page-hero > h1,
.page-hero > h2,
.page-hero > p {
  position: relative;
  z-index: 2;
}

.page-hero-content {
  max-width: 900px;
  padding: 1rem 1.25rem;
}

.page-hero .eyebrow {
  color: var(--accent-gold);
  margin-bottom: 0.4rem;
}

.page-hero h1,
.page-hero h2 {
  color: #fff;
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1.15;
  text-shadow: 0 2px 10px rgba(0,0,0,.4);
}

@media (max-width: 800px) {
  .page-hero {
    min-height: 34vh;
  }
}


/* ===== FAQ HERO USES THE SAME ROBUST IMAGE METHOD ===== */
.faq-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: var(--dark-green) !important;
}

.faq-hero::before {
  content: none !important;
}

.faq-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(0, 0, 0, 0.46);
  pointer-events: none;
}

.faq-hero .page-hero-bg {
  position: absolute;
  z-index: 0;
  inset: -12px;
  width: calc(100% + 24px);
  height: calc(100% + 24px);
  object-fit: cover;
  object-position: center;
  filter: blur(4px);
  transform: scale(1.035);
}

.faq-hero .hero-text {
  position: relative;
  z-index: 2;
}
