* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  img {
    max-inline-size: 100%;
  }
  
  body {
    font-family: system-ui, sans-serif;
    font-size: 1rem;
    line-height: 1.7;
    color: #cdd5fa;
    background: #0a0a0a;

    /* Use whichever works best for you */
    min-block-size: 100vh;
    min-block-size: 100dvh;
    min-block-size: 100svh;
  }
  
  h1 p a {
    font-size: 1.75rem;
    line-height: 1.5;
    margin-block-end: 1rem;
  }
  
  p a {
    padding-bottom: 1rem;
    color: #fff;
  }
  
  .logo {
    display: flex;
    justify-content: center;
    font-size: 3rem;
    line-height: 1.5;
  }
  
  .main {
    padding: 1.25rem;
  }
  
  /* Photo Gallery */
  .gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    grid-auto-rows: 12.5rem;
    grid-auto-flow: dense;
    gap: 0.75rem;
  }
  
  .gallery figure {
    /* container-type: inline-size; */
    container: figure / inline-size;
    overflow: hidden;
  
    display: grid;
    /* grid-template-columns: 1fr; */
    /* grid-template-rows: 1fr; */
  
    /*
      Because 1fr = minmax(auto, 1fr),
      to prevent the grid blowout,
      set the minimum to zero.
    */
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
  }
  
  .gallery img {
    inline-size: 100%;
    block-size: 100%;
    object-fit: cover;
  
    /* grid-row: 1 / -1; */
    /* grid-column: 1 / -1; */
    grid-area: 1 / 1 / -1 / -1;
  
    transition: scale 1s ease-in-out;
  }
  
  .gallery figure:hover img {
    scale: 1.125;
  }
  
  .gallery figcaption {
    grid-area: 1 / 1 / -1 / -1;
    align-self: end;
    z-index: 1;
  
    padding: 3em 15% 1em 1em;
    color: #fff;
    font-size: 0.875rem;
    line-height: 1.3;
    background: linear-gradient(transparent 25%, rgb(0 0 0 / 0.75));
    display: none;
  }

  /* 🔹 Lightbox (Mode plein écran) */
.lightbox {
  display: none; /* Caché par défaut */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.lightbox-content {
  max-width: 90%;
  max-height: 90%;
  box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease-in-out;
}

/* 🔹 Effet de fermeture */
.close {
  position: absolute;
  top: 15px;
  right: 25px;
  color: white;
  font-size: 30px;
  font-weight: bold;
  cursor: pointer;
}

/* 🔹 Animation d'apparition */
.lightbox.show {
  display: flex;
  animation: fadeIn 0.3s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

  
  @container figure (width > 20rem) {
    .gallery figcaption {
      display: block;
    }
  }
  
  .gallery figcaption h3 {
    font-size: 1.0625rem;
  }
  
  .gallery figcaption p, a {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  
  @media (width > 600px) {
    .gallery figure:nth-child(1) {
      grid-area: span 2 / span 2;
    }
  
    .gallery figure:nth-child(2) {
      grid-area: span 2 / span 2;
    }
  
    .gallery figure:nth-child(n) {
      grid-row: span 2;
    }
  
    .gallery figure:nth-child(n + 3) {
      grid-column: span 2 / span 1;
    }
  }
  