:root {
  --primary-color: #007bff;
  --white-color: #ffffff;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, Helvetica, sans-serif;
}

body {
  padding: 10px;
}

img {
  display: block;
  max-width: 100%;
}

ul {
  list-style: none;
}

.title-primary {
  margin: 0px auto 40px auto;
  text-align: center;
  font-size: 2.5rem;
  max-width: 40ch;
  color: #010b16;
}

.header {
  max-width: 1100px;
  margin: 50px auto;
}

.items {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  align-items: center;
}

.item {
  border: 2px solid var(--primary-color);
  border-radius: 50px;
  padding: 8px 16px;
  color: var(--primary-color);
  font-size: 1.125rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.item:hover,
.item.active {
  color: var(--white-color);
  background: var(--primary-color);
}

.gallery {
  padding: 0px calc((100% - 1100px) / 4);
  margin: 0px auto 50px auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  justify-content: center;
  align-content: center;
}

.gallery img {
  cursor: pointer;
  border-radius: 5px;
  transition: all 0.3s ease;
}

.gallery .image span {
  display: flex;
  width: 100%;
  border-radius: 5px;
  overflow: hidden;
}

.gallery .image.hide {
  display: none;
}

.gallery .image.show {
  display: block;
  animation: animate 0.4s ease;
}

@keyframes animate {
  0% {
    transform: scale(0.5);
  }
  100% {
    transform: scale(1);
  }
}

.gallery .image:hover img {
  transform: scale(1.1);
}

.preview-box {
  z-index: 5;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  opacity: 0;
  pointer-events: none;
  background-color: var(--white-color);
  max-width: 700px;
  width: 100%;
  padding: 5px;
  border-radius: 5px;
  box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.2);
}

.preview-box.show {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
  transition: all 0.3s ease;
}

.preview-box .details {
  display: flex;
  justify-content: space-between;
  padding: 10px;
}

.preview-box .details .title {
  display: flex;
  align-items: center;
  font-size: 1.125rem;
}

.preview-box .details p {
  margin-left: 5px;
  font-weight: 600;
}

.preview-box .details .icon {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--white-color);
  background-color: var(--primary-color);
  padding: 10px 15px;
  border-radius: 50%;
  cursor: pointer;
  transition: 0.3s;
}

.details .icon:hover {
  transform: scale(1.1);
}

.preview-box .image-box {
  display: flex;
  width: 100%;
}

.image-box img {
  width: 100%;
  border-radius: 0px 0px 5px 5px;
}

.shadow {
  z-index: 3;
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  display: none;
}

.shadow.show {
  display: block;
}

@media (max-width: 900px) {
  .gallery {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
}

@media (max-width: 767px) {
  .header {
    margin: 50px auto;
  }
  .gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 600px) {
  .gallery img {
    height: 200px;
    width: 300px;
  }
}

@media (max-width: 599px) {
  .gallery {
    grid-template-columns: 1fr;
  }
}
