/* ==========================================================================
   MALAWI TWIN — Theme CSS
   Malawi flag colour palette + modern layout system
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CUSTOM PROPERTIES
   -------------------------------------------------------------------------- */
:root {
  /* Brand colours — Malawi national flag */
  --clr-green:        #007A33;
  --clr-green-dark:   #005a25;
  --clr-green-light:  #e8f4ed;
  --clr-green-mid:    #c2deca;
  --clr-red:          #CE1126;
  --clr-red-dark:     #a80e1e;
  --clr-black:        #111111;
  --clr-white:        #ffffff;

  /* UI colours */
  --clr-text:         #1c1c1c;
  --clr-text-light:   #555e57;
  --clr-border:       #d6e8db;
  --clr-bg:           #f8faf8;
  --clr-bg-alt:       #f0f7f2;

  /* Typography */
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body:    'Plus Jakarta Sans', 'Helvetica Neue', Arial, sans-serif;

  /* Spacing scale */
  --space-xs:   0.5rem;
  --space-sm:   1rem;
  --space-md:   1.5rem;
  --space-lg:   2.5rem;
  --space-xl:   4rem;
  --space-2xl:  6rem;

  /* Layout */
  --max-width:  1160px;
  --radius:     8px;
  --radius-lg:  16px;

  /* Shadows */
  --shadow-sm:  0 1px 4px rgba(0,0,0,0.07);
  --shadow-md:  0 4px 20px rgba(0,0,0,0.10);
  --shadow-lg:  0 8px 40px rgba(0,0,0,0.13);

  /* Transitions */
  --ease: 0.22s ease;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--clr-text);
  background: var(--clr-white);
  -webkit-font-smoothing: antialiased;
}

img, video { max-width: 100%; height: auto; display: block; }

a {
  color: var(--clr-green);
  text-decoration: none;
  transition: color var(--ease);
}
a:hover { color: var(--clr-green-dark); text-decoration: underline; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: 1.25;
  color: var(--clr-black);
  font-weight: 700;
}

h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); }
h4 { font-size: 1.15rem; }

p { margin-bottom: var(--space-sm); }
p:last-child { margin-bottom: 0; }

ul, ol { padding-left: 1.5em; }
li { margin-bottom: 0.35em; }

/* --------------------------------------------------------------------------
   3. LAYOUT UTILITIES
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-md);
}

.section {
  padding-block: var(--space-2xl);
}

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

.section--dark {
  background: var(--clr-green-dark);
  color: var(--clr-white);
}
.section--dark h2,
.section--dark h3 { color: var(--clr-white); }

.section__label {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--clr-green);
  margin-bottom: var(--space-xs);
}

.section__title {
  margin-bottom: var(--space-sm);
}

.section__lead {
  font-size: 1.125rem;
  color: var(--clr-text-light);
  max-width: 640px;
  margin-bottom: var(--space-lg);
}

.text-center { text-align: center; }
.text-center .section__lead { margin-inline: auto; }

/* --------------------------------------------------------------------------
   4. BUTTONS
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.8em 1.75em;
  border-radius: 100px;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--ease), color var(--ease), border-color var(--ease), transform var(--ease), box-shadow var(--ease);
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: var(--clr-green);
  color: var(--clr-white);
  border-color: var(--clr-green);
}
.btn--primary:hover {
  background: var(--clr-green-dark);
  border-color: var(--clr-green-dark);
  color: var(--clr-white);
}

.btn--white {
  background: var(--clr-white);
  color: var(--clr-green-dark);
  border-color: var(--clr-white);
}
.btn--white:hover {
  background: var(--clr-green-light);
  border-color: var(--clr-green-light);
  color: var(--clr-green-dark);
}

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

.btn--outline-white {
  background: transparent;
  color: var(--clr-white);
  border-color: rgba(255,255,255,0.7);
}
.btn--outline-white:hover {
  background: rgba(255,255,255,0.12);
  border-color: var(--clr-white);
  color: var(--clr-white);
}

/* --------------------------------------------------------------------------
   5. HEADER / NAV
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--clr-white);
  border-bottom: 1px solid var(--clr-border);
  box-shadow: var(--shadow-sm);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: var(--space-md);
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  flex-shrink: 0;
}
.site-logo:hover { text-decoration: none; }

.site-logo__img {
  height: 44px;
  width: auto;
}

.site-logo__text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.site-logo__name {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--clr-green-dark);
}
.site-logo__tagline {
  font-size: 0.7rem;
  color: var(--clr-text-light);
  letter-spacing: 0.04em;
}

/* Primary nav */
.primary-nav { display: flex; align-items: center; gap: 0.25rem; }

.primary-nav a {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--clr-text);
  padding: 0.45em 0.85em;
  border-radius: var(--radius);
  transition: background var(--ease), color var(--ease);
  text-decoration: none;
}
.primary-nav a:hover,
.primary-nav a.active {
  background: var(--clr-green-light);
  color: var(--clr-green-dark);
  text-decoration: none;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius);
}
.nav-toggle:hover { background: var(--clr-green-light); }
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--clr-text);
  border-radius: 2px;
  transition: transform var(--ease), opacity var(--ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav drawer */
.mobile-nav {
  display: none;
  flex-direction: column;
  background: var(--clr-white);
  border-top: 1px solid var(--clr-border);
  padding: var(--space-sm) var(--space-md) var(--space-md);
  gap: 0.25rem;
}
.mobile-nav.is-open { display: flex; }
.mobile-nav a {
  font-size: 1rem;
  font-weight: 600;
  color: var(--clr-text);
  padding: 0.65em 0.85em;
  border-radius: var(--radius);
  text-decoration: none;
}
.mobile-nav a:hover,
.mobile-nav a.active {
  background: var(--clr-green-light);
  color: var(--clr-green-dark);
}

/* --------------------------------------------------------------------------
   6. HERO
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 88vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--clr-green-dark);
}

.hero__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 30%;
  filter: brightness(0.42);
  transition: transform 8s ease;
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 720px;
  padding-block: var(--space-2xl);
}

.hero__eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--clr-green-mid);
  margin-bottom: var(--space-sm);
  padding: 0.35em 1em;
  border: 1px solid rgba(194,222,202,0.4);
  border-radius: 100px;
}

.hero__title {
  font-size: clamp(2.2rem, 6vw, 4rem);
  color: var(--clr-white);
  margin-bottom: var(--space-md);
  text-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.hero__subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: rgba(255,255,255,0.82);
  margin-bottom: var(--space-lg);
  max-width: 560px;
  line-height: 1.7;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

/* --------------------------------------------------------------------------
   7. STATS STRIP
   -------------------------------------------------------------------------- */
.stats-strip {
  background: var(--clr-green);
  color: var(--clr-white);
  padding-block: var(--space-lg);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-md);
  text-align: center;
}

.stat__number {
  display: block;
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1;
  color: var(--clr-white);
}

.stat__label {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.75);
  letter-spacing: 0.04em;
  margin-top: 0.35rem;
}

/* --------------------------------------------------------------------------
   8. PARISH CARDS
   -------------------------------------------------------------------------- */
.parishes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-md);
}

.parish-card {
  background: var(--clr-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform var(--ease), box-shadow var(--ease);
  display: flex;
  flex-direction: column;
}
.parish-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.parish-card__image {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--clr-green-light);
  display: flex;
  align-items: center;
  justify-content: center;
}
.parish-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.parish-card:hover .parish-card__image img { transform: scale(1.04); }

.parish-card__placeholder {
  font-size: 3rem;
  color: var(--clr-green);
  opacity: 0.4;
}

.parish-card__body {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  flex: 1;
}

.parish-card__meta {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--clr-green);
  margin-bottom: 0.5rem;
}

.parish-card__body h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.parish-card__body p {
  color: var(--clr-text-light);
  font-size: 0.95rem;
  flex: 1;
  margin-bottom: var(--space-md);
}

/* --------------------------------------------------------------------------
   9. PROJECTS GRID
   -------------------------------------------------------------------------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-md);
}

.project-item {
  background: var(--clr-white);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  border: 1px solid var(--clr-border);
  transition: box-shadow var(--ease), border-color var(--ease);
}
.project-item:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--clr-green-mid);
}

.project-item__icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  line-height: 1;
}

.project-item h3 {
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
}

.project-item p {
  font-size: 0.9rem;
  color: var(--clr-text-light);
  margin: 0;
}

/* --------------------------------------------------------------------------
   10. NEWS CARDS
   -------------------------------------------------------------------------- */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-md);
}

.news-card {
  background: var(--clr-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--clr-border);
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--ease), transform var(--ease);
}
.news-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.news-card__image {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--clr-green-light);
}
.news-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.news-card:hover .news-card__image img { transform: scale(1.04); }

.news-card__body {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  flex: 1;
}

.news-card__date {
  font-size: 0.78rem;
  color: var(--clr-text-light);
  margin-bottom: 0.4rem;
  font-weight: 600;
}

.news-card__body h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}
.news-card__body h3 a {
  color: var(--clr-black);
  text-decoration: none;
}
.news-card__body h3 a:hover { color: var(--clr-green); }

.news-card__body p {
  font-size: 0.9rem;
  color: var(--clr-text-light);
  flex: 1;
  margin-bottom: var(--space-sm);
}

.read-more {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--clr-green);
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
}
.read-more::after { content: '→'; transition: transform var(--ease); }
.read-more:hover::after { transform: translateX(4px); }

/* --------------------------------------------------------------------------
   11. PARISH PAGE (2-col)
   -------------------------------------------------------------------------- */
.parish-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--space-xl);
  align-items: start;
}

.parish-hero-image {
  width: 100%;
  aspect-ratio: 16/7;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-lg);
}

.parish-facts {
  background: var(--clr-bg-alt);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  border: 1px solid var(--clr-border);
  position: sticky;
  top: calc(68px + var(--space-sm));
}

.parish-facts h3 {
  font-size: 1rem;
  margin-bottom: var(--space-sm);
  padding-bottom: var(--space-xs);
  border-bottom: 2px solid var(--clr-green);
  color: var(--clr-green-dark);
}

.fact-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.fact-list li {
  display: flex;
  flex-direction: column;
  padding: 0.65em 0;
  border-bottom: 1px solid var(--clr-border);
  font-size: 0.9rem;
}
.fact-list li:last-child { border-bottom: none; }
.fact-list__label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--clr-green);
  margin-bottom: 0.15rem;
}

/* --------------------------------------------------------------------------
   12. GET INVOLVED CARDS
   -------------------------------------------------------------------------- */
.involved-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-md);
}

.involved-card {
  background: var(--clr-white);
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-md);
  text-align: center;
  border: 1px solid var(--clr-border);
  transition: box-shadow var(--ease), border-color var(--ease);
}
.involved-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--clr-green-mid);
}

.involved-card__icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-sm);
  display: block;
}
.involved-card h3 { margin-bottom: 0.5rem; font-size: 1.1rem; }
.involved-card p { font-size: 0.9rem; color: var(--clr-text-light); margin-bottom: var(--space-md); }

/* --------------------------------------------------------------------------
   13. CONTACT LAYOUT
   -------------------------------------------------------------------------- */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--space-xl);
  align-items: start;
}

.contact-info {
  background: var(--clr-bg-alt);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  border: 1px solid var(--clr-border);
}
.contact-info h3 {
  font-size: 1rem;
  margin-bottom: var(--space-sm);
  color: var(--clr-green-dark);
}
.contact-info address {
  font-style: normal;
  font-size: 0.925rem;
  color: var(--clr-text-light);
  line-height: 1.8;
}

/* --------------------------------------------------------------------------
   14. CONTENT (article body)
   -------------------------------------------------------------------------- */
.content-body h2 { margin-top: var(--space-lg); margin-bottom: var(--space-xs); }
.content-body h3 { margin-top: var(--space-md); margin-bottom: var(--space-xs); }
.content-body ul, .content-body ol { margin-bottom: var(--space-sm); }
.content-body blockquote {
  border-left: 4px solid var(--clr-green);
  padding-left: var(--space-md);
  margin: var(--space-md) 0;
  font-size: 1.15rem;
  font-style: italic;
  color: var(--clr-text-light);
}

/* --------------------------------------------------------------------------
   15. BREADCRUMB
   -------------------------------------------------------------------------- */
.breadcrumb {
  padding-block: var(--space-sm);
  font-size: 0.85rem;
  color: var(--clr-text-light);
}
.breadcrumb a { color: var(--clr-green); }
.breadcrumb span { margin-inline: 0.4em; opacity: 0.5; }

/* --------------------------------------------------------------------------
   16. PAGE BANNER (interior pages)
   -------------------------------------------------------------------------- */
.page-banner {
  background: var(--clr-green-dark);
  color: var(--clr-white);
  padding-block: var(--space-xl);
}
.page-banner h1 { color: var(--clr-white); margin-bottom: 0.5rem; }
.page-banner p { color: rgba(255,255,255,0.75); font-size: 1.1rem; margin: 0; }

/* --------------------------------------------------------------------------
   17. FOOTER
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--clr-black);
  color: rgba(255,255,255,0.7);
  padding-top: var(--space-2xl);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: var(--space-xl);
  padding-bottom: var(--space-xl);
}

.footer-brand p {
  font-size: 0.9rem;
  line-height: 1.7;
  margin-top: var(--space-sm);
  max-width: 280px;
}

.footer-col h4 {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--clr-white);
  margin-bottom: var(--space-sm);
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.footer-col a {
  color: rgba(255,255,255,0.6);
  font-size: 0.9rem;
  text-decoration: none;
  transition: color var(--ease);
}
.footer-col a:hover { color: var(--clr-white); text-decoration: none; }

.footer-logo__name {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--clr-white);
}
.footer-logo__tagline {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.04em;
  margin-top: 0.2rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-block: var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-sm);
  font-size: 0.8rem;
  color: rgba(255,255,255,0.4);
}
.footer-bottom a { color: rgba(255,255,255,0.5); }
.footer-bottom a:hover { color: var(--clr-white); }

/* --------------------------------------------------------------------------
   18. PAGINATION
   -------------------------------------------------------------------------- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: var(--space-xl);
  flex-wrap: wrap;
}
.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding-inline: 0.75rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid var(--clr-border);
  text-decoration: none;
  color: var(--clr-text);
  transition: background var(--ease), color var(--ease), border-color var(--ease);
}
.pagination a:hover { background: var(--clr-green-light); border-color: var(--clr-green-mid); color: var(--clr-green-dark); text-decoration: none; }
.pagination .active { background: var(--clr-green); color: var(--clr-white); border-color: var(--clr-green); }

/* --------------------------------------------------------------------------
   19. RESPONSIVE
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .parish-layout,
  .contact-layout { grid-template-columns: 1fr; }
  .parish-facts { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--space-lg); }
}

@media (max-width: 640px) {
  .primary-nav { display: none; }
  .nav-toggle { display: flex; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero { min-height: 70vh; }
  .hero__actions { flex-direction: column; }
  .hero__actions .btn { width: 100%; justify-content: center; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
