/**
 * Hero Banner Styles & Animations for Bikiak Berri
 * Uses Elementor Global Variables and Dawner font
 */

/* Scroll Track & Pinned Sticky Hero (Inspiración ERA Residence) */
.bikiak-hero-scroll-track {
  position: relative;
  width: 100%;
  min-height: 150vh;
}

.bikiak-hero-section {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background-color: var(--bikiak-bg-dark, #1b1712);
  z-index: 2;
}

body.admin-bar .bikiak-hero-section {
  top: 32px;
  height: calc(100vh - 32px);
}

@media screen and (max-width: 782px) {
  body.admin-bar .bikiak-hero-section {
    top: 46px;
    height: calc(100vh - 46px);
  }
}

body.elementor-editor-active .bikiak-hero-scroll-track {
  min-height: auto !important;
}

body.elementor-editor-active .bikiak-hero-section {
  position: relative !important;
  top: 0 !important;
  height: auto !important;
  min-height: 100vh !important;
}

/* Background image wrapper with subtle zoom on entry */
.bikiak-hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-position: center bottom;
  background-repeat: no-repeat;
  background-size: cover;
  z-index: 1;
  transform: scale(1.05);
  animation: bikiakHeroZoom 1.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes bikiakHeroZoom {
  0% {
    transform: scale(1.1);
    opacity: 0.8;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.bikiak-hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  background: radial-gradient(circle at center, rgba(27, 23, 18, 0.2) 0%, rgba(20, 18, 15, 0.8) 100%);
  pointer-events: none;
}

/* Container */
.bikiak-hero-container {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: var(--bikiak-hero-top-offset, 100px) 24px 45px;
  box-sizing: border-box;
  text-align: center;
}

@media screen and (max-width: 782px) {
  .bikiak-hero-container {
    padding-top: var(--bikiak-hero-top-offset, calc(var(--bikiak-header-height, 80px) + 20px));
  }
}

/* Top Intro & Main Headline Block - Sticky in Container */
.bikiak-hero-content-top {
  position: -webkit-sticky;
  position: sticky;
  top: var(--bikiak-hero-top-offset, 100px);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin-top: 0;
  will-change: transform;
}

@media screen and (max-width: 782px) {
  .bikiak-hero-content-top {
    top: var(--bikiak-hero-top-offset, calc(var(--bikiak-header-height, 80px) + 15px));
  }
}

/* Scroll Transition Composition (ERA Residence Style) */
.bikiak-hero-section.has-scroll-transition .bikiak-hero-content-top {
  display: grid;
  grid-template-areas: "hero-stage";
  justify-items: center;
  align-items: center;
  min-height: 180px;
}

.bikiak-hero-section.has-scroll-transition .bikiak-hero-logo-box,
.bikiak-hero-section.has-scroll-transition .bikiak-hero-title-box {
  grid-area: hero-stage;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

/* Initial Full Logo Box */
.bikiak-hero-logo-box {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.4s ease, transform 0.4s ease;
  will-change: transform, opacity;
  z-index: 2;
}

.bikiak-hero-logo-img {
  width: 100%;
  max-width: 260px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.5));
  animation: bikiakLogoIntro 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes bikiakLogoIntro {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Title Box (When Scroll Transition Active) */
.bikiak-hero-section.has-scroll-transition .bikiak-hero-title-box {
  opacity: 0;
  transform: translateY(24px);
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
  will-change: transform, opacity;
  z-index: 1;
}

/* Elementor Editor View */
body.elementor-editor-active .bikiak-hero-section.has-scroll-transition .bikiak-hero-content-top {
  display: flex !important;
  flex-direction: column !important;
  gap: 20px !important;
}

body.elementor-editor-active .bikiak-hero-logo-box,
body.elementor-editor-active .bikiak-hero-title-box {
  opacity: 1 !important;
  transform: none !important;
  pointer-events: auto !important;
}

.bikiak-hero-location {
  font-family: inherit;
  font-size: 15px;
  letter-spacing: 0.16em;
  font-weight: 500;
  color: var(--bikiak-text-inv, #f7f2ea);
  opacity: 0;
  transform: translateY(20px);
  animation: bikiakFadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
  margin-bottom: 8px;
}

:where(.bikiak-hero-title) {
  font-family: inherit;
  font-size: clamp(48px, 8vw, 110px);
  font-weight: 400;
}

.bikiak-hero-title {
  line-height: 0.95;
  letter-spacing: 0.04em;
  color: var(--bikiak-text-inv, #f7f2ea);
  margin: 0;
  padding: 0;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(30px);
  animation: bikiakFadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.5s forwards;
  transition: transform 0.4s ease, opacity 0.4s ease;
  will-change: transform, opacity;
}

.bikiak-hero-title-line {
  display: block;
}

/* Center Spacer (La copa queda protagonista en el centro) */
.bikiak-hero-center-spacer {
  flex-grow: 1;
  min-height: 40px;
}

/* Bottom CTA & Subtitle Block - Always maintained on scroll */
.bikiak-hero-content-bottom {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.bikiak-hero-subtitle {
  font-size: 14px;
  letter-spacing: 0.08em;
  color: rgba(247, 242, 234, 0.85);
  margin: 0;
  max-width: 500px;
  line-height: 1.5;
  opacity: 0;
  transform: translateY(20px);
  animation: bikiakFadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.7s forwards;
}

.bikiak-hero-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 28px;
  border-radius: 999px;
  border: 1px solid rgba(247, 242, 234, 0.9);
  background: var(--bikiak-text-inv, #f7f2ea);
  color: var(--bikiak-primary, #14120f);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateY(20px);
  animation: bikiakFadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.9s forwards;
}

.bikiak-hero-cta-btn:hover {
  background: transparent;
  color: var(--bikiak-text-inv, #f7f2ea);
  border-color: var(--bikiak-text-inv, #f7f2ea);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* Keyframes */
@keyframes bikiakFadeUp {
  0% {
    opacity: 0;
    transform: translateY(24px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .bikiak-hero-section {
    min-height: 520px;
    height: 100vh;
    height: 100dvh;
  }

  .bikiak-hero-container {
    padding-top: var(--bikiak-hero-top-offset, 100px);
    padding-bottom: 24px;
    padding-left: 16px;
    padding-right: 16px;
  }

  .bikiak-hero-content-top {
    top: var(--bikiak-hero-top-offset, 100px);
  }

  .bikiak-hero-section.has-scroll-transition .bikiak-hero-content-top {
    min-height: 125px;
  }

  .bikiak-hero-logo-box {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .bikiak-hero-logo-img {
    max-width: 165px;
  }

  .bikiak-hero-location {
    font-size: 11px;
    letter-spacing: 0.12em;
    margin-bottom: 4px;
  }

  :where(.bikiak-hero-title) {
    font-size: clamp(28px, 8.5vw, 42px);
  }

  .bikiak-hero-title {
    line-height: 1;
  }

  .bikiak-hero-subtitle {
    font-size: 12px;
    max-width: 290px;
    line-height: 1.4;
    padding: 0 10px;
  }

  .bikiak-hero-cta-btn {
    padding: 9px 22px;
    font-size: 10px;
  }

  .bikiak-hero-content-bottom {
    gap: 12px;
    margin-bottom: 16px;
  }
}
