/*
  Jameson Road Services - Custom Stylesheet
  -----------------------------------------
  Table of Contents:
  1.  Root Variables & Global Styles
  2.  Preloader
  3.  Navigation Bar
  4.  Hero Section
  5.  General Section & Component Styling
  6.  Service Cards
  7.  About Section
  8.  Why Choose Us Section
  9.  Projects Section
  10. Testimonials Section
  11. Contact Section
  12. Footer
  13. Animations & Transitions
  14. Responsive Design
*/

/* 1. Root Variables & Global Styles
-------------------------------------------------- */
:root {
    --primary-color: #002d5b; /* Slightly deeper blue for more gravitas */
    --secondary-color: #f39c12; /* A vibrant, confident orange */
    --secondary-hover: #e08e0b; /* Darker orange for hover states */
    --dark-color: #2c3e50; /* Darker grey for strong text contrast */
    --light-color: #ffffff;
    --grey-bg: #f4f6f8; /* Lighter, cleaner grey */
    --text-muted: #555;
    
    /* Font Families */
    --font-primary: 'Roboto', sans-serif;
    --font-headings: 'Poppins', sans-serif;
    
    /* Transitions */
    --transition-fast: all 0.2s ease-in-out;
    --transition-smooth: all 0.35s ease-in-out;
}

html {
    scroll-behavior: smooth;
    font-size: 16px; /* Set a base for easier rem calculations */
}

body {
    font-family: var(--font-primary);
    background-color: #fdfdfd;
    color: var(--dark-color);
    line-height: 1.7;
}

/* Improved focus state for accessibility */
:focus-visible {
    outline: 3px solid var(--secondary-color);
    outline-offset: 2px;
}

/* 2. Preloader
-------------------------------------------------- */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--primary-color);
    z-index: 1099;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.spinner {
    border: 5px solid rgba(255, 255, 255, 0.2);
    border-top: 5px solid var(--secondary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


/* 3. Navigation Bar
-------------------------------------------------- */
.navbar {
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    background-color: var(--primary-color) !important;
    padding: 1rem 0;
}

.navbar-brand {
    font-family: var(--font-headings);
    font-weight: 700;
    font-size: 1.7rem; /* Adjusted for better balance */
}
.navbar-brand i {
    margin-right: 10px;
    color: var(--secondary-color);
}

.nav-link {
    font-family: var(--font-headings);
    font-weight: 600;
    font-size: 1.05rem;
    transition: var(--transition-smooth);
}
.nav-link:hover, .nav-link.active {
    color: var(--secondary-color) !important;
}

.btn-cta-nav {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: var(--light-color);
    font-weight: 700;
    transition: var(--transition-smooth);
    border-radius: 50px;
    padding: 0.6rem 1.5rem;
}
.btn-cta-nav:hover {
    background-color: var(--secondary-hover);
    color: var(--light-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* 4. Hero Section
-------------------------------------------------- */
.hero {
    /* The background-image is set inline on the <header> tag in index.php */
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed; /* Parallax effect */
    color: white;
    padding: 12rem 0; /* Adjusted padding */
    text-align: center;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(rgba(0, 30, 60, 0.75), rgba(0, 30, 60, 0.75));
    z-index: 1;
}

.hero .container {
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-family: var(--font-headings);
    /* CHANGE: Adjusted clamp for better responsiveness on all screens */
    font-size: clamp(2.5rem, 7vw, 4.5rem); 
    font-weight: 700;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.7);
    margin-bottom: 1.5rem;
}

.hero p {
    /* CHANGE: Adjusted clamp for mobile readability */
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    margin-bottom: 2.5rem;
    max-width: 850px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 400;
}

.btn-hero {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: var(--light-color);
    padding: 1.2rem 3rem;
    /* CHANGE: Adjusted clamp for responsive button text */
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
    font-weight: 700;
    transition: var(--transition-smooth);
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-hero:hover {
    background-color: var(--secondary-hover);
    color: var(--light-color);
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

/* 5. General Section & Component Styling
-------------------------------------------------- */
.section-padding {
    padding: 6rem 0; /* Adjusted padding */
}

.section-title {
    text-align: center;
    margin-bottom: 4rem; /* Adjusted margin */
    font-family: var(--font-headings);
    font-weight: 700;
    color: var(--primary-color);
    /* CHANGE: Adjusted clamp for better responsive titles */
    font-size: clamp(2.2rem, 5vw, 3rem);
}
.section-title::after {
    content: '';
    display: block;
    width: 80px; /* Adjusted size */
    height: 5px; /* Adjusted size */
    background: var(--secondary-color);
    margin: 15px auto 0;
    border-radius: 3px;
}

/* 6. Service Cards
-------------------------------------------------- */
.service-card {
    border: none;
    transition: var(--transition-smooth);
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    border-radius: 20px;
    overflow: hidden;
    background-color: var(--light-color);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.service-card:hover {
    transform: translateY(-12px); /* Adjusted hover effect */
    box-shadow: 0 18px 35px rgba(0,0,0,0.12);
}

.service-card img {
    height: 280px; /* Adjusted height */
    object-fit: cover;
}
.service-card .card-body {
    padding: 2rem; /* Adjusted padding */
    flex-grow: 1;
}
.service-card .card-title {
    font-family: var(--font-headings);
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}
.service-card .card-text {
    font-size: 1.05rem;
    color: var(--text-muted);
}

/* 7. About Section
-------------------------------------------------- */
#about img {
     border-radius: 20px;
     box-shadow: 0 18px 35px rgba(0,0,0,0.12);
     width: 100%;
     height: 100%;
     object-fit: cover;
}
#about .about-section-title {
    font-family: var(--font-headings);
    font-weight: 700;
    color: var(--primary-color);
    font-size: clamp(2rem, 4.5vw, 2.8rem); /* Responsive font size */
    margin-bottom: 2rem;
    text-align: left;
}
#about .about-section-title::after {
    display: none;
}

/* 8. Why Choose Us Section
-------------------------------------------------- */
#why-choose-us {
    background-color: var(--grey-bg);
}

.feature-icon {
    font-size: 3.5rem; /* Adjusted size */
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    display: inline-block;
    padding: 1.5rem; /* Adjusted padding */
    background-color: var(--light-color);
    border-radius: 50%;
    box-shadow: 0 8px 20px rgba(0,0,0,0.07);
    transition: var(--transition-smooth);
}
.feature-item:hover .feature-icon {
    transform: scale(1.1);
    box-shadow: 0 12px 25px rgba(243, 156, 18, 0.3);
}
.feature-item h3 {
    font-family: var(--font-headings);
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.4rem;
    margin-bottom: 1rem;
}
.feature-item p {
    font-size: 1.05rem;
    color: var(--text-muted);
}

/* 9. Projects Section
-------------------------------------------------- */
#projects {
    background-color: var(--grey-bg);
}
.project-item {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: var(--transition-smooth);
}
.project-item:hover {
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
}

.project-item img {
    transition: transform 0.5s ease;
    width: 100%;
    height: 320px;
    object-fit: cover;
}

.project-item:hover img {
    transform: scale(1.1);
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 45, 91, 0.88), rgba(0, 30, 60, 0.96));
    color: white;
    opacity: 0;
    transition: opacity 0.5s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 30px;
}
.project-item:hover .project-overlay {
    opacity: 1;
}
.project-overlay h4 {
    font-family: var(--font-headings);
    font-weight: 700;
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
    transform: translateY(20px);
    transition: transform 0.5s ease;
}
.project-item:hover .project-overlay h4 {
    transform: translateY(0);
}

/* 10. Testimonials Section
-------------------------------------------------- */
#testimonials {
    background-color: var(--grey-bg);
}
.testimonial-card {
    background: var(--light-color);
    padding: 2.5rem; /* Adjusted padding */
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.07);
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
}

.testimonial-card i.fa-quote-left {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
}
.testimonial-card .quote-text {
    font-size: 1.1rem; /* Adjusted font size */
    font-style: italic;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    color: #444;
}
.testimonial-card h5 {
    font-family: var(--font-headings);
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.15rem;
}

/* 11. Contact Section
-------------------------------------------------- */
#contact {
    background: linear-gradient(rgba(0, 45, 91, 0.92), rgba(0, 30, 60, 0.97)), url('https://images.unsplash.com/photo-1620121684898-742969443932?q=80&w=1920&auto=format&fit=crop') no-repeat center center;
    background-size: cover;
    background-attachment: fixed;
    color: var(--light-color);
}
#contact .section-title {
    color: var(--light-color);
}
#contact .section-title::after {
    background: var(--secondary-color);
}
.form-control {
    border-radius: 10px;
    padding: 1rem 1.2rem;
    border: 1px solid #ced4da;
    font-size: 1.05rem;
    transition: var(--transition-smooth);
}
.form-control:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.25rem rgba(243, 156, 18, 0.3);
    background-color: #fff;
}
.btn-submit {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: var(--light-color);
    padding: 1rem 2.5rem;
    font-size: 1.15rem; /* Adjusted font size */
    font-weight: 700;
    border-radius: 50px;
    transition: var(--transition-smooth);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.btn-submit:hover {
    background-color: var(--secondary-hover);
    color: var(--light-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* 12. Footer
-------------------------------------------------- */
footer {
    background-color: var(--dark-color);
    color: #bdc3c7;
    padding: 4rem 0 2rem 0; /* Adjusted padding */
}
footer h5 {
    font-family: var(--font-headings);
    color: var(--light-color);
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}
footer a {
    color: #bdc3c7;
    text-decoration: none;
    transition: var(--transition-fast);
}
footer a:hover {
    color: var(--secondary-color);
    text-decoration: none;
}
footer .list-unstyled a {
    position: relative;
    padding-bottom: 3px;
}
footer .list-unstyled a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--secondary-color);
    transition: width 0.3s ease;
}
footer .list-unstyled a:hover::after {
    width: 100%;
}

.social-icons a {
    font-size: 1.6rem; /* Adjusted size */
    margin: 0 12px 0 0;
    color: #bdc3c7;
    transition: var(--transition-smooth);
}
.social-icons a:hover {
    color: var(--secondary-color);
    transform: scale(1.15) translateY(-2px);
}
.footer-bottom {
    border-top: 1px solid #34495e;
    padding-top: 2rem;
    margin-top: 2.5rem; /* Adjusted margin */
}
.footer-bottom p {
    font-size: 0.95rem;
    margin: 0;
}

/* 13. Animations & Transitions
-------------------------------------------------- */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.is-visible {
    opacity: 1;
    transform: translateY(0);
}


/* 14. Responsive Design
-------------------------------------------------- */

/* Medium devices (tablets, less than 992px) */
@media (max-width: 991.98px) {
    .hero {
        padding: 9rem 0;
    }
    #about .col-lg-6 {
        text-align: center;
    }
    #about .about-section-title {
        text-align: center;
    }
    #about .about-section-title::after {
        content: '';
        display: block;
        width: 80px;
        height: 5px;
        background: var(--secondary-color);
        margin: 15px auto 0;
        border-radius: 3px;
    }
    .section-padding {
        padding: 5rem 0;
    }
    footer {
        text-align: center;
    }
    .social-icons, .footer-bottom, .footer .text-lg-start {
        text-align: center !important;
    }
}

/* Small devices (landscape phones, less than 768px) */
@media (max-width: 767.98px) {
    .hero {
        padding: 7rem 0;
        background-attachment: scroll; /* Disable parallax on mobile for performance */
    }
    .section-title {
        margin-bottom: 3.5rem;
    }
    .section-padding {
        padding: 4rem 0;
    }
    .service-card .card-body, .testimonial-card {
        padding: 1.8rem;
    }
    .service-card img {
        height: 250px; /* Further reduce image height on mobile */
    }
    .project-item img {
        height: 280px;
    }
    .btn-hero {
        padding: 1rem 2.5rem; /* Make hero button smaller */
    }
    .footer-bottom {
        margin-top: 2rem;
    }
}

/* Extra small devices (portrait phones, less than 576px) */
@media (max-width: 575.98px) {
    .navbar-brand {
        font-size: 1.5rem; /* Smaller brand text */
    }
    .hero {
        padding: 6rem 0;
    }
    .section-padding {
        padding: 3.5rem 0;
    }
    .section-title {
        margin-bottom: 3rem;
    }
    .testimonial-card {
        padding: 1.5rem;
    }
    .contact-form .row > div {
        margin-bottom: 1rem;
    }
}