/* v3 gallery (photo marquee). Figma: Gallery 11001:2967 (1440), mobile 11307:11208 (430). */
.v3-gal {
  --gal-dash: repeating-linear-gradient(180deg, var(--v3-gray-50) 0 3px, transparent 3px 5px);
  --gal-dash-h: repeating-linear-gradient(90deg, var(--v3-gray-50) 0 3px, transparent 3px 5px);
  --gal-head: 57px;              /* title line + gap down to the strip */
  --gal-line: calc(var(--v3-gutter) - 12px);   /* outer guide lines sit 12px outside the content */
  --gal-card: 320px;
  --gal-pitch: 332;              /* card + 12px gutter, unitless: used for the animation duration */
  --gal-speed: 30;               /* px per second: slow and constant */
  position: relative;
  padding-bottom: 0;
  background: var(--v3-bg-gray);
  overflow-x: clip;
  isolation: isolate;
}
.v3-gal::before,
.v3-gal::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.v3-gal::before {                /* dashed guide lines: outer verticals and the line above the strip */
  max-width: var(--v3-container-max);
  margin-inline: auto;
  background:
    var(--gal-dash) var(--gal-line) 0 / 1px 100% no-repeat,
    var(--gal-dash) right var(--gal-line) top 0 / 1px 100% no-repeat,
    var(--gal-dash-h) var(--gal-line) calc(var(--v3-section-pad) + var(--gal-head)) / calc(100% - 2 * var(--gal-line)) 1px no-repeat;
}
.v3-gal::after {
  opacity: 0.04;
  background: url("../../../images/v3/hero/noise.webp") 0 0 / 1024px;
}

.v3-gal__title {
  height: var(--gal-head);
  margin: 0;
  font-size: var(--v3-fs-body-m);
  font-weight: 700;
  line-height: var(--v3-lh-body-m);
  color: var(--v3-dark);
}

/* ---- marquee ---- */
.v3-gal__strip {
  margin-inline: -5px;           /* the Figma clip window is 5px wider than the container on each side */
  height: 455px;
  overflow: clip;
}
.v3-gal__track {
  display: flex;
  width: max-content;
  height: 100%;
  animation: v3-gal-marquee calc(var(--v3-gal-count) * var(--gal-pitch) / var(--gal-speed) * 1s) linear infinite;
  will-change: transform;
}
.v3-gal__strip:focus-visible .v3-gal__track { animation-play-state: paused; }   /* WCAG 2.2.2: keyboard focus (Tab) pauses it, a mouse click does not; no hover pause per the designer */
.v3-gal__strip:focus-visible { outline: 2px solid var(--v3-primary); outline-offset: -2px; }
.v3-gal__set {
  flex: none;
  display: flex;
  margin: 0;
  padding: 40px 0 0 5px;
  list-style: none;
}
.v3-gal__item {
  position: relative;
  flex: none;
  width: calc(var(--gal-card) + 12px);
  padding-right: 12px;
}
.v3-gal__item::after {           /* dashed divider between photos, full strip height */
  content: "";
  position: absolute;
  top: -40px;
  right: 6px;
  width: 1px;
  height: 455px;
  background: var(--gal-dash);
}
.v3-gal__img {
  display: block;
  width: var(--gal-card);
  height: var(--gal-card);
  border-radius: var(--v3-radius-md);
  object-fit: cover;
}
@keyframes v3-gal-marquee {
  to { transform: translateX(-50%); }
}

@media (max-width: 768px) {
  .v3-gal {
    --gal-head: 58px;
    --gal-line: calc(var(--v3-gutter) - 4px);
    --gal-card: 228px;
    --gal-pitch: 244;
  }
  .v3-gal__strip { margin-inline: 0; height: 324px; }
  .v3-gal__set { padding: 48px 0 0; }
  .v3-gal__item { width: calc(var(--gal-card) + 16px); padding-right: 16px; }
  .v3-gal__item::after { top: -48px; right: 8px; height: 324px; }
}

/* reduced motion: a static row the user scrolls by hand, no duplicate set */
@media (prefers-reduced-motion: reduce) {
  .v3-gal__strip { overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
  .v3-gal__track { animation: none; }
  .v3-gal__set[aria-hidden="true"] { display: none; }
}
