/**
 * Site-wide motion & hover effects (~0.5–0.9s)
 */

@media (prefers-reduced-motion: reduce) {
  .fx-reveal,
  .fx-reveal.fx-visible,
  body.fx-page-ready .page-title-hero,
  body.fx-page-ready .site-header,
  .fx-hover-lift {
    transition: none !important;
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Page enter */
body.fx-page-ready .site-header {
  animation: fxFadeDown 0.7s ease both;
}

body.fx-page-ready .page-title-hero {
  animation: fxFadeUp 0.85s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes fxFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fxFadeDown {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* Scroll reveal */
.fx-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.fx-reveal.fx-visible {
  opacity: 1;
  transform: translateY(0);
}

.fx-reveal.fx-fade {
  transform: none;
}

.fx-reveal.fx-fade.fx-visible {
  transform: none;
}

.fx-reveal.fx-scale {
  transform: scale(0.94);
}

.fx-reveal.fx-scale.fx-visible {
  transform: scale(1);
}

/* Hover lift cards */
.fx-hover-lift {
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.35s ease,
    border-color 0.35s ease;
}

.fx-hover-lift:hover {
  transform: translateY(-6px);
}

body.page-granite-series-html .category-products li.item.fx-hover-lift:hover,
body.page-shree-krishna-granites-slabs-html .category-products li.item.fx-hover-lift:hover,
body.page-products-html .category-products li.item.fx-hover-lift:hover {
  box-shadow: 0 14px 32px rgba(31, 63, 122, 0.18);
}

.gallery-item.fx-hover-lift:hover {
  box-shadow: 0 14px 28px rgba(31, 63, 122, 0.2);
}

.product-card.fx-hover-lift:hover,
.category-card.fx-hover-lift:hover,
.process-card.fx-hover-lift:hover {
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.22);
}

.contact-card.fx-hover-lift:hover {
  box-shadow: 0 12px 28px rgba(31, 63, 122, 0.14);
}

/* Buttons */
.fx-btn {
  transition:
    transform 0.28s ease,
    box-shadow 0.28s ease,
    background 0.28s ease,
    color 0.28s ease;
}

.fx-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(194, 134, 31, 0.35);
}

/* Nav link underline */
.site-header .main-nav a {
  position: relative;
}

.site-header .main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #c2861f, #d59b2d);
  transition: width 0.35s ease;
}

.site-header .main-nav a:hover::after,
.site-header .main-nav a.active::after {
  width: 100%;
}

/* Gallery lightbox (all pages with .gallery-item) */
.gallery-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 48px 20px 20px;
  background: rgba(15, 23, 42, 0.92);
  box-sizing: border-box;
}

.gallery-lightbox.is-open {
  display: flex;
  animation: fxFadeIn 0.35s ease;
}

body.gallery-lightbox-open {
  overflow: hidden;
}

.gallery-lightbox-close {
  position: fixed;
  top: 16px;
  right: 20px;
  z-index: 10001;
  width: 48px;
  height: 48px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  background: rgba(27, 39, 64, 0.9);
  color: #fff;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s ease, transform 0.25s ease;
}

.gallery-lightbox-close:hover,
.gallery-lightbox-close:focus {
  background: #c2861f;
  color: #1b2740;
  outline: none;
  transform: scale(1.06);
}

.gallery-lightbox-inner {
  max-width: min(1100px, 96vw);
  max-height: calc(100vh - 80px);
}

.gallery-lightbox-img {
  max-width: 100%;
  max-height: calc(100vh - 80px);
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  animation: fxScaleIn 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes fxScaleIn {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
