/**
 * FSP Hero Section Styles
 * Hero section with gradient background and CTA
 *
 * @package Free_Style_Products
 */

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero-section {
    /*
     * --hero-bg-image: default hero background image.
     *
     * This is overridden by the `.hero-variant-*` classes below, which are
     * applied automatically by layout-stable.php based on the Theme Mods
     * Branding tab selection. Admins can also preview any variant live via
     * the ?hero=<slug> URL parameter (see fsp-theme-functions.php).
     *
     * A custom URL entered in the Branding tab takes precedence over the
     * presets by emitting an inline `style="--hero-bg-image:url(...);"` on
     * the hero section.
     */
    --hero-bg-image: url('https://safetywearsupply.com/wp-content/uploads/2026/04/fsp-hero-crew-jobsite.webp');

    /*
     * --hero-height / --hero-bg-position / --hero-bg-size: swappable layout knobs.
     *
     * The Branding tab's Custom Hero Setup section overrides these via
     * .hero-height-*, .hero-position-*, and .hero-fit-* classes (or inline
     * style values when the admin sets a custom length / background-position
     * string). --hero-bg-size toggles whether the image scales to fill the
     * banner box (cover) or sits at its natural width so the banner height
     * acts as a "window" revealing only a slice of the image (100% auto /
     * contain).
     */
    --hero-height: 100vh;
    --hero-bg-position: center center;
    --hero-bg-size: cover;

    min-height: var(--hero-height);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: linear-gradient(135deg, var(--hw-dark) 0%, var(--hw-dark-secondary) 50%, var(--hw-dark-tertiary) 100%);
    overflow: hidden;
    padding-top: 80px;
}

/* ==========================================================================
   Hero Height Presets
   Each preset swaps --hero-height so the banner's min-height responds.
   ========================================================================== */

.hero-section.hero-height-full            { --hero-height: 100vh; }
.hero-section.hero-height-three-quarters  { --hero-height: 75vh; }
.hero-section.hero-height-two-thirds      { --hero-height: 66vh; }
.hero-section.hero-height-half            { --hero-height: 50vh; }
.hero-section.hero-height-quarter         { --hero-height: 25vh; }

/* ==========================================================================
   Hero Image Position Presets
   Swap --hero-bg-position so the same zoomed image reveals a different crop.
   ========================================================================== */

.hero-section.hero-position-center { --hero-bg-position: center center; }
.hero-section.hero-position-top    { --hero-bg-position: center top; }
.hero-section.hero-position-bottom { --hero-bg-position: center bottom; }

/* ==========================================================================
   Hero Image Sizing Mode Presets
   Swap --hero-bg-size to change how the image fills the banner box.

   - cover   : image scales to fully fill the box; may crop. Pairs with the
               Ken Burns zoom below.
   - natural : image stays at its natural aspect at 100% width; the banner
               height becomes a "window" over a horizontal slice (driven by
               --hero-bg-position).
   - contain : image is scaled to fit entirely inside the box without
               cropping; may letterbox on the sides.
   ========================================================================== */

.hero-section.hero-fit-cover   { --hero-bg-size: cover; }
.hero-section.hero-fit-natural { --hero-bg-size: 100% auto; }
.hero-section.hero-fit-contain { --hero-bg-size: contain; }

/* ==========================================================================
   Hero Background Variants
   Each preset swaps the --hero-bg-image custom property. Upload the matching
   image to the WordPress Media Library and adjust the URL here if needed.
   ========================================================================== */

.hero-section.hero-variant-crew {
    --hero-bg-image: url('https://safetywearsupply.com/wp-content/uploads/2026/04/fsp-hero-crew-jobsite.webp');
}

.hero-section.hero-variant-solo-hammer {
    --hero-bg-image: url('https://safetywearsupply.com/wp-content/uploads/2026/04/fsp-hero-solo-hammer.jpg');
}

.hero-section.hero-variant-active-zone {
    --hero-bg-image: url('https://safetywearsupply.com/wp-content/uploads/2026/04/fsp-hero-active-zone.jpg');
}

.hero-section.hero-variant-airport {
    --hero-bg-image: url('https://safetywearsupply.com/wp-content/uploads/2026/04/fsp-hero-airport-crew.jpg');
}

.hero-section.hero-variant-jobsite {
    --hero-bg-image: url('https://safetywearsupply.com/wp-content/uploads/2026/04/fsp-hero-jobsite-sunset.jpg');
}

/* Zoomed, full-bleed background image layer (sits beneath the darkening overlay) */
.hero-section::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: var(--hero-bg-image);
    background-size: var(--hero-bg-size);
    background-position: var(--hero-bg-position);
    background-repeat: no-repeat;
    background-color: var(--hw-dark);
    transform: scale(1.12);
    transform-origin: center;
    z-index: 0;
    pointer-events: none;
    animation: fspHeroKenBurns 30s ease-in-out infinite alternate;
}

/*
 * Fit Width / Contain modes intentionally pin the image at its chosen scale,
 * so the Ken Burns zoom would silently re-enlarge the image and defeat the
 * "natural window" intent. Opt those modes out of the transform + animation.
 */
.hero-section.hero-fit-natural::after,
.hero-section.hero-fit-contain::after {
    transform: none;
    animation: none;
}

@keyframes fspHeroKenBurns {
    0% {
        transform: scale(1.12) translate(0, 0);
    }
    100% {
        transform: scale(1.2) translate(-1.25%, -1.5%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-section::after {
        animation: none;
    }
}

/* Brand radial accents — subtle green glow layered above the image */
.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 80%, rgba(44, 198, 77, 0.18) 0%, transparent 55%),
        radial-gradient(circle at 80% 20%, rgba(44, 198, 77, 0.14) 0%, transparent 55%);
    pointer-events: none;
    z-index: 2;
    mix-blend-mode: screen;
}

/* Darkening gradient keeps text legible over the action shot */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(15, 15, 15, 0.82) 0%, rgba(15, 15, 15, 0.6) 50%, rgba(15, 15, 15, 0.78) 100%);
    opacity: 1;
    pointer-events: none;
    z-index: 1;
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 3;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    margin-bottom: 25px;
    line-height: 1.1;
    background: linear-gradient(135deg, var(--hw-white) 0%, var(--hw-light-gray) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 4px 18px rgba(0, 0, 0, 0.55));
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--hw-gray-lighter);
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
}

.hero-cta {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.hero-cta .btn {
    padding: 15px 35px;
    font-weight: 600;
    font-size: 1.1rem;
}

.moq-badge {
    display: inline-block;
    background: rgba(44, 198, 77, 0.15);
    border: 1px solid var(--hw-primary);
    padding: 12px 30px;
    border-radius: 50px;
    color: var(--hw-primary);
    font-weight: 600;
    font-size: 0.95rem;
}

/* Responsive */
@media (max-width: 767.98px) {
    .hero-content {
        padding: 0 15px;
    }

    .hero-cta {
        flex-direction: column;
        align-items: center;
    }

    .hero-cta .btn {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 575.98px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .moq-badge {
        padding: 10px 20px;
        font-size: 0.85rem;
    }
}
