body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #fff;
    text-align: center;
}



.header h2 {
    font-size: 22px;
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.header p {
    font-size: 14px;
    letter-spacing: 3px;
    color: #666;
}

.gallery{
    position: relative;
    
}

/* GALLERY GRID */
.gallery .grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 images per row */
    grid-gap: 5px;
    padding: 10px;
}

.gallery img {
    width: 100%;
    height: 180px;   /* slightly taller to look good in 4-column layout */
    object-fit: cover;
    cursor: pointer;
    transition: opacity 0.3s;
}


.gallery img:hover {
    opacity: 0.7;
}

/* MODAL */
#modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0; 
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    overflow: auto; /* allow scrolling */
}

/* Ensure the modal content doesn't overlap the close button */
.modal-content {
    margin: auto;
    display: block;
    max-width: 95%;
    max-height: 80%; /* Make sure it never exceeds viewport height */
    margin-top: 5%;
    border-radius: 6px;
    position: relative;
}

/* Close button positioning */
.close {
    position: absolute; /* Position inside the modal */
    top: 20px;
    right: 20px;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    font-weight: bold;
    z-index: 10000; /* Ensure it stays on top */
}

/* Modal fade-in background */
.modal.show {
    animation: modalFadeIn 1s ease forwards;
}

@keyframes modalFadeIn {
    from { background: rgba(0,0,0,0); transform: scale(0); }
    to   { background: rgba(0,0,0,0.8);transform: scale(1.0); }
}

/* Image zoom-in animation */
.modal-content {
    opacity: 0;
    transform: scale(0.6);
    transition: all 0.35s ease;
}

.modal.show .modal-content {
    opacity: 1;
    transform: scale(1);
}
