/* Base Variables & Reset */
:root {
    --brand-color: #6D73AA;
    --brand-dark: #565B88; /* Slightly darker for hover states */
    --brand-light: #F4F5F9; /* Very faint tint for section backgrounds */
    --text-main: #333333;
    --text-muted: #666666;
    --white: #FFFFFF;
    --border-color: #E2E2E2;
}

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

body {
    /* Using system fonts makes it look native and load instantly */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-main);
    background-color: var(--white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--brand-color);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--brand-dark);
}

/* Layout Utilities */
.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.grid {
    display: grid;
    gap: 30px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    border: 2px solid transparent;
}

.btn-primary {
    background-color: var(--brand-color);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--brand-dark);
    color: var(--white);
}

.btn-outline {
    background-color: transparent;
    color: var(--brand-color);
    border-color: var(--brand-color);
}

.btn-outline:hover {
    background-color: var(--brand-light);
}

/* Typography */
h1, h2, h3 {
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--brand-color);
}

.section-title {
    font-size: 2.25rem;
    text-align: center;
    margin-bottom: 3rem;
}

/* Header */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    display: flex;
    align-items: center;
    height: 50px; /* Keeps the logo a stable size */
}

.logo img {
    height: 100%;
    width: auto;
}

.site-nav {
    display: none; /* Hidden on small screens, shown in media query */
    gap: 30px;
}

.site-nav a {
    color: var(--text-main);
    font-weight: 500;
}

.site-nav a:hover {
    color: var(--brand-color);
}

/* Hero Section */
.hero {
    padding: 80px 0;
    background-color: var(--brand-light);
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.hero-inner h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 1.5rem;
}

.hero-inner p {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto 2.5rem;
}

.hero-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Services Section */
.services {
    padding: 80px 0;
}

.service-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.card {
    background: var(--white);
    border: 1px solid var(--border-color);
    padding: 30px;
    border-radius: 6px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.card h3 {
    font-size: 1.25rem;
    margin-bottom: 10px;
    color: var(--text-main);
}

.card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* About Section */
.about {
    padding: 80px 0;
    background-color: var(--brand-light);
}

.about-inner {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.about-content {
    flex: 1;
}

.about-content .section-title {
    text-align: left;
}

.about-content p {
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
}

.about-image-placeholder {
    flex: 1;
    background-color: #e2e4ef;
    min-height: 350px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--brand-color);
    font-weight: 500;
}

/* Contact Section */
.contact {
    padding: 80px 0;
}

.contact-grid {
    grid-template-columns: 1fr;
    gap: 50px;
}

.contact-info h3 {
    font-size: 1.5rem;
}

.contact-list {
    list-style: none;
    margin-top: 1.5rem;
}

.contact-list li {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.contact-form {
    background: var(--brand-light);
    padding: 30px;
    border-radius: 6px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--brand-color);
}

/* Footer */
.site-footer {
    background-color: var(--text-main);
    color: var(--white);
    padding: 40px 0;
    text-align: center;
}

.footer-inner p {
    color: #a0a0a0;
    margin-bottom: 5px;
}

/* Responsive Breakpoints */
@media (min-width: 768px) {
    .site-nav {
        display: flex;
    }

    .about-inner {
        flex-direction: row;
        align-items: center;
    }

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

.grid-gallery {
    --size: 100px;
    display: grid;
    grid-template-columns: repeat(6, var(--size));
    grid-auto-rows: var(--size);
    margin-bottom: var(--size);
    place-items: start center;
    gap: 5px;

    &:has(:hover) img:not(:hover),
    &:has(:focus) img:not(:focus){
        filter: brightness(0.5) contrast(0.5);
    }

    & img {
        object-fit: cover;
        width: calc(var(--size) * 2);
        height: calc(var(--size) * 2);
        clip-path: path("M90,10 C100,0 100,0 110,10 190,90 190,90 190,90 200,100 200,100 190,110 190,110 110,190 110,190 100,200 100,200 90,190 90,190 10,110 10,110 0,100 0,100 10,90Z");
        transition: clip-path 0.25s, filter 0.75s;
        grid-column: auto / span 2;
        border-radius: 5px;

        &:nth-child(5n - 1) {
            grid-column: 2 / span 2
        }

        &:hover,
        &:focus {
            clip-path: path("M0,0 C0,0 200,0 200,0 200,0 200,100 200,100 200,100 200,200 200,200 200,200 100,200 100,200 100,200 100,200 0,200 0,200 0,100 0,100 0,100 0,100 0,100Z");
            z-index: 1;
            transition: clip-path 0.25s, filter 0.25s;
        }

        &:focus {
            outline: 1px dashed black;
            outline-offset: -5px;
        }
    }
}

/* =========================================
   Gallery Carousel Additions
   ========================================= */
.gallery-carousel {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    width: 100%;
    margin: 0 auto;
}

.gallery-track-wrapper {
    overflow: hidden;
    width: 100%;
    /* Padding ensures the grid hover effects aren't cut off by overflow:hidden */
    padding: 20px 0;
}

.gallery-track {
    display: flex;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    gap: 50px; /* Space between pages */
}

/* Ensure each grid "page" takes up the full width */
.gallery-track .grid-gallery {
    flex: 0 0 100%;
    justify-content: center; /* Centers the honeycomb inside the slider */
}

/* Let users know they can click the images */
.grid-gallery img {
    cursor: pointer;
}

/* Arrow Buttons */
.gallery-nav {
    background: var(--white);
    color: var(--brand-color);
    border: 2px solid var(--brand-color);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.gallery-nav:hover {
    background: var(--brand-color);
    color: var(--white);
}


/* =========================================
   Lightbox (Pop-out Modal) Additions
   ========================================= */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px); /* Nice modern blur effect */
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Active class toggled by JavaScript */
.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.lightbox.active .lightbox-content {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: var(--white);
    font-size: 45px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.lightbox-close:hover {
    color: var(--brand-color);
}

/* --- Mobile Fixes --- */
@media (max-width: 768px) {
    /* 1. Simplify the grid layout to a clean 2-column design */
    .grid-gallery {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        place-items: stretch;
        margin-bottom: 0;
    }

    /* 2. Remove the heavy, hardcoded clip-path and make images responsive */
    .grid-gallery img {
        width: 100%;
        height: 150px; /* Keeps all images uniformly sized */
        object-fit: cover;
        grid-column: span 1 !important; /* Overrides the desktop spanning */
        clip-path: none !important; /* Kills the broken triangle mask */
        border-radius: 8px; /* Adds nice, simple rounded corners */
        transition: transform 0.2s; /* Lighter transition for performance */
    }

    /* 3. Disable the heavy sibling-fading filter that causes mobile lag */
    .grid-gallery:has(:hover) img:not(:hover),
    .grid-gallery:has(:focus) img:not(:focus){
        filter: none;
    }

    /* 4. Adjust carousel spacing and buttons */
    .gallery-carousel {
        gap: 10px;
    }

    .gallery-nav {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    /* 5. Move the lightbox 'X' button inward so it isn't cut off */
    .lightbox-close {
        top: 15px;
        right: 20px;
    }
}