/* Reset default styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', sans-serif;
    line-height: 1.6;
    color: #FFFFFF;
    background-color: #1A1A1A;
    overflow-x: hidden;
    text-align: center; /* Center inline and inline-block elements */
}

body.no-scroll {
    overflow: hidden;
    height: 100vh;
}

/* Header */
.sticky-header {
    background-color: #FFFFFF;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease;
    width: 100%; /* Full viewport width */
}

.sticky-header.scrolled {
    background-color: #FFFFFF;
}

/* Inner header content wrapper for centering */
.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.logo-img {
    max-width: 120px;
    height: auto;
    transition: transform 0.3s ease;
}

.logo-img:hover {
    transform: scale(1.05);
}

/* Navigation */
nav {
    position: relative;
}

.hamburger, .close-menu {
    display: none;
    font-size: 24px;
    cursor: pointer;
    color: #333333;
    padding: 5px;
    z-index: 102;
}

.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

.nav-links li a {
    color: #333333;
    text-decoration: none;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    padding: 8px 15px;
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.nav-links li a:hover {
    background-color: #D94F04;
    color: #FFFFFF;
}

.nav-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 99;
}

/* Hero Section */
.hero {
    position: relative;
    height: 100vh;
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6));
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    animation: fadeIn 1.5s ease-in;
    max-width: 100%;
    margin: 0 auto;
}

.hero-content {
    max-width: 800px;
    padding: 20px;
}

.hero h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 3.5em;
    color: #FFFFFF;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.subheadline {
    font-size: 1.5em;
    color: #F2A30F;
    margin-bottom: 20px;
}

.slogan {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.3em;
    color: #FFFFFF;
    margin-bottom: 30px;
    text-transform: uppercase;
}

.cta-button {
    display: inline-block;
    background-color: #D94F04;
    color: #FFFFFF;
    padding: 15px 30px;
    text-decoration: none;
    border-radius: 5px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.cta-button:hover {
    background-color: #F2A30F;
    transform: scale(1.05);
}

/* Sections */
.section {
    padding: 80px 20px;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    width: 100%;
}

h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 2.5em;
    color: #FFFFFF;
    margin-bottom: 20px;
}

.section-intro {
    font-size: 1.2em;
    color: #CCCCCC;
    max-width: 700px;
    margin: 0 auto 40px;
}

.section-intro a {
    color: #4A90E2;
    text-decoration: none;
}

.section-intro a:hover {
    text-decoration: underline;
}

/* About Section */
.owner-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.owner-card {
    background-color: #2A2A2A;
    padding: 20px;
    border-radius: 10px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.owner-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.owner-card h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.8em;
    color: #F2A30F;
    margin-bottom: 10px;
}

.owner-card p {
    color: #CCCCCC;
}

/* Services Section */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    max-width: 1000px;
    margin: 0 auto 40px;
    justify-content: center; /* Center grid items */
}

.service-item {
    background-color: #2A2A2A;
    padding: 20px;
    border-radius: 10px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
    max-width: 300px; /* Ensure consistent item width */
}

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

/* Center the last item ("Siding & Insulation") on wider screens */
@media (min-width: 768px) {
    .services-grid {
        grid-template-columns: repeat(3, minmax(250px, 1fr)); /* Force 3 columns on wider screens */
    }
    .service-item:last-child {
        grid-column: 2 / 3; /* Center the last item in the grid */
    }
}

.service-item i {
    font-size: 2em;
    color: #D94F04;
    margin-bottom: 15px;
}

.service-item h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5em;
    color: #FFFFFF;
    margin-bottom: 10px;
}

.service-item p {
    color: #CCCCCC;
}

/* Gallery Section */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    max-width: 1000px;
    margin: 0 auto;
}

.gallery-grid.masonry {
    column-count: 3;
    column-gap: 20px;
    max-width: 1000px;
    margin: 0 auto;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    cursor: pointer;
    break-inside: avoid;
    margin-bottom: 20px;
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none; /* Prevent ::after from intercepting clicks */
}

.gallery-item:hover::after {
    opacity: 1;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    display: block;
    margin: auto;
    padding: 10px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #FFFFFF;
    font-size: 40px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.lightbox-close:hover {
    color: #F2A30F;
}

.lightbox-prev,
.lightbox-next {
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.7); /* Increased opacity for better visibility */
    color: #FFFFFF;
    border: none;
    font-size: 40px; /* Larger arrows */
    padding: 15px 20px; /* Larger clickable area */
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
    z-index: 1001;
}

.lightbox-prev {
    left: 40px; /* Moved further from the image */
}

.lightbox-next {
    right: 40px; /* Moved further from the image */
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background-color: rgba(0, 0, 0, 0.9);
    transform: translateY(-50%) scale(1.1);
}

/* Contact Section */
.contact-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
}

form {
    background-color: #2A2A2A;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 500px;
    margin-bottom: 30px;
}

label {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.1em;
    color: #FFFFFF;
    margin-bottom: 5px;
    display: block;
    text-align: left;
}

input, textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #4F4F4F;
    border-radius: 5px;
    background-color: #1A1A1A;
    color: #FFFFFF;
    font-size: 1em;
}

input:focus, textarea:focus {
    border-color: #D94F04;
    outline: none;
}

button {
    width: 100%;
    padding: 15px;
    background-color: #D94F04;
    color: #FFFFFF;
    border: none;
    border-radius: 5px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

button:hover {
    background-color: #F2A30F;
    transform: scale(1.05);
}

.contact-info {
    list-style: none;
    padding: 0;
    width: 100%;
    max-width: 500px;
}

.contact-info li {
    background-color: #2A2A2A;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 5px;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.contact-info li:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.contact-info li i {
    margin-right: 10px;
    color: #D94F04;
}

.contact-info li strong {
    color: #F2A30F;
}

.contact-info li a {
    color: #4A90E2;
    text-decoration: none;
}

.contact-info li a:hover {
    text-decoration: underline;
}

/* Back to Top Button */
#back-to-top {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #D94F04;
    color: #FFFFFF;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 24px;
    cursor: pointer;
    z-index: 100;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

#back-to-top:hover {
    background-color: #F2A30F;
    transform: scale(1.1);
}

/* Footer */
footer {
    background-color: #2A2A2A;
    color: #FFFFFF;
    text-align: center;
    padding: 20px 15px; /* Added horizontal padding to prevent content from touching edges */
    font-size: 0.9em;
    width: 100%; /* Full width */
}

footer a {
    color: #4A90E2;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.section {
    animation: slideIn 0.8s ease-out;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .sticky-header {
        padding: 10px 15px;
        position: relative;
        justify-content: center; /* Center the content */
    }

    .logo {
        flex: 1;
        text-align: center;
        margin: 0; /* Remove any margin to ensure proper centering */
    }

    .logo-img {
        max-width: 100px;
    }

    .hamburger {
        display: block;
        position: absolute;
        top: 50%;
        right: 15px;
        transform: translateY(-50%);
    }

    .close-menu {
        display: none;
        position: fixed;
        top: 15px;
        right: 15px;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        position: fixed;
        top: 0;
        right: 0;
        width: 100%; /* Full width for mobile menu */
        height: 100vh;
        background-color: #F5F5F5;
        padding: 60px 20px;
        z-index: 100;
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
    }

    .nav-links.active {
        display: flex;
        transform: translateX(0);
    }

    .nav-links li a {
        font-size: 1.2em;
        padding: 10px 20px;
        color: #333333;
    }

    .nav-links li a:hover {
        background-color: #D94F04;
        color: #FFFFFF;
    }

    .nav-backdrop.active {
        display: block;
    }

    .hero {
        height: 80vh;
    }

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

    .subheadline {
        font-size: 1.2em;
    }

    .slogan {
        font-size: 1.1em;
    }

    .cta-button {
        padding: 12px 25px;
        font-size: 0.9em;
    }

    .section {
        padding: 50px 15px;
    }

    h2 {
        font-size: 2em;
    }

    .owner-grid {
        max-width: 400px; /* Reduced max-width for better centering on mobile */
    }

    .services-grid {
        max-width: 260px; /* Further reduced max-width for better centering on mobile */
        margin: 0 auto;
        justify-items: center; /* Center items within the grid */
        align-items: center; /* Vertically center items */
    }

    .service-item {
        width: 100%;
        max-width: 240px; /* Adjusted to fit within the smaller grid container */
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        max-width: 500px;
    }

    .gallery-grid.masonry {
        column-count: 2;
        max-width: 500px;
    }

    .contact-container {
        max-width: 500px;
    }

    form {
        padding: 20px;
    }

    .contact-info li {
        padding: 12px;
        font-size: 1em;
        background-color: #333333; /* Slightly lighter background for contrast */
        border: 1px solid #F2A30F; /* Subtle orange border for pop */
        display: flex;
        align-items: center;
        flex-wrap: wrap; /* Allow wrapping for long text */
        gap: 5px; /* Add spacing between icon and text */
    }

    .contact-info li i {
        font-size: 1.2em;
        flex-shrink: 0; /* Prevent icon from shrinking */
    }

    .contact-info li a {
        word-break: break-all; /* Break long email addresses */
    }

    .lightbox-content {
        max-width: 95%;
        max-height: 85%;
        padding: 5px;
    }

    .lightbox-close {
        top: 15px;
        right: 20px;
        font-size: 30px;
    }

    .lightbox-prev,
    .lightbox-next {
        font-size: 30px; /* Slightly smaller for mobile */
        padding: 10px 15px; /* Adjusted padding for mobile */
    }

    .lightbox-prev {
        left: 15px; /* Closer to edge on mobile */
    }

    .lightbox-next {
        right: 15px; /* Closer to edge on mobile */
    }

    .lightbox-prev:hover,
    .lightbox-next:hover {
        transform: translateY(-50%) scale(1.1);
    }

    #back-to-top {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2em;
    }

    .subheadline {
        font-size: 1em;
    }

    .slogan {
        font-size: 0.9em;
    }

    .cta-button {
        padding: 10px 20px;
        font-size: 0.85em;
    }

    h2 {
        font-size: 1.8em;
    }

    .owner-grid {
        max-width: 300px; /* Further reduced for very small screens */
    }

    .services-grid {
        max-width: 200px; /* Further reduced for very small screens */
        margin: 0 auto;
        justify-items: center; /* Center items within the grid */
        align-items: center; /* Vertically center items */
    }

    .service-item {
        max-width: 180px; /* Adjusted to fit within the smaller grid container */
    }

    .gallery-grid.masonry {
        column-count: 1;
        max-width: 300px;
    }

    .contact-container {
        max-width: 300px;
    }

    form {
        padding: 15px;
    }

    .contact-info li {
        padding: 10px;
        font-size: 0.95em;
    }

    .contact-info li i {
        font-size: 1em;
    }

    .lightbox-content {
        max-width: 98%;
        max-height: 80%;
        padding: 5px;
    }

    .lightbox-close {
        top: 10px;
        right: 15px;
        font-size: 25px;
    }

    .lightbox-prev,
    .lightbox-next {
        font-size: 25px; /* Smaller for very small screens */
        padding: 8px 12px; /* Adjusted padding */
    }

    .lightbox-prev {
        left: 10px; /* Closer to edge on very small screens */
    }

    .lightbox-next {
        right: 10px; /* Closer to edge on very small screens */
    }

    .lightbox-prev:hover,
    .lightbox-next:hover {
        transform: translateY(-50%) scale(1.1);
    }
}