/* -----------------------------------
   Base Styles
----------------------------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  font-family: "Times New Roman", Georgia, serif;
  color: #1a1a1a;
  background: url("../images/background.jpeg") no-repeat center center fixed;
  background-size: cover;
  scroll-behavior: smooth;
}

:root {
  --accent: #071e64;
}

/* -----------------------------------
   Header (Desktop & Tablet)
----------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
  z-index: 1000;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: height 0.4s ease, padding 0.4s ease;
  padding: 18px 0 12px;
}

/* Two-layer animated header */
.header-expanded,
.header-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 92%;
  max-width: 1300px;
  display: flex;
  align-items: center;
  transition: opacity 0.6s ease, transform 0.6s ease;
  pointer-events: none;
}

.header-expanded {
  justify-content: space-between;
  opacity: 1;
  pointer-events: auto;
}

.brand-large {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-logo {
  height: 90px;
  width: auto;
  transition: height 0.4s ease;
}

h1, h2, h3, h4, h5, h6, .brand-text {
  font-size: 1.8rem;
  font-weight: 700;
  color: #000;
  letter-spacing: 0.2px;
}

.header-center {
  justify-content: center;
  gap: 2rem;
  opacity: 0;
  transform: translate(-50%, calc(-50% - 12px));
}

.site-header.scrolled {
  height: 110px;
  padding-top: 10px;
}

.site-header.scrolled .header-expanded {
  opacity: 0;
  transform: translate(-50%, calc(-50% - 20px));
  pointer-events: none;
}

.site-header.scrolled .header-center {
  opacity: 1;
  transform: translate(-50%, -50%);
  pointer-events: auto;
}

.logo img {
  height: 60px;
  width: auto;
  transition: height 0.3s ease;
}

/* -----------------------------------
   Navbar
----------------------------------- */
.navbar ul {
  list-style: none;
  display: flex;
  gap: 1.8rem;
}

.navbar a {
  text-decoration: none;
  color: #222;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.3px;
  position: relative;
  transition: color 0.2s ease;
}

.navbar a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.navbar a:hover,
.navbar a.active {
  color: var(--accent);
}

.navbar a:hover::after,
.navbar a.active::after {
  transform: scaleX(1);
}

/* Buttons in nav */
.navbar a.btn {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  border-radius: 9999px;
  padding: 8px 14px;
  transition: all 0.2s ease;
}
.navbar a.btn::after { display: none; }
.navbar a.btn:hover {
  background: #3b5ab5;
  box-shadow: 0 0 0 2px rgba(124,158,107,0.15);
}

/* -----------------------------------
   Tablet adjustments
----------------------------------- */
@media (min-width: 601px) and (max-width: 900px) {
  .header-expanded,
  .header-center {
    flex-direction: column;
    gap: 1rem;
  }

  .navbar ul {
    flex-wrap: wrap;
    justify-content: center;
  }

  .brand-logo {
    height: 70px;
  }

  .site-header {
    height: 150px;
  }
}

/* -----------------------------------
   Parallax & Hero
----------------------------------- */
.parallax-image {
  position: relative;
  height: 60vh;
  min-height: 400px;
  background-image: url("../images/hero-background.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  z-index: 0;
}

/* Hero card */
.hero--card {
  position: relative;
  max-width: 900px;
  margin: -80px auto 60px;
  padding: clamp(40px, 6vw, 60px);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #ececec;
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  text-align: left;
  z-index: 2;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.hero--card.is-visible { opacity: 1; transform: none; }

.hero--card h1 {
  text-align: center;
  color: var(--accent);
  font-size: clamp(2rem, 4vw, 2.6rem);
  margin-bottom: 1rem;
}

.hero--card p {
  color: #333;
  line-height: 1.6;
  margin-bottom: 1rem;
}

@media (max-width: 600px) {
  .hero--card {
    margin-top: -40px;
    padding: 28px 20px;
  }
}

/* -----------------------------------
   Main Content Sections
----------------------------------- */
main {
  width: 90%;
  max-width: 1000px;
  margin: 0 auto 80px;
}

/* Join section */
.join {
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.05);
  padding: clamp(40px, 6vw, 60px);
  margin: 80px auto;
  text-align: center;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.join.is-visible { opacity: 1; transform: none; }
.join h2 {
  color: var(--accent);
  font-size: 2rem;
  margin-bottom: 2rem;
}
.join form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
}
.join .form-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 700px;
}
.join input {
  flex: 1 1 200px;
  padding: 12px 14px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
}
.join .primary {
  margin-top: 1rem;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  padding: 14px 28px;
  border-radius: 9999px;
  border: none;
  transition: all 0.2s ease;
}
.join .primary:hover { background: #3b5ab5; }

/* -----------------------------------
   Articles Preview
----------------------------------- */
.articles-preview {
  position: relative;
  width: 100%;
  background: linear-gradient(to bottom right, #ffffff, #f0f4f1);
  border-top: 1px solid #eaeaea;
  border-bottom: 1px solid #eaeaea;
  text-align: center;
  padding: clamp(80px, 10vw, 120px) 20px;
  overflow: hidden;
  border-radius: 16px;
}

.articles-preview::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("../images/hero-background.jpg");
  background-size: cover;
  background-position: center;
  opacity: 0.12;
  z-index: 0;
}

.articles-preview .articles-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
  margin: 0 auto;
}

.articles-preview h2 {
  color: var(--accent);
  font-size: clamp(2rem, 3.5vw, 2.6rem);
  margin-bottom: 1rem;
}

.articles-preview p {
  color: #333;
  font-size: 1.1rem;
  margin-bottom: 2rem;
  line-height: 1.6;
}

.articles-preview .primary-link {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  padding: 14px 34px;
  border-radius: 9999px;
  text-decoration: none;
  transition: all 0.25s ease;
}
.articles-preview .primary-link:hover {
  background: #3b5ab5;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(124,158,107,0.25);
}

/* -----------------------------------
   Articles Page Layout
----------------------------------- */
.article {
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
  padding: clamp(40px, 6vw, 60px);
  margin: 80px auto;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.article:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

/* -----------------------------------
   Footer
----------------------------------- */
footer {
  text-align: center;
  padding: 20px;
  font-size: 0.9rem;
  color: #666;
  background: #fff;
  border-top: 1px solid #e5e5e5;
}

/* -----------------------------------
   Reveal Animations
----------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* -----------------------------------
   RESPONSIVE HEADER HAND-OFF
----------------------------------- */

/* Hide mobile header by default */
.mobile-header { display: none; }

/* Everything below 600px = Mobile-only header */
@media (max-width: 600px) {
  /* Reset desktop header container */
  .site-header {
    height: auto !important;
    overflow: visible !important;
    padding: 0;
  }

  /* Hide desktop layers */
  .header-expanded,
  .header-center {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  /* Show mobile version */
  .mobile-header {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    gap: 0.6rem;
    background: #fff;
    border-bottom: 1px solid #e5e5e5;
    padding: 10px 12px;
    position: sticky;
    top: 0;
    z-index: 1000;
  }

  /* Top row: logo + title */
  .mobile-header .brand-large {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
  }

  .mobile-header .brand-logo {
    height: 44px;
    width: auto;
  }

  .mobile-header .brand-text {
    font-size: 1.3rem;
    font-weight: 700;
    color: #000;
  }

  /* Navbar row */
  .mobile-header .navbar ul {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    width: 100%;
    padding: 0 10px;
    gap: 0.6rem;
  }

  .mobile-header .navbar a {
    flex: 1;
    text-align: center;
    font-size: 0.9rem;
    padding: 6px 4px;
    white-space: nowrap;
  }

  .mobile-header .navbar a.btn {
    font-size: 0.9rem;
    padding: 6px 10px;
  }

  /* Extra space between Join & Donate */
  .mobile-header .navbar a.btn + a.btn {
    margin-left: 14px;
  }
}

/* -----------------------------------
   ARTICLES PAGE (News Layout)
----------------------------------- */

.articles-list {
  width: 90%;
  max-width: 1100px;
  margin: 120px auto 100px;
  display: flex;
  flex-direction: column;
  gap: 80px;
}

.news-article {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 3rem;
  border-bottom: 1px solid #e5e5e5;
  padding-bottom: 60px;
  position: relative;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.news-article.is-visible {
  opacity: 1;
  transform: none;
}

/* Default: image left, text right */
.news-article .article-media {
  order: 1;
  flex: 1 1 45%;
}
.news-article .article-text {
  order: 2;
  flex: 1 1 50%;
}

/* Alternate: image right, text left */
.news-article.alternate .article-media {
  order: 2;
}
.news-article.alternate .article-text {
  order: 1;
}

/* Article inner styling */
.article-media img {
  width: 100%;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid #e5e5e5;
}

.article-text h2 {
  color: var(--accent);
  font-size: clamp(1.6rem, 2.5vw, 2.2rem);
  margin-bottom: 0.4rem;
}
.article-text .meta {
  color: #777;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}
.article-text .excerpt {
  color: #333;
  line-height: 1.7;
  margin-bottom: 1rem;
}

/* “More text” collapsible area */
.article-text .more-text {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.6s ease, opacity 0.6s ease;
  color: #333;
  line-height: 1.7;
}
.news-article.expanded .more-text {
  max-height: none; /* enough to show full text */
  opacity: 1;
  margin-top: 1rem;
}

/* Read more button */
.read-more {
  display: inline-block;
  background: none;
  border: none;
  color: var(--accent);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: color 0.2s ease;
  margin-top: 0.5rem;
}
.read-more:hover {
  color: #3b5ab5;
  text-decoration: underline;
}

/* Responsive layout */
@media (max-width: 800px) {
  .news-article {
    flex-direction: column;
    text-align: center;
  }
  .article-media,
  .article-text {
    order: unset;
  }
  .article-text {
    text-align: left;
  }
  .article-media img {
    max-width: 100%;
  }
  .articles-list {
    margin-top: 100px;
  }
}
@media (max-width: 800px) {
  .news-article.alternate .article-media {
    order: 1 !important;
  }
  .news-article.alternate .article-text {
    order: 2 !important;
  }
}
/* -----------------------------------
   FIX: Ensure Mobile Header Always Visible
----------------------------------- */
@media (max-width: 600px) {
  .site-header {
    position: relative !important; /* break out of sticky/overflow context */
    height: auto !important;
    overflow: visible !important;
    display: block !important;
    padding: 0 !important;
    border-bottom: 1px solid #e5e5e5 !important;
    z-index: 9999 !important;
  }

  .site-header .header-expanded,
  .site-header .header-center {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  .mobile-header {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    background: #fff;
    padding: 10px 12px;
    gap: 0.6rem;
    border-bottom: 1px solid #e5e5e5;
  }
}
/* -----------------------------------
   FINAL MOBILE HEADER FORCE-FIX
----------------------------------- */
@media screen and (max-width: 900px) {
  /* Completely neutralize desktop header styling */
  .site-header {
    all: unset;
    position: sticky;
    top: 0;
    z-index: 9999;
    display: block;
    background: #fff;
    border-bottom: 1px solid #e5e5e5;
  }

  /* Hide desktop layers */
  .site-header .header-expanded,
  .site-header .header-center {
    display: none !important;
  }

  /* Force mobile header to render */
  .mobile-header {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0.6rem;
    width: 100%;
    background: #fff;
    padding: 10px 12px;
  }

  .mobile-header .brand-large {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
  }

  .mobile-header .brand-logo {
    height: 44px;
    width: auto;
  }

  .mobile-header .brand-text {
    font-size: 1.3rem;
    font-weight: 700;
    color: #000;
  }

  .mobile-header .navbar ul {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    width: 100%;
    gap: 0.6rem;
  }

  .mobile-header .navbar a {
    flex: 1;
    text-align: center;
    font-size: 0.9rem;
    padding: 6px 4px;
  }

  .mobile-header .navbar a.btn {
    font-size: 0.9rem;
    padding: 6px 10px;
  }

  .mobile-header .navbar a.btn + a.btn {
    margin-left: 14px;
  }
}

/* Page-specific override: Articles page uses the old flat color */
body.articles-page {
  background-color: #f7f8fa !important;
  background-image: none !important;  /* cancel the sitewide background.jpg */
  background-attachment: initial;
  background-repeat: initial;
  background-position: initial;
  background-size: initial;
}


body {
  background: url("../images/background.jpeg") no-repeat center center fixed !important;
  background-size: cover !important;
}
