/* hero.css - Full-viewport hero carousel */

.hero {
    position: relative;
    width: 100%;
    height: 600px;
    min-height: 600px;
    overflow: hidden;
    background: var(--teal-dk);
}

body.page-home {
    --nav-h: 75px;
}

/* Slides */
.slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    padding: 0 80px 0;
    z-index: 1;
}

.slide-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transform: scale(1.08);
    opacity: 0;
    will-change: transform, opacity;
}

.slide-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.slide--corporate .slide-video {
    width: 1632px;
    height: 918px;
    inset: -79px auto auto 0;
    object-fit: cover;
}

/* Dark gradient so text is always readable */
.slide::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.75) 0%,
        rgba(0, 0, 0, 0.3) 45%,
        transparent 100%
    );
    pointer-events: none;
    z-index: 1;
}

.slide-content {
    position: relative;
    z-index: 2;
    opacity: 0;
    transform: translateY(30px);
    max-width: 750px;
}

.slide--corporate .slide-content {
    position: absolute;
    left: 61px;
    top: var(--nav-h);
    bottom: 126px;
    display: flex;
    align-items: center;
    z-index: 3;
    max-width: none;
}


.slide-content h1.corporate {
    font-size: 80px;
    font-weight: 700;
    color: #f2f2f2;
    line-height: 80px;
    letter-spacing: 0;
    text-transform: uppercase;
    text-shadow: 0 2px 30px rgba(0, 0, 0, 0.45);
}

.slide-content h1.sustainability {
    font-weight: 700;
    font-size: 56px;
    line-height: 64px;
    text-transform: uppercase;
    vertical-align: bottom;
    white-space: nowrap;
}

.slide-content h1.esg {
    font-weight: 700;
    font-size: 56px;
    line-height: 64px;
    text-transform: uppercase;
    vertical-align: bottom;
    white-space: nowrap;
}

.slide-content h1.safety {
    font-weight: 700;
    font-size: 80px;
    line-height: 80px;
    text-transform: uppercase;
    vertical-align: bottom;
}

.slide-content h1.diversity {
    font-weight: 700;
    font-size: 80px;
    line-height: 80px;
    text-transform: uppercase;
    vertical-align: bottom;
    white-space: nowrap;
}

.slide-content h1.sustainability,
.slide-content h1.esg,
.slide-content h1.safety,
.slide-content h1.diversity {
    letter-spacing: 0;
    text-shadow: 4px 4px 10px rgba(0, 0, 0, 0.25);
}

.slide-content h1 strong {
    font-weight: 900;
    display: block;
}

/* Tab bar */
.carousel-tabs {
    position: absolute;
    bottom: 76px;
    left: 0;
    right: 0;
    height: 50px;
    width: 91%;
    margin: auto;
    display: flex;
    z-index: 10;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18); /* subtle bottom line for whole bar */
}

.tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: start;
    gap: 8px;
    cursor: pointer;
    position: relative;
    padding: 0 16px;
    background: transparent;
    border: none;
    border-right: 1px solid rgba(255, 255, 255, 0.07);
    transition: background 0.2s;
}

.tab:last-child {
    border-right: none;
}

.tab-num {
    font-size: 1.25rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.05em;
    transition: color 0.3s;
    white-space: nowrap;
}

.tab-label {
    font-size: 1.25rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.04em;
    transition: color 0.3s;
    white-space: nowrap;
}

.tab.is-active .tab-num {
    color: #f2f2f2;
    font-size: 1.25rem;
}
.tab.is-active .tab-label {
    color: #f2f2f2;
    font-weight: 700;
    font-size: 1.25rem;
}

/* Orange bottom line on active tab */
.tab::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--orange);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.tab.is-active::after {
    transform: scaleX(1);
}

/* GSAP-driven progress bar */
.tab-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--orange);
    width: 0%;
    z-index: 2;
    pointer-events: none;
}

/* Arrows */
.arrow {
    position: absolute;
    bottom: 18px;
    z-index: 20;
    width: 38px;
    height: 38px;
    border: 1.5px solid rgba(255, 255, 255, 0.45);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    cursor: pointer;
    transition:
        border-color 0.2s,
        background 0.2s;
}

.arrow:hover {
    border-color: #f2f2f2;
    background: rgba(255, 255, 255, 0.15);
}
.arrow svg {
    width: 14px;
    height: 14px;
}
.arrow--left {
    left: 70px;
}
.arrow--right {
    right: 70px;
}

/* Remove default border-bottom from .tab itself */
.tab {
    border-bottom: none; /* <- important */
}

/* Subtle bottom border for ALL tabs (inactive look) */
.tab::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(
        255,
        255,
        255,
        0.18
    ); /* light / subtle - adjust opacity/color to taste */
    z-index: 1;
}

/* Orange indicator ONLY for active tab */
.tab::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--orange);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
    z-index: 2; /* above the subtle line */
}

.tab.is-active::after {
    transform: scaleX(1);
}

.tab:hover::before {
    background: rgba(255, 255, 255, 0.35);
}

.tab-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--orange);
    width: 0%;
    z-index: 3;
    pointer-events: none;
    transform-origin: left;
}

.tab.is-active .tab-progress {
    width: 0%;
}

/* Responsive */
@media (max-width: 767px) {
    .hero {
        height: 500px;
        min-height: 500px;
    }

    /* headline underlay */
    .slide::after {
        display: block;
        background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.6) 100%);
    }

    /* the desktop rule frames the banner for the 1440 stage; re-fit it to the phone hero */
    .slide--corporate .slide-video {
        width: 100%;
        height: 100%;
        inset: 0;
        object-position: center top;
    }

    .slide {
        padding: 0 30px 130px;
    }

    .slide--corporate .slide-content {
        position: relative;
        left: auto;
        top: auto;
        bottom: auto;
        display: block;
    }

    .slide-content h1 {
        font-size: clamp(2rem, 8vw, 3rem);
        letter-spacing: -0.5px;
    }

    .carousel-tabs {
        height: 60px;
        /* the 76px desktop offset leaves dead image below the bar on a 500px
           hero - sit it just above the section that follows */
        bottom: 14px;
    }

    .tab {
        flex-direction: column;
        gap: 2px;
        padding: 0 8px;
    }
    .tab-num {
        font-size: 0.6rem;
    }
    .tab-label {
        font-size: 0.65rem;
    }

    .arrow--left {
        left: 10px;
    }
    .arrow--right {
        right: 10px;
    }
}

@media (max-width: 480px) {
    .tab-num {
        display: none;
    }
}

/* "Build" unbolded in the corporate hero headline */
.slide-content h1.corporate .corporate-light { font-weight: 400; }

@media (min-width: 1729px) {
    .hero {
        width: calc(100vw / var(--cap-zoom));
        margin-left: calc((1440px - 100vw / var(--cap-zoom)) / 2);
        margin-right: 0;
    }
    /* Shift only the text wrapper into the centred column - leave .slide and its
       inset:0 .slide-bg alone so the banner image/video still fills the hero. */
    .slide-content {
        margin-left: calc((100vw / var(--cap-zoom) - 1440px) / 2);
    }
    .slide--corporate .slide-video {
        width: calc(100vw / var(--cap-zoom));
    }
    .slide--corporate .slide-content {
        left: calc((100vw / var(--cap-zoom) - 1440px) / 2 + 61px);
        margin-left: 0;
    }
}
