/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cormorant Garamond', serif;
    line-height: 1.6;
    color: #333;
    overflow-x: hidden;
}

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

/* Header Styles */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(58, 54, 54, 0.432);
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
}

.nav-left {
    flex: 1;
    display: flex;
    justify-content: flex-start;
}

.logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo img {
    height: 80px;
    width: auto;
}

.brand-text {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    text-transform: none;
    letter-spacing: 1px;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2.5rem;
    flex: 1;
    justify-content: flex-end;
    background: transparent; /* use pseudo-element for blur */
    position: relative; /* anchor pseudo-element */
}

/* Removed desktop nav overlay to avoid stripe over nav links */

/* Ensure menu items render above the blur overlay */
.nav-menu > * {
    position: relative;
    z-index: 1;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: white;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8), 0 0 20px rgba(255, 255, 255, 0.6);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    z-index: 1001;
    width: 30px;
    height: 24px;
    justify-content: space-between;
    padding: 4px 0;
}

.bar {
    width: 100%;
    height: 2px;
    background-color: white;
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

/* Hero Section */
.hero {
    height: 90vh;
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('images/hero-bg-1920.webp');
    background-size: cover;
    background-position: bottom;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    padding-top: 100px;
    position: relative; /* enable pseudo-elements at edges */
}

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

.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    white-space: normal; /* allow wrapping */
    overflow: visible; /* show full text */
    text-overflow: clip; /* no ellipsis */
    line-height: 1.2; /* balanced line height */
}

.hero-subtitle {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.25rem;
    margin-bottom: 2rem;
    font-weight: 400;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 12px 30px;
    background-color: #3a3636;
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    border: 2px solid #3a3636;
    cursor: pointer;
}

.btn:hover {
    background-color: transparent;
    color: #3a3636;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background-color: #3a3636;
    border-color: #3a3636;
    color: white;
}

.btn-primary:hover {
    background-color: transparent;
    color: #3a3636;
}

.btn-secondary {
    background-color: transparent;
    color: white;
    border-color: white;
}

.btn-secondary:hover {
    background-color: white;
    color: #333;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.3);
}

/* Ensure secondary buttons are visible on light sections */
.services--plain .btn-secondary,
.about .btn-secondary,
.gallery .btn-secondary,
.contact .btn-secondary {
    background-color: transparent;
    color: #333;
    border-color: #333;
}

.services--plain .btn-secondary:hover,
.about .btn-secondary:hover,
.gallery .btn-secondary:hover,
.contact .btn-secondary:hover {
    background-color: #333;
    color: #fff;
}

/* Section Styles */
section {
    padding: 80px 0;
}

/* Gallery Section */
.gallery {
    background-color: #f7f7f7;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.gallery-item {
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    position: relative;
    margin: 0;
    aspect-ratio: 1 / 1; /* ensures square cards for a clean 2x2 */
}

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

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

@media (max-width: 992px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .gallery-item {
        aspect-ratio: 4 / 3; /* slightly shorter tiles on tablets */
    }
}

@media (max-width: 600px) {
    /* Mobile: make hero fill the viewport */
    .hero {
        height: 90vh;
        min-height: 90svh; /* safe viewport on mobile */
        background-attachment: scroll;
        background-image: linear-gradient(rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.35)), url('images/hero-bg-768.webp');
        padding-top: 90px; /* keep content clear of fixed header */
    }

    /* Triangle notch: downward white triangle from hero into next section */
    .hero::after {
        content: '';
        position: absolute;
        left: 50%;
        bottom: 0;
        transform: translateX(-50%);
        width: 0;
        height: 0;
        border-left: 10vw solid transparent; /* half current width */
        border-right: 10vw solid transparent; /* half current width */
        border-bottom: 4vh solid #ffffff; /* half current height */
        z-index: 2;
        pointer-events: none;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    .gallery {
        padding: 40px 0; /* reduce vertical spacing on mobile */
    }
    .gallery-item {
        aspect-ratio: 3 / 2; /* shorter tiles to avoid huge height */
    }
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    color: #333;
}

/* Services Section */
 .services {
     background-image: url('images/services-bg-1920.webp');
     background-size: cover;
     background-position: center;
     background-attachment: fixed;
     position: relative;
     padding: 100px 0;
}

.services::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1;
}

.services .section-title {
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.services .container {
    position: relative;
    z-index: 2;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
    margin-top: 2rem;
}

.service-card {
    background: white;
    padding: 3rem 2.5rem;
    border-radius: 0;
    text-align: left;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-top: 4px solid #333;
    display: flex;
    flex-direction: column;
    min-height: 400px;
}

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

.service-header {
    margin-bottom: 2rem;
}

.service-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.service-subtitle {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.9rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 400;
    display: block;
    margin-bottom: 0.5rem;
}

.service-card h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.service-card p {
    font-family: 'Cormorant Garamond', serif;
    color: #666;
    line-height: 1.7;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.service-card .btn {
    margin-top: auto;
    align-self: flex-start;
}

.service-card p:last-of-type {
    margin-bottom: 2rem;
}

/* Feature cards (Why Choose Us) */
.feature-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-top: 1rem;
}

.feature-card {
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: flex;
    flex-direction: column;
    text-align: center; /* center feature card content */
}

.feature-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 32px rgba(0,0,0,0.12);
}

.feature-image img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.feature-body {
    padding: 1rem 1.25rem 1.25rem;
}

.feature-body h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.feature-body p {
    color: #666;
    line-height: 1.7;
    font-size: 1rem;
}

/* Center content on plain services section (Custom Homes page) */
.services--plain .container {
    text-align: center;
}

.services--plain .section-subtitle,
.services--plain .section-title {
    text-align: center;
}

.services--plain .service {
    align-items: center;
    text-align: center;
}

.services--plain .feature-cards {
    justify-items: center;
}

/* Center content on About page */
.about .container,
.about .about-text,
.about .about-text .section-title {
    text-align: center;
}

/* About Section */
.about {
    background-color: white;
    padding: 60px 0; /* reduce top spacing above OUR STORY */
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.about-text {
    text-align: left;
}

.section-subtitle {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.9rem;
    color: #3a3636;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 1rem;
    position: relative;
}

.section-subtitle::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -0.5rem;
    width: 40px;
    height: 2px;
    background-color: #3a3636;
    transform: translateX(-50%);
}

.about-text .section-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 2rem;
    line-height: 1.2;
    text-align: left;
}

.about-text p {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: #666;
    line-height: 1.8;
}

.about-text .btn {
    margin-top: 1rem;
}

.about-image {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.about-image img {
    width: 100%;
    height: 400px;
    object-fit: fill;
    transition: transform 0.3s ease;
    transform: scale(1.05);
}

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

.about-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.stat {
    text-align: center;
}

.stat h3 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #007bff;
    margin-bottom: 0.5rem;
}

.stat p {
    font-weight: 500;
    color: #666;
}

/* Contact Section */
.contact {
    background-color: #f8f9fa;
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    margin-top: 2rem;
    
}

.contact-info h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #333;
}

.contact-info p {
    color: #666;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.contact-item strong {
    min-width: 100px;
    color: #333;
}

/* Contact Form Styles */
.contact-form {
    width: 100%;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3a3636;
}

.form-group textarea {
    height: 120px;
    resize: vertical;
}

/* Footer */
.footer {
    background-color: #3a3636;
    color: white;
    text-align: center;
    padding: 3rem 0;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: white;
}

.footer-section p,
.footer-section a {
    font-family: 'Cormorant Garamond', serif;
    color: #ccc;
    text-decoration: none;
    line-height: 1.6;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid #555;
    padding-top: 2rem;
    font-family: 'Cormorant Garamond', serif;
    color: #ccc;
}

/* Responsive Design */
@media (max-width: 992px) {
    .header {
        padding: 0.5rem 0;
    }

    .nav-container {
        padding: 0 1rem;
    }

    .nav-left {
        display: none;
    }

    .logo {
        position: static;
        transform: none;
        left: auto;
    }

    .logo img {
        height: 50px;
    }

    .brand-text {
        font-size: 1rem;
    }

    .nav-menu {
        gap: 1.5rem;
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100vh;
        background: transparent; /* blur via pseudo-element */
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding-top: 0;
        transition: left 0.3s ease;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        z-index: 2000; /* ensure above full-page overlay */
    }

    /* Fullscreen blur overlay across the entire page when menu is open */
    body.nav-open::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
        z-index: 1000; /* below menu, above header */
        pointer-events: none;
    }

    /* Prevent background scrolling while menu is open */
    body.nav-open {
        overflow: hidden;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu li {
        margin: 2rem 0;
    }

    .nav-link {
        font-size: 1.5rem;
        color: white;
    }

    /* Ensure menu links render above any menu background/overlay */
    .nav-menu li,
    .nav-menu a,
    .nav-menu .nav-link {
        position: relative;
        z-index: 2001; /* links above any background */
        text-shadow: 0 1px 2px rgba(0,0,0,0.4); /* improve contrast */
    }

    .hamburger {
        display: flex;
        position: relative;
        z-index: 3000; /* above menu and overlay */
    }

    .hamburger.active {
        position: fixed;
        top: 14px;
        right: 16px;
        z-index: 3001; /* ensure clickability when active */
    }

    /* Center bars inside the button area when active */
    .hamburger.active .bar {
        position: absolute;
        left: 50%;
        top: 50%;
        width: 100%;
        transform: translate(-50%, -50%);
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translate(-50%, -50%) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0);
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translate(-50%, -50%) rotate(-45deg);
    }

    .hero {
        padding-top: 80px;
    }

    .hero-content {
        text-align: left;
    }

    .hero-title {
        font-size: 2rem;
        white-space: normal;
        line-height: 38px;

    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: flex-start;
    }

    .section-title {
        font-size: 2rem;
    }

    .services-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .feature-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .about-text {
        text-align: center;
    }

    .about-text .section-title {
        font-size: 2rem;
    }

    /* Show text above image in the stacked mobile layout */
    .about-image {
        order: 1;
    }

    .service-card {
        padding: 2rem 1.5rem;
    }

    .service-card h3 {
        font-size: 1.5rem;
    }

    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .about-stats {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
}

@media (max-width: 480px) {
    .hero {
        background-attachment: scroll;
    }

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

    .container {
        padding: 0 15px;
    }

    .feature-cards {
        grid-template-columns: 1fr;
    }

    .service-card {
        padding: 1.5rem;
    }

    section {
        padding: 60px 0;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Loading Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.service-card,
.about-content,
.contact-content {
    animation: fadeInUp 0.6s ease-out;
}

/* Plain services variant for pages that should not use a photo background */
.services--plain {
    background-image: none !important;
    background-color: #f7f7f7;
    background-attachment: scroll;
}

.services--plain::before {
    content: none !important;
}

.services--plain .section-title {
    color: #333;
    text-shadow: none;
}

/* Service text blocks styled as readable cards on plain background */
.services--plain .service {
    background: #ffffff;
    padding: 2rem;
    border: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    border-top: 4px solid #333;
    border-radius: 6px;
}

.services--plain .service h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    margin-bottom: 0.75rem;
}

.services--plain .service p {
    color: #666;
    line-height: 1.8;
    font-size: 1.05rem;
}

/* Extra responsive tweaks for cards */
@media (max-width: 992px) {
    .service-card { min-height: auto; }
    .about-stats { gap: 1rem; }
}

@media (max-width: 480px) {
    .service-card { min-height: auto; }
}