.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-gap: 10px;
  max-width: 1200px;
  margin: 0 auto;
}

@media screen and (max-width: 1024px) {
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media screen and (max-width: 640px) {
  .gallery { grid-template-columns: repeat(1, minmax(0, 1fr)); }
}

.gallery figure {
  margin: 0;
  border: 1px solid #cdcdcd;
  background: #000;
  transition: transform 0.3s ease;
}

.gallery img {
  width: 100%;
  height: 200px;
  object-fit: cover; /* fill | contain | cover | scale-down */
  cursor: pointer;
  transition: all 0.3s ease;
}

.gallery figcaption {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1.1em;
  text-align: center;
  color: #fff;
  padding: 10px;
}

.gallery img.full {
  position: fixed;
  top: 0; left: 0; z-index: 999;
  width: 100vw; height: 100vh;
  object-fit: contain; /* fill | contain | cover | scale-down */
  background: #000;
  padding: 10px;
}

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

/* Add some padding to prevent horizontal scroll on mobile */
.gallery { 
  overflow-x: hidden;
  padding: 0 10px;
}

.gallery img {
  transition: all 0.3s; 
}

/* Collapsible Button Styling */
.toggle-btn {
  background-color: #f1f1f1;
  color: black;
  cursor: pointer;
  padding: 25px;
  width: 100%;
  border: none;
  text-align: left;
  font-size: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 5px;
  margin-bottom: 10px;
  transition: background-color 0.3s ease;
}

.toggle-btn:hover {
  background-color: #e0e0e0;
}

.toggle-btn:focus {
  outline: none;
}

.toggle-btn.active::after {
  content: "\2212"; /* minus sign */
}

.toggle-btn::after {
  content: '\002B'; /* plus sign */
  font-weight: bold;
  float: right;
  margin-left: 5px;
}

/* Separator line */
.separator {
  flex-grow: 1;
  height: 1px;
  background-color: #ccc;
  margin: 0 10px;
}

/* Ensure the button text and icons are touch-friendly */
.toggle-btn span {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

/* Better layout on mobile */
@media screen and (max-width: 640px) {
  .toggle-btn {
    font-size: 32px;
    padding: 30px;
  }

  .gallery figcaption {
    font-size: 1em;
  }
}
