/* Bar Gallery Section */
html{
    scroll-behavior: smooth;
}
#bar-gallery {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Yu Gothic', 'Meiryo', sans-serif;
  margin: 30px 0;
  margin-top: 20px;
  scroll-margin-top: 70px;
}

#bar-gallery p {
  margin-bottom: 20px;
  text-align: center;
  font-style: normal;
  font-size: 2rem;
  font-weight: 500;
  line-height: 1.6;
  font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Yu Gothic', 'Meiryo', sans-serif;
}

/* Gallery container wider */
.gallery-container {
  width: 1200px; /* wider fixed width */
  max-width: 95%; /* responsive on smaller screens */
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

/* Each gallery item */
.gallery-item {
  width: 180px;  /* larger images inside wider container */
  height: 140px;
  overflow: hidden;
  cursor: pointer;
}


.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Modal styles */
.modal {
  display: none; 
  position: fixed;
  z-index: 1000;
  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%;
}

.close {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #fff;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover,
.close:focus {
  color: #bbb;
}

/* Responsive: scale down on small screens */
@media (max-width: 768px) {
  #bar-gallery p {
    font-size: 1.6rem;
  }
  
  .gallery-container {
    width: 100%;
    gap: 8px;
  }
  .gallery-item {
    width: 45%; /* two per row */
    height: auto;
    aspect-ratio: 1/1; /* maintain square */
  }
  #bar-gallery {
    margin-top: 10px; /* smaller gap */
    margin-bottom: 20px;
  }
  .container {
    min-height: auto; /* remove 100vh forcing extra height */
  }

}

@media (max-width: 480px) {
  #bar-gallery p {
    font-size: 1.4rem;
  }
  
  .gallery-item {
    width: 100%;
    aspect-ratio: 1/1;
  }
  #bar-gallery {
    margin-top: 5px;  /* even smaller on very small screens */
    margin-bottom: 15px;
  }
}
