.gallery {
    max-width: 100%;
    margin: 0 auto;
    background: white;
    padding: 15px;
}
.row {
    display: flex;
    gap: 3px;
    margin-bottom: 3px;
}
.row:last-child {
    margin-bottom: 0;
}
.col {
    flex: 1;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
}
.col:hover {
    transform: translateY(-5px);
}
.col img {
    width: 100%;
    height: auto;
    display: block;
}
.col .overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: white;
    padding: 20px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}
.col:hover .overlay {
    transform: translateY(0);
}
.overlay h3 {
    margin: 0 0 5px 0;
    font-size: 1.2em;
}
.overlay p {
    margin: 0;
    font-size: 0.9em;
    opacity: 0.9;
}
@media (max-width: 768px) {
    body {
        padding: 15px;
    }
    
    .gallery {
        padding: 15px;
    }
    
    .row {
        flex-direction: column;
        gap: 1px;
    }
    
    .col img {
        height: 200px;
        object-fit: contain;
    }
    
    .gallery h1 {
        font-size: 1.5em;
        margin-bottom: 20px;
    }
    
    .overlay h3 {
        font-size: 1.1em;
    }
    
    .overlay p {
        font-size: 0.8em;
    }
}
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
}
.modal-content {
    position: relative;
    margin: auto;
    padding: 20px;
    max-width: 95%;
    max-height: 95%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    box-sizing: border-box;
}
.modal img {
    width: 100%;
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    object-position: center;
}
.modal-caption {
    color: white;
    text-align: center;
    margin-top: 20px;
    max-width: 100%;
}
.modal-caption h3 {
    margin: 10px 0 5px 0;
    font-size: 1.5em;
}
.modal-caption p {
    margin: 5px 0;
    font-size: 1.1em;
}
.close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
}
.close:hover,
.close:focus {
    color: #bbb;
    text-decoration: none;
}
.gallery img {
    cursor: pointer;
}

/* Additional responsive improvements for modal */
@media (max-width: 768px) {
    .modal-content {
        padding: 10px;
        max-width: 98%;
        max-height: 98%;
    }
    
    .modal img {
        max-height: 60vh;
    }
    
    .close {
        top: 10px;
        right: 20px;
        font-size: 30px;
    }
    
    .modal-caption h3 {
        font-size: 1.2em;
    }
    
    .modal-caption p {
        font-size: 0.9em;
    }
}
