/* ==========================================
  Indexss Page Styles
  Hero page with background image optimization
  ========================================== */

/* ==========================================
  CSS Variables
  ========================================== */
:root {
  --primary: #6ee7b7;
  --text: #ffffff;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ==========================================
  Header with Background Image
  Optimized loading with blur effect
  ========================================== */
header {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background-color: #0b0f19; /* Fallback color */
  background-image: url('/img/eglise_int.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  isolation: isolate;
}

/* Blur effect while image loads */
header.loading {
  background-image: none;
  background-color: #0b0f19;
}

header.loading::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.3), rgba(110, 231, 183, 0.3));
  animation: pulse 2s ease-in-out infinite;
  z-index: -1;
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.8; }
}

/* Dark overlay for better text readability */
header::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.6) 0%,
    rgba(0, 0, 0, 0.4) 50%,
    rgba(0, 0, 0, 0.7) 100%
  );
  z-index: -1;
}

/* Smooth fade-in when image loads */
header.loaded {
  animation: fadeIn 0.6s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    filter: blur(10px);
  }
  to {
    opacity: 1;
    filter: blur(0);
  }
}

/* ==========================================
  Navigation Bar
  ========================================== */
nav {
  position: relative;
  z-index: 10;
  padding: 20px 40px;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

nav ul {
  list-style: none;
  display: flex;
  gap: 32px;
  justify-content: center;
  align-items: center;
}

nav ul li a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  transition: color 0.3s ease, transform 0.2s ease;
  display: inline-block;
}

nav ul li a:hover,
nav ul li a:focus {
  color: var(--primary);
  transform: translateY(-2px);
}

/* ==========================================
  Hero Text Section
  ========================================== */
.hero-text {
  position: relative;
  z-index: 10;
  text-align: center;
  padding-bottom: 50vh;
  max-width: 900px;
  margin: 0 auto;
}

.hero-text h1 {
  font-size: clamp(2.5rem, 5vw + 1rem, 4.5rem);
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: 2px;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.8);
  animation: slideUp 0.8s ease-out;
}

.hero-text p {
  font-size: clamp(1.1rem, 2vw + 0.5rem, 1.5rem);
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  animation: slideUp 0.8s ease-out 0.2s backwards;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================
  Loading Spinner (optional)
  ========================================== */
.loading-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 5;
}

@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

header.loaded .loading-spinner {
  display: none;
}

/* ==========================================
  Responsive Design (Mobile)
  ========================================== */
  
.menu-toggle {
  display:none;
  font-size: 1.8rem;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  transition: color 0.3s ease;
}

.menu-toggle:hover{
  color: var(--primary);
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  nav {
    padding: 15px 20px;
  }

  nav ul {
    display: none;
    flex-direction: column;
    gap: 16px;
    background: rgba(0, 0, 0, 0);
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    padding: 20px 0;
    text-align: center;
  }

  .nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  nav ul.active{
    display: flex;
    background: rgba(0, 0, 0, 0);
  }

  .hero-text {
    padding-bottom: 45vh;
  }

  .hero-text h1 {
    letter-spacing: 1px;
  }
}

@media (max-width: 480px) {
  nav ul {
    gap: 12px;
  }

  nav ul li a {
    font-size: 0.95rem;
  }
}

