/* ==========================================================================
   Hero Sections - Sagra del Borgo Antico di Montefiore
   Full-screen and half-screen hero areas with background images,
   gradient overlays, parallax support, and scroll indicator.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Hero base
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 60vh;
}

/* Size variants */
.hero--full {
  min-height: 100vh;
  min-height: 100dvh;
}

.hero--half {
  min-height: 50vh;
}

.hero--small {
  min-height: 40vh;
}

/* --------------------------------------------------------------------------
   Hero particles canvas
   Absolutely positioned so it doesn't affect flex layout.
   -------------------------------------------------------------------------- */
#hero-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Hero background image
   Absolutely positioned, covers the entire hero area.
   -------------------------------------------------------------------------- */
.hero__bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background-color: #2a2420;
  background-image: linear-gradient(
    100deg,
    #2a2420 30%,
    #3a3430 50%,
    #2a2420 70%
  );
  background-size: 200% 100%;
  animation: shimmer 1.8s ease-in-out infinite;
}

.hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Fade-in solo su desktop; su mobile l'immagine appare subito */
@media (min-width: 1024px) {
  .hero__bg img {
    opacity: 0;
    transition: opacity 0.6s ease;
  }

  .hero__bg img.loaded {
    opacity: 1;
  }
}

/* Parallax support via data attribute (attribute is on the element itself) */
.hero__bg[data-parallax] {
  height: 160%;
  top: -30%;
  will-change: transform;
}

/* --------------------------------------------------------------------------
   Hero overlay
   Dark gradient overlay, heavier at the bottom for text readability.
   -------------------------------------------------------------------------- */
.hero__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background: linear-gradient(
    to bottom,
    rgba(26, 23, 20, 0.25) 0%,
    rgba(26, 23, 20, 0.4) 50%,
    rgba(26, 23, 20, 0.7) 100%
  );
}

/* --------------------------------------------------------------------------
   Hero content
   Centered text, sits above the overlay.
   -------------------------------------------------------------------------- */
.hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: var(--color-warm-white);
  padding: var(--space-xl);
  max-width: var(--container-max);
  width: 100%;
}

/* Hero title */
.hero__title {
  font-family: var(--font-accent);
  font-size: var(--text-hero);
  font-weight: 400;
  color: var(--color-warm-white);
  line-height: 1.15;
  margin-bottom: var(--space-lg);
  text-shadow: 0 2px 20px rgba(26, 23, 20, 0.4);
  overflow-wrap: break-word;
  word-wrap: break-word;
  hyphens: auto;
}

/* Hero subtitle */
.hero__subtitle {
  font-family: var(--font-body);
  font-size: var(--text-xl);
  font-weight: 400;
  color: var(--color-cream);
  line-height: 1.5;
  margin-bottom: var(--space-2xl);
  opacity: 0.9;
}

/* Hero CTA button */
.hero__cta {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: var(--space-md) var(--space-2xl);
  background-color: var(--color-primary);
  color: var(--color-warm-white);
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background-color var(--transition-fast),
              transform var(--transition-fast),
              box-shadow var(--transition-fast);
}

.hero__cta:hover {
  background-color: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: var(--color-warm-white);
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   Scroll indicator
   Bouncing arrow at the bottom of the hero to invite scrolling.
   -------------------------------------------------------------------------- */
.hero__scroll-indicator {
  position: absolute;
  bottom: var(--space-xl);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  color: var(--color-warm-white);
  opacity: 0.7;
  transition: opacity var(--transition-fast);
  cursor: pointer;
}

.hero__scroll-indicator:hover {
  opacity: 1;
  text-decoration: none;
}

.hero__scroll-indicator span {
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.hero__scroll-indicator svg,
.hero__scroll-indicator .arrow {
  width: 20px;
  height: 20px;
  animation: bounce 2s ease infinite;
}
