/* ============================================================
   DOMUS MIDÍ — ANIMATIONS CSS
   Supporting styles for GSAP animations
   ============================================================ */

/* ---------- SPLIT TEXT CHARS ---------- */
.hero-title .char {
  display: inline-block;
  will-change: transform, opacity;
}

.hero-title .word {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
}

/* ---------- HORIZONTAL GALLERY PIN ---------- */
.horizontal-gallery-pin {
  will-change: transform;
}

/* ---------- COUNTER ---------- */
.stat-number {
  will-change: contents;
  display: inline-block;
}

/* ---------- GOLDEN LINE DRAW ---------- */
/* Initial state managed via width: 0 in style.css; JS animates width → 200px */

/* ---------- LOADER STATES ---------- */
.loader-line {
  transform-origin: left;
  transform: scaleX(0);
}

/* ---------- NAVBAR TRANSITION ---------- */
.navbar {
  will-change: background-color, box-shadow, padding;
}

/* ---------- IMAGE PARALLAX CONTAINER ---------- */
.parallax-img {
  will-change: transform;
  transform: scale(1.15);
}

/* ---------- STAGGER ITEMS ---------- */
.stagger-item {
  will-change: transform, opacity;
}

/* ---------- MAGNETIC BTN WRAPPER ---------- */
.btn-magnetic {
  will-change: transform;
  display: inline-block;
}

/* ---------- CLIP REVEAL ---------- */
.clip-reveal {
  clip-path: inset(0 100% 0 0);
  will-change: clip-path;
}

/* ---------- SCALE REVEAL ---------- */
.scale-reveal {
  transform: scale(0.92) translateY(20px);
  opacity: 0;
  will-change: transform, opacity;
}

/* ---------- CARD HOVER (purely CSS fallback) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .gallery-card,
  .puglia-card,
  .servizio-item,
  .masonry-item {
    transition: transform 0.3s ease;
  }
}

/* ---------- REDUCED MOTION OVERRIDES ---------- */
@media (prefers-reduced-motion: reduce) {
  .hero-title .char { opacity: 1 !important; transform: none !important; }
  .loader { display: none !important; }
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- SCROLL-DRIVEN PROGRESS BAR ---------- */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: var(--color-secondary);
  z-index: 1001;
  transform-origin: left;
  will-change: transform;
}

/* ---------- SECTION ENTER CLASSES ---------- */
.is-visible {
  opacity: 1 !important;
  transform: none !important;
}

/* ---------- HORIZONTAL SCROLL GALLERY (no GSAP fallback) ---------- */
@media (max-width: 768px) {
  .horizontal-gallery-wrapper {
    overflow: hidden !important;
  }

  .horizontal-gallery {
    transform: none !important;
  }
}

/* ---------- CUSTOM CURSOR STATES ---------- */
.custom-cursor.is-hovering {
  transform: translate(-50%, -50%) scale(2.5);
  background: rgba(201,169,110,0.8);
}

.custom-cursor-ring.is-hovering {
  transform: translate(-50%, -50%) scale(0.5);
  opacity: 0;
}

/* ---------- PAGE TRANSITION OVERLAY ---------- */
.transition-overlay {
  position: fixed;
  inset: 0;
  z-index: 8000;
  pointer-events: none;
}

.transition-overlay__bar {
  position: absolute;
  left: 0;
  right: 0;
  height: 100%;
  background: var(--color-primary);
  transform: scaleY(0);
  will-change: transform;
}

/* ---------- SWIPE INDICATOR (mobile gallery) ---------- */
.swipe-hint {
  display: none;
  text-align: center;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-gray);
  padding-top: 16px;
}

@media (max-width: 768px) {
  .swipe-hint { display: block; }
}

/* ---------- STAR ANIMATION ---------- */
.star-fill {
  stroke: var(--color-secondary);
  fill: none;
  stroke-width: 1.5;
}

.star-fill.filled {
  fill: var(--color-secondary);
}

/* ---------- TYPING CURSOR (optional) ---------- */
.typing-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--color-secondary);
  margin-left: 4px;
  vertical-align: middle;
  animation: blink 0.8s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* ---------- SCROLL LOCK ---------- */
body.scroll-locked {
  overflow: hidden;
}
