/* ======================= General Styles & Variables ======================= */
:root {
    --primary-color: #ffc107; /* Construction Yellow/Gold */
    --primary-hover: #e0a800;
    --primary-darker: #c89805; /* For 3D button shadow */
    --secondary-color: #212529; /* Darker Grey / Asphalt */
    --light-grey: #f8f9fa;
    --text-color: #333;
    --white: #fff;
    --border-radius: 8px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

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

html { 
    scroll-behavior: smooth; 
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--white);
}

.container { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 0 20px; 
}

h1, h2, h3, h4 { 
    font-family: 'Montserrat', sans-serif; 
    color: var(--secondary-color); 
    margin-bottom: 20px; 
    line-height: 1.2; 
}

.content-section { 
    padding: 10px 0; 
}

.alt-bg { 
    background-color: var(--light-grey); 
}

/* Fade-in Animation on Scroll */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible { 
    opacity: 1; 
    transform: translateY(0); 
}

/* ======================= Buttons & CTAs ======================= */
.cta-wrapper {
    text-align: center; /* Center the CTA button */
    margin-top: 40px;
}

/* 3D Button Effect */
.cta-button, form button {
    background-color: var(--primary-color);
    color: var(--secondary-color);
    padding: 15px 35px;
    text-decoration: none;
    font-weight: bold;
    font-family: 'Montserrat', sans-serif;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    box-shadow: 0 5px 0 var(--primary-darker); /* Darker shade for 3D effect */
    transition: all 0.1s ease-in-out;
    display: inline-block;
}

.cta-button:hover, form button:hover {
    transform: translateY(2px);
    box-shadow: 0 3px 0 var(--primary-darker);
}

.cta-button:active, form button:active {
    transform: translateY(4px);
    box-shadow: 0 1px 0 var(--primary-darker);
}


/* ======================= Header & Nav ======================= */
.main-header { 
    padding: 15px 0; 
    border-bottom: 1px solid #eee; 
}

.main-header .container { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}

/* --- Fix for Stretched Header Logo --- */
.main-header .logo img {
    max-height: 60px;  /* This correctly caps the height */
    width: auto;       /* THIS IS THE FIX: It tells the browser to scale the width proportionally */
    height: auto;      /* Also good practice to ensure height is not fixed elsewhere */
}

.header-contact span { 
    font-size: 0.9em; 
    color: #666; 
}

.header-contact a { 
    font-size: 1.5em; 
    font-weight: bold; 
    color: var(--secondary-color); 
    text-decoration: none; 
    display: block; 
}

.main-nav { 
    background-color: var(--secondary-color); 
    padding: 15px 0; 
    position: sticky; 
    top: 0; 
    z-index: 1000; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.1); 
}

.main-nav ul { 
    list-style: none; 
    display: flex; 
    justify-content: center; 
    gap: 40px; 
}

.main-nav a { 
    color: var(--white); 
    text-decoration: none; 
    font-weight: bold; 
    text-transform: uppercase; 
    font-size: 0.9em; 
    transition: color 0.3s ease; 
}

.main-nav a:hover { 
    color: var(--primary-color); 
}

/* ======================= Hero Section ======================= */
.hero-slider {
    background-image: linear-gradient(to bottom, rgba(0,0,0,0.7), rgba(0,0,0,0.4)), url('https://esc-surfacing.co.uk/images/tarmac_driveways.jpg?text=Tarmac+Driveway+Background');
    background-size: cover;
    background-position: center;
    color: var(--white);
    padding: 10px 0;
    text-align: center;
    animation: zoom-in 20s ease-out infinite alternate;
}

@keyframes zoom-in { 
    from { background-size: 100%; } 
    to { background-size: 110%; } 
}

.hero-text h1 { 
    font-size: 3.5em; 
    color: var(--white); 
    text-shadow: 0 2px 10px rgba(0,0,0,0.5); 
}

.hero-details { 
    display: flex; 
    justify-content: space-between; 
    align-items: stretch; 
    gap: 40px; 
    margin-top: 40px; 
    text-align: left; 
}

.bullet-list, .hero-form { 
    flex: 1; 
    padding: 30px; 
    border-radius: var(--border-radius); 
    background: rgba(0,0,0,0.3); 
    backdrop-filter: blur(5px); 
}

.bullet-list ul { 
    list-style: none; 
    font-size: 1.2em; 
}

.bullet-list li { 
    margin-bottom: 15px; 
}

.bullet-list .fa-check-circle { 
    color: var(--primary-color); 
    margin-right: 15px; 
}

/* ======================= Forms & CAPTCHA ======================= */
.hero-form, .contact-form-wrapper { 
    background: rgba(255, 255, 255, 0.95); 
    color: var(--text-color); 
    box-shadow: var(--shadow); 
    border-radius: var(--border-radius);
    padding: 30px;
}

.contact-form-wrapper {
    max-width: 700px; 
    margin: 30px auto 0;
}

.hero-form h3, .contact-form-wrapper h3 { 
    text-align: center; 
}

form input, form textarea, form button { 
    width: 100%; 
    padding: 15px; 
    margin-bottom: 15px; 
    border-radius: var(--border-radius); 
    border: 1px solid #ccc; 
    font-size: 1em; 
    font-family: 'Roboto', sans-serif;
}

.captcha-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.captcha-group label {
    flex-shrink: 0;
    font-weight: 500;
}

.hero-form .captcha-group label, .contact-form-wrapper .captcha-group label {
    color: var(--text-color);
}

.hero-details .captcha-group input {
    margin-bottom: 0; /* Override default margin */
}


/* ======================= Gallery Section ======================= */
.gallery-grid { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 25px; 
    margin-top: 40px; 
}

.gallery-card { 
    position: relative; 
    overflow: hidden; 
    border-radius: var(--border-radius); 
    box-shadow: 0 4px 15px rgba(0,0,0,0.1); 
    transition: all 0.3s ease; 
}

.gallery-card:hover { 
    transform: translateY(-10px); 
    box-shadow: var(--shadow); 
}

.gallery-image { 
    width: 100%; 
	 height: 100%;            /* This makes the image fill the full height of the card */
    object-fit: cover;       /* This scales the image to cover the area, cropping if needed */
    display: block; 
}

.card-overlay { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(0,0,0,0.7); 
    color: var(--white); 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
    opacity: 0; 
    transition: opacity 0.4s ease; 
    cursor: pointer; 
}

.gallery-card:hover .card-overlay { 
    opacity: 1; 
}

.card-overlay .fa-search-plus { 
    font-size: 2.5em; 
    margin-bottom: 10px; 
}

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

.modal-content { 
    margin: auto; 
    display: block; 
    max-width: 85%; 
    max-height: 85%; 
}

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

/* ======================= Reviews Carousel ======================= */
.review-carousel { 
    width: 100%; 
    overflow: hidden; 
    position: relative; 
    margin-top: 30px; 
    -webkit-mask-image: linear-gradient(to right, transparent, black 20%, black 80%, transparent); 
    mask-image: linear-gradient(to right, transparent, black 20%, black 80%, transparent); 
}

.carousel-track { 
    display: flex; 
    width: fit-content; 
    animation: scroll 60s linear infinite; 
}

.review-carousel:hover .carousel-track { 
    animation-play-state: paused; 
}

.review-card { 
    flex-shrink: 0; 
    width: 380px; 
    background: var(--white); 
    border-left: 5px solid var(--primary-color); 
    border-radius: var(--border-radius); 
    padding: 30px; 
    margin: 10px 20px; 
    box-shadow: var(--shadow); 
}

.review-card p { 
    font-style: italic; 
    margin-bottom: 15px; 
}

.review-card span { 
    display: block; 
    font-weight: bold; 
    color: var(--secondary-color); 
}

@keyframes scroll { 
    0% { transform: translateX(0); } 
    100% { transform: translateX(-50%); } 
}

/* ======================= Accreditations Section ======================= */
.accreditation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 40px;
}
.accreditation-card {
    background: var(--white);
    padding: 25px;
    text-align: center;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.accreditation-card:hover {
    transform: translateY(-10px);
}
.accreditation-card img {
    max-height: 80px;
    margin-bottom: 20px;
}
.accreditation-card h4 {
    color: var(--secondary-color);
    margin-bottom: 10px;
}
.accreditation-card p {
    font-size: 0.9em;
    line-height: 1.5;
}


/* ======================= FAQ Accordion ======================= */
.faq-accordion { 
    max-width: 800px; 
    margin: 30px auto; 
}

.faq-item { 
    border-bottom: 1px solid #ddd; 
}

.faq-question { 
    width: 100%; 
    background: none; 
    border: none; 
    text-align: left; 
    font-size: 1.1em; 
    font-weight: 500; 
    padding: 20px; /* Added padding for better hover */
    cursor: pointer; 
    position: relative; 
    padding-right: 40px; 
    font-family: 'Roboto', sans-serif; 
    transition: background-color 0.3s ease;
}

.faq-question:hover {
    background-color: #e9ecef;
}

.faq-question::after { 
    content: '+'; 
    position: absolute; 
    right: 20px; 
    font-size: 1.8em; 
    color: var(--primary-color); 
    transition: transform 0.3s ease; 
}

.faq-question.active::after { 
    transform: rotate(45deg); 
}

.faq-answer { 
    max-height: 0; 
    overflow: hidden; 
    transition: max-height 0.4s ease-out; 
}

.faq-answer p { 
    padding: 0 20px 20px 20px; 
}

/* ======================= Partners & Other Sections ======================= */
.partners-section { 
    padding: 30px 0; 
    background-color: var(--light-grey); 
}

.partners-section .container { 
    display: flex; 
    justify-content: space-around; 
    align-items: center; 
    flex-wrap: wrap; 
    gap: 20px; 
}

.partners-section img { 
    max-height: 50px; 
    filter: grayscale(100%); 
    opacity: 0.7; 
    transition: all 0.3s ease; 
}

.partners-section img:hover { 
    filter: grayscale(0); 
    opacity: 1; 
}

.service-lists { 
    display: flex; 
    justify-content: space-around; 
    gap: 30px; 
    margin-top: 20px;
}

.service-lists ul, .areas-services-summary ul { 
    list-style: none; 
}

.service-lists li, .areas-services-summary li { 
    margin-bottom: 10px; 
}

.service-lists li { 
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="%23ffc107"><path d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"/></svg>') no-repeat left center; 
    background-size: 16px; 
    padding-left: 28px; 
}

.areas-services-summary { 
    display: flex; 
    justify-content: space-around; 
    gap: 30px; 
}

/* ======================= Footer ======================= */
.main-footer { 
    background-color: var(--secondary-color); 
    color: #ccc; 
    padding: 60px 0 0; 
}

.main-footer .container { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 40px; 
}

.main-footer a { 
    color: var(--white); 
    text-decoration: none; 
    transition: color 0.3s ease; 
}

.main-footer a:hover { 
    color: var(--primary-color); 
}

.main-footer h4 { 
    color: var(--primary-color); 
    margin-bottom: 15px;
    text-transform: uppercase;
    font-size: 1.1em;
}

.main-footer ul { 
    list-style: none; 
} 

.main-footer li { 
    margin-bottom: 10px; 
}

.social-icons a { 
    font-size: 1.5em; 
    margin-right: 15px; 
}

.footer-bottom { 
    text-align: center; 
    padding: 20px 0; 
    margin-top: 40px; 
    border-top: 1px solid #444; 
}

/* ======================= Responsive Design ======================= */
@media (max-width: 992px) {
    .gallery-grid { 
        grid-template-columns: repeat(2, 1fr); 
    }
    .hero-details { 
        flex-direction: column; 
        align-items: center; 
    }
    .bullet-list, .hero-form { 
        width: 100%; 
        max-width: 500px; 
    }
}

@media (max-width: 768px) {
    h1 { 
        font-size: 2.5em; 
    }
    .main-header .container { 
        flex-direction: column; 
        gap: 15px; 
    }
    .main-nav ul { 
        flex-wrap: wrap; 
        justify-content: center; 
        gap: 20px; 
    }
    .areas-services-summary, .service-lists { 
        flex-direction: column; 
        text-align: center; 
    }
    .service-lists li { 
        background-position: center left; 
    }
    .gallery-grid { 
        grid-template-columns: 1fr; 
    }
    .review-card { 
        width: 300px; 
    }
}