.asrc {
  position: relative;
  --asrc-gap: 16px;
  --asrc-per: var(--asrc-pd, 8);
  --asrc-radius: 14px;
  --asrc-ratio: 1/1;
  --asrc-font: 14px;
}
.asrc--circle {
  --asrc-radius: 50%;
}
.asrc--square {
  --asrc-radius: 0px;
}
.asrc-r-4x5 {
  --asrc-ratio: 4/5;
}
.asrc-r-3x4 {
  --asrc-ratio: 3/4;
}
.asrc--sm {
  --asrc-font: 13px;
}
.asrc--md {
  --asrc-font: 14px;
}
.asrc--lg {
  --asrc-font: 16px;
}

/* ---------- track ---------- */
.asrc__track {
  display: flex;
  gap: var(--asrc-gap);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  overscroll-behavior-x: contain;
  padding: 4px 0 6px;
  scrollbar-width: none;
}
.asrc__track::-webkit-scrollbar {
  display: none;
}
.asrc-has-bar .asrc__track {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.25) transparent;
  padding-bottom: 10px;
}
.asrc-has-bar .asrc__track::-webkit-scrollbar {
  display: block;
  height: 6px;
}
.asrc-has-bar .asrc__track::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 3px;
}
.asrc-has-bar .asrc__track::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.06);
  border-radius: 3px;
}

/* ---------- tile ---------- */
.asrc a.asrc__tile,
.asrc a.asrc__tile:hover,
.asrc a.asrc__tile:focus {
  text-decoration: none;
  box-shadow: none;
  color: inherit;
}
.asrc__tile {
  flex: 0 0
    calc((100% - (var(--asrc-per) - 1) * var(--asrc-gap)) / var(--asrc-per));
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.asrc__frame {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: var(--asrc-ratio);
  border-radius: var(--asrc-radius);
  overflow: hidden;
  background: #f4f4f5;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}
.asrc__frame .asrc__img,
.asrc__ph {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.asrc__ph {
  background: linear-gradient(135deg, #eee, #f7f7f7);
}
.asrc__meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  max-width: 100%;
  text-align: center;
}
.asrc__label {
  font-size: var(--asrc-font);
  line-height: 1.35;
  font-weight: 600;
  overflow-wrap: anywhere;
  transition: opacity 0.2s ease;
}
.asrc__count {
  font-size: calc(var(--asrc-font) - 2px);
  opacity: 0.6;
}

/* ---------- overlay label ---------- */
.asrc-label-overlay .asrc__meta {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  z-index: 1;
  padding: 32px 10px 12px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.68), rgba(0, 0, 0, 0));
  color: #fff;
}
.asrc-label-overlay .asrc__count {
  opacity: 0.85;
}
.asrc-label-overlay.asrc--circle .asrc__meta {
  padding-bottom: 18%;
}

/* ---------- hover ---------- */
.asrc-hover-lift .asrc__tile:hover .asrc__frame,
.asrc-hover-lift .asrc__tile:focus-visible .asrc__frame {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}
.asrc-hover-lift .asrc__tile:hover .asrc__img,
.asrc-hover-zoom .asrc__tile:hover .asrc__img {
  transform: scale(1.05);
}
.asrc-label-below .asrc__tile:hover .asrc__label {
  opacity: 0.75;
}
.asrc__tile:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
  border-radius: 8px;
}

/* ---------- arrows ---------- */
.asrc__arrow {
  position: absolute;
  top: 0;
  bottom: calc(1.4 * var(--asrc-font) + 14px);
  margin-block: auto;
  z-index: 2;
  border: 0;
  padding: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
  line-height: 1;
  transition:
    opacity 0.2s,
    background-color 0.2s;
}
.asrc-label-overlay .asrc__arrow {
  bottom: 6px;
}
.asrc__arrow[hidden] {
  display: none;
}
.asrc__arrow svg {
  display: block;
}
.asrc__arrow--prev {
  inset-inline-start: -6px;
}
.asrc__arrow--next {
  inset-inline-end: -6px;
}
[dir="rtl"] .asrc__arrow svg {
  transform: scaleX(-1);
}
.asrc-arrows-sm .asrc__arrow {
  --asrc-a: 32px;
  font-size: 18px;
}
.asrc-arrows-md .asrc__arrow {
  --asrc-a: 40px;
  font-size: 24px;
}
.asrc-arrows-lg .asrc__arrow {
  --asrc-a: 48px;
  font-size: 30px;
}
.asrc__arrow {
  width: var(--asrc-a);
  height: var(--asrc-a);
}
.asrc-arrows-light .asrc__arrow {
  background: #fff;
  color: #222;
  border-radius: 50%;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.18);
}
.asrc-arrows-light .asrc__arrow:hover {
  background: #fafafa;
}
.asrc-arrows-minimal .asrc__arrow {
  background: none;
  color: rgba(120, 120, 120, 0.85);
}
.asrc-arrows-minimal .asrc__arrow:hover {
  color: #222;
}
.asrc-arrows-dark .asrc__arrow {
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border-radius: 50%;
}

/* ---------- breakpoints ---------- */
@media (min-width: 1025px) {
  .asrc-layout-grid .asrc__track {
    display: grid;
    grid-template-columns: repeat(var(--asrc-per), minmax(0, 1fr));
    overflow: visible;
    scroll-snap-type: none;
  }
  .asrc-layout-grid .asrc__arrow,
  .asrc-layout-grid .asrc__clone {
    display: none;
  }
}
@media (max-width: 1024px) {
  .asrc {
    --asrc-per: var(--asrc-pt, 5);
    --asrc-gap: 14px;
  }
}
@media (max-width: 767px) {
  .asrc {
    --asrc-per: var(--asrc-pm, 3);
    --asrc-gap: 12px;
  }
  .asrc:not(.asrc-arrows-mobile) .asrc__arrow {
    display: none;
  }
  .asrc .asrc__arrow {
    --asrc-a: 32px;
    font-size: 20px;
  }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .asrc__track {
    scroll-behavior: auto;
  }
  .asrc__frame,
  .asrc__frame .asrc__img {
    transition: none;
  }
  .asrc-hover-lift .asrc__tile:hover .asrc__frame,
  .asrc-hover-lift .asrc__tile:hover .asrc__img,
  .asrc-hover-zoom .asrc__tile:hover .asrc__img {
    transform: none;
  }
}
