/* General Resets & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box; /* Makes managing padding and borders easier */
}

html {
    scroll-behavior: smooth; /* Smooth scrolling for nav links */
}

body {
    font-family: 'Arial', sans-serif; /* A good default, consider Google Fonts later */
    line-height: 1.6;
    color: #333; /* Dark grey for good readability */
    background-color: #f4f4f4; /* Light background */
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto; /* Center content */
    padding: 20px 0; /* Vertical padding */
}

a {
    color: #555f42; /* Standard link color (your custom color) */
    text-decoration: none;
    transition: color 0.3s ease; /* Smooth hover effect */
}

a:hover {
    color: #555f42; /* Keep same color on hover for now, or change if desired */
}

ul {
    list-style: none; /* Remove bullet points from lists */
}

/* Header Styles */
.main-header {
    background-color: #222; /* Dark background for the header */
    color: #fff;
    padding: 1rem 0;
    position: sticky; /* Makes header stick to the top */
    top: 0;
    z-index: 1000; /* Ensures header is above other content */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px; /* Add horizontal padding for header container */
}

.main-header h1 {
    font-size: 1.8rem;
    margin: 0;
}

.main-nav ul {
    display: flex; /* Arrange nav items in a row */
}

.main-nav ul li {
    margin-left: 20px;
}

.main-nav ul li a {
    color: #fff;
    font-weight: bold;
    padding: 5px 0;
    position: relative; /* For the underline effect */
}

.main-nav ul li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background: #555f42; /* Underline color (your custom color) */
    left: 0;
    bottom: -5px;
    transition: width 0.3s ease;
}

.main-nav ul li a:hover::after {
    width: 100%;
}

/* Section Styling - General */
section {
    padding: 60px 0; /* Top and bottom padding for sections */
    text-align: center;
}

section:nth-of-type(odd) { /* Alternate background colors for sections */
    background-color: #fff;
}

section:nth-of-type(even) {
    background-color: #f9f9f9;
}

h2 {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

h2::after {
    content: '';
    position: absolute;
    width: 80px;
    height: 4px;
    background: #555f42; /* Underline color (your custom color) */
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    border-radius: 2px;
}

/* Hero/Mission Section */
.hero-section {
    background: url('../images/hero_background.jpg') no-repeat center center/cover; /* Replace with a suitable background image */
    color: #ffffff;
    background-color: #555f42 !important; /* Ensure your custom background color for hero */
    padding: 100px 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
    min-height: 450px; /* Ensure sufficient height */
    display: flex;
    align-items: center; /* Vertically center content */
    justify-content: center; /* Horizontally center content */
}

.hero-section h2 {
    font-size: 3.5rem;
    margin-bottom: 15px;
    color: #fff; /* Override section H2 color */
}

.hero-section h2::after {
    background: #fff; /* White underline for hero section */
}

.hero-section p {
    font-size: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

/* About Section */
.about-section .about-content {
    display: flex;
    flex-direction: column; /* Stack on small screens */
    align-items: center;
    gap: 30px;
    text-align: left;
    max-width: 900px;
    margin: 0 auto;
}

.about-section .about-image {
    width: 250px;
    height: 250px;
    border-radius: 50%; /* Make it circular */
    object-fit: cover; /* Crop image to fit circle */
    border: 5px solid #555f42; /* Your custom border color */
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
}

.about-section p {
    font-size: 1.1rem;
    line-height: 1.8;
}

/* Services Section */
.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Responsive grid */
    gap: 30px;
    margin-top: 40px;
}

.service-item {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.service-item h3 {
    font-size: 1.8rem;
    color: #555f42; /* Your custom color */
    margin-bottom: 15px;
}

.service-item p {
    font-size: 1rem;
    color: #555;
}

/* Portfolio Section (Carousel) */
.portfolio-section {
    background-color: #f9f9f9;
}

.carousel-container {
    position: relative;
    max-width: 800px; /* Desktop max-width for the carousel container */
    margin: 40px auto;
    overflow: hidden; /* Crucial for hiding images outside view */
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    /* height will be implicitly determined by the content of carousel-track and its wrappers */
    /* REMOVE any 'height: 0;' or 'transition: height...' from here */
}

.carousel-track {
    display: flex;
    transition: transform 1.0s ease-in-out;
    width: fit-content; /* Allows the track to hold all wrappers side-by-side */
    position: relative; /* Context for children if needed */
}

/* NEW/REVISED: Wrapper for each image to control aspect ratio */
.carousel-item-wrapper {
    position: relative; /* CRITICAL: Establishes positioning context for the absolute image */
    width: 800px; /* CRITICAL: For desktop, each slide is 800px wide (matches .carousel-container) */
    flex-shrink: 0; /* Prevents this item from shrinking within the flex container */
    /*
    height: 0; and padding-top will be set dynamically by JS based on image aspect ratio.
    DO NOT PUT FIXED HEIGHTS OR PADDING-TOP HERE IN FINAL CODE.
    */
    min-height: 400px; /* REMOVE THIS AFTER DEBUGGING */
    background-color: #eee; /* REMOVE THIS AFTER DEBUGGING */
}

.carousel-track img {
    position: absolute; /* Image fills its parent wrapper */
    top: 0;
    left: 0;
    width: 100%; /* Image fills its wrapper */
    height: 100%; /* Image fills its wrapper */
    object-fit: contain; /* Or 'cover' if you prefer cropping */
    display: block; /* Removes extra space below image */
}

.carousel-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    padding: 15px 10px;
    cursor: pointer;
    font-size: 2rem;
    z-index: 10;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.carousel-button:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

.carousel-button.prev {
    left: 10px;
}

.carousel-button.next {
    right: 10px;
}

/* Contact Section */
.contact-section .contact-info {
    font-size: 1.1rem;
    line-height: 1.8;
    max-width: 600px;
    margin: 0 auto;
}

.contact-section .social-links a {
    margin: 0 10px;
    font-weight: bold;
}

/* Footer Styles */
footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 20px 0;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (min-width: 768px) {
    .about-section .about-content {
        flex-direction: row; /* Row layout on larger screens */
        text-align: left;
    }

    .about-section .about-image {
        margin-right: 30px; /* Space between image and text */
    }

    .hero-section {
        background-size: cover; /* Changed from 768px auto to cover for better hero image handling */
    }
}

@media (max-width: 767px) {
    .main-header .container {
        flex-direction: column;
        text-align: center;
    }

    .main-nav ul {
        flex-direction: column;
        margin-top: 15px;
    }

    .main-nav ul li {
        margin: 5px 0;
    }

    .hero-section h2 {
        font-size: 2.5rem;
    }

    .hero-section {
        background-size: cover;
    }

    .hero-section p {
        font-size: 1.2rem;
    }

    h2 {
        font-size: 2rem;
    }

    .service-grid {
        grid-template-columns: 1fr; /* Stack services on small screens */
    }

    /* CAROUSEL MOBILE FIXES */
    .carousel-container {
        max-width: 95%; /* Allows it to take full width of its parent (.container, which is 90% wide) */
        padding: 0; /* No extra padding on carousel-container itself */
        box-shadow: none; /* Optional mobile aesthetic */
        border-radius: 0; /* Optional mobile aesthetic */
    }

    .carousel-track {
        width: 100%;
        padding: 0; /* No extra padding on carousel-container itself */
        box-shadow: none; /* Optional mobile aesthetic */
        border-radius: 0; /* Optional mobile aesthetic */
    }
    .carousel-item-wrapper {
        width: 100%; /* CRITICAL: Each slide is 100% of its .carousel-container parent */
        
        /* This ensures proper scaling within the already centered .container */
        min-height: 300px;
        background-color: #eee;
    }

    .carousel-button {
        padding: 8px 6px;
        font-size: 1.2rem;
    }
}