@import url("colors.css");

@import url("colors.css");

.modal {
display: none;
position: fixed; 
z-index: 9999; 
padding-top: 60px; 
left: 0; top: 0;
width: 100%; height: 100%; 
overflow: auto; 
background-color: rgba(0,0,0,0.8);
}

.modal-content {
margin: auto;
display: block;
max-width: 90%;
max-height: 80%;

}

#caption {
text-align: center;
color: #ccc;
padding: 10px 0;
}

.close {
position: absolute;
top: 30px; right: 45px;
color: #fff !important;
font-size: 40px;
font-weight: bold;
cursor: pointer;
}

.close:hover, .arrow:hover { background: var(--secAcc); }

.arrow {
cursor: pointer;
position: absolute;
top: 50%;
width: auto;
margin-top: -22px;
padding: 16px;
color: var(--bkg2);
font-weight: bold;
font-size: 30px;
user-select: none;
-webkit-user-select: none;
}

.arrow.left {
left: 20px;
}

.arrow.right {
right: 20px;
}

figure {
display: inline-block;
margin: 10px;
max-width: 200px;
}

img.thumb {
max-width: 100%;
cursor: pointer;
display: block;
}

media.thumb {
max-width: 100%;
cursor: pointer;
display: block;
}

.gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 20px; /* space between images */
  justify-content: center; 
  padding: 20px 10px;
}

.gallery figure.landscape {
  flex: 2 1 400px;  /* Bigger size for landscape */
  max-width: 450px;
}

.gallery figure.portrait {
  flex: 1 1 200px;  /* Smaller size for portrait */
  max-width: 350px;
}

.gallery figure {
  margin: 0px;
  background: var(--bkg2);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  flex: 1 1 300px; /* Responsive: grows/shrinks, min 300px */
  max-width: 350px;
}

.gallery figure:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Universal thumbnail styling - applies to BOTH <img> and <video> */
.gallery .thumb {
  width: 100%;
  height: 300px; /* Fixed height for uniform grid */
  object-fit: cover; /* Crops images/videos to fill space perfectly */
  cursor: pointer;
  display: block;
  border: none;
}

/* Video thumbnail specific tweaks */
.gallery video.thumb {
  background: #000; /* Black background if video fails to load frame */
}

/* Figcaption styling */
.gallery figcaption {
  padding: 12px;
  font-size: 14px;
  font-weight: 1500;
  color: #333;
  text-align: center;
  background: var(--bkg2);
}


#caption {
  color: var(--bkg2);
  text-align: center;
  padding: 20px 10px;
  font-size: 18px;
}


/* Responsive breakpoints */
@media (max-width: 768px) {
  .gallery figure {
    flex: 1 1 250px;
    max-width: 300px;
  }
  
  .modal-content {
    max-width: 95%;
    max-height: 80%;
  }
  
  .gallery .thumb {
    height: 180px;
  }
}

@media (max-width: 480px) {
  .gallery {
    gap: 15px;
    padding: 15px 5px;
  }
  
  .gallery figure {
    flex: 1 1 100%;
    max-width: none;
  }
  
  .gallery .thumb {
    height: 250px; /* Taller on mobile for better touch targets */
  }
}
