.latest-gallery-wrapper {
  position: relative;
  overflow: hidden;
  padding: 0 40px;
}

.latest-gallery-container {
  display: flex;
  overflow-x: auto;
  scroll-behavior: smooth;
  gap: 16px;
  padding: 20px 0;
}

.latest-gallery-card {
  width: 320px;
  background: #2c2c2c;
  color: white;

  overflow: hidden;
  flex-shrink: 0;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
}

.thumbnail-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  overflow: hidden;
  background: #111;
}

.thumbnail-wrapper img {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.latest-gallery-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.latest-gallery-info {
  padding: 12px;
}

.latest-gallery-info h4 {
  font-size: 18px;
  margin: 0 0 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.latest-gallery-info .date {
  font-size: 14px;
  color: #ccc;
}

.latest-gallery-info a {
  display: inline-block;
  margin-top: 8px;
  color: #00bfff;
  font-weight: bold;
  text-decoration: none;
}

/* Navigation buttons */
.gallery-nav-btn {
  position: absolute;
  top: 45%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.6);
  border: none;
  color: white;
  font-size: 32px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 1;
}

.gallery-nav-btn.left {
  left: 0;
}

.gallery-nav-btn.right {
  right: 0;
}
.latest-gallery-info .count {
  font-size: 13px;
  color: #bbb;
  margin-top: 2px;
}

@media (max-width: 768px) {
  .latest-gallery-wrapper {
    padding: 0 20px;
    position: relative;
  }

  .latest-gallery-container {
    gap: 12px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .latest-gallery-card {
    flex: 0 0 100vw;
    max-width: 100vw;
    scroll-snap-align: start;
    border-radius: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
  }

  .thumbnail-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    overflow: hidden;
    background: #111;
  }

  .thumbnail-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .latest-gallery-info {
    padding: 12px 16px;
    text-align: left; /* 👈 force left alignment */
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
  }

  .latest-gallery-info h4 {
    font-size: 16px;
    margin: 0 0 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .latest-gallery-info .date {
    font-size: 14px;
    color: #ccc;
    margin-bottom: 6px;
  }

  .latest-gallery-info a {
    display: inline-block;
    font-size: 14px;
    font-weight: bold;
    color: #00bfff;
    text-decoration: none;
  }

  .gallery-nav-btn {
    top: 40%;
    width: 36px;
    height: 36px;
    font-size: 28px;
  }

  .gallery-nav-btn.left {
    left: 4px;
  }

  .gallery-nav-btn.right {
    right: 4px;
  }
}
