/* --- 1. Global Reset & Variables --- */
:root {
    --color-primary: #8B4513; /* Saddle Brown - Classic wood tone */
    --color-secondary: #C8AE7D; /* Antique Gold - Accent color */
    --color-text: #333;
    --color-light: #f9f9f9;
    --color-dark: #1f150b;
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Roboto', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    color: var(--color-text);
    line-height: 1.6;
    background-color: #fff;
}

/* --- 2. Typography --- */
h1, h2, h3 {
    font-family: var(--font-heading);
    color: var(--color-dark);
}

h1 { font-size: 3.5rem; }
h2 { font-size: 2.5rem; margin-bottom: 1.5rem; }
h3 { font-size: 1.6rem; margin-bottom: 0.5rem; }

.section-title {
    text-align: center;
    padding-bottom: 1rem;
    position: relative;
    margin-bottom: 3rem;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--color-primary);
    margin: 10px auto 0;
}

/* --- 3. Utility Classes --- */
.section {
    padding: 80px 5%;
    max-width: 1200px;
    margin: 0 auto;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 700;
    transition: background-color 0.3s, transform 0.2s;
    border: none;
    cursor: pointer;
}

.primary-btn {
    background-color: var(--color-primary);
    color: var(--color-light);
}

.primary-btn:hover {
    background-color: #A0522D; /* Lighter brown */
    transform: translateY(-2px);
}

/* --- 4. Header & Navigation --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 5%;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    z-index: 1000;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--color-primary);
}

.navbar a {
    text-decoration: none;
    color: var(--color-dark);
    font-weight: 500;
    margin-left: 30px;
    position: relative; /* CRITICAL: Establishes a context for the ::after element */
    transition: color 0.3s;
}

/* 1. Create the invisible underline */
.navbar a::after {
    content: '';
    position: absolute;
    width: 0; /* Start with zero width */
    height: 2px;
    background: #4CAF50;
    bottom: -5px; /* Position it below the text */
    left: 0;
    transition: width 0.3s ease-out; /* Animate the width */
}

/* 2. On hover, expand the underline */
.navbar a:hover::after, 
.navbar a.active::after {
    width: 100%; /* Expand to full width on hover */
}

/* Keep the color change for visual feedback */
.navbar a:hover, 
.navbar a.active {
    color: #4CAF50;
}

.contact-btn {
    background-color: var(--color-secondary);
    padding: 8px 15px;
    border-radius: 4px;
    color: var(--color-dark) !important;
}

.contact-btn:hover {
    background-color: #0bb825; /* Darker gold */
}

/* --- Styling for Icon Alignment in Contact Info --- */
.contact-info p {
    display: flex; /* Allows the icon and text to sit on the same line */
    align-items: center; /* Vertically centers the icon with the text */
    margin-bottom: 12px;
    justify-content: center; /* Center the whole line under the centered form */
}

.contact-info p a {
    color: var(--color-text); /* Ensure the link color is readable */
    text-decoration: none;
    transition: color 0.3s;
}

.contact-info p a:hover {
    color: var(--color-primary); /* Use brand color on hover */
}

.contact-info i {
    color: var(--color-primary); /* Brand color for the icons */
    font-size: 1.1rem;
    margin-right: 10px; /* Space between the icon and the text */
    width: 20px; /* Gives the icons a consistent spacing box */
    text-align: center;
}

.appointment-note {
    font-style: italic;
    margin-top: 20px;
    color: #666;
}

.menu-toggle {
    display: none; /* Hidden on large screens */
    font-size: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-primary);
}

/* --- 5. Hero Section --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    
    background-color: var(--color-dark);
    background-image: url('../images/logo-trim2.jpg');
    background-repeat: no-repeat;
    background-position: center center;
    
    /* FIX: Set the base size to the maximum (100% of the container width),
       or 'contain' if your image has a lot of padding and you want it to fit tightly.
       We will use a percentage that's guaranteed to be contained, and let the animation handle the rest. */
    background-size: 100% auto; /* Base state is 100% width, height auto (contained by default) */
    
    animation: mymove 30s infinite alternate; /* Keep the smooth alternating animation */
    
    color: var(--color-dark);
    position: relative;
    padding-top: 80px; 
}

@keyframes mymove {
    /* 0% (Start) and 100% (End) automatically use the size defined in .hero (100% auto) */
    
    50% {
        /* MIN STATE: Reduce to 50% of the container's width. 
           Since 50% is < 100%, the image will be fully visible and reduced. */
        background-size: 50% auto; 
    }
}


.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4); /* Dark overlay */
}

.hero-content {
    position: relative;
    z-index: 10;
}

.hero h1 {
    color: #fff;
    margin-bottom: 20px;
}

.hero .tagline {
    font-size: 1.5rem;
    margin-bottom: 40px;
    font-weight: 300;
    color: var(--color-light);
}

/* --- 6. About Us Section --- */
.about-us {
    background-color: var(--color-light);
}

.about-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.about-content p {
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.stats-grid {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    margin-top: 40px;
}

.stats-grid div {
    flex-basis: 30%;
    font-size: 1.1rem;
    font-weight: 400;
    border-left: 3px solid var(--color-primary);
    padding-left: 15px;
    text-align: left;
}

.stats-grid span {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1;
}

/* --- 7. Services/Selling Points Section --- */
.services {
    background-color: #fff;
}

.selling-points-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
}

.selling-point {
    padding: 30px;
    border: 1px solid #eee;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
}

.selling-point:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.point-title {
    color: var(--color-primary);
}

/* --- 7.5. Testimonials Section --- */
.testimonials {
    background-color: #f5f5f5; /* Use a light gray to distinguish it */
    padding: 100px 5%; /* Give it more vertical space */
}

.testimonial-grid {
    display: grid;
    /* Creates 3 columns on large screens, or fills the space nicely */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 30px;
    margin-top: 40px;
}

.testimonial-card {
    background: #fff;
    padding: 30px;
    border-radius: 6px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border-top: 5px solid var(--color-primary); /* Primary color accent */
    font-style: italic;
    height: 100%; /* Ensures all cards stretch to the same height */
    display: flex;
    flex-direction: column;
}

.testimonial-card .quote {
    font-size: 1.1rem;
    margin-bottom: 20px;
    line-height: 1.5;
}

.testimonial-card .author {
    font-style: normal;
    font-weight: 500;
    color: var(--color-primary);
    margin-top: auto; /* Pushes the author to the bottom */
}

/* --- 8. Portfolio Section (Gallery) --- */
.portfolio {
    background-color: var(--color-light);
}

.section-subtitle {
    text-align: center;
    margin-bottom: 40px;
    font-size: 1.1rem;
}

/* --- 8. Portfolio Section (Gallery) - NEW SHOWCASE LAYOUT --- */

/* Parent Container: Controls spacing between items */
.showcase-container {
    display: flex; 
    flex-direction: column;
    gap: 60px; /* Space between each showcase item */
    padding-top: 20px;
}

.showcase-item {
    display: flex;
    flex-direction: column; /* Default: Stacks image on top of text for mobile/tablet */
    align-items: stretch;
    background-color: #fff; /* Light background for contrast */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-radius: 6px;
    overflow: hidden;
}

.showcase-image {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    min-height: 300px; /* Ensure images have a decent minimum height */
    flex: 1 1 auto; 
}

.showcase-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease-in-out; /* Smooth zoom transition */
}

.showcase-description {
    padding: 30px;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center; /* Center text vertically */
}

.showcase-description h3 {
    color: var(--color-primary);
    margin-bottom: 10px;
}

.project-details {
    margin-top: 15px;
    font-size: 0.95rem;
    color: #666;
    font-weight: 500;
}

/* ANIMATED OVERLAY EFFECTS */
.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Use the Primary color, semi-transparent */
    background: rgba(139, 69, 19, 0.8); 
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0; /* Start invisible */
    transition: opacity 0.3s ease-in-out;
}

.overlay-text {
    color: white;
    font-size: 1.4rem;
    font-weight: 700;
    transform: translateY(20px); /* Start below center */
    transition: transform 0.3s ease-in-out;
}

/* HOVER STATE: Zoom, Fade in Overlay, Slide up Text */
.showcase-image:hover img {
    transform: scale(1.08); /* Impressive zoom effect */
}

.showcase-image:hover .image-overlay {
    opacity: 1; /* Fade in the overlay */
}

.showcase-image:hover .overlay-text {
    transform: translateY(0); /* Slide the text up to center */
}


/* --- 11. Media Queries (Responsiveness) --- */
/* Add the new rules to the existing media query section */
@media (min-width: 992px) {
    /* ... existing media query rules ... */
    
    /* ADD NEW RULES HERE */
    .showcase-item {
        flex-direction: row; /* Layout image and text side-by-side */
        min-height: 450px; /* Give the overall item a stately minimum height */
    }
    
    /* Alternate the layout: Even items have the image on the right */
    .showcase-item:nth-child(even) {
        flex-direction: row-reverse;
    }

    .showcase-image {
        flex: 0 0 60%; /* Image takes 60% of the width */
        min-height: 100%; /* Ensure image fills the new height */
    }
    
    .showcase-description {
        flex: 0 0 40%; /* Description takes 40% of the width */
    }
}

/* --- Modal Styling --- */
.modal {
    display: none; 
    position: fixed; 
    z-index: 2000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0,0,0,0.9); 
}

.modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 900px;
    max-height: 80vh;
    object-fit: contain;
}

.modal-caption, .modal-description {
    margin: 15px auto;
    width: 80%;
    max-width: 900px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
}

.modal-caption {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.close-btn:hover, .close-btn:focus {
    color: var(--color-primary);
    text-decoration: none;
}


/* --- 9. Contact Us Section (Form) --- */
.contact-us {
    text-align: center;
}

.contact-form {
    max-width: 600px;
    margin: 30px auto;
    text-align: left;
    padding: 30px;
    border: 1px solid #eee;
    border-radius: 5px;
    background-color: #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--color-dark);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    font-family: var(--font-body);
}

.form-group textarea {
    resize: vertical;
}

.submit-btn {
    width: 100%;
}

.form-status {
    text-align: center;
    margin-top: 15px;
    font-weight: 500;
    color: green;
}

.contact-info {
    margin-top: 40px;
}

.contact-info p {
    margin-bottom: 10px;
}


/* --- 10. Footer --- */
.footer {
    background-color: var(--color-dark);
    color: var(--color-light);
    text-align: center;
    padding: 30px 5%;
    font-size: 0.9rem;
}

/* --- 11. Media Queries (Responsiveness) --- */

/* Tablet & Smaller Screens */
@media (max-width: 992px) {
    .navbar {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 80px; /* Below the header */
        right: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.98);
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
        padding: 20px 0;
        text-align: center;
    }

    .navbar.active {
        display: flex;
    }

    .navbar a {
        margin: 10px 0;
        padding: 10px 0;
        border-bottom: 1px solid #eee;
        width: 100%;
        margin-left: 0;
    }

    .navbar a:last-child {
        border-bottom: none;
    }

    .menu-toggle {
        display: block;
    }

    .hero h1 {
        font-size: 2.5rem;
    }
}

/* Mobile Screens */
@media (max-width: 576px) {
    .section {
        padding: 50px 5%;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero .tagline {
        font-size: 1.2rem;
    }

    .stats-grid {
        flex-direction: column;
        align-items: center;
    }

    .stats-grid div {
        text-align: center;
        border-left: none;
        border-bottom: 3px solid var(--color-primary);
        padding-left: 0;
        padding-bottom: 10px;
    }

    .modal-content {
        width: 95%;
    }
}
