
#gallery{
  width: 100%;
  margin: 4rem 0 0;
  background-color: var(--primary-bg);
 
}
.gallery {
  display: grid;
  background-color: white;
  max-width: 1024px;
  margin: 0 auto 0;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  padding: 1rem;
  border-radius: 0 0 5px 5px
 
}
.gallery-item {
  display: flex;
  flex-direction: column;
  justify-content: flex-start; /* h3 och p upptill */
  text-align: left;
  border: 1px solid rgb(163, 163, 163);
  border-radius: 5px;
  padding: 1rem;
  height: 100%; /* se till att alla gallery-items är lika höga */
}

 

.gallery-item button {
  margin-top: auto;  
  align-self: center;  
  padding: 0.5rem 1rem;
  border: none;
  background-color: var(--primary-bg);
  color: white;
  border-radius: 5px;
  cursor: pointer;
/*   transition: background-color 0.5s ease; */
transition:   background-color 0.5s ease,
opacity 0.5s ease,
transform 0.3s ease; 
}
.gallery-item button:hover {
  opacity: .7;
}

.gallery-item video {
  height: 250px;
  object-fit: cover;
}
.gallery-item img, .gallery-item video {
  width: 100%;
  cursor: pointer;
  border-radius: 5px;
  transition: 0.3s;
}

.gallery-item img:hover {
  opacity: 0.8;
}
 
h1 {
  max-width: 1024px;
  font-size: 2rem;
  text-align: center;
  font-weight: 600;
  margin: 3rem auto 0;
  padding: 3rem 0 2rem;
  background-color: var(--light-bg);
  border-radius: 5px 5px 0 0;
}
#gallery h2{
  max-width: 1024px;
background-color: white;
  font-size: 1.3rem;
  padding: 1rem 2rem 1rem;
  margin: 0 auto 0;
  font-weight: 600;
  text-align: center;
  letter-spacing: .8px;
}
h3{
  font-size: 1.3rem;
}
@media (max-width: 540px){
#gallery h1{
  padding: 2rem 0;
/*   margin: 3rem 1rem 1rem; */
}
}
  
 

.caption {
  flex-grow: 1;  
  margin: 1em 0 1em 0;
  font-size: 1em;
  color: #333;
  line-height: 1.3em;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
 
.caption p {
  color: var(--black-font-p);
  text-align: left;
  padding: 1rem;
  line-height: 1.3em;
  font-style: italic;
 
  background-color:transparent;
  margin-bottom: 0.5rem;
}

.lightbox {
  display: none;
  position: fixed;
  z-index: 999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.lightbox img {
  max-width: 90%;
  max-height: 80%;
  border-radius: 10px;
  box-shadow: 0 0 15px rgba(0,0,0,0.5);
}

.close-btn {
  color: white;
  font-size: 30px;
  font-weight: bold;
  position: absolute;
  top: 20px;
  right: 30px;
  cursor: pointer;
  user-select: none;
}

.close-btn:hover {
  color: #ccc;
}