/* Galerie « En images » : grille de vignettes qui ouvrent la visionneuse. */
@layer components {
  .gallery {
    --stack-gap: 48px;
  }

  .gallery__head {
    --stack-gap: 20px;
  }

  .gallery__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
    gap: 40px 24px;
  }

  .gallery__item {
    --stack-gap: 14px;
  }

  .gallery__trigger {
    position: relative;
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: var(--color-steel);
    cursor: zoom-in;
  }

  .gallery__trigger picture {
    width: 100%;
    height: 100%;
  }

  .gallery__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.9s var(--ease-zoom);
  }

  .gallery__trigger:hover .gallery__img {
    transform: scale(1.035);
  }

  /* 44 px = 42 px de disque + 1 px de bordure de chaque côté. */
  .gallery__zoom {
    position: absolute;
    right: 14px;
    bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line-on-photo);
    border-radius: 50%;
    background: rgb(var(--rgb-night) / 0.55);
    color: var(--color-cream);
    opacity: 0;
    transform: translateY(4px);
    pointer-events: none;
    transition:
      opacity 0.35s ease,
      transform 0.35s ease;
  }

  .gallery__trigger:hover .gallery__zoom,
  .gallery__trigger:focus-visible .gallery__zoom {
    opacity: 1;
    transform: none;
  }

  @media (hover: none) {
    .gallery__zoom {
      opacity: 1;
      transform: none;
    }
  }

  .gallery__caption {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 16px;
  }

  .gallery__title {
    font-style: italic;
    font-size: 22px;
    line-height: 1.2;
    color: var(--color-ink);
  }

  .gallery__note {
    max-width: 720px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--color-text-muted);
  }
}
