/* Service Header Block - Based on Blog Hero but simplified for services */

/* ============================================================
   1. GLOBAL PAGE SAFETY
   ============================================================ */
body.single-service {
    overflow-x: clip !important;
    width: 100% !important;
}

/* ============================================================
   2. COMPONENT RESET & OVERHANG CONTROL
   ============================================================ */
.service-header-block {
    width: 100%;
    position: relative;
    background: transparent !important;
    background-color: transparent !important;
    margin-top: -2px !important; 
    padding-top: 100px; 
    padding-bottom: 0 !important;
    box-sizing: border-box;
    color: var(--nebula-white, #ffffff) !important;
    --image-overhang: 12vw; 
    margin-bottom: var(--image-overhang) !important;
}

/* Force text colors but EXCLUDE the button */
.service-header-block h1, 
.service-header-block a:not(.btn),
.service-hero__description {
    color: var(--nebula-white, #ffffff) !important;
}

/* Explicitly set the button text color */
.service-header-block .btn {
    color: var(--nebula-blue, #313A4C) !important;
}

/* ============================================================
   3. BACKGROUNDS & IMAGES
   ============================================================ */
.hero-bg-panel {
    position: absolute;
    top: 0;
    left: 50%;
    width: 100vw;
    margin-left: -50vw;
    /* Height 100% means it stops exactly where the container stops */
    height: 100%; 
    background-color: var(--nebula-blue, #313A4C);
    z-index: 0;
    overflow: hidden; /* Contains the graphic cleanly */
}

/* Physical Pattern Container (Standardized to .hero-bg) */
.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Locks height to 100% so top/bottom never crop. Width adjusts automatically. */
    background-size: auto 100%; 
    /* Centers the graphic so any side-cropping happens evenly */
    background-position: center center; 
    background-repeat: no-repeat;
    z-index: 1;
    pointer-events: none; /* Allows clicks to pass through */
}

.service-header-block::before,
.service-header-block::after { 
    display: none !important; 
    content: none !important;
    background-image: none !important;
}

/* ============================================================
   4. LAYOUT WRAPPERS (Aligned with Footer Grid)
   ============================================================ */
.hero__wrap { 
    position: relative; 
    z-index: 10; 
    width: 100%; 
    padding: 0 20px; 
    box-sizing: border-box; 
}

@media screen and (min-width: 1024px) {
    .hero__wrap {
        padding: 0 40px; 
    }
}

.hero__inner { 
    max-width: 1540px; 
    width: 100%; 
    margin: 0 auto; 
    box-sizing: border-box; 
}

/* ============================================================
   5. MOBILE & TABLET LAYOUT (0px to 1025px)
   ============================================================ */
@media (max-width: 1025px) {
    .service-hero-layout {
        display: block !important;
        width: 100% !important;
    }

    .hero__content {
        width: 100% !important;
        max-width: 100% !important;
        padding-bottom: 40px !important; 
        position: relative;
        z-index: 20;
    }

    .service-hero__title-wrapper {
        display: flex;
        align-items: center; 
        gap: 20px; 
        margin-bottom: 30px; 
    }

    .service-hero__title-wrapper .service-hero__icon {
        margin-bottom: 0 !important; 
        flex-shrink: 0; 
    }

    .service-hero__title-wrapper h1 {
        margin-bottom: 0 !important; 
    }

    .hero__image {
        display: block !important;
        width: 80% !important;
        max-width: 100% !important;
        margin-left: auto !important;
        margin-right: auto !important;
        margin-top: 0 !important;
        position: relative;
        z-index: 30;
        /* Pulls the image down out of the blue box */
        margin-bottom: calc(var(--image-overhang) * -1) !important; 
    }
    
    .hero__image img {
        box-shadow: 0 10px 25px rgba(0,0,0,0.2) !important;
    }
}

/* ============================================================
   6. DESKTOP LAYOUT (1026px+)
   ============================================================ */
@media (min-width: 1026px) {
    .service-header-block {
        padding-top: 140px; /* Snugger top padding */
        --image-overhang: 7vw; /* Roughly 20% of the image height on desktop */
    }

    .service-hero-layout {
        display: flex !important;
        justify-content: space-between;
        align-items: center; /* Vertically center the content with the image */
        gap: 60px;
    }

    .hero__content {
        flex: 1;
        max-width: 50%;
        display: flex;
        flex-direction: column;
        justify-content: center; 
        /* Ensure there's enough room below the text so the image dictates the bottom */
        padding-bottom: calc(var(--image-overhang) + 20px);
        position: relative;
        z-index: 20;
    }

    .hero__image {
        flex: 0 0 45%;
        max-width: 45%;
        margin: 0 !important;
        position: relative;
        z-index: 30;
        /* Pulls the image down out of the blue box */
        margin-bottom: calc(var(--image-overhang) * -1) !important;
    }
    
    .hero__image img {
        box-shadow: 0 25px 60px rgba(0,0,0,0.25);
    }
}

/* ============================================================
   7. GLOBAL STYLES & EMPTY IMAGE FALLBACK
   ============================================================ */
.hero__image img {
    border-radius: 24px;
    width: 100% !important;
    height: auto !important;
    display: block;
    background-color: #333;
}

.hero__image--empty {
    min-height: 250px;
}

@media (min-width: 1026px) {
    .hero__image--empty {
        min-height: 400px;
    }
}

/* ============================================================
   8. SERVICE-SPECIFIC ELEMENTS (Title & Icon Layout)
   ============================================================ */

/* The content box wrapper */
.hero__content-box {
    position: relative;
    z-index: 20;
}

/* The wrapper that holds the Icon and the H1 */
.service-hero__title-wrapper {
    display: flex;
    align-items: center; /* Vertically center the icon and text */
    justify-content: flex-start;
    gap: 30px; /* Space between the icon and the title */
    margin-bottom: 30px; 
}

.service-hero__icon {
    display: flex;
    align-items: center;
    flex-shrink: 0; /* Prevents the icon from being squished by long titles */
}

/* Target BOTH image and animated icon types */
.service-hero__icon img,
.service-hero__icon .nebula-animated-icon {
    width: 100px !important; 
    height: 100px !important; 
    display: block;
    object-fit: contain;
}

@media (min-width: 768px) {
    .service-hero__icon img,
    .service-hero__icon .nebula-animated-icon {
        width: 150px !important; 
        height: 150px !important; 
    }
}

/* LOTTIE FIX: Pins zoom to the left to align smoothly */
.service-hero__icon .nebula-lottie-container svg {
    transform-origin: left center !important;
}

/* The H1 Title */
.service-header-block h1 {
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 700;
    line-height: 1.1;
    margin: 0 !important;
    padding-left: 20px;
    word-wrap: break-word; 
}

/* The Subheader */
.service-hero__description {
    font-size: 1.2rem;
    line-height: 1.6;
    margin-top: 0;
    margin-bottom: 0;
    color: var(--nebula-white, #ffffff);
    opacity: 0.95;
    max-width: 90%; /* Keeps text readable on large screens */
}

.service-hero__description p {
    margin: 0;
    color: var(--nebula-white, #ffffff);
}

/* The Button Area */
.service-hero__action {
    margin-top: 40px; /* INCREASED PADDING: Gives the button more breathing room */
}

@media (max-width: 768px) {
    .service-hero__description {
        font-size: 1.1rem;
        max-width: 100%;
    }
    
    .service-hero__action {
        margin-top: 30px;
    }
}

@media (max-width: 480px) {
    .service-hero__title-wrapper {
        gap: 15px; /* Tighter gap on very small screens */
        margin-bottom: 20px;
    }
    
    .service-hero__icon img,
    .service-hero__icon .nebula-animated-icon {
        width: 80px !important;
        height: 80px !important;
    }
    
    .service-hero__description {
        font-size: 1rem;
    }
}