* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.hero {
    position: relative;
    width: 100%;
    height: 80vh;
    min-height: 500px;
    overflow: hidden;
    font-family: "EB Garamond", serif;
    color: #ffffff;
}

/* ---------- SLIDER ---------- */
.slider {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 1.2s ease-in-out;
    position: absolute;
    inset: 0;
    z-index: 0;
}

.slide {
    position: relative;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    z-index: 0;
}

/* ---------- NAVIGATION BUTTONS ---------- */
.prev, .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.3); /* Semi-transparent background */
    color: white;
    border: none;
    font-size: 2rem;
    padding: 10px 10px;
    cursor: pointer;
    z-index: 10; /* Ensure it sits on top of the text (z-index 2) */
    transition: background-color 0.3s ease;
    border-radius: 4px;
    user-select: none; /* Prevents highlighting the arrow text */
}

.prev {
    left: 10px;
}

.next {
    right: 10px;
}

.prev:hover, .next:hover {
    background-color: rgba(0, 0, 0, 0.9); /* Darker on hover */
}

/* ---------- OVERLAYS ---------- */
.image-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1;
    pointer-events: none;
}

.slide-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    color: #ffffff;
}

/* ---------- TEXT (FLUID) ---------- */
.top-text {
    position: absolute;
    top: 6%;
    width: 100%;
    padding: 0 8%;
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    font-size: clamp(1.2rem, 2.5vw, 2rem);
}

.center-text {
    position: absolute;
    top: 40%;
    width: 100%;
    text-align: center;
    font-weight: 700;
    font-size: clamp(3rem, 10vw, 10rem);
}

.bottom-text {
    position: absolute;
    top: 70%;
    width: 100%;
    text-align: center;
    font-size: clamp(1rem, 2vw, 2rem);
    padding: 0 8%;
}

.slide24-top-text {
    position: absolute;
    top: 20%;
    width: 100%;
    padding: 0 10%;
    text-align: center;
    font-weight: 600;
    font-size: clamp(3rem, 3.5vw, 5rem);
}

.slide24-center-text {
    position: absolute;
    top: 60%;
    width: 100%;
    padding: 0 10%;
    text-align: center;
    font-weight: 400;
    font-size: clamp(1rem, 2vw, 2rem);
}

.slide-explanation-img {
    position: absolute;
    top: 65%; /* Positioned beneath the text */
    left: 50%;
    transform: translateX(-50%); /* Centers it horizontally */
    
    /* Responsive Width: starts at 300px, grows with screen, caps at 600px */
    width: clamp(300px, 50vw, 600px); 
    height: auto;
    
    z-index: 3;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3); /* subtle shadow for pop */
}

/* ---------- SERVICES SECTION ---------- */
.services {
    padding: 60px 8%; /* Top/Bottom padding 60px, Side padding 8% to match hero */
    background-color: #f9f9f9; /* Light grey background for separation */
    text-align: center;
    color: #333; /* Dark grey text for readability */
}

.section-title {
    font-size: clamp(1.2rem, 3vw, 2.5rem);
    margin-bottom: 40px;
    font-weight: 600;
    text-transform: uppercase;
    border-bottom: 2px solid #ccc;
    display: inline-block;
    padding-bottom: 10px;
}

.services-container {
    display: flex;
    justify-content: space-between; /* Spacing between items */
    gap: 30px; /* Gap between columns */
    flex-wrap: wrap; /* Allows stacking on mobile screens */
    padding: 50px;
}

.service-item {
    flex: 1;
    min-width: 220px; /* Slightly smaller min-width to prevent early wrapping */
    max-width: 350px; /* Prevents them from getting too huge on large screens */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.services > p {
    padding: 2px;
}

.services > h2 {
    padding: 2px;
}

/* Image Container (Replaced .service-link) */
.service-img-container {
    display: block;
    width: 100%;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.service-img-container img {
    width: 100%;
    height: 200px; /* Slightly shorter height to balance 4 items */
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

/* Keep the zoom effect for polish, but remove pointer cursor if desired */
.service-img-container:hover img {
    transform: scale(1.05);
}

.service-item h3 {
    font-size: 1.4rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.service-item p {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #555;
    max-width: 95%;
}

/* ---------- MIDSTREAM BUSINESS FUNCTIONS ---------- */
.midstream-functions {
    padding: 60px 4%; /* Increased side padding slightly */
    background-color: #e0e0e0;
    text-align: center;
    color: #333;
}

.functions-container {
    display: grid;
    /* Create 2 columns. Each column holds one "function-item" (which has img+text) */
    grid-template-columns: 1fr 1fr; 
    gap: 20px 6%; /* 60px vertical gap, 6% horizontal gap (substantial space) */
    margin-top: 20px;
    align-items: start; /* Aligns items to the top of their row */
}

/* THE ITEM CONTAINER (Image + Text) */
.function-item {
    display: flex;
    flex-direction: row; /* Always Image Left, Text Right */
    align-items: center; 
    width: 100%;
    text-align: left;
}

/* THE HALVES */
.image-half, .text-half {
    flex: 1; 
    width: 50%; 
}

/* Image Styles */
.image-half img {
    width: 100%;
    height: 280px; /* Slightly smaller height to fit the compact layout */
    object-fit: cover;
    border-radius: 8px;
    display: block; 
}

/* Text Styles */
.text-half {
    padding-left: 20px; /* Space between image and text */
}

.text-half h3 {
    font-size: 1.4rem; /* Adjusted font size for the tighter layout */
    margin-bottom: 10px;
    color: #000;
    font-weight: 700;
}

.text-half p {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #444;
}

/* ---------- FOOTER ---------- */
footer {
    background-color: #000000; /* Black background */
    color: #ffffff; /* White text (same as hero) */
    padding: 0px 5%;
}

.footer-container {
    display: flex;
    justify-content: space-between; /* Pushes Logo left and Contact right */
    align-items: center; /* Vertically centers them */
    flex-wrap: wrap;
    gap: 20px;
}

.footer-logo img {
    height: 100px; /* Adjust based on your logo size */
    width: auto;
}

/* If using text for logo instead of image */
.footer-logo h2 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.footer-contact {
    text-align: right;
    display: flex;
    flex-direction: column; /* Stacks the email and phone vertically */
    gap: 5px; /* Space between email and phone */
}

.footer-contact p {
    font-size: 1rem;
    font-weight: 400;
    margin: 0;
    letter-spacing: 0.5px;
}

/* Mobile Responsiveness */
@media (max-width: 1024px) {
    .functions-container {
        grid-template-columns: 1fr; /* 1 column of items */
        gap: 40px;
    }
    
    .function-item {
        max-width: 800px; /* Limit width for readability */
        margin: 0 auto; /* Center the item */
    }
}

@media (max-width: 768px) {
    .services-container {
        flex-direction: column;
    }
    
    .service-link img {
        height: auto; /* Allow auto height on mobile if preferred */
        aspect-ratio: 16/9;
    }

    .footer-container {
        flex-direction: column;
        text-align: center;
    }
    .footer-contact {
        text-align: center;
    }

    .function-row {
        flex-direction: column; /* Stack vertically */
        gap: 20px;
        margin-bottom: 50px;
    }
    /* CRITICAL: On mobile, force even rows to be column (normal stacking)
       instead of row-reverse. This ensures Image (1st child) stays on top. */
    .function-item {
        flex-direction: column; /* Stack vertically */
        text-align: center; /* Center text on mobile */
    }

    .image-half, .text-half {
        width: 100%;
        padding: 0;
    }

    .image-half img {
        height: 250px;
        margin-bottom: 20px;
    }
    
    .text-half p {
        text-align: left; /* Keep paragraph left-aligned if preferred, or center */
    }    
}