/* ============================================
   Sudanese Canadian Church of British Columbia
   Main Stylesheet
   ============================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

/* --- CSS Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* --- Custom Properties --- */
:root {
  --primary: #1B4332;
  --primary-light: #2D6A4F;
  --primary-dark: #0F2B1F;
  --secondary: #D4A843;
  --secondary-light: #E8C96A;
  --accent: #8B2500;
  --accent-light: #B33A00;
  --bg: #FDF8F0;
  --surface: #FFFFFF;
  --text: #1A1A1A;
  --text-secondary: #555555;
  --text-light: #FFFFFF;
  --text-muted: #888888;
  --border: #E0D8CC;
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --transition: 0.3s ease;
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --header-height: 80px;
  --max-width: 1200px;
}

/* --- Base --- */
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--secondary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--secondary-light); }
ul { list-style: none; }

/* --- Typography --- */
h1, h2, h3, h4, h5 { font-family: var(--font-heading); font-weight: 700; line-height: 1.3; color: var(--text); }
h1 { font-size: clamp(2rem, 4vw, 3.2rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: 1rem; }
h3 { font-size: clamp(1.2rem, 2vw, 1.6rem); margin-bottom: 0.75rem; }
p { margin-bottom: 1rem; color: var(--text-secondary); }

/* --- Layout --- */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }
.section { padding: 80px 0; }
.section-alt { background: var(--surface); }
.section-title { text-align: center; margin-bottom: 1rem; position: relative; }
.section-subtitle { text-align: center; color: var(--text-secondary); max-width: 700px; margin: 0 auto 3rem; font-size: 1.05rem; }
.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--secondary), var(--accent));
  margin: 16px auto 0;
  border-radius: 2px;
}

/* --- Header --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: var(--primary);
  transition: background var(--transition), box-shadow var(--transition);
}
.site-header.scrolled {
  background: var(--primary-dark);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}
.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
}
.header-brand img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 50%;
  background: var(--text-light);
  padding: 3px;
}
.header-brand h1 {
  font-family: var(--font-heading);
  font-size: clamp(0.85rem, 1.5vw, 1.15rem);
  color: var(--text-light);
  font-weight: 600;
  white-space: nowrap;
  margin: 0;
  line-height: 1.2;
}
.main-nav { display: flex; align-items: center; }
.main-nav ul {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.main-nav a {
  color: rgba(255,255,255,0.85);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.main-nav a:hover,
.main-nav a.active {
  color: var(--text-light);
  background: rgba(255,255,255,0.12);
}
.main-nav a.active { border-bottom: 2px solid var(--secondary); }

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  background: none;
  border: none;
  z-index: 1001;
}
.hamburger span {
  display: block;
  width: 26px;
  height: 2px;
  background: var(--text-light);
  transition: all var(--transition);
  border-radius: 2px;
}
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* --- Hero Banner --- */
.hero {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  margin-top: var(--header-height);
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15,43,31,0.75) 0%, rgba(27,67,50,0.85) 100%);
}
.hero-content {
  position: relative;
  z-index: 2;
  color: var(--text-light);
  padding: 40px 24px;
  max-width: 800px;
}
.hero-content h1 {
  color: var(--text-light);
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin-bottom: 1rem;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.hero-content p {
  color: rgba(255,255,255,0.9);
  font-size: clamp(1rem, 2vw, 1.25rem);
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Page Hero (shorter) */
.page-hero { min-height: 45vh; }

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 14px 32px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.btn-primary {
  background: var(--secondary);
  color: var(--primary-dark);
}
.btn-primary:hover {
  background: var(--secondary-light);
  color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212,168,67,0.4);
}
.btn-outline {
  background: transparent;
  color: var(--text-light);
  border: 2px solid var(--secondary);
}
.btn-outline:hover {
  background: var(--secondary);
  color: var(--primary-dark);
  transform: translateY(-2px);
}

/* --- Cards --- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}
.card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}
.card-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}
.card-body {
  padding: 28px;
}
.card-body h3 { color: var(--primary); }
.card-body p { font-size: 0.95rem; }
.card-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--text-light);
  margin-bottom: 16px;
}

/* --- Two Column Layout --- */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}
.two-col img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  height: 400px;
  object-fit: cover;
}
.two-col-text h2 { margin-bottom: 1rem; }
.two-col-text p { margin-bottom: 1rem; }

/* --- Values Grid --- */
.values-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}
.value-item {
  text-align: center;
  padding: 32px 20px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}
.value-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}
.value-item .icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  display: block;
}
.value-item h3 { color: var(--primary); font-size: 1.1rem; }
.value-item p { font-size: 0.9rem; margin: 0; }

/* --- Ministry Section --- */
.ministry-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: center;
  margin-bottom: 60px;
  padding-bottom: 60px;
  border-bottom: 1px solid var(--border);
}
.ministry-block:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.ministry-block.reverse { direction: rtl; }
.ministry-block.reverse > * { direction: ltr; }
.ministry-block img {
  width: 100%;
  height: 350px;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.ministry-text h3 { color: var(--primary); font-size: 1.4rem; }
.ministry-text ul { margin: 12px 0; padding-left: 20px; }
.ministry-text ul li {
  list-style: disc;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-size: 0.95rem;
}

/* --- Events Schedule Table --- */
.schedule-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 40px;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.schedule-table th {
  background: var(--primary);
  color: var(--text-light);
  padding: 16px 20px;
  text-align: left;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.schedule-table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
  color: var(--text-secondary);
}
.schedule-table tr:last-child td { border-bottom: none; }
.schedule-table tr:hover td { background: rgba(212,168,67,0.06); }

/* --- Event Cards --- */
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.event-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--secondary);
  transition: transform var(--transition), box-shadow var(--transition);
}
.event-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.event-card h3 { color: var(--primary); font-size: 1.15rem; margin-bottom: 8px; }
.event-date {
  display: inline-block;
  background: var(--primary);
  color: var(--text-light);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 12px;
}

/* --- Gallery --- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  cursor: pointer;
  aspect-ratio: 4/3;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.gallery-item:hover img { transform: scale(1.08); }
.gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: var(--text-light);
  font-size: 0.9rem;
  font-weight: 500;
  transform: translateY(100%);
  transition: transform var(--transition);
}
.gallery-item:hover .gallery-caption { transform: translateY(0); }

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.lightbox.active { display: flex; }
.lightbox img {
  max-width: 90%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 0 40px rgba(0,0,0,0.5);
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 2.5rem;
  color: var(--text-light);
  cursor: pointer;
  background: none;
  border: none;
  transition: transform var(--transition);
  z-index: 2001;
}
.lightbox-close:hover { transform: rotate(90deg); }
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2rem;
  color: var(--text-light);
  background: rgba(255,255,255,0.1);
  border: none;
  padding: 12px 18px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.lightbox-nav:hover { background: rgba(255,255,255,0.2); }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

/* --- Contact Form --- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
}
.contact-info-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}
.contact-info-item .icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--text-light);
}
.contact-info-item h4 { font-family: var(--font-body); font-weight: 600; margin-bottom: 4px; }
.contact-info-item p { margin: 0; font-size: 0.95rem; }
.contact-form { background: var(--surface); padding: 36px; border-radius: var(--radius); box-shadow: var(--shadow); }
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.9rem;
  color: var(--text);
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  background: var(--bg);
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(27,67,50,0.12);
}
.form-group textarea { resize: vertical; min-height: 130px; }
.form-message {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  display: none;
  font-size: 0.9rem;
}
.form-message.success { display: block; background: #d4edda; color: #155724; }
.form-message.error { display: block; background: #f8d7da; color: #721c24; }

/* Map */
.map-container {
  margin-top: 40px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.map-container iframe { width: 100%; height: 400px; border: none; }

/* --- Footer --- */
.site-footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.8);
  padding: 60px 0 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.footer-brand img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 50%;
  background: var(--text-light);
  padding: 3px;
}
.footer-brand span {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  color: var(--text-light);
  font-weight: 600;
}
.footer-col p { font-size: 0.9rem; line-height: 1.7; color: rgba(255,255,255,0.7); }
.footer-col h4 {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--secondary);
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul a {
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
  transition: color var(--transition), padding-left var(--transition);
}
.footer-col ul a:hover { color: var(--secondary); padding-left: 4px; }
.footer-contact-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 0.9rem;
}
.footer-contact-item .icon { font-size: 1rem; min-width: 20px; color: var(--secondary); }
.footer-bottom {
  padding: 24px 0;
  text-align: center;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
}
.footer-bottom span { color: var(--secondary); }

/* --- Animations --- */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Responsive --- */
@media (max-width: 992px) {
  .two-col, .ministry-block, .contact-grid, .footer-grid {
    grid-template-columns: 1fr;
  }
  .ministry-block.reverse { direction: ltr; }
  .footer-grid { gap: 30px; }
}

@media (max-width: 768px) {
  :root { --header-height: 70px; }
  .hamburger { display: flex; }
  .main-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--primary-dark);
    flex-direction: column;
    padding: 100px 30px 30px;
    transition: right var(--transition);
    box-shadow: -4px 0 20px rgba(0,0,0,0.3);
  }
  .main-nav.open { right: 0; }
  .main-nav ul { flex-direction: column; gap: 0; width: 100%; }
  .main-nav a {
    display: block;
    padding: 14px 16px;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    border-radius: 0;
  }
  .hero { min-height: 55vh; }
  .page-hero { min-height: 35vh; }
  .section { padding: 50px 0; }
  .cards-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .two-col img, .ministry-block img { height: 280px; }
}

@media (max-width: 480px) {
  .header-brand h1 { font-size: 0.8rem; }
  .header-brand img { width: 38px; height: 38px; }
  .hero-content h1 { font-size: 1.6rem; }
  .btn { padding: 12px 24px; font-size: 0.85rem; }
}
