/**
 * WMD Solutions Base Theme - Hero Banner styles.
 * Loaded only when a hero banner block is present.
 * Header styles live in header.css.
 * Nav styles live in css/components/menu.css.
 * Overlay utilities live in base.css.
 */

/* ======================================================
   Z-INDEX STACK
   0: hero-bg-image
   1: hero-bg-video
   2: wmd-overlay-gradient
   3: hero-content-overlay
   200: site-header (transparent, absolute)
   ====================================================== */

/* ======================================================
   HERO BANNER BASE
   ====================================================== */

.hero-banner {
  position: relative;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.hero-height--full {
  min-height: 100vh;
}

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

.hero-height--auto {
  min-height: var(--hero-min-height, 400px);
}

/* ======================================================
   VIDEO BACKGROUND
   ====================================================== */

.hero-bg-video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%);
  z-index: 1;
  object-fit: cover;
}

/* ======================================================
   IMAGE BACKGROUND
   ====================================================== */

.hero-bg-image {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  z-index: 0;
}

/* ======================================================
   OVERLAY - sits above both video and image
   ====================================================== */

.hero-banner .wmd-overlay-gradient {
  z-index: 2;
}

/* ======================================================
   CONTENT OVERLAY - sits above everything
   ====================================================== */

.hero-content-overlay {
  position: relative;
  z-index: 3;
  width: 100%;
  padding: var(--hero-content-padding, 4rem 0);
  text-align: center;
}

.hero-text--light .hero-content-overlay {
  color: #ffffff;
}

.hero-text--light .hero-content-overlay a {
  color: #ffffff;
}

.hero-text--dark .hero-content-overlay {
  color: #111111;
}

/* ======================================================
   HERO CONTENT CARD
   Frosted glass card wrapping each referenced block.
   Slide-down entry animation on load.
   ====================================================== */

.hero-content-overlay .block {
  display: inline-block;
  text-align: center;
  background: var(--hero-card-bg, rgba(0, 0, 0, 0.25));
  backdrop-filter: blur(var(--hero-card-blur, 6px));
  -webkit-backdrop-filter: blur(var(--hero-card-blur, 6px));
  border-radius: var(--hero-card-radius, 6px);
  padding: var(--hero-card-padding, 2rem 2.5rem);
  animation: heroSlideDown 0.8s ease forwards;
}

@keyframes heroSlideDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ======================================================
   MOBILE HERO
   No video, no image — dark bg + content only. Fast.
   ====================================================== */

@media (max-width: 767px) {
  .hero-banner {
    background: linear-gradient(
      to bottom,
      color-mix(in srgb, var(--overlay-color) calc(var(--overlay-gradient-start) * 100%), transparent),
      color-mix(in srgb, var(--overlay-color) calc(var(--overlay-gradient-end) * 100%), transparent)
    );
  }

  .hero-bg-video {
    display: none !important;
  }

  .hero-has-video .hero-bg-image {
    display: block !important;
  }

  .hero-height--full {
    min-height: unset;
  }

  .hero-content-overlay .block {
    display: block;
  }
}

/* ======================================================
   TRANSPARENT HEADER OVER HERO
   ====================================================== */

.transparent-header .site-header {
  position: absolute;
  top: var(--drupal-displace-offset-top, 0px);
  left: 0;
  width: 100%;
  z-index: 200;
  background: transparent !important;
}

/* White text/icons on transparent header */
.transparent-header .site-header .nav-link,
.transparent-header .site-header .navbar-brand,
.transparent-header .site-header .navbar-toggler {
  color: var(--header-transparent-color, #ffffff) !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.transparent-header .site-header .nav-link:hover {
  color: var(--header-transparent-hover, rgba(255, 255, 255, 0.85)) !important;
}

.transparent-header .site-header .header-top {
  color: var(--header-transparent-color, #ffffff);
  border-bottom-color: rgba(255, 255, 255, 0.2);
}

.transparent-header .site-header .header-top a {
  color: var(--header-transparent-color, #ffffff);
}

.transparent-header .site-header .cart-block--icon-wrapper svg {
  color: var(--header-transparent-color, #ffffff) !important;
}

.transparent-header .site-header .navbar-toggler-icon {
  filter: invert(1);
}

/* Transparent + sticky: switch to fixed after scroll */
.transparent-header.sticky-header .site-header {
  position: absolute;
}

.transparent-header.sticky-header.scrolled .site-header {
  position: fixed;
  top: var(--drupal-displace-offset-top, 0px);
  background: var(--header-scroll-bg, rgba(255, 255, 255, 0.75)) !important;
  backdrop-filter: blur(var(--header-scroll-blur, 8px));
  -webkit-backdrop-filter: blur(var(--header-scroll-blur, 8px));
  box-shadow: var(--header-sticky-shadow);
}

/* Restore configurable color after scroll */
.transparent-header.sticky-header.scrolled .site-header .nav-link,
.transparent-header.sticky-header.scrolled .site-header .navbar-brand {
  color: var(--header-scrolled-color, var(--color-text)) !important;
  text-shadow: none;
}

.transparent-header.sticky-header.scrolled .site-header .cart-block--icon-wrapper svg {
  color: var(--header-scrolled-color, var(--color-text)) !important;
}

.transparent-header.sticky-header.scrolled .site-header .navbar-toggler-icon {
  filter: none;
}

.transparent-header.sticky-header.scrolled .site-header .header-top {
  color: var(--header-scrolled-color, var(--color-text));
}
