/*!
 * Copyright (C) 2023 StApps
 * This program is free software: you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the Free
 * Software Foundation, version 3.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program. If not, see <https://www.gnu.org/licenses/>.
 */

:host {
  scrollbar-width: none;
  scroll-snap-type: x mandatory;

  position: relative;

  contain: layout;
  overflow: auto hidden;
  display: grid;
  grid-auto-flow: column;
  gap: var(--swiper-gap, 0);
  justify-content: start;

  margin-inline: calc(-1 * var(--swiper-scroll-padding));

  &::ng-deep > * {
    scroll-margin-inline: var(--swiper-scroll-padding, 0);
    scroll-snap-align: start;
    contain: layout;
    width: var(--swiper-slide-width);

    &:first-child {
      width: calc(var(--swiper-slide-width) + var(--swiper-scroll-padding));
      padding-inline-start: var(--swiper-scroll-padding);
    }

    &:last-child {
      scroll-snap-align: end;
      width: calc(var(--swiper-slide-width) + var(--swiper-scroll-padding));
      padding-inline-end: var(--swiper-scroll-padding);
    }

    &:only-child {
      width: calc(var(--swiper-slide-width) + 2 * var(--swiper-scroll-padding));
    }
  }

  &::-webkit-scrollbar {
    display: none;
  }
}
