.cory-scroll-gallery {
  --csg-gap: 12px;
  --csg-visible: 2;
  --csg-text-offset: 12px;
  --csg-aspect-ratio: 3 / 2;
  --csg-image-fit: cover;
  --csg-focus-x: 50%;
  --csg-focus-y: 50%;
  --csg-hover-scale: 1.06;
  --csg-hover-darkness: .28;
  --csg-hover-duration: 350ms;
  color: inherit;
}
.cory-scroll-gallery *, .cory-scroll-gallery *::before, .cory-scroll-gallery *::after { box-sizing: border-box; }
.cory-scroll-gallery__viewport {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
}
.cory-scroll-gallery__viewport::-webkit-scrollbar { display: none; }
.cory-scroll-gallery__viewport:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.cory-scroll-gallery__viewport.is-dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; }
.cory-scroll-gallery__track { display: flex; gap: var(--csg-gap); }
.cory-scroll-gallery__item {
  flex: 0 0 calc((100% - (var(--csg-gap) * (var(--csg-visible) - 1))) / var(--csg-visible));
  min-width: 0;
  scroll-snap-align: start;
}
.cory-scroll-gallery__link { display: block; color: inherit; text-decoration: none; }
.cory-scroll-gallery__link:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
.cory-scroll-gallery__image-wrap {
  position: relative;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  aspect-ratio: var(--csg-aspect-ratio) !important;
  background: #ececec;
}
.cory-scroll-gallery__image-wrap::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--csg-hover-duration) ease;
}
.cory-scroll-gallery__image {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: none;
  object-fit: var(--csg-image-fit) !important;
  object-position: var(--csg-focus-x) var(--csg-focus-y) !important;
  transition: transform var(--csg-hover-duration) ease;
}
.cory-scroll-gallery--hover-zoom .cory-scroll-gallery__item:hover .cory-scroll-gallery__image,
.cory-scroll-gallery--hover-zoom-darken .cory-scroll-gallery__item:hover .cory-scroll-gallery__image { transform: scale(var(--csg-hover-scale)); }
.cory-scroll-gallery--hover-darken .cory-scroll-gallery__item:hover .cory-scroll-gallery__image-wrap::after,
.cory-scroll-gallery--hover-zoom-darken .cory-scroll-gallery__item:hover .cory-scroll-gallery__image-wrap::after { opacity: var(--csg-hover-darkness); }
@media (prefers-reduced-motion: reduce) {
  .cory-scroll-gallery__image,
  .cory-scroll-gallery__image-wrap::after { transition: none; }
}
.cory-scroll-gallery__text { margin-top: var(--csg-text-offset); }
.cory-scroll-gallery__title { margin: 0; font: inherit; font-weight: 600; line-height: 1.2; }
.cory-scroll-gallery__description { margin: 4px 0 0; line-height: 1.45; }
.cory-scroll-gallery--text-overlay-bottom .cory-scroll-gallery__item,
.cory-scroll-gallery--text-overlay-center .cory-scroll-gallery__item { position: relative; }
.cory-scroll-gallery--text-overlay-bottom .cory-scroll-gallery__text,
.cory-scroll-gallery--text-overlay-center .cory-scroll-gallery__text {
  position: absolute; z-index: 1; left: 0; right: 0; margin: 0; padding: 32px 20px 20px;
  color: #fff; pointer-events: none;
  background: linear-gradient(transparent, rgba(0,0,0,.72));
}
.cory-scroll-gallery--text-overlay-bottom .cory-scroll-gallery__text { bottom: 0; }
.cory-scroll-gallery--text-overlay-center .cory-scroll-gallery__text { top: 50%; transform: translateY(-50%); padding: 20px; background: rgba(0,0,0,.26); }
.cory-scroll-gallery--text-overlay-bottom .cory-scroll-gallery__title,
.cory-scroll-gallery--text-overlay-center .cory-scroll-gallery__title { color: inherit; }
.cory-scroll-gallery--text-overlay-bottom .cory-scroll-gallery__description,
.cory-scroll-gallery--text-overlay-center .cory-scroll-gallery__description { color: inherit; }
.cory-scroll-gallery__arrows { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.cory-scroll-gallery__arrow {
  width: 42px; height: 42px; padding: 0; border: 1px solid currentColor; border-radius: 50%;
  background: transparent; color: currentColor; cursor: pointer; font: 22px/1 sans-serif;
  transition: opacity .2s ease, background-color .2s ease, color .2s ease;
}
.cory-scroll-gallery__arrow:hover:not(:disabled) { background: currentColor; color: #fff; }
.cory-scroll-gallery__arrow:disabled { cursor: default; opacity: .35; }
.cory-scroll-gallery__progress { height: 2px; margin-top: 16px; background: rgba(0,0,0,.16); overflow: hidden; }
.cory-scroll-gallery__progress span { display: block; width: 0; height: 100%; background: currentColor; transition: width .12s linear; }
.cory-scroll-gallery__social { margin-top: 40px; }
.cory-scroll-gallery__social-heading { margin: 0 0 14px; font: inherit; font-weight: 600; line-height: 1.2; }
.cory-scroll-gallery__social-links { display: flex; flex-wrap: wrap; gap: 16px; }
.cory-scroll-gallery__social-link { display: inline-flex; align-items: center; gap: .5em; color: inherit; text-decoration: none; transition: opacity .2s ease, color .2s ease; }
.cory-scroll-gallery__social-link:hover { opacity: .72; }
.cory-scroll-gallery__social-link:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.cory-scroll-gallery__social-icon { display: inline-flex; line-height: 1; }
.cory-scroll-gallery__empty { padding: 20px; border: 1px dashed #b6b6b6; color: #666; text-align: center; }
@media (max-width: 1024px) {
  .cory-scroll-gallery { --csg-visible: 2; }
  .cory-scroll-gallery--tablet-grid .cory-scroll-gallery__viewport { overflow: visible; cursor: default; scroll-snap-type: none; }
  .cory-scroll-gallery--tablet-grid .cory-scroll-gallery__track { display: grid; grid-template-columns: repeat(var(--csg-tablet-columns), minmax(0, 1fr)); }
  .cory-scroll-gallery--tablet-grid .cory-scroll-gallery__item { flex: initial; width: auto; }
  .cory-scroll-gallery--tablet-grid .cory-scroll-gallery__arrows,
  .cory-scroll-gallery--tablet-grid .cory-scroll-gallery__progress { display: none; }
}
@media (max-width: 767px) {
  .cory-scroll-gallery { --csg-visible: 1.1; }
  .cory-scroll-gallery--mobile-grid .cory-scroll-gallery__viewport { overflow: visible; cursor: default; scroll-snap-type: none; }
  .cory-scroll-gallery--mobile-grid .cory-scroll-gallery__track { display: grid; grid-template-columns: repeat(var(--csg-mobile-columns), minmax(0, 1fr)); }
  .cory-scroll-gallery--mobile-grid .cory-scroll-gallery__item { flex: initial; width: auto; }
  .cory-scroll-gallery--mobile-grid .cory-scroll-gallery__arrows,
  .cory-scroll-gallery--mobile-grid .cory-scroll-gallery__progress { display: none; }
  .cory-scroll-gallery--tablet-grid.cory-scroll-gallery--mobile-scroll .cory-scroll-gallery__viewport { overflow-x: auto; overflow-y: hidden; cursor: grab; scroll-snap-type: x proximity; }
  .cory-scroll-gallery--tablet-grid.cory-scroll-gallery--mobile-scroll .cory-scroll-gallery__track { display: flex; }
  .cory-scroll-gallery--tablet-grid.cory-scroll-gallery--mobile-scroll .cory-scroll-gallery__item { flex: 0 0 calc((100% - (var(--csg-gap) * (var(--csg-visible) - 1))) / var(--csg-visible)); width: auto; }
  .cory-scroll-gallery--tablet-grid.cory-scroll-gallery--mobile-scroll .cory-scroll-gallery__arrows,
  .cory-scroll-gallery--tablet-grid.cory-scroll-gallery--mobile-scroll .cory-scroll-gallery__progress { display: flex; }
  .cory-scroll-gallery--tablet-grid.cory-scroll-gallery--mobile-scroll .cory-scroll-gallery__progress { display: block; }
}
