/* Homepage gallery only; category gallery page stays unchanged. */
#main .home-gallery-carousel {
  min-width: 0;
  width: 100%;
  position: relative;
}
#main .home-gallery-track {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 22px;
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 0;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 5px 0 11px;
  touch-action: pan-x pan-y;
}
#main .home-gallery-track::-webkit-scrollbar {
  display: none;
}
#main .home-gallery-track .home-gallery-slide {
  flex: 0 0 calc((100% - 44px) / 3);
  width: calc((100% - 44px) / 3);
  max-width: none;
  min-width: 0;
  height: auto;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  flex-direction: column;
  padding: 7px;
  border: 1px solid #9e7a3c70;
  border-radius: 11px;
  overflow: hidden;
  background: linear-gradient(140deg, #18150d, #0e0e0b);
  box-shadow: 0 0 13px #c89d3610;
}
#main .home-gallery-track .home-gallery-slide img {
  width: 100%;
  height: auto;
  aspect-ratio: 4/5;
  object-fit: cover;
  object-position: center;
  border: 1px solid #c39a4a26;
  border-radius: 6px;
  flex-shrink: 0;
}
#main .home-gallery-track .home-gallery-slide strong {
  font-size: 15px;
  line-height: 1.6;
  margin: 14px 10px 5px;
  color: #eee4cf;
  overflow-wrap: anywhere;
}
#main .home-gallery-track .home-gallery-slide > span {
  font-size: 9px;
  line-height: 1.8;
  letter-spacing: 1.5px;
  margin: 0 10px 12px;
  color: #c5a461;
  overflow-wrap: anywhere;
}
#main .home-gallery-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 18px;
}
#main .home-gallery-buttons {
  display: flex;
  gap: 9px;
  align-items: center;
}
#main .home-gallery-buttons button {
  min-width: 44px;
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid #82652f;
  border-radius: 7px;
  background: #d3ae5408;
  color: #e5c67f;
  line-height: 1.4;
  font-size: 17px;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s;
}
#main .home-gallery-buttons [data-gallery-play] {
  min-width: 86px;
  font-size: 11px;
}
#main .home-gallery-buttons button:hover {
  border-color: #c59e4c;
  background: #d3ae5419;
}
#main .home-gallery-buttons button:disabled {
  opacity: 0.4;
  cursor: default;
}
#main .home-gallery-count {
  font-size: 12px;
  color: #c4b28c;
  white-space: nowrap;
}
#main .home-gallery-hint {
  font-size: 11px;
  line-height: 1.8;
  color: #8f8674;
  margin: 13px 0 0;
}
@media (max-width: 1050px) {
  #main .home-gallery-track {
    gap: 18px;
  }
  #main .home-gallery-track .home-gallery-slide {
    flex-basis: calc((100% - 18px) / 2);
    width: calc((100% - 18px) / 2);
  }
}
@media (max-width: 760px) {
  #main .home-gallery-track {
    gap: 16px;
  }
  #main .home-gallery-track .home-gallery-slide {
    flex-basis: 100%;
    width: 100%;
    padding: 6px;
    border-radius: 10px;
  }
  #main .home-gallery-track .home-gallery-slide img {
    aspect-ratio: auto;
    height: clamp(290px, calc(100vh - 250px), 560px);
    height: clamp(290px, calc(100svh - 250px), 560px);
    object-fit: cover;
  }
  #main .home-gallery-track .home-gallery-slide strong {
    font-size: 16px;
    margin: 14px 12px 5px;
  }
  #main .home-gallery-track .home-gallery-slide > span {
    font-size: 10px;
    margin: 0 12px 13px;
    letter-spacing: 1.5px;
  }
  #main .home-gallery-controls {
    gap: 14px;
    margin-top: 14px;
  }
  #main .home-gallery-buttons {
    gap: 8px;
  }
  #main .home-gallery-count {
    font-size: 11px;
  }
  #main .home-gallery-hint {
    font-size: 10px;
  }
}
@media (max-width: 380px) {
  #main .home-gallery-track .home-gallery-slide img {
    height: clamp(260px, calc(100svh - 240px), 460px);
  }
  #main .home-gallery-buttons button {
    padding-inline: 11px;
  }
  #main .home-gallery-buttons [data-gallery-play] {
    min-width: 78px;
  }
}
@media (max-height: 500px) and (orientation: landscape) {
  #main .home-gallery-track .home-gallery-slide img {
    height: 270px;
    aspect-ratio: auto;
  }
}
@media (prefers-reduced-motion: reduce) {
  #main .home-gallery-buttons button {
    transition: none;
  }
}
