/*
 * Sideways rows (inc/rail.php): a list that scrolls natively to the side, without a scrollbar.
 * Swipes, momentum and snapping are the browser's own; js/rail.js only drives the optional arrows.
 * The row's own stylesheet lays it out (grid or flex, gaps, widths, edge-to-edge padding).
 *
 *   .ags-rail                  a row at every width
 *   .ags-rail.ags-rail--tablet a row up to 1100px, laid out by its own stylesheet above that
 *   .ags-rail.ags-rail--phone  a row up to 767px
 *   .ags-rail--snap            stops with an item at the start edge (each direct child)
 *
 * overflow-y is hidden, not left alone: with overflow-x alone it computes to auto as well, and
 * any content a few pixels taller than the row (cards waiting below their place to rise in,
 * js/home-motion.js) makes the row scroll vertically too. On iPhones a vertical swipe that starts
 * on such a row is caught by it instead of scrolling the page.
 */

.ags-rail:not(.ags-rail--tablet, .ags-rail--phone) {
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

@media (max-width: 1100px) {
  .ags-rail.ags-rail--tablet {
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }
}

@media (max-width: 767px) {
  .ags-rail.ags-rail--phone {
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }
}

.ags-rail::-webkit-scrollbar {
  display: none;
}

/* Where the row is not a scroller (a gated row on a wide screen), snapping has nothing to act on. */
.ags-rail--snap {
  scroll-snap-type: x mandatory;
}

.ags-rail--snap > * {
  scroll-snap-align: start;
}

/* Arrows (agskindermo_rail_arrows()): step one visible width, fade at the ends. */

.ags-rail-arrows {
  --ink: #201600;
  --line: #E3DED6;
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.ags-rail-arrows .ags-rail-arrow {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s, color 0.2s, opacity 0.2s;
}

.ags-rail-arrows .ags-rail-arrow:disabled {
  opacity: 0.35;
  cursor: default;
}

/* Hover only where there is a pointer: on phones a tap leaves :hover stuck. */
@media (hover: hover) {
  .ags-rail-arrows .ags-rail-arrow:not(:disabled):hover {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
  }
}
