/*!
 * JustPorn - centered swipe snap for thumbnail sliders (2026-11-12 b)
 * Touch devices (phones, tablets in portrait): after a swipe the card always stops CENTERED.
 * Initial position is unchanged: snap positions are clamped to the scroll range, so the first card
 * (scrollLeft 0) and the last card (scrollLeft max) keep their natural start/end alignment. Nothing jumps on load.
 * Desktop (mouse) is not affected. Rollback = remove the <link> from include_footer_general.tpl.
 *
 * Scrollers (all native overflow-x, no Swiper/JS slider):
 *   homepage "Watched right now" row (ul.grid-temp), homepage geo/models row,
 *   homepage "Recommended for you" row, homepage Shorts track, video-page related row in the player (.jp-rel-row)
 * Not touched: category chips (#swiper1) and Related/Latest tabs (.jp-tabs) - variable-width pills, not thumbnails.
 *
 * One card per swipe instead of free momentum: set --jp-snap-stop:always (see NOTES.md).
 *
 * b: + desktop / mouse: cards get scroll-snap-align:center too (container snap type is NOT changed:
 * rows stay `proximity`, Shorts stays `mandatory`). Reason: the arrow buttons (jp-snap-20261112b.js) scroll so that a card is
 * centered; with `start` alignment the browser would pull the row back to a start position after the smooth scroll.
 */
@media (pointer:coarse) and (max-width:1023px){
  :root{--jp-snap-stop:normal}

  /* containers: proximity -> mandatory */
  .container>#custom_list_videos_videos_watched_right_now_items>.grid-temp,
  .container>#custom_list_videos_videos_watched_right_now_items~#custom_list_videos_videos_wich_geo_models_items,
  #custom_list_videos_jp_recommendations_home_items,
  .jp-shorts-row .jp-shorts-track,
  .player-related-videos .player-related-videos-container.jp-rel-row{
    scroll-snap-type:x mandatory
  }

  /* cards: start -> center (selectors mirror the originals so they win by order + equal specificity) */
  .container>#custom_list_videos_videos_watched_right_now_items>.grid-temp>li,
  .container>#custom_list_videos_videos_watched_right_now_items~#custom_list_videos_videos_wich_geo_models_items>.thumb,
  .container>#custom_list_videos_videos_watched_right_now_items>.grid-temp>.jp-row-more-item,
  .container>#custom_list_videos_videos_watched_right_now_items~#custom_list_videos_videos_wich_geo_models_items>.jp-row-more-item,
  #custom_list_videos_jp_recommendations_home_items>.thumb,
  #custom_list_videos_jp_recommendations_home_items>.jp-row-more-item,
  .jp-shorts-row .jp-shorts-track>.jp-shorts-item,
  .player-related-videos .player-related-videos-item.jp-rel-card{
    scroll-snap-align:center;
    scroll-snap-stop:var(--jp-snap-stop)
  }
}

/* desktop / mouse / wide screens: only the alignment of the cards changes (type unchanged) */
@media (pointer:fine),(min-width:1024px){
  .container>#custom_list_videos_videos_watched_right_now_items>.grid-temp>li,
  .container>#custom_list_videos_videos_watched_right_now_items~#custom_list_videos_videos_wich_geo_models_items>.thumb,
  .container>#custom_list_videos_videos_watched_right_now_items>.grid-temp>.jp-row-more-item,
  .container>#custom_list_videos_videos_watched_right_now_items~#custom_list_videos_videos_wich_geo_models_items>.jp-row-more-item,
  #custom_list_videos_jp_recommendations_home_items>.thumb,
  #custom_list_videos_jp_recommendations_home_items>.jp-row-more-item,
  .jp-shorts-row .jp-shorts-track>.jp-shorts-item{
    scroll-snap-align:center
  }
}
