/*
 * HERO SECTION STYLES
 * Gestione layout, parallasse, elementi decorativi e animazioni di entrata
 */

/* --- Layout Principale --- */
.hero-container {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-bg-beige);
}

/* Sfondo e Immagine */
.hero-bg-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;

  /* Stato iniziale per animazione */
  opacity: 0;
  transform: scale(1.1);
  transition:
    opacity 1.5s ease-out,
    transform 1.5s ease-out;
}

.hero-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Overlay Effetto Vetro */
.hero-overlay-blur {
  position: absolute;
  inset: 0;
  z-index: 10;
  background-color: rgba(230, 222, 209, 0.4);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);

  /* Stato iniziale */
  opacity: 0;
  transition: opacity 1.5s ease-out;
}

/* --- Elementi Decorativi (Foglie) --- */
.leaf-container {
  position: absolute;
  z-index: 10;
  opacity: 0.6;
  pointer-events: none;
  mix-blend-mode: multiply;
  filter: drop-shadow(0 25px 25px rgba(0, 0, 0, 0.15));
  transition: all 1.5s ease-out;
}

.leaf-left {
  bottom: 0;
  left: -4rem;
  width: 12rem;
  transform: translateX(-50px); /* Start position */
  opacity: 0;
}

.leaf-right {
  top: 0;
  right: -5rem;
  width: 14rem;
  transform: translateX(50px); /* Start position */
  opacity: 0;
}

@media (min-width: 768px) {
  .leaf-left {
    width: 16rem;
  }
  .leaf-right {
    width: 20rem;
  }
}

@media (min-width: 1024px) {
  .leaf-left {
    width: 20rem;
  }
  .leaf-right {
    width: 24rem;
  }
}

/* --- Contenuto Centrale --- */
.hero-content {
  position: relative;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1rem;
  max-width: 56rem;
  margin: 0 auto;
}

/* Logo */
.hero-logo-wrapper {
  width: 10rem;
  margin-bottom: 1rem;
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 1s ease-out,
    transform 1s ease-out;
}

@media (min-width: 768px) {
  .hero-logo-wrapper {
    width: 16rem;
  }
}

/* Gruppo Testi */
.hero-text-group {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

/* Classi condivise per animazione testi */
.hero-anim-item {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.8s ease-out,
    transform 0.8s ease-out;
}

/* Titolo */
.hero-title {
  font-family: var(--font-primary);
  font-size: 2rem;
  line-height: 2;
  font-weight: 700;
  color: var(--color-brand-brown);
  margin: 0;
  letter-spacing: -0.15em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Separatore */
.hero-separator {
  height: 2px;
  width: 5rem;
  background-color: rgba(62, 52, 43, 0.4);
  border-radius: 9999px;
  margin: 0.88rem 0;
}

/* Separatore animato (stato iniziale) */
.hero-separator-anim {
  width: 0;
  opacity: 0;
  transition:
    width 1s ease-in-out,
    opacity 1s ease-in-out;
}

/* Sottotitolo */
.hero-subtitle {
  font-family: var(--font-primary);
  font-size: 1.25rem;
  letter-spacing: -0.15em;
  line-height: 2;
  font-weight: 700;
  color: #7a9939;
  margin: 0;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

/* Data */
.hero-date {
  font-family: var(--font-primary);
  font-size: 0.6rem;
  letter-spacing: -0.15em;
  color: var(--color-text-grey);
  margin-top: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Media Queries Testi */
@media (min-width: 768px) {
  .hero-title {
    font-size: 2.7rem;
  }
  .hero-subtitle {
    font-size: 1.6rem;
  }
  .hero-date {
    margin-top: 20px;
    font-size: 0.7rem;
  }
}

/* --- Call to Action (CTA) Button --- */
.hero-cta-button {
  /* Layout e Posizionamento */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.1rem 2.8rem;
  margin-top: 2.5rem;

  /* Stato Iniziale Animazione: Usiamo 'top' per evitare conflitti con 'transform: scale' */
  opacity: 0;
  position: relative;
  top: 0;

  /* Stile */
  font-family: var(--font-primary);
  font-size: 1.75rem;
  line-height: 1;
  color: var(--color-bg-beige);
  text-decoration: none;
  background: linear-gradient(135deg, #7a9939 0%, #63802d 100%);
  border-radius: 9999px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  cursor: pointer;

  /* Transizioni */
  transition:
    transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    box-shadow 0.4s ease,
    filter 0.4s ease;
}

.cta-text {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  font-size: 0.79rem;
  letter-spacing: -0.15em;
  font-weight: 600;
}

.cta-icon {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-left: 0.75rem;
}

.cta-shine {
  display: none;
}
@media (min-width: 375px) {
  .cta-text {
    font-size: 0.9rem;
  }
}
@media (min-width: 768px) {
  .hero-cta-button {
    font-size: 2rem;
    padding: 0.9rem 3.5rem;
  }
  .cta-text {
    font-size: 0.9rem;
  }
}

/* Hover CTA */
.hero-cta-button:hover {
  transform: scale(1.05);
  filter: brightness(1.1);
  box-shadow: 0 15px 30px -5px rgba(122, 153, 57, 0.6);
}

/* --- Scroll Indicator --- */
.scroll-indicator {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;

  /* Stato Iniziale */
  opacity: 0;
  transition: opacity 1.5s ease-out;
}

.scroll-text {
  font-family: var(--font-secondary);
  font-size: 0.75rem;
  color: rgba(62, 52, 43, 0.7);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.scroll {
  overflow: hidden;
  width: 2px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.scroll-line {
  width: 1px;
  height: 3rem;
  background: linear-gradient(to bottom, transparent, rgba(62, 52, 43, 0.5), transparent);
  position: relative;
}

.scroll-line-inner {
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 40%;
  background-color: var(--color-brand-brown);
  transform: translateX(-50%);
  /* Animazione loop infinita */
  animation: scrollDrop 3s infinite;
}

/* --- Stati Attivi (Triggered by JS .hero-active) --- */

.hero-active .hero-bg-layer {
  opacity: 0.5;
  transform: scale(1);
}

.hero-active .hero-overlay-blur {
  opacity: 1;
}

/* Elementi con Delay a cascata */
.hero-active .hero-logo-wrapper {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.5s;
}

.hero-active .hero-title {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.8s;
}

.hero-active .hero-separator-anim {
  width: 4rem;
  opacity: 1;
  transition-delay: 1s;
}

.hero-active .hero-subtitle {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 1.2s;
}

.hero-active .hero-date {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 1.4s;
}

.hero-active .hero-cta-button {
  /* Animazione custom definita nei keyframes */
  animation: ctaEnter 0.8s ease-out 1.6s forwards;
}

.hero-active .scroll-indicator {
  opacity: 1;
  transition-delay: 0.1s;
}

/* Entrata Foglie */
.hero-active .leaf-left {
  opacity: 0.8;
  transform: translateX(0);
}
.hero-active .leaf-right {
  opacity: 0.8;
  transform: translateX(0);
}

/* --- Seamless Waves (Footer) --- */
.seamless-waves-container {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 120px;
  z-index: 20;
  overflow: hidden;
  pointer-events: none;
}

@media (min-width: 768px) {
  .seamless-waves-container {
    height: 192px;
  }
}

.hero-wave-layer {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 200%;
  height: 100%;
  display: flex;
  color: #e6ded1;
}

.wave-svg {
  width: 50%;
  height: 100%;
}

/* Animazioni Onde Specifiche */
.hero-wave-layer-1 {
  opacity: 0.4;
  animation: waveSlideLeft 45s linear infinite;
}
.hero-wave-layer-2 {
  opacity: 0.7;
  animation: waveSlideRight 30s linear infinite;
}
.hero-wave-layer-3 {
  opacity: 1;
  animation: waveSlideLeft 20s linear infinite;
}

/* --- Keyframes Animations --- */

/* Float Foglie */
.leaf-left .leaf-svg {
  animation: floatLeafLeft 8s ease-in-out infinite;
}
.leaf-right .leaf-svg {
  animation: floatLeafRight 9s ease-in-out infinite;
}

@keyframes floatLeafLeft {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(1deg);
  }
}

@keyframes floatLeafRight {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(25px) rotate(-1deg);
  }
}

/* Scroll Indicator Drop */
@keyframes scrollDrop {
  0% {
    top: -50%;
  }
  100% {
    top: 130%;
  }
}

/* CTA Entrance (usa top per non bloccare transform) */
@keyframes ctaEnter {
  from {
    opacity: 0;
    top: 20px;
  }
  to {
    opacity: 1;
    top: 0;
  }
}

/* Onde Movimento */
@keyframes waveSlideLeft {
  0% {
    transform: translateX(0%);
  }
  100% {
    transform: translateX(-50%);
  }
}

@keyframes waveSlideRight {
  0% {
    transform: translateX(-50%);
  }
  100% {
    transform: translateX(0%);
  }
}
