/* ============================= */
/* 1. BASE STYLES AND TYPOGRAPHY */
/* ============================= */
body {
    /* Use a modern, clean font stack */
    font-family: 'Helvetica Neue', Arial, sans-serif; 
    margin: 0;
    padding: 0;
    background-color: #f4f4f4; /* Light gray background */
    color: #333;
    line-height: 1.6;
}

header {
    text-align: center;
    padding: 20px;
    background-color: #004d99; /* Deep blue header */
    color: white;
}

h1 {
    font-size: 2.5em;
    margin-bottom: 5px;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    margin: 0 10px;
}

nav a:hover {
    text-decoration: underline;
}

footer {
    text-align: center;
    padding: 15px;
    margin-top: 20px;
    border-top: 1px solid #ccc;
    background-color: #e9e9e9;
    font-size: 0.8em;
}

/* =============================== */
/* 2. RESPONSIVE PHOTO GALLERY GRID */
/* =============================== */
.photo-gallery {
    display: grid;
    /* Create a responsive grid: 
       4 columns max, but adjusts down to 1 column on small screens */
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px; /* Space between gallery items */
    padding: 20px;
    max-width: 1200px; /* Limits width on ultra-wide screens */
    margin: 0 auto;
}

.gallery-item {
    background-color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Subtle shadow for depth */
    border-radius: 8px;
    overflow: hidden; 
    transition: transform 0.3s;
}

.gallery-item:hover {
    transform: translateY(-5px); /* Lift effect on hover */
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.gallery-item img {
    width: 100%;
    height: 150px; /* Fixed height for consistent grid look */
    display: block;
    object-fit: cover; /* Ensures images cover the area without distortion */
}

figcaption {
    padding: 10px;
    text-align: center;
    font-size: 0.9em;
    font-style: italic;
    color: #555;
    min-height: 40px; /* Ensures all captions have space */
}

/* ===================== */
/* 3. LIGHTBOX MODAL (The Fix) */
/* ===================== */
#lightbox {
    /* CRITICAL: Lifts the element out of the page flow and fixes it to viewport */
    position: fixed; 
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    
    /* Overlay and Centering */
    background-color: rgba(0, 0, 0, 0.9); 
    display: flex;
    justify-content: center;
    align-items: center;
    
    /* CRITICAL: Ensures it sits above all other page content */
    z-index: 1000; 
    cursor: pointer;
}

#lightbox.hidden {
    display: none;
}

#lightbox-image {
    max-width: 90%;
    max-height: 90%;
    border-radius: 5px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.4);
    pointer-events: none; /* Prevents click on image from closing lightbox */
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.close-btn:hover {
    color: #f00; /* Red on hover for high contrast */
}