/*
Theme Name: Salient Child
Theme URI: http://themenectar.com/
Description: Theme Child per inserire la Hero Section con la Tigre
Author: ThemeNectar
Author URI: http://themenectar.com/
Template: salient
Version: 1.0.0
*/

/* Reset and Base Styles */
html {
  margin: 0;
  padding: 0;
  width: 100%;
  background-color: #050505;
  color: #ffffff;
}

body {
  margin: 0;
  padding: 0;
  width: 100%;
  background-color: #050505;
  color: #ffffff;
  overflow-x: hidden;
  /* Only apply on body to preserve position:sticky on mobile */
}

/* 
  Full Screen Takeover Container
  No headers or navigation. Keeps the video locked in position as the page scrolls.
*/
.scroll-wrapper {
  position: relative;
  width: 100%;
  height: 500vh;
  /* Deep scroll area for detailed frame-by-frame scrubbing */
  background-color: #050505;
}

/* 
  Sticky Wrapper that stays locked in viewport.
  Avoids layout shift or jumpiness during ScrollTrigger operations.
*/
.hero-container {
  width: 100%;
  height: 100vh;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Background Video and Dark Overlay wrapper */
.video-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background-size: cover;
  background-position: center;
}

.bg-canvas,
.bg-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* GPU Hardware Acceleration & Composition */
  will-change: transform;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  perspective: 1000;
  -webkit-backface-visibility: hidden;
  -webkit-perspective: 1000;
}

/* Dark Overlay to maintain readability for white text */
.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg,
      rgba(0, 0, 0, 0.25) 0%,
      rgba(0, 0, 0, 0.45) 100%);
  z-index: 2;
}

/* 
  Content Overlay containing absolute centered story text layers.
  Z-index sits on top of video and overlay.
*/
.content-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 3;
  pointer-events: none;
  /* Allows pointer events to pass through, but CTA button explicitly allows clicking */
}

/* Common style for text blocks */
.story-text {
  position: absolute;
  width: 90%;
  max-width: 800px;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  /* handled via autoAlpha in GSAP to handle layout & pointer events */
  will-change: transform, opacity;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.8);
  pointer-events: auto;
  /* Enables click events for buttons inside the blocks */
}

/* Left alignment layout */
.story-text.align-left {
  left: 8%;
  align-items: flex-start;
  text-align: left;
}

/* Right alignment layout */
.story-text.align-right {
  right: 8%;
  align-items: flex-end;
  text-align: right;
}

/* Centered layout (without transform overlaps) */
.story-text.align-center {
  left: 0;
  right: 0;
  margin: 0 auto;
  align-items: center;
  text-align: center;
}

/* Pre-text tag (Server di Live Streaming) */
.story-tag {
  font-size: clamp(0.75rem, 1.5vw, 1.05rem);
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 0.8rem;
}

/* Main Headers */
.story-text h2 {
  font-size: clamp(1.6rem, 4.2vw, 3.6rem);
  font-weight: 900;
  letter-spacing: 0.12em;
  line-height: 1.25;
  text-transform: uppercase;
  margin: 0 0 2rem 0;
  color: #ffffff;
}

/* Premium CTA Button styling */
.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 44px;
  font-size: clamp(0.8rem, 1.2vw, 0.95rem);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-decoration: none;
  text-transform: uppercase;
  color: #000000;
  background-color: #ffffff;
  border: 2px solid #ffffff;
  border-radius: 50px;
  box-shadow: 0 10px 30px rgba(255, 255, 255, 0.15);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.cta-btn:hover {
  background-color: transparent;
  color: #ffffff;
  transform: translateY(-3px);
  box-shadow: 0 15px 40px rgba(255, 255, 255, 0.35);
}

.cta-btn:active {
  transform: translateY(-1px);
}

/* 
  Preloader Overlay
  Fullscreen black cover that fades out gracefully.
*/
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #050505;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 1;
  visibility: visible;
}

.preloader.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Preloader Content Stack */
.preloader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

/* Minimalist elegant preloader spinner */
.preloader-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* Progress Text style (inheriting WordPress fonts) */
.preloader-text {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Mobile responsive overrides: center all storytelling texts on mobile screens */
@media (max-width: 768px) {

  .story-text.align-left,
  .story-text.align-right {
    left: 0 !important;
    right: 0 !important;
    margin: 0 auto !important;
    align-items: center !important;
    text-align: center !important;
  }
}

:root {
  --hero-accent: #A70909;
}

/* --- Overlay leggero sul video per garantire leggibilità del testo --- */
.video-overlay {
  background: linear-gradient(180deg,
      rgba(0, 0, 0, 0.35) 0%,
      rgba(0, 0, 0, 0.15) 40%,
      rgba(0, 0, 0, 0.45) 100%);
}

/* --- Vignettatura: scurisce i bordi, concentra l'attenzione al centro --- */
.hero-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center,
      rgba(0, 0, 0, 0) 45%,
      rgba(0, 0, 0, 0.55) 100%);
}

.content-overlay {
  position: relative;
}

/* --- Barra di progresso scroll, fissa in alto sull'intero hero --- */
.hero-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.15);
  z-index: 20;
}

.hero-progress-fill {
  width: 0%;
  height: 100%;
  background: var(--hero-accent);
}

/* --- Posizionamento base di ogni blocco di testo --- */
.story-text {
  position: absolute;
  top: 50%;
  width: 90%;
  max-width: 620px;
  display: flex;
  flex-direction: column;
  padding: 40px 44px;
}

/* Spazi personalizzati tra gli elementi (desktop) */
.story-text .story-counter {
  margin-bottom: 9px;
}

.story-text .story-tag {
  margin-bottom: 18px;
}

.story-text h2 {
  margin-bottom: 36px;
}

/* Alone/nuvola sfumata dietro al testo */
.story-text::before {
  content: "";
  position: absolute;
  inset: -70px;
  background: radial-gradient(ellipse at center,
      rgba(0, 0, 0, 0.55) 0%,
      rgba(0, 0, 0, 0.35) 35%,
      rgba(0, 0, 0, 0.15) 60%,
      rgba(0, 0, 0, 0) 80%);
  filter: blur(35px);
  z-index: -1;
  pointer-events: none;
}

.story-text-1 {
  z-index: 1;
}

.story-text-2 {
  z-index: 2;
}

.story-text-3 {
  z-index: 3;
}

.story-text-4 {
  z-index: 4;
}

.story-text-5 {
  z-index: 5;
}

/* --- Allineamento a sinistra --- */
.story-text.align-left {
  left: 6%;
  transform: translateY(-50%);
  text-align: left;
  align-items: flex-start;
}

/* --- Allineamento a destra --- */
.story-text.align-right {
  left: auto;
  right: 6%;
  transform: translateY(-50%);
  text-align: right;
  align-items: flex-end;
}

/* --- Numerazione scena (es. 01/05) --- */
.story-text .story-counter {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #ffffff;
}

.story-text .story-counter span {
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
}

/* --- Tag sopra il titolo --- */
.story-text .story-tag {
  font-size: clamp(12px, 1.4vw, 15px);
  font-weight: 600;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: #ffffff;
  opacity: 0.85;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}


/* --- Titolo principale --- */
.story-text h2 {
  font-size: clamp(26px, 4.4vw, 50px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.5px;
  color: #ffffff;
  margin: 0;
}

/* --- Parola chiave evidenziata: rosso pieno, nessun glow --- */
.highlight-word {
  color: var(--hero-accent);
  font-weight: 900;
}

/* --- Pulsante CTA: bianco con testo rosso, nessun glow --- */
.story-text .cta-btn {
  display: inline-block;
  padding: 14px 38px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  background: #ffffff;
  color: var(--hero-accent);
  text-decoration: none;
  border: 1.5px solid #ffffff;
  border-radius: 2px;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  margin-top: 20px;
}

.story-text .cta-btn:hover {
  background: var(--hero-accent);
  color: #ffffff;
  border-color: var(--hero-accent);
}

/* --- Indicatore "scrolla" iniziale --- */
.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 36px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 10;
  opacity: 1;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.scroll-cue.is-hidden {
  opacity: 0;
}

.scroll-cue-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #ffffff;
  opacity: 0.75;
}

.scroll-cue-svg svg,
.hero-scroll-cue-bounce svg {
  display: block;
  width: 22px;
  height: 22px;
  color: #ffffff;
  opacity: 0.85;
}

.hero-scroll-cue-bounce {
  display: inline-flex;
  transform-origin: center;
  animation: hero-scroll-cue-bounce 1.6s ease-in-out infinite;
  will-change: transform;
}

@keyframes hero-scroll-cue-bounce {

  0%,
  100% {
    transform: translate(0, 0);
  }

  50% {
    transform: translate(0px, 3px);
  }
}

/* --- Adattamento mobile: layout centrato e più compatto --- */
@media (max-width: 640px) {

  .story-text.align-left,
  .story-text.align-right {
    left: 50%;
    right: auto;
    transform: translate(-50%, -50%);
    text-align: center;
    align-items: center;
    width: 88%;
    padding: 28px 26px;
  }

  /* Spazi personalizzati per mobile */
  .story-text .story-counter {
    margin-bottom: 7px;
  }

  .story-text .story-tag {
    margin-bottom: 14px;
  }

  .story-text h2 {
    margin-bottom: 28px;
  }

  .story-text.align-left .story-tag::before,
  .story-text.align-right .story-tag::after {
    display: none;
  }

  .story-text::before {
    inset: -40px;
    filter: blur(25px);
  }

  .story-text .cta-btn {
    padding: 12px 28px;
    font-size: 12px;
  }

  .scroll-cue {
    bottom: 22px;
  }
}

/* --- MOBILE CINEMATIC HERO SECTION --- */
.mobile-hero-wrapper {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background-color: #050505;
  z-index: 1;
}

.mobile-video-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.mobile-bg-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mobile-video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.4) 0%,
    rgba(0, 0, 0, 0.6) 100%
  );
  z-index: 2;
}

/* Custom helper to hide and format mobile stories by default on page load before GSAP runs */
.mobile-story-text {
  display: none;
  opacity: 0;
  visibility: hidden;
  position: absolute;
  top: 0;          /* Overrides top: 50% from desktop .story-text */
  bottom: 0;       /* Combines with top and margin: auto to center vertically */
  left: 0;
  right: 0;
  margin: auto;    /* Centers the absolute block both horizontally and vertically */
  height: fit-content; /* Prevents container from stretching to full height */
  align-items: flex-start; /* Aligns child elements (tag, title, button) to the left side of the block */
  text-align: left;        /* Aligns multi-line texts to the left */
}

/* Slightly increase font sizes specifically for mobile hero texts */
.mobile-story-text .story-counter {
  font-size: 15px;
}

.mobile-story-text .story-tag {
  font-size: 14px;
}

.mobile-story-text h2 {
  font-size: clamp(30px, 7vw, 42px); /* Punchier, larger titles on mobile viewports */
  line-height: 1.2;
}

.mobile-story-text .cta-btn {
  font-size: 14px;
  padding: 13px 34px;
}