.gallery-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; padding: 210px 70px 70px; /* room for the nav bar */ } .gallery-grid img { width: 100%; max-width: 700px; height: auto; border-radius: 8px; object-fit: cover; cursor: pointer; transition: 0.3s; } .gallery-grid img:hover { opacity: 0.8; } /* Lightbox styles */ .lightbox { 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.9); backdrop-filter: blur(5px); } .lightbox-content { margin: auto; display: block; max-width: 90%; max-height: 90%; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); border-radius: 4px; box-shadow: 0 0 20px rgba(0,0,0,0.5); animation: zoom 0.3s; } @keyframes zoom { from {transform: translate(-50%, -50%) scale(0.8)} to {transform: translate(-50%, -50%) scale(1)} } .lightbox-close { position: absolute; top: 15px; right: 35px; color: #f1f1f1; font-size: 40px; font-weight: bold; transition: 0.3s; cursor: pointer; z-index: 1001; } .lightbox-close:hover, .lightbox-close:focus { color: #bbb; text-decoration: none; cursor: pointer; } /* mobile */ @media (max-width: 900px) { .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 6px; padding: 72px 4px 20px; } .lightbox-content { max-width: 96%; } .lightbox-close { top: 8px; right: 16px; } }