/* =================================================
   Carousel / Slick Base
================================================= */

.th-carousel{
  position:relative;
  display:block;
  user-select:none;
  touch-action:pan-y;
}

.th-carousel .slick-list{
  overflow:hidden;
}

.th-carousel .slick-track{
  display:flex;
}

.th-carousel .slick-slide{
  display:none;
}

.th-carousel.slick-initialized .slick-slide{
  display:block;
}

.th-carousel .slick-slide:focus{
  outline:none;
}

.th-carousel .slick-dots{
  list-style:none;
  display:flex;
  justify-content:center;
  gap:6px;
  margin:10px 0 0;
  padding:0;
}

.th-carousel .slick-dots li{
  width:8px;
  height:8px;
}

.th-carousel .slick-dots button{
  width:8px;
  height:8px;
  padding:0;
  border:0;
  border-radius:999px;
  background:rgba(0,0,0,.25);
  font-size:0;
}

.th-carousel .slick-dots .slick-active button{
  background:#f97316;
}

/* =================================================
   Shared Gallery / Carousel Card Style
================================================= */

.category-grid_img2,
.gallery__item{
  position:relative;
  width:100%;
  overflow:hidden;
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:20px;
  box-shadow:0 8px 24px rgba(15,23,42,.06);
  transition:
    transform .22s ease,
    border-color .22s ease,
    box-shadow .22s ease;
}

figure.gallery__item{
  display:block;
  aspect-ratio:4 / 5;
  margin:0;
  padding:0;
}

.category-grid_img2{
  aspect-ratio:4 / 5;
}

.gallery__media{
  position:absolute;
  inset:0;
  display:block;
  width:100%;
  height:100%;
  overflow:hidden;
  border-radius:inherit;
}
.category-grid_img2 img,
.gallery__image{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
  transition:transform .35s ease;
}

.category-grid_img2 img{
  object-position:center bottom;
}

@media (hover:hover){

  .category-grid_img2:hover,
  .gallery__item:hover{
    transform:translateY(-4px);
    border-color:#f97316;
    box-shadow:0 18px 45px rgba(15,23,42,.10);
  }

  .category-grid_img2:hover img,
  .gallery__item:hover .gallery__image{
    transform:scale(1.04);
  }
}
/* =================================================
   Gallery Grid Layout
================================================= */

.gallery__track{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  column-gap:6px;
  row-gap:6px;
  max-width:1200px;
  margin:0 auto;
  padding-right:5px;
  padding-left:5px;
}

@media (max-width:768px){

  .gallery__track{
    grid-template-columns:repeat(2,minmax(0,1fr));
    column-gap:6px;
    row-gap:6px;
  }

  .category-grid_img2,
  .gallery__item{
    border-radius:18px;
  }

}
/* =================================================
   Horizontal Snap Carousel Layout
================================================= */

.carousel-gallery .carousel-snap{
  display:grid;
  grid-auto-flow:column;
  grid-auto-columns:calc((100% - 48px) / 5);
  gap:8px;
  overflow-x:auto;
  margin:0 auto;
  padding:8px 8px 16px;
  scroll-snap-type:x mandatory;
  scroll-behavior:smooth;
  scrollbar-width:none;
  -ms-overflow-style:none;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior-inline:contain;
}

.carousel-gallery .carousel-snap::-webkit-scrollbar{
  display:none;
}

.carousel-gallery .carousel-snap__item{
  min-width:0;
  scroll-snap-align:start;
}

@media (max-width:1024px){

  .carousel-gallery .carousel-snap{
    grid-auto-columns:calc((100% - 24px) / 3);
  }

}

@media (max-width:768px){

  .carousel-gallery .carousel-snap{
    grid-auto-columns:calc((100% - 8px) / 2);
    gap:8px;
    padding:6px 2px 14px;
    scroll-padding-left:2px;
  }

}

/* =================================================
   Reduced Motion
================================================= */

@media (prefers-reduced-motion:reduce){

  .category-grid_img2,
  .gallery__item,
  .category-grid_img2 img,
  .gallery__image{
    transition:none;
  }

  .carousel-gallery .carousel-snap{
    scroll-behavior:auto;
  }

}
/* =================================================
   Shared Carousel Section
================================================= */

.carousel-gallery{
  padding:clamp(28px,4vw,44px) 0;
  background:#f8fafc;
}

.carousel-gallery__container{
  width:min(100%,1200px);
  margin:0 auto;
  padding:0 16px;
}

/* 兼容仍使用 Bootstrap .container 的旧页面 */
.carousel-gallery > .section-shell > .container,
.carousel-gallery > .container{
  width:min(100%,1200px);
  max-width:1200px;
  margin:0 auto;
  padding-right:16px;
  padding-left:16px;
}

/* =================================================
   Shared Gallery Section
================================================= */

.gallery{
    max-width:1180px;
    margin:0 auto;
    padding:0 8px;
}

.gallery .section-shell{
  width:min(100%,1200px);
  margin:0 auto;
}

@media (max-width:767.98px){

  .carousel-gallery{
    padding:30px 0 38px;
  }

  .carousel-gallery__container,
  .carousel-gallery > .section-shell > .container,
  .carousel-gallery > .container{
    padding-right:16px;
    padding-left:16px;
  }

  .gallery{
    padding-inline:6px;

  }

  .gallery__track{
    padding-inline:2px;
  }

  .category-grid_img2,
  .gallery__item{
    border-radius:18px;
    box-shadow:0 5px 16px rgba(15,23,42,.05);
  }

}