/* CJFB — base styles shared across every page (Editorial Prestige design system) */

@layer base {
  html, body { margin: 0; padding: 0; }
  body { overscroll-behavior: none; }
  main > :first-child { margin-top: 0 !important; }
  main > :last-child { margin-bottom: 0 !important; }
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c8c5d2; border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: #8585ce; }

:focus-visible {
  outline: 2px solid #6969b2;
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Scroll progress bar ---------- */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #6969b2, #8585ce);
  z-index: 60;
  transition: width 0.1s ease-out;
}

/* ---------- Header elevation on scroll ---------- */
.site-header-inner {
  transition: box-shadow 0.3s ease, background-color 0.3s ease, transform 0.3s ease;
}
.site-header-inner.is-scrolled {
  box-shadow: 0 12px 40px -10px rgba(57, 44, 72, 0.18);
}

/* ---------- Mobile nav drawer ---------- */
#mobile-nav-panel {
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
  transform: translateY(-8px);
  opacity: 0;
  visibility: hidden;
}
#mobile-nav-panel.is-open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.mobile-dropdown-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.mobile-dropdown-content.is-open {
  max-height: 240px;
}

/* ---------- Back to top ---------- */
#back-to-top {
  transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.2s ease;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
}
#back-to-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ---------- Scroll reveal ---------- */
[data-animate] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
[data-animate].is-visible {
  opacity: 1;
  transform: translateY(0);
}
[data-animate="fade"] { transform: none; }
[data-animate="zoom"] { transform: scale(0.94); }
[data-animate="zoom"].is-visible { transform: scale(1); }
[data-animate="left"] { transform: translateX(-32px); }
[data-animate="left"].is-visible { transform: translateX(0); }
[data-animate="right"] { transform: translateX(32px); }
[data-animate="right"].is-visible { transform: translateX(0); }

[data-animate-group] > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
[data-animate-group].is-visible > * {
  opacity: 1;
  transform: translateY(0);
}
[data-animate-group].is-visible > *:nth-child(1) { transition-delay: 0ms; }
[data-animate-group].is-visible > *:nth-child(2) { transition-delay: 90ms; }
[data-animate-group].is-visible > *:nth-child(3) { transition-delay: 180ms; }
[data-animate-group].is-visible > *:nth-child(4) { transition-delay: 270ms; }
[data-animate-group].is-visible > *:nth-child(5) { transition-delay: 360ms; }
[data-animate-group].is-visible > *:nth-child(6) { transition-delay: 450ms; }
[data-animate-group].is-visible > *:nth-child(7) { transition-delay: 540ms; }
[data-animate-group].is-visible > *:nth-child(8) { transition-delay: 630ms; }

/* ---------- 3D tilt cards ---------- */
.tilt-card {
  transform-style: preserve-3d;
  perspective: 1000px;
  transition: transform 0.15s ease-out, box-shadow 0.3s ease;
}
.tilt-card-inner {
  transform-style: preserve-3d;
}

/* ---------- Image zoom-on-hover wrapper ---------- */
.img-zoom { overflow: hidden; }
.img-zoom img { transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
.img-zoom:hover img { transform: scale(1.06); }

/* ---------- Animated counters ---------- */
[data-counter] { font-variant-numeric: tabular-nums; }

/* ---------- Hero parallax layer ---------- */
[data-parallax] { will-change: transform; }

/* ---------- Lightbox ---------- */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(30, 25, 39, 0.92);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.25s ease;
}
#lightbox.is-open { display: flex; opacity: 1; }
#lightbox img {
  max-width: min(92vw, 1100px);
  max-height: 86vh;
  border-radius: 1rem;
  box-shadow: 0 24px 80px -16px rgba(0,0,0,0.5);
  transform: scale(0.96);
  transition: transform 0.25s ease;
}
#lightbox.is-open img { transform: scale(1); }

/* ---------- Form feedback ---------- */
.form-field-error { border-color: #ba1a1a !important; }
.form-error-msg { color: #ba1a1a; font-size: 12px; margin-top: 4px; display: none; }
.form-error-msg.is-visible { display: block; }
.form-success-banner {
  display: none;
}
.form-success-banner.is-visible {
  display: flex;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  [data-animate], [data-animate-group] > * {
    opacity: 1 !important;
    transform: none !important;
  }
  .tilt-card { transform: none !important; }
}
