/* Performance Optimized CSS - Faith Miracle Assembly */
:root {
  --primary-color: #01141f;
  --secondary-color: #f8f9fa;
  --dark-blue: #001f3f;
  --text-color: #333;
  --text-light: #444;
  --background-color: #f9f9f9;
  --white: #ffffff;
  --border-radius: 8px;
  --border-radius-large: 12px;
  --transition: 0.3s ease;
  --shadow: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-hover: 0 8px 16px rgba(0,0,0,0.2);
  --font-family: 'Segoe UI', sans-serif;
  --spacing-small: 10px;
  --spacing-medium: 20px;
  --spacing-large: 40px;
  --spacing-xl: 60px;
}

/* Base Styles with performance optimizations */
* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  margin: 0;
  padding: 0;
  background-color: var(--background-color);
  color: var(--text-color);
  width: 100%;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Header Container */
.fma-header {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  color: var(--white);
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* Background Video */
.header-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  transform: translateZ(0); /* Hardware acceleration */
}

/* Image Slideshow */
.image-slider {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Performance: Hardware acceleration for slides */
.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: translateZ(0); /* Force hardware acceleration */
  transition: opacity 1s ease-in-out;
  z-index: -1;
  will-change: opacity; /* Optimize for animations */
}

.slide.active {
  opacity: 1;
}

/* Top Navigation Bar */
.header-top {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  padding: 0 25px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  z-index: 10;
  background: rgba(0, 0, 0, 0);
}

/* Logo and Church Name - FIXED */
.logo-link {
  display: flex;
  flex-direction: row;
  align-items: center;
  text-decoration: none;
  gap: 2px;
}

.logo {
  height: 40px;
  width: 40px; /* FIXED: Added proper unit */
  transform: translateZ(0); /* Hardware acceleration */
}

.church-name {
  font-size: 1rem;
  font-weight: bold;
  color: var(--white);
  margin: 0;
  line-height: 1;
}

/* Navigation Links */
.nav-links {
  display: flex;
  gap: var(--spacing-medium);
}

.nav-links a {
  color: var(--white);
  text-decoration: none;
  font-weight: bold;
  transition: color var(--transition);
}

.nav-links a:hover {
  color: var(--primary-color);
}

/* Main Header Content */
.header-content {
  position: relative;
  z-index: 2;
  background: rgba(0, 0, 0, 0.582);
  padding: var(--spacing-medium) var(--spacing-large);
  border-radius: var(--spacing-small);
}

.action-boxes {
  display: flex;
  justify-content: center;
  gap: var(--spacing-medium);
  margin: 30px 0;
  flex-wrap: wrap;
}

/* Performance optimized boxes */
.box {
  padding: var(--spacing-medium) 30px;
  border-radius: var(--border-radius);
  text-align: center;
  font-weight: bold;
  text-decoration: none;
  color: var(--white);
  width: 200px;
  transition: transform var(--transition);
  transform: translateZ(0); /* Hardware acceleration */
  will-change: transform; /* Optimize for animations */
}

.box:hover {
  transform: scale(1.05) translateZ(0);
}

.box.blue {
  background-color: var(--primary-color);
}

.box.white {
  background-color: var(--white);
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.box.green {
  background-color: var(--secondary-color);
  color: var(--text-color);
}

/* Welcome Section */
.welcome-section {
  background-color: var(--secondary-color);
  padding: var(--spacing-large);
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  overflow-x: hidden;
  gap: var(--spacing-small);
}

.welcome-text {
  flex: 1;
  padding-right: var(--spacing-medium);
}

.welcome-text h2 {
  margin-top: 0;
  font-size: 28px;
  color: var(--text-color);
}

.welcome-text p {
  font-size: 16px;
  color: var(--text-light);
  line-height: 1.6;
}

.join-box {
  margin-top: var(--spacing-medium);
  background-color: var(--dark-blue);
  padding: var(--spacing-small) var(--spacing-medium);
  display: inline-block;
}

.join-box a {
  color: var(--white);
  text-decoration: none;
  font-weight: bold;
}

.slideshow-box {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
}

.slideshow {
  width: 300px;
  height: 300px;
  overflow: hidden;
  position: relative;
}

.slideshow img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  animation: slide 9s infinite;
  transform: translateZ(0); /* Hardware acceleration */
}

.slideshow img:nth-child(2) {
  animation-delay: 3s;
}

.slideshow img:nth-child(3) {
  animation-delay: 6s;
}

@keyframes slide {
  0% { opacity: 0; }
  10% { opacity: 1; }
  30% { opacity: 1; }
  40% { opacity: 0; }
  100% { opacity: 0; }
}

/* Flyer Grid - Original Version */
.flyer-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px;
  padding: 40px 30px;
  background-color: #f5f5f5;
}

.flyer-item {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  transform: translateZ(0);
  will-change: transform;
}

.flyer-item:hover {
  transform: scale(1.03) translateZ(0);
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.flyer-item img {
  width: 100%;
  height: auto;
  display: block;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .flyer-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 20px 15px;
  }
}

@media (max-width: 480px) {
  .flyer-grid {
    padding: 15px 10px;
  }
}
/* Quick fix for container height issues */
.flyer-item {
  height: fit-content !important;
  min-height: auto !important;
  align-self: start;
}

.flyer-item img {
  vertical-align: top;
  line-height: 0;
}

/* Greatness Section */
.greatness-section {
  background-image: url('Images/IMG-20250804-WA0036.jpg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  width: 100%;
  padding: 200px 30px;
  box-sizing: border-box;
  transition: height 0.3s ease;
}


.greatness-overlay {
  background-color: rgba(255, 255, 255, 0.85);
  padding: var(--spacing-large);
  border-radius: var(--border-radius-large);
  max-width: 900px;
  margin: 0 auto;
}

.greatness-content h2 {
  font-size: 2em;
  color: var(--text-color);
  margin-bottom: var(--spacing-medium);
}

.greatness-content p {
  font-size: 1.1em;
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: var(--spacing-medium);
}

.join-btn {
  background-color: var(--dark-blue);
  color: var(--white);
  padding: 12px 24px;
  text-decoration: none;
  font-weight: bold;
  border-radius: 6px;
  display: inline-block;
  transition: background var(--transition);
}

.join-btn:hover {
  background-color: #003366;
}

/* Support Section */
.support-section {
  background-size: cover;
  background-position: center;
  padding: var(--spacing-xl) 30px;
  box-sizing: border-box;
  width: 100%;
}

.support-content {
  background-color: rgba(255, 255, 255, 0);
  padding: var(--spacing-large);
  border-radius: var(--border-radius-large);
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.support-content h2,
.support-content h3 {
  font-size: 2em;
  color: #2c3e50;
  margin-bottom: var(--spacing-medium);
}

.support-content p {
  font-size: 1.1em;
  color: #34495e;
  line-height: 1.6;
  margin-bottom: var(--spacing-medium);
}

.support-btn {
  background-color: var(--dark-blue);
  color: var(--white);
  padding: 12px 24px;
  text-decoration: none;
  font-weight: bold;
  border-radius: 6px;
  display: inline-block;
  margin: var(--spacing-small);
  transition: background var(--transition);
}

.support-btn:hover {
  background-color: #003366;
}

/* GET CONNECTED Cards - Increased Size */
.connect-row {
  background-color: transparent;
  padding: 60px 30px; /* Increased padding */
  text-align: center;
}

.connect-header {
  font-size: 2.5em;
  color: #2c3e50;
  margin-bottom: 50px; /* Increased margin */
}

.connect-cards {
  display: flex;
  justify-content: space-between;
  gap: 40px; /* Increased gap between cards */
  flex-wrap: nowrap;
  max-width: 1200px; /* Increased max width */
  margin: 0 auto;
}

.connect-card {
  flex: 1;
  max-width: 280px; /* Increased from 220px to 280px */
  min-width: 250px; /* Added minimum width */
  border-radius: 12px; /* Slightly larger border radius */
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(0,0,0,0.15); /* Enhanced shadow */
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  transform: translateZ(0);
  will-change: transform;
}

.connect-card:hover {
  transform: scale(1.08) translateZ(0); /* Increased hover scale */
  box-shadow: 0 12px 24px rgba(0,0,0,0.25); /* Enhanced hover shadow */
}

.connect-card img {
  width: 100%;
  height: auto;
  display: block;
  min-height: 200px; /* Ensure minimum height */
  object-fit: contain; /* Ensures good image display */
}

/* Mobile responsive */
@media (max-width: 768px) {
  .connect-cards {
    flex-direction: column;
    align-items: center;
    gap: 30px;
  }
  
  .connect-card {
    max-width: 350px; /* Larger on mobile */
    width: 100%;
  }
}

@media (max-width: 480px) {
  .connect-row {
    padding: 40px 20px;
  }
  
  .connect-card {
    max-width: 300px;
  }
}
.connect-card {
  height: fit-content !important;
  min-height: auto !important;
  align-self: start;
}

.connect-card img {
  vertical-align: top;
  line-height: 0;
}
/* Lead Pastor Section */
.lead-pastor-section {
  width: 100%;
  margin: var(--spacing-xl) 0;
  background-image: url('Images/pst.jpg');
  background-size: cover;
  background-position: center;
  padding: 80px 30px;
  box-sizing: border-box;
  color: var(--white);
  margin-bottom: 0;
  padding-bottom: 0;
}

.pastor-bg {
  background-color: rgba(0, 0, 0, 0.6);
  padding: var(--spacing-large);
  border-radius: var(--border-radius-large);
  max-width: 900px;
  margin: 0 auto;
}

.pastor-content h1 {
  font-size: 2.5em;
  margin-bottom: var(--spacing-small);
  color: var(--white);
}

.pastor-content h2 {
  font-size: 1.8em;
  margin-bottom: var(--spacing-medium);
  color: #f9f9f9;
}

.pastor-content p {
  font-size: 1.1em;
  line-height: 1.6;
  margin-bottom: 15px;
  color: #e0e0e0;
}

.learn-link {
  display: inline-block;
  padding: 12px 24px;
  background-color: #e74c3c;
  color: var(--white);
  text-decoration: none;
  font-weight: bold;
  border-radius: 6px;
  transition: background-color var(--transition);
}

.learn-link:hover {
  background-color: #c0392b;
}

/* Footer */
.site-footer {
  background-color: #01141f;
  color: #f0eded;
  padding: var(--spacing-medium) var(--spacing-small);
  text-align: center;
  font-size: 0.9rem;
  border-top: 1px solid #ddd;
  margin-top: 0;
  padding-top: 0;
}

.footer-nav {
  margin-top: 8px;
}

.footer-nav a {
  color: #0077cc;
  text-decoration: none;
  margin: 0 8px;
}

.footer-nav a:hover {
  text-decoration: underline;
}

.divider {
  color: #999;
}

.social-icons {
  margin: 15px 0;
}

.social-icons a {
  margin: 0 6px;
  display: inline-block;
}

.social-icons img {
  width: 24px;
  height: 24px;
  vertical-align: middle;
}

/* Hamburger Menu */
.hamburger {
  display: none;
  font-size: 2rem;
  cursor: pointer;
  color: var(--white);
  z-index: 30;
}

.close-btn {
  display: none;
  font-size: 2rem;
  color: var(--white);
  text-align: right;
  cursor: pointer;
  margin-bottom: var(--spacing-small);
}

/* Mobile styles */
@media (max-width: 767px) {
  .hamburger {
    display: block;
    position: absolute;
    top: 15px;
    right: 25px;
    z-index: 1100;
  }

  /* Turn .nav-links into fullscreen overlay */
  .nav-links {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(1, 20, 31, 0.97);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border-radius: 0;
    z-index: 2000;
    transition: opacity 0.4s ease;
    opacity: 0;
  }

  .nav-links.show {
    display: flex;
    opacity: 1;
  }

  .nav-links a {
    font-size: 2rem;
    margin: 15px 0;
    color: var(--white);
    text-decoration: none;
    font-weight: bold;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
  }

  /* Animate links one by one */
  .nav-links.show a {
    opacity: 1;
    transform: translateY(0);
  }
  .nav-links.show a:nth-child(1) { transition-delay: 0.1s; }
  .nav-links.show a:nth-child(2) { transition-delay: 0.2s; }
  .nav-links.show a:nth-child(3) { transition-delay: 0.3s; }
  .nav-links.show a:nth-child(4) { transition-delay: 0.4s; }

  /* Close button inside overlay */
  .close-btn {
    display: block;
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 3rem;
    cursor: pointer;
    color: var(--white);
  }
}

/* Expression page styles */
.welcome {
  background-color: var(--white);
  padding: 100px 20px 40px 20px;
  text-align: center;
  border-radius: var(--spacing-small);
  box-shadow: var(--shadow);
  max-width: 600px;
  margin: -60px auto 60px auto;
  width: 100%;
  margin-left: calc(-50vw + 50%);
  box-sizing: border-box;
}

.welcome h1 {
  font-size: 36px;
  color: #2c3e50;
  margin-bottom: var(--spacing-small);
}

.welcome p {
  font-size: 20px;
  color: #555;
  margin-bottom: 30px;
}

/* Mobile optimizations */
@media (max-width: 600px) {
  .header-content {
    padding: var(--spacing-medium);
    text-align: center;
    margin-top: var(--spacing-medium);
  }

  .action-boxes {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: var(--spacing-small);
    box-sizing: border-box;
    overflow: visible;
  }

  .action-boxes .box {
    width: 90%;
    max-width: 300px;
    margin: var(--spacing-small) auto;
    box-sizing: border-box;
  }
}