/* Church Template - Main CSS */

/* CSS Custom Properties for Theming */
:root {
  /* Colors - Will be overridden by JavaScript from config */
  --primary-color: #2c3e50;
  --secondary-color: #3498db;
  --accent-color: #e74c3c;
  --background-color: #ffffff;
  --text-color: #333333;
  --text-light: #666666;
  --text-muted: #999999;
  --border-color: #e0e0e0;
  --shadow-color: rgba(0, 0, 0, 0.1);
  
  /* Status Colors */
  --success-color: #28a745;
  --success-light: #d4edda;
  --success-dark: #155724;
  --warning-color: #ffc107;
  --warning-light: #fff3cd;
  --warning-dark: #856404;
  --primary-light: rgba(44, 62, 80, 0.1);
  
  /* Typography */
  --font-primary: 'Arial', sans-serif;
  --font-secondary: 'Georgia', serif;
  --font-size-base: 16px;
  --font-size-xs: 12px;
  --font-size-sm: 14px;
  --font-size-small: 14px;
  --font-size-md: 16px;
  --font-size-lg: 18px;
  --font-size-large: 18px;
  --font-size-xl: 24px;
  --font-size-xxl: 32px;
  --font-size-hero: 48px;
  --line-height-base: 1.6;
  --line-height-tight: 1.2;
  
  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --spacing-xxl: 4rem;
  
  /* Layout */
  --container-max-width: 1200px;
  --container-padding: 1rem;
  --border-radius: 8px;
  --border-radius-small: 4px;
  --border-radius-large: 12px;
  
  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
  
  /* Shadows */
  --shadow-small: 0 2px 4px var(--shadow-color);
  --shadow-medium: 0 4px 8px var(--shadow-color);
  --shadow-large: 0 8px 16px var(--shadow-color);
  
  /* Breakpoints (for reference in media queries) */
  --breakpoint-sm: 576px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 992px;
  --breakpoint-xl: 1200px;
}

/* Reset and Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: var(--font-size-base);
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  line-height: var(--line-height-base);
  color: var(--text-color);
  background-color: var(--background-color);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-secondary);
  line-height: var(--line-height-tight);
  margin-bottom: var(--spacing-sm);
  color: var(--text-color);
}

h1 {
  font-size: var(--font-size-hero);
  font-weight: 700;
}

h2 {
  font-size: var(--font-size-xxl);
  font-weight: 600;
}

h3 {
  font-size: var(--font-size-xl);
  font-weight: 600;
}

h4 {
  font-size: var(--font-size-large);
  font-weight: 500;
}

h5, h6 {
  font-size: var(--font-size-base);
  font-weight: 500;
}

p {
  margin-bottom: var(--spacing-sm);
  color: var(--text-color);
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--secondary-color);
}

a:focus {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

/* Layout Components */
.container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.section {
  padding: var(--spacing-xxl) 0;
}

.section-header {
  text-align: center;
  margin-bottom: var(--spacing-xl);
}

.section-title {
  margin-bottom: var(--spacing-sm);
}

.section-subtitle {
  color: var(--text-light);
  font-size: var(--font-size-large);
  max-width: 600px;
  margin: 0 auto;
}

.section-footer {
  text-align: center;
  margin-top: var(--spacing-xl);
}

/* Grid System */
.grid {
  display: grid;
  gap: var(--spacing-lg);
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* Flexbox Utilities */
.flex {
  display: flex;
}

.flex-column {
  flex-direction: column;
}

.flex-center {
  justify-content: center;
  align-items: center;
}

.flex-between {
  justify-content: space-between;
  align-items: center;
}

.flex-wrap {
  flex-wrap: wrap;
}

/* Button Styles */
.btn {
  display: inline-block;
  padding: var(--spacing-sm) var(--spacing-lg);
  border: 2px solid transparent;
  border-radius: var(--border-radius);
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-normal);
  line-height: 1.2;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.btn-primary:hover {
  background-color: var(--secondary-color);
  border-color: var(--secondary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

.btn-secondary {
  background-color: var(--secondary-color);
  color: white;
  border-color: var(--secondary-color);
}

.btn-secondary:hover {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

.btn-outline {
  background-color: transparent;
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-outline:hover {
  background-color: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

.btn-accent {
  background-color: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
}

.btn-accent:hover {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

/* Card Component */
.card {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-small);
  overflow: hidden;
  transition: all var(--transition-normal);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-large);
}

.card-header {
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--border-color);
}

.card-body {
  padding: var(--spacing-lg);
}

.card-footer {
  padding: var(--spacing-lg);
  border-top: 1px solid var(--border-color);
  background-color: #f8f9fa;
}

.card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

/* Form Elements */
.form-group {
  margin-bottom: var(--spacing-md);
}

.form-label {
  display: block;
  margin-bottom: var(--spacing-xs);
  font-weight: 500;
  color: var(--text-color);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: var(--spacing-sm);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  transition: border-color var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.text-muted {
  color: var(--text-muted);
}

.text-light {
  color: var(--text-light);
}

.text-primary {
  color: var(--primary-color);
}

.text-secondary {
  color: var(--secondary-color);
}

.text-accent {
  color: var(--accent-color);
}

.bg-primary {
  background-color: var(--primary-color);
  color: white;
}

.bg-secondary {
  background-color: var(--secondary-color);
  color: white;
}

.bg-light {
  background-color: #f8f9fa;
}

.bg-dark {
  background-color: #343a40;
  color: white;
}

/* Spacing Utilities */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }
.mt-5 { margin-top: var(--spacing-xl); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }
.mb-5 { margin-bottom: var(--spacing-xl); }

.pt-0 { padding-top: 0; }
.pt-1 { padding-top: var(--spacing-xs); }
.pt-2 { padding-top: var(--spacing-sm); }
.pt-3 { padding-top: var(--spacing-md); }
.pt-4 { padding-top: var(--spacing-lg); }
.pt-5 { padding-top: var(--spacing-xl); }

.pb-0 { padding-bottom: 0; }
.pb-1 { padding-bottom: var(--spacing-xs); }
.pb-2 { padding-bottom: var(--spacing-sm); }
.pb-3 { padding-bottom: var(--spacing-md); }
.pb-4 { padding-bottom: var(--spacing-lg); }
.pb-5 { padding-bottom: var(--spacing-xl); }

/* Accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--primary-color);
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: var(--border-radius-small);
  z-index: 1000;
}

.skip-link:focus {
  top: 6px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Print Styles */
@media print {
  * {
    background: transparent !important;
    color: black !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }
  
  a,
  a:visited {
    text-decoration: underline;
  }
  
  .btn {
    border: 1px solid black;
  }
  
  .skip-link,
  .mobile-menu-toggle {
    display: none;
  }
}/* Utility 
Classes */
.bg-light {
  background-color: #f8f9fa;
}

.text-center {
  text-align: center;
}

.text-muted {
  color: var(--text-muted);
}

.img-responsive {
  max-width: 100%;
  height: auto;
}

.section {
  padding: var(--spacing-xl) 0;
}

.section-header {
  text-align: center;
  margin-bottom: var(--spacing-lg);
}

.section-title {
  font-size: var(--font-size-xxl);
  color: var(--primary-color);
  margin-bottom: var(--spacing-sm);
  font-weight: 600;
}

.section-subtitle {
  font-size: var(--font-size-lg);
  color: var(--text-light);
  margin: 0;
}/* Imag
e Optimization and Responsive Images */

/* Base image styles */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Lazy loading placeholder */
img[loading="lazy"] {
  opacity: 0;
  transition: opacity var(--transition-normal);
}

img[loading="lazy"].loaded,
img[loading="lazy"]:not([data-src]) {
  opacity: 1;
}

/* Image aspect ratio containers */
.image-container {
  position: relative;
  overflow: hidden;
}

.image-container::before {
  content: '';
  display: block;
  padding-top: 56.25%; /* 16:9 aspect ratio */
}

.image-container.aspect-4-3::before {
  padding-top: 75%; /* 4:3 aspect ratio */
}

.image-container.aspect-1-1::before {
  padding-top: 100%; /* 1:1 aspect ratio */
}

.image-container.aspect-3-2::before {
  padding-top: 66.67%; /* 3:2 aspect ratio */
}

.image-container img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Responsive image utilities */
.img-responsive {
  max-width: 100%;
  height: auto;
}

.img-fluid {
  max-width: 100%;
  height: auto;
}

/* Image loading states */
.image-loading {
  background: linear-gradient(90deg, var(--border-color) 25%, transparent 25%, transparent 75%, var(--border-color) 75%);
  background-size: 20px 20px;
  animation: loading-shimmer 1.5s infinite linear;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
}

@keyframes loading-shimmer {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 20px 0;
  }
}

.image-error {
  background: var(--bg-light, #f8f9fa);
  border: 2px dashed var(--border-color);
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: var(--font-size-sm);
}

.image-error::before {
  content: '🖼️';
  font-size: 2rem;
  margin-bottom: var(--spacing-sm);
  opacity: 0.5;
}

/* Hero image optimization */
.hero-background {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
}

.hero-background::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.5));
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
}

/* Critical image preloading */
.preload-critical {
  position: absolute;
  top: -9999px;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

/* WebP support detection */
.webp .webp-image {
  display: block;
}

.webp .fallback-image {
  display: none;
}

.no-webp .webp-image {
  display: none;
}

.no-webp .fallback-image {
  display: block;
}

/* Performance optimization utilities */
.will-change-transform {
  will-change: transform;
}

.will-change-opacity {
  will-change: opacity;
}

.gpu-accelerated {
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000px;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  img[loading="lazy"] {
    transition: none;
  }
  
  .loading-shimmer {
    animation: none;
  }
  
  .will-change-transform,
  .will-change-opacity {
    will-change: auto;
  }
}

/* Print styles for images */
@media print {
  img {
    max-width: 100% !important;
    page-break-inside: avoid;
  }
  
  .hero-background {
    background: none !important;
  }
  
  .image-loading,
  .image-error {
    display: none;
  }
}