

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr); 
  grid-template-rows: repeat(3, 1fr);   
  gap: 15px;
  max-width: 1200px; 
  margin: 0 auto;   
  height: calc(100vh - 40px); 
}

.gallery__item {
  position: relative;
  box-shadow: 0px 1px 3px 0px rgba(0, 0, 0, 0.2),
    0px 1px 1px 0px rgba(0, 0, 0, 0.14), 
    0px 2px 1px -1px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  border-radius: 4px;
}

.gallery__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery__image:hover {
  transform: scale(1.03);
  cursor: zoom-in;
}


.box {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.8);
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 999;
}

.box.is-open {
  opacity: 1;
  pointer-events: initial;
}

.box__content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}

.box__image {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
}

.box__button {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 50%;
  background-color: transparent;
  color: #fff;
  cursor: pointer;
  transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%23ffffff' d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'/%3E%3C/svg%3E");
  background-position: center;
  background-size: 60%;
  background-repeat: no-repeat;
}

.box__button:hover,
.box__button:focus {
  background-color: rgba(0, 0, 0, 0.436);
}