/* --- GENERAL LAYOUT --- */
body {
    font-family: sans-serif;
    margin: 8px;
}

main {
    padding-top: 60px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
    position: sticky;
    top: 0;
    background-color: white;
    z-index: 1000;
    border-bottom: 1px solid #ccc;
}

/* --- MODAL / LIGHTBOX STYLES --- */

/* The Modal (background) */
.modal {
    display: none; /* Hidden by default */
    position: fixed; 
    z-index: 2000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: hidden; /* Prevents scroll bars if not needed */
    background-color: rgba(0,0,0,0.9); 
    
    /* CENTER ALIGNMENT MAGIC */
    flex-direction: column; /* Stack image and caption vertically */
    justify-content: center; /* Center vertically */
    align-items: center; /* Center horizontally */
}

/* Modal Content (image) */
.modal-content {
    display: block;
    width: auto; /* Let image decide width based on height */
    max-width: 90%; /* Don't touch edges */
    max-height: 80vh; /* Leave room for caption */
    object-fit: contain; /* Keep aspect ratio */
}

/* Caption of Modal Image */
#caption {
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    height: auto; /* Allow height to fit text */
    min-height: 40px;
    font-family: sans-serif;
}

/* Animation */
.modal-content, #caption {  
    animation-name: zoom;
    animation-duration: 0.3s;
}

@keyframes zoom {
    from {transform:scale(0.9); opacity: 0} 
    to {transform:scale(1); opacity: 1}
}

/* The Close Button */
.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 2001;
}

.close:hover,
.close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/* --- NAVIGATION ARROWS --- */
.prev, .next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -50px; /* Offset to center the arrow vertically */
    color: white;
    font-weight: bold;
    font-size: 30px;
    transition: 0.3s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    -webkit-user-select: none;
    z-index: 2001;
    background-color: rgba(0,0,0,0.3);
}

.next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.prev {
    left: 0;
    border-radius: 3px 0 0 3px;
}

.prev:hover, .next:hover {
    background-color: rgba(0,0,0,0.8);
}

/* Thumbnail Styles */
.modal-trigger {
    cursor: pointer;
    transition: 0.3s;
}
.modal-trigger:hover {
    opacity: 0.7;
}

@media only screen and (max-width: 700px){
    .modal-content {
        max-width: 100%;
    }
    .prev, .next {
        padding: 10px;
        font-size: 20px;
    }
}
/* --- GALLERY GRID LAYOUT --- */
.gallery-grid {
    display: grid;
    /* This magic line creates responsive columns that are at least 250px wide */
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px; /* Space between images */
    margin-top: 10px;
    margin-bottom: 40px;
}

.gallery-grid img {
    width: 100%;
    height: 300px; /* Force consistent height */
    object-fit: cover; /* Crop image to fill the square without stretching */
    cursor: pointer;
    border-radius: 4px; /* Optional: slight rounded corners */
    transition: transform 0.2s ease;
}

/* Hover effect for thumbnails */
.gallery-grid img:hover {
    transform: scale(1.02);
    opacity: 0.9;
}

.no-underline {
  text-decoration: none;      /* hide underline */
  color: blue;                /* optional: link color */
}

.no-underline:hover,
.no-underline:focus {
  text-decoration: underline; /* optional: show on hover/focus */
}
