/* ===========================================
   CHURCH WEBSITE - PERFORMANCE & SMOOTHNESS
   Optimized for 60FPS smooth navigation
   =========================================== */

/* GPU Acceleration — only for elements that actually animate */
.hero-parallax img,
.splash-slide {
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Optimized Scroll Behavior */
html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Smooth Page Transitions */
body {
  opacity: 1;
  transition: opacity 0.3s ease-in-out;
}

/* Prevent Layout Shift During Load */
img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Navbar transitions handled in components.css */

/* Form Input Smooth Focus */
input,
textarea,
select {
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

/* Button Smooth Hover */
button,
.btn,
a.btn {
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Smooth Link Transitions */
a[href] {
  transition: color 0.2s ease;
}

/* Card Elevation Smooth */
.card-hover,
.contact-card,
.footer-block,
.service-item {
  transition: all 0.3s cubic-bezier(0.23, 1, 0.320, 1);
}

/* Smooth Color Transitions */
.text-primary,
.text-secondary {
  transition: color 0.2s ease;
}

/* Reduce Animation Duration Slightly for Responsiveness */
/* @keyframes fadeIn defined in pages.css */

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Prevent Jank During Animations */
.animating,
[data-animating="true"] {
  transform: translateZ(0);
}

/* Global transition-timing override removed — each component sets its own */

/* Shadow Smooth Transitions */
.shadow-elevation-1,
.shadow-elevation-2,
.shadow-elevation-3,
.shadow-elevation-4 {
  transition: box-shadow 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Scrollbar styles defined in utilities.css */

/* ::selection styles defined in utilities.css */

/* Smooth Focus Ring */
:focus-visible {
  outline: 2px solid #d4a574;
  outline-offset: 2px;
  transition: outline 0.2s ease;
}

/* Modal/Overlay Smooth Transitions */
.modal,
[role="dialog"],
.overlay {
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* contain: layout removed — it breaks sticky/fixed positioning */

/* Optimize Text Rendering */
body {
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
}

/* Smooth Loading States */
.loading::after,
.skeleton {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* @keyframes pulse defined in pages.css */

/* Prevent Flash of Unstyled Content (FOUC) */
body:not(.loaded) .lazy-content {
  opacity: 0;
  transition: opacity 0.3s ease;
}

body.loaded .lazy-content {
  opacity: 1;
}

/* Smooth Navbar Link Ripple */
.nav-link::before {
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
    height 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Smooth Error/Success States */
.form-group.error,
.form-group.success {
  transition: all 0.3s ease;
}

.form-error-msg {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Smooth Breadcrumb Transitions */
.breadcrumbs {
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.breadcrumb-current {
  transition: color 0.3s ease;
}

/* Optimize Hero Animations */
.hero-title,
.hero-subtitle,
.hero-overlay {
  transition: opacity 0.8s cubic-bezier(0.23, 1, 0.32, 1), transform 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Smooth Section Reveals */
[data-reveal] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.23, 1, 0.32, 1),
    transform 0.7s cubic-bezier(0.23, 1, 0.32, 1);
}

[data-reveal].active {
  opacity: 1;
  transform: translateY(0);
}

/* Respect Prefers Reduced Motion for All Transitions */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* Smooth Loader Transitions */
.page-loader {
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.page-loader.hidden {
  opacity: 0;
  visibility: hidden;
}

/* Prevent Content Jump on Scroll */
html {
  overflow-y: scroll;
}

/* Sticky element transitions handled in their respective component CSS */

/* Optimize Backdrop Filter */
[style*="backdrop-filter"] {
  will-change: backdrop-filter;
}

/* Smooth Filter Transitions */
.filter-active {
  transition: filter 0.3s ease;
}

/* Ensure Smooth Print Transitions */
@media print {
  * {
    transition: none !important;
    animation: none !important;
  }
}