/* Base Setup */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow-x: hidden; /* This is good to prevent horizontal scroll */
}

.page-wrapper {
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    padding-top: 80px;
}

body.home main {
    padding-top: 0;
}

body.home header.scrolled + main {
    padding-top: 80px;
}

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    color: #333;
    background-color: #f5f7fa;
    line-height: 1.6;
}

a {
    color: #2A9D8F;
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: #E76F51;
}

/* Header & Navigation */
header {
    height: 80px;
    width: 100%;
    position: fixed;
    top: 0;
    z-index: 10;
    background-color: transparent;
    color: #333;
    transition: background-color 0.3s ease, box-shadow 0.3s ease, color 0.3s ease;
    box-sizing: border-box;
}

header nav a {
    margin-left: 1.5rem;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    transition: color 0.3s;
}

header nav a:hover {
    border-bottom: 2px solid #E76F51;
}

.menu-toggle {
    display: none;
    font-size: 2rem;
    cursor: pointer;
    box-sizing: border-box;
}

header.scrolled {
    background-color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    color: #333;
}

header.scrolled nav a {
    color: #333;
}

.logo {
    flex-shrink: 0;
}

.logo img {
    max-height: 50px;
    padding-top: 0.5rem;
}

/* Hero Section */
.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    width: 100%;
    color: white;
    text-align: center;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

.hero h1 {
    font-size: 3rem;
    max-width: 100%;
    background: rgba(0, 0, 0, 0.6);
    padding: 1.5rem;
    border-radius: 12px;
    animation: fadeIn 2s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Content Section */
.content {
    padding: 4rem 3rem;
    max-width: 1000px;
    margin: 0 auto;
}

.content h1, .content h2, .content h3 {
    color: #222;
    margin-bottom: 1rem;
}

.content p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.content ul {
    list-style-type: disc;
    padding-left: 1.5rem;
}

.content ul li {
    margin-bottom: 1.5rem;
}

/* Blockquote */
blockquote {
    font-style: italic;
    margin: 2rem 0;
    padding-left: 1.5rem;
    border-left: 4px solid #2A9D8F;
    background-color: #f0f8ff;
    padding: 1rem;
    border-radius: 6px;
}

/* Buttons */
.button {
    display: inline-block;
    margin-top: 1.5rem;
    padding: 0.75rem 1.5rem;
    background-color: #F4A261;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
    transition: background-color 0.3s, color 0.3s;
}

.button:hover {
    background-color: #E76F51;
    color: white;
}

.button-wrapper {
    text-align: center;
    margin-top: 1.5rem;
}

.button.outline {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    color: white;
    border: 2px solid white;
    text-align: center;
}

.button.outline:hover {
    background-color: white;
    color: #F4A261;
}

/* Contact CTA Section */
.contact-cta {
    display: flex;
    justify-content: center;
    background-image: url('../images/pattern.png');
    background-color: #F4A261;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 3rem 2rem;
    border-radius: 8px;
    margin: 4rem auto;
}

.contact-cta > .page-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.contact-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.contact-content h2 {
    margin-bottom: 0.5rem;
}

.contact-content .subtext {
    font-size: 1.2rem;
    font-weight: normal;
    margin: 0;
}

.contact-action {
    display: flex;
    justify-content: flex-end;
}

/* Footer */
.site-footer {
    text-align: center;
    background-color: #eaeaea;
    color: #333;
    padding: 1rem 0;
    font-size: 0.9rem;
    margin-top: auto;
}

/* Profile and Investment Images */
.profile-pic {
    max-width: 200px;
    border-radius: 50%;
    margin-bottom: 1.5rem;
}

.investment img {
    max-width: 150px;
    margin-bottom: 0.5rem;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .logo img {
        padding-left: 0.5rem; /* Mobile-specific left padding */
    }
    
    header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .menu-toggle {
        display: block;
    }

    nav {
        display: none;
        flex-direction: column;
        width: 100%;
        background-color: white;
        position: absolute;
        top: 80px;
        left: 0;
        margin-top: 0;
        justify-content: space-around;
    }

    nav a {
        padding: 1rem;
        border-bottom: 1px solid #ddd;
        color: #333;
        margin-left: 0;
    }

    nav.active {
        display: flex;
    }

    .hero h1 {
        font-size: 2rem;
        padding: 1rem;
        max-width: 90%;
    }

    .content {
        padding: 2rem 1.5rem;
    }

    .contact-cta {
        flex-direction: column;
        text-align: center;
        margin: 2rem 1.5rem;
    }

    .contact-cta > .page-container {
        flex-direction: column;
        text-align: center;
    }

    .contact-content {
        max-width: 100%;
        margin-bottom: 1.5rem;
    }

    .contact-action {
        justify-content: center;
    }

    /* This is the key adjustment */
    header > .page-container {
        padding: 0 1rem; /* Ensure consistent horizontal padding for header content */
        width: calc(100% - 2rem); /* Account for the padding in the width calculation */
        box-sizing: border-box; /* Make sure padding is included in the element's total width and height */
    }
}

.signature {
    text-align: right;
    font-style: italic;
    margin-top: 2rem;
}

.scroll-animate {
    opacity: 0;
    transform: scale(0.9);
    transition: transform 0.6s ease, opacity 0.6s ease;
}

.scroll-animate.visible {
    opacity: 1;
    transform: scale(1);
}

.page-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1rem;
    width: 100%;
	box-sizing: border-box;
}

header > .page-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    /* Added box-sizing to header's page-container for consistency */
    box-sizing: border-box; 
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 columns on desktop */
    gap: 1rem;
    margin: 3rem 0;
}

@media (max-width: 768px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on mobile */
    }
}


.portfolio-item {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1; /* Force perfect square blocks */
    overflow: hidden;
    cursor: pointer;
    display: block;
    background-color: #f9f9f9; /* Optional: background behind logo */
}

.portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: transform 0.3s ease;
    padding: 0.5rem; /* Ensure clean breathing room */
    box-sizing: border-box; /* Prevent overflow from padding */
}


.portfolio-item:hover img {
    transform: scale(1.05);
}

.portfolio-item .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Default fallback */
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    text-align: center;
    padding: 1rem;
    box-sizing: border-box;
}

.portfolio-item.brick:hover .overlay { background-color: rgba(72, 124, 148, 0.85); }
.portfolio-item.ruggable:hover .overlay { background-color: rgba(147, 75, 50, 0.85); }
.portfolio-item.squatch:hover .overlay { background-color: rgba(31, 53, 33, 0.85); }


.portfolio-item:hover .overlay {
    opacity: 1;
}

.overlay h3 {
    margin: 0.5rem 0;
    color: white;
}

.overlay p {
    font-size: 0.9rem;
}

.portfolio-item.active .overlay {
    opacity: 1;
}