  /* Gallery grid */
  .gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--gap);
    padding: var(--gap);
    max-width: 1200px;
    margin: auto;
  }

  .gallery a {
    outline-offset: 4px;
  }

  .gallery img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: var(--radius);
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
    cursor: zoom-in;
    display: block;
  }

  .gallery a:focus-visible img {
    outline: 3px solid #1976d2;
  }

  /* Lightbox */
  .lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
  }

  .lightbox:target {
    display: flex;
  }

  .lightbox figure {
    margin: 0;
    text-align: center;
    max-width: 90vw;
    max-height: 90vh;
  }

  .lightbox img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 8px;
    animation: zoom 0.25s ease;
  }

  .lightbox figcaption {
    color: #fff;
    margin-top: 0.5rem;
    font-size: 0.9rem;
  }

  /* Close button */
  .close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: 2px solid #fff;
    color: #fff;
    padding: 0.5rem 0.75rem;
    border-radius: 999px;
    font-size: 0.9rem;
    text-decoration: none;
  }

  .close:focus-visible {
    outline: 3px solid #ff0000;
    outline-offset: 3px;
  }
  
  .close:focus:not(:focus-visible) {
    outline: none;
  }

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

