:root {
    --primary: #1a1a1a;
    --secondary: #8c7355;
    /* Gold/Bronze accent for premium construction feel */
    --accent: #d4a373;
    --background: #fdfcfb;
    --surface: #ffffff;
    --text: #333333;
    --text-light: #666666;
    --border: #e0e0e0;

    --font-heading: 'Playfair Display', serif;
    --font-body: 'Outfit', sans-serif;

    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 4rem;
    --space-xl: 8rem;

    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.08);
}

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

body {
    font-family: var(--font-body);
    background-color: var(--background);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

/* Header */
.site-header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1.5rem 0;
    transition: all 0.3s ease;
}

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

.brand-logo {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.brand-logo span {
    color: var(--secondary);
}

.main-nav ul {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.main-nav a {
    text-decoration: none;
    color: var(--primary);
    font-weight: 500;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-bottom: 4px;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--secondary);
    border-color: var(--secondary);
}

/* Hero Section */
.hero {
    padding: var(--space-xl) 0;
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('assets/hero-bg.jpg');
    /* Need a default hero image */
    background-size: cover;
    background-position: center;
    color: white;
    text-align: center;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-lg);
}

.hero h1 {
    font-family: var(--font-heading);
    font-size: 4rem;
    margin-bottom: var(--space-sm);
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.hero p {
    font-size: 1.25rem;
    max-width: 600px;
    margin: 0 auto;
    opacity: 0.9;
}

/* Gallery Grid */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.project-card {
    background: var(--surface);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-md);
}

.card-image {
    height: 250px;
    background-color: #f0f0f0;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
}

.card-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.5), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.project-card:hover .card-image::after {
    opacity: 1;
}

.card-image.no-image {
    background: linear-gradient(135deg, var(--surface) 0%, #f0f0f0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-image.no-image::before {
    content: '';
    width: 40px;
    height: 40px;
    border: 2px solid var(--secondary);
    border-radius: 50%;
    opacity: 0.3;
}

.card-image.no-image::after {
    display: none;
    /* No hover overlay needed here */
}

.card-content {
    padding: 1.5rem;
}

.card-content h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.card-content p {
    color: var(--text-light);
    font-size: 0.9rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Single Post View */
.post-header {
    margin-bottom: var(--space-lg);
    text-align: center;
}

.post-header h1 {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    color: var(--primary);
    margin-bottom: var(--space-sm);
}

.post-content {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.1rem;
    color: var(--text);
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: var(--space-md) 0;
}

/* WP Content Styles */
.wp-block-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
    padding: 0;
    list-style: none;
}

.wp-block-gallery .wp-block-image {
    margin: 0;
    display: flex;
    flex-direction: column;
}

.wp-block-gallery .wp-block-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 3/2;
    /* Standardize aspect ratio */
    border-radius: 4px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease;
    display: block;
}

.wp-block-gallery .wp-block-image img:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-md);
}

/* Remove default margins from figures in content */
.post-content figure {
    margin: 0;
}

/* Footer */
.site-footer {
    background-color: var(--primary);
    color: white;
    padding: var(--space-lg) 0 var(--space-md);
    margin-top: var(--space-xl);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.footer-col h3 {
    font-family: var(--font-heading);
    margin-bottom: 1.5rem;
    color: var(--accent);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: var(--space-md);
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

/* Utilities */
.fade-in {
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--secondary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: var(--space-lg) auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Page Views */
.page-view {
    padding-top: var(--space-lg);
    padding-bottom: var(--space-xl);
    animation: fadeIn 0.8s ease-out;
}

.page-view h1 {
    font-family: var(--font-heading);
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: var(--space-md);
    text-align: center;
}

.page-view-content {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.15rem;
    color: var(--text-light);
    line-height: 1.8;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-md);
    margin-top: var(--space-lg);
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.contact-card {
    background: white;
    padding: var(--space-md);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.contact-card h3 {
    font-family: var(--font-heading);
    margin-bottom: 1rem;
    color: var(--secondary);
}

/* Mobile */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 2px;
    background-color: var(--primary);
    margin: 5px 0;
    transition: 0.3s;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    /* Although only 2 spans in HTML, nice to have robust CSS or fix HTML */
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Wait, HTML only has 2 spans. Let's fix HTML or just animate 2 lines */
/* Actually, let's just make sure HTML has 3 spans or adapt animation */
/* For now, assuming we will add a 3rd span or this is fine */

@media (max-width: 768px) {
    .site-header {
        padding: 1rem 0;
    }

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

    .project-grid {
        grid-template-columns: 1fr;
    }

    .main-nav ul {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background: white;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
        z-index: 1000;
    }

    .main-nav ul.active {
        right: 0;
    }

    .mobile-menu-toggle {
        display: block;
    }
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    pointer-events: all;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    background: transparent;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    background: none;
    border: none;
    padding: 10px;
    line-height: 1;
    z-index: 2001;
}

.lightbox-caption {
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 100%;
    text-align: center;
    color: white;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}