/* THE GALLERY, THE KIT'S ONE (ui/Gallery.astro, kit-gallery.js): items side by side, the middle one shown, its neighbours
   peeking. A wide screen: every item in the one cell, each moved its place away from the shown one (--at), round and
   round, the track never scrolled, moved by its arrows, a tap or a drag. A narrow one: a sideways swipe snapping each to
   the middle. Any item: its own width (--g-gal-w), its own buttons above or below it. Tokens only. */
.g-gal { min-width: 0; }
.g-gal__view { overflow: hidden; touch-action: pan-y; }
.g-gal__track { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; }
.g-gal__slide { grid-area: 1 / 1; display: flex; flex-direction: column; align-items: center; width: var(--g-gal-w); max-width: calc(100% - var(--g-8));
  transform: translateX(calc(var(--at, 0) * (100% + var(--g-6)) + var(--gal-drag, 0px))); transition: transform var(--g-slow) var(--g-ease); }
.g-gal__slide.is-still, .g-gal.is-dragging .g-gal__slide { transition: none; }
.g-gal__slide:not(.is-at) { cursor: pointer; }   /* beside the middle one: a tap brings it there */
.g-gal__bar { position: relative; z-index: 4; display: flex; justify-content: center; align-items: center; gap: var(--g-6); margin-top: var(--g-5); }   /* its arrows over anything laid over the gallery (the home's miniature): always pressable */
@media (min-width: 900px) {
  .g-gal__view { cursor: grab; user-select: none; -webkit-user-select: none; }
  .g-gal.is-dragging .g-gal__view { cursor: grabbing; }
  .g-gal__view img { -webkit-user-drag: none; }
}
@media not (min-width: 900px) {
  .g-gal__bar { display: none; }
  .g-gal__view { touch-action: auto; }
  .g-gal__track { display: flex; gap: var(--g-6); overflow-x: auto;   /* a clear gap between one and the next (Maayan, 2026-11-21) */
  scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain;
    padding: var(--g-1) var(--g-6) 0; scroll-padding-inline: var(--g-6); }
  .g-gal__track::-webkit-scrollbar { display: none; }
  .g-gal__slide { grid-area: auto; flex: 0 0 100%; max-width: none; min-width: 0; transform: none; transition: none; scroll-snap-align: center; scroll-snap-stop: always; }
}
/* start: the shown one at the start, the rest to its right, its view out to the screen's right edge (kit-gallery.js) */
.g-gal[data-start] .g-gal__track { justify-items: start; }
.g-gal[data-start] .g-gal__slide { max-width: none; }
.g-gal[data-start] .g-gal__slide.is-left { transform: translateX(calc(var(--at, 0) * (100% + var(--g-6)) - var(--gal-back, 0px) + var(--gal-drag, 0px))); }   /* gone past the part on its left, never peeking in the gap */
.g-gal[data-start] .g-gal__bar { justify-content: flex-start; }
.g-gal[data-on-picture] .g-gal__bar .g-iconbtn { background: var(--g-over-picture); -webkit-backdrop-filter: var(--g-over-blur); backdrop-filter: var(--g-over-blur); }   /* over a picture: its arrows seen */
@media not (min-width: 900px) {
  .g-gal[data-start] .g-gal__track { padding-inline: 0; scroll-padding-inline: 0; }
  .g-gal[data-start] .g-gal__slide { flex: 0 0 var(--g-gal-w); scroll-snap-align: start; }
  .g-gal[data-start] .g-gal__slide.is-left { transform: none; }   /* a phone: each in its own place in the row, never moved back under the shown one (Maayan, 2026-11-21: "fix gallery item on hp in mobile") */
  .g-gal[data-start] .g-gal__bar { display: none; }
}
@media (prefers-reduced-motion: reduce) { .g-gal__slide { transition: none; } }
