/* Import Font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500&display=swap');

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

body {
    font-family: 'Inter', sans-serif;
    background-color: #f8f8f8; /* Slightly off-white */
    color: #333; /* Dark grey */
    line-height: 1.6;
}

/* Header and Navigation */
header {
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 20px 30px; 
    border-bottom: 1px solid #eee;
    margin-bottom: 30px;
}

.site-title {
    font-weight: 500; 
    font-size: 1.2rem;
    text-transform: uppercase; 
    letter-spacing: 0.5px;
}

nav ul {
    list-style: none;
}

nav ul li {
    display: inline-block;
    margin: 0 15px;
}

nav button {
    font-family: inherit;
    font-size: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #555;
    padding: 5px 0;
    border-bottom: 2px solid transparent;
    transition: color 0.3s ease, border-bottom-color 0.3s ease;
}

nav button:hover,
nav button.active {
    color: #000;
    border-bottom-color: #000;
}

/* Add padding to main content area */
main {
    padding: 0 20px; /* Add horizontal padding */
}

/* Intro Text Toggle and Box */
.intro-container {
    text-align: center;
    margin-bottom: 20px; /* Space between intro and grid */
    overflow: hidden; /* Contain elements during transition */
    /* Add centering to match the grid */
    max-width: 1400px; /* Match grid max-width */
    margin-left: auto; 
    margin-right: auto;
}

.intro-toggle {
    display: inline-block;
    cursor: pointer;
    font-size: 1.2rem;
    color: #888; /* Lighter grey for subtlety */
    padding: 5px 10px;
    margin-bottom: 10px; /* Space between toggle and potential text */
    transition: color 0.3s ease;
}

.intro-toggle:hover {
    color: #333;
}

.intro-text-box {
    max-height: 0; /* Initially hidden */
    overflow: hidden;
    transition: max-height 0.5s ease-out, padding 0.5s ease-out; /* Smooth transition */
    font-size: 0.95rem;
    color: #555;
    /* Remove initial padding */
    /* padding: 0 20px; */ 
}

.intro-text-box.show {
    max-height: 100px; /* Arbitrary large enough height to reveal content */
    padding: 15px 20px; /* Add padding ONLY when shown */
}

.intro-text-box p {
    max-width: 600px; /* Limit width of the text */
    margin: 0 auto; /* Center the paragraph within the box */
}

/* Image Grid - Using Flexbox */
.image-grid {
    display: flex; 
    flex-wrap: wrap; 
    gap: 5px; 
    /* padding: 0 5px; */ /* Remove direct padding if main has padding */
    /* Add max-width and center */
    max-width: 1400px; /* Example max-width, adjust as needed */
    margin: 0 auto; /* Center the grid */
}

.image-grid .grid-item {
    overflow: hidden; 
    flex: 1 1 250px; /* Grow, Shrink, Basis - controls width */
    height: 300px; /* ADDED - Fixed height for consistent aspect ratio */
}

/* REMOVED Hidden state for filtered-out items */
/* 
.grid-item.hidden {
    opacity: 0;
    max-height: 0; 
    max-width: 0;
    min-width: 0;
    flex-basis: 0 !important; 
    margin: 0 !important; 
    padding: 0 !important; 
    border: none !important; 
    pointer-events: none; 
    overflow: hidden; 
}
*/

.image-grid img {
    display: block;
    width: 100%; 
    height: 100%; /* RE-ADDED - Fill the container height */
    object-fit: cover; /* RE-ADDED - Cover the area, cropping if needed */
    cursor: pointer;
}

/* REMOVE Hover effect */
/* 
.image-grid img:hover {
    transform: scale(1.03);
}
*/

/* Modal Styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    /* background-color: rgba(0, 0, 0, 0.85); */ /* Old dark overlay */
    background-color: #ffffff; /* CHANGED to white */
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex; /* Show the modal */
    /* opacity: 1; */ /* REMOVED - No longer needed for transition */
}

.modal-content {
    display: block;
    margin: auto;
    max-width: 90%;
    max-height: 90vh;
    /* Add transition for zoom effect */
    transition: transform 0.3s ease;
    cursor: zoom-in; /* Indicate zoom is possible */
}

/* REMOVE Modal Animation */
/* 
@keyframes fadeInScale {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}
*/

.close-button {
    position: absolute;
    top: 20px;
    right: 35px;
    /* color: #f1f1f1; */ /* Old light color */
    color: #333; /* CHANGED to dark grey */
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-button:hover,
.close-button:focus {
    /* color: #bbb; */ /* Old light hover color */
    color: #666; /* CHANGED to a medium grey for hover */
    text-decoration: none;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    header {
        padding: 15px 20px; 
    }
    .site-title {
        font-size: 1.1rem;
    }
    nav ul li {
        margin: 0 10px;
    }
    nav button {
        font-size: 0.9rem;
    }
    .image-grid {
        gap: 3px;
        padding: 0 3px;
    }
    .image-grid .grid-item {
        flex-basis: 150px; /* Adjust basis for smaller screens */
    }
}

@media (max-width: 480px) {
    header {
        padding: 15px 15px; 
        flex-direction: column; 
        align-items: flex-start; 
    }
    .site-title {
        margin-bottom: 10px; 
        font-size: 1rem;
    }
    nav ul {
        width: 100%; 
        text-align: left; 
    }
    nav ul li {
        margin: 0 8px 0 0; 
    }
    nav button {
        font-size: 0.85rem;
    }
    .image-grid {
        gap: 2px;
        padding: 0 2px;
    }
     .image-grid .grid-item {
        flex-basis: calc(50% - 2px); /* Approx 2 columns with gap */
    }
    .modal-content {
        max-width: 95%;
        max-height: 85vh;
    }
    .close-button {
        font-size: 30px;
        top: 15px;
        right: 25px;
    }
} 