/* ==========================================================================
   Engineering Hero
   Layers (bottom -> top): bg video -> foreground video -> overlay -> content
   ========================================================================== */

.engineering-hero {
    position: relative;
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
    isolation: isolate;
    background-color: #8a8d90; /* fallback while the video loads */
}

/* ---------- Layer 1: Background video ---------- */
.engineering-hero__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.engineering-hero__bg-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center bottom;
    display: block;
}

.engineering-hero__bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ---------- Layer 2: Foreground video (same position as before) ---------- */
.engineering-hero__video {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -55%; /* pinned to the end of the section */
    z-index: 1;
    pointer-events: none;
}

.engineering-hero__video-element {
    width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain;
    object-position: center bottom;
    display: block;
}

/* ---------- Layer 3: Overlay (keeps the title readable) ---------- */
.engineering-hero__overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.18) 0%,
        rgba(0, 0, 0, 0) 45%
    );
    pointer-events: none;
}

/* ---------- Layer 4: Content ---------- */
.engineering-hero__container {
    position: relative;
    z-index: 3;
    width: 100%;
    min-height: inherit;
    padding: 0 60px;
    box-sizing: border-box;
    display: flex;
    align-items: flex-start;
}

.engineering-hero__content {
    padding-top: 28px;
    max-width: 1100px;
}

.engineering-hero__title {
    position: absolute;
    top: 15%;
    margin: 0;
    color: #fff;
    font-size: clamp(2.5rem, 6vw, 6rem);
    font-weight: 300;
    line-height: 1.1;
    letter-spacing: -0.01em;
}

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
    .engineering-hero {
        min-height: 80vh;
    }

    .engineering-hero__container {
        padding: 0 32px;
    }
}

@media (max-width: 575px) {
    .engineering-hero {
        min-height: 70vh;
    }

    .engineering-hero__container {
        padding: 0 20px;
    }

    .engineering-hero__content {
        padding-top: 20px;
    }
}

/* ---------- RTL (Arabic) ---------- */
[dir="rtl"] .engineering-hero__content {
    margin-inline-start: auto;
    text-align: right;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .engineering-hero__video {
        display: none;
    }

    .engineering-hero__bg-video {
        display: none; /* falls back to the solid background color */
    }
}