/* ═══════════════════════════════════════════
   ANIMAZIONI FORESTA – Birdgarden
   Foglie cadenti · Uccellino volante · Luce · Scroll reveal · Lightbox
   ═══════════════════════════════════════════ */

/* ---------- 1. FOGLIE CHE CADONO ---------- */

@keyframes leafFall1 {
  0%   { transform: translateY(-60px) translateX(0) rotate(0deg); opacity: 0; }
  5%   { opacity: 1; }
  20%  { transform: translateY(20vh) translateX(40px) rotate(80deg); }
  40%  { transform: translateY(40vh) translateX(-25px) rotate(180deg); }
  60%  { transform: translateY(60vh) translateX(35px) rotate(270deg); opacity: 0.8; }
  80%  { transform: translateY(80vh) translateX(-15px) rotate(340deg); opacity: 0.5; }
  100% { transform: translateY(105vh) translateX(10px) rotate(380deg); opacity: 0; }
}

@keyframes leafFall2 {
  0%   { transform: translateY(-60px) translateX(0) rotate(0deg); opacity: 0; }
  5%   { opacity: 0.9; }
  25%  { transform: translateY(25vh) translateX(-30px) rotate(-60deg); }
  50%  { transform: translateY(50vh) translateX(20px) rotate(-150deg); }
  75%  { transform: translateY(75vh) translateX(-35px) rotate(-250deg); opacity: 0.6; }
  100% { transform: translateY(105vh) translateX(0px) rotate(-320deg); opacity: 0; }
}

@keyframes leafSwirl {
  0%   { transform: translateY(-50px) translateX(0) rotate(0deg) scale(1); opacity: 0; }
  8%   { opacity: 0.85; }
  25%  { transform: translateY(22vh) translateX(55px) rotate(100deg) scale(0.9); }
  50%  { transform: translateY(45vh) translateX(-40px) rotate(220deg) scale(0.85); }
  75%  { transform: translateY(70vh) translateX(30px) rotate(310deg) scale(0.8); opacity: 0.5; }
  100% { transform: translateY(100vh) translateX(-10px) rotate(400deg) scale(0.7); opacity: 0; }
}

.bg-leaf {
  position: fixed;
  top: -60px;
  z-index: 9998;
  pointer-events: none;
  will-change: transform, opacity;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.15));
}

.bg-leaf--1 {
  width: 28px; height: 28px;
  background: url('../img/leaf-1.svg') no-repeat center / contain;
  animation: leafFall1 var(--dur, 9s) linear var(--delay, 0s) infinite;
}
.bg-leaf--2 {
  width: 22px; height: 22px;
  background: url('../img/leaf-2.svg') no-repeat center / contain;
  animation: leafFall2 var(--dur, 11s) linear var(--delay, 0s) infinite;
}
.bg-leaf--3 {
  width: 34px; height: 34px;
  background: url('../img/leaf-1.svg') no-repeat center / contain;
  animation: leafSwirl var(--dur, 13s) linear var(--delay, 0s) infinite;
}


/* ---------- 2. UCCELINO VOLANTE ---------- */

@keyframes birdGlide {
  0%   { transform: translate(-80px, 20px) rotate(0deg); opacity: 0; }
  5%   { opacity: 0.9; }
  50%  { transform: translate(50vw, -30px) rotate(-8deg); }
  95%  { opacity: 0.7; }
  100% { transform: translate(110vw, 10px) rotate(3deg); opacity: 0; }
}

.bg-bird-fly {
  position: fixed;
  top: 15%;
  left: 0;
  width: 42px;
  height: 42px;
  background: url('../img/bird-perched.svg') no-repeat center / contain;
  z-index: 9997;
  pointer-events: none;
  animation: birdGlide 22s linear infinite;
  opacity: 0;
}


/* ---------- 3. LUCE SOLARE (atmosfera) ---------- */

@keyframes sunPulse {
  0%, 100% { opacity: 0.03; }
  50%      { opacity: 0.06; }
}

.sun-glow {
  position: fixed;
  top: -100px;
  right: -100px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212,160,60,0.15) 0%, transparent 70%);
  z-index: 1;
  pointer-events: none;
  animation: sunPulse 8s ease-in-out infinite;
}


/* ---------- 4. SCROLL REVEAL ---------- */

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}


/* ---------- 5. LIGHTBOX ---------- */

.birdgarden-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(13, 27, 14, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s;
}
.birdgarden-modal.active {
  opacity: 1;
  visibility: visible;
}
.birdgarden-modal img {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: 14px 6px 14px 6px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.birdgarden-modal .modal-caption {
  color: #d4edd4;
  margin-top: 1rem;
  font-size: 0.9rem;
  font-style: italic;
  text-align: center;
  padding: 0 1rem;
}
.birdgarden-modal .modal-close {
  position: absolute;
  top: 1.5rem;
  right: 2rem;
  font-size: 2.5rem;
  color: #e8f0e8;
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
  transition: color 0.3s, transform 0.3s;
}
.birdgarden-modal .modal-close:hover {
  color: #d4a03c;
  transform: rotate(90deg);
}


/* ---------- 6. SKELETON LOADING ---------- */

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton-loading {
  background: linear-gradient(90deg,
    #d4edd4 25%,
    #b5ddb5 50%,
    #d4edd4 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 14px 6px 14px 6px;
  min-height: 200px;
}


/* ---------- 7. SEZIONE "CONTATTACI" DECORATA ---------- */

.contact-section,
.widget_contact,
#contattaci {
  position: relative;
  background: linear-gradient(135deg, var(--forest-50), var(--forest-100));
  border-radius: 14px 6px 14px 6px;
  padding: 2rem;
  margin: 2rem 0;
}
.contact-section::before {
  content: '🌿';
  position: absolute;
  top: -12px;
  right: 20px;
  font-size: 1.8rem;
  opacity: 0.5;
}
