[id] {
  scroll-margin: var(--header-height);
}

.slider-layout {
  overflow: hidden;
  margin: 2rem calc(var(--edge) * -1) 2rem;
  text-align: center;
  position: relative;
  --swiper-navigation-sides-offset: calc(var(--swiper-navigation-size) / 2);
  --swiper-theme-color: #ffffff;
  --swiper-pagination-bullet-inactive-color: var(--accent);
  --swiper-pagination-color: var(--secondary);

  .swiper-button-next,
  .swiper-button-prev {
    background-color: var(--primary);
    width: var(--swiper-navigation-size);
    opacity: 0.75;
  }

  .swiper-button-next.swiper-button-disabled,
  .swiper-button-prev.swiper-button-disabled {
    opacity: 0.3;
  }

  &:has(.btn-text + .btn.pri-btn) {
    .btn.pri-btn {
      margin-top: 0;
    }
  }

  .filter-hide {
    display: none;
  }

  .btn-text {
    margin-top: auto;
  }

  /* &:last-child {
    margin-bottom: 0;
  } */
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
  opacity: 1;
  color: white;
}

.swiper-button-disabled {
  background-color: #1d1c1a;
  border-color: #1d1c1a;
}

.swiper-button-disabled::after {
  color: white;
  font-size: 1rem;
}

.slider-layout article {
  position: relative;
  display: flex;
  flex-direction: column;
  /* background-color: var(--background-muted); */
  height: 100%;
}

.slider-layout article.with-btn-overlay {
  margin-bottom: 1.5rem;
}

.slider-layout .img-container {
  /* margin-top: -3rem; */
  /* padding: 0 1.5rem; */
}

.slider-layout .description {
  padding-block: 1.25rem 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.slider-layout .description p {
  /* display: -webkit-box; */
  /* -webkit-line-clamp: 3; */
  /* -webkit-box-orient: vertical; */
  overflow: hidden;
  text-overflow: ellipsis;
  /* max-height: 80px; */
  /* line-height: 26px;/ */
  line-height: 1.5;
}

.slider-layout .description .price {
  color: var(--primary);
  margin-top: auto;
  font-weight: 600;
  font-size: var(--text-lg);
}

.slider-layout .description .price:has(+ .action-layout-2) {
  margin-top: 0;
}

.slider-layout .description>*:last-child {
  /* margin-top: auto; */
  /* place-self: end;
	align-self: flex-end; */
}

/* Spacer that keeps Learn More level with cards that have a Reserve button.
   Only needed when some card in the slider has one. */
.slider-layout:has(.pri-btn) .description>.btn-text:not(:has(~ .pri-btn)) {
  margin-bottom: 3rem;
}

/* .slider-layout .description > *:has(+ :last-child) {
	margin-bottom: 2rem;
} */

.slider-layout {
  h4 {
    font-size: var(--text-lg);
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 60px;
    font-family: var(--text-sans);
    margin-top: 0;

    &:has(+ .date) {
      margin-bottom: 0;
    }

    a {
      color: inherit;
    }
  }

  .date {
    margin-top: 0.5em;
    font-size: var(--text-sm);
    color: var(--accent-foreground);
  }

  .swiper-slide {
    align-self: stretch;
    height: auto;
  }

  .swiper-wrapper {
    container-type: inline-size;
  }
}

.slider-overflow {
  margin-inline: calc(var(--edge) * -1);
  overflow: hidden;
}

.slider-layout .swiper-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.category-tag-container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.category-tag {
  display: flex;
  font-size: var(--text-base);
  color: var(--accent-foreground);
  justify-content: center;
  gap: 0.5rem;
  align-items: center;
}

.category-tag svg {
  width: 1.25rem;
  height: 1.25rem;
}

.category-tag:hover {
  /* color: var(--background); */
}

.slider-layout-2 {
  .img-container {
    position: relative;
  }

  .img-container:before {
    content: '';
    display: block;
    position: absolute;
    z-index: 2;
    width: 100%;
    height: 100%;
    background: linear-gradient(transparent 60%, var(--primary));
  }

  .img-holder {
    position: relative;
    z-index: 1;
  }

  .description {
    position: relative;
  }

  .info {
    z-index: 3;
    position: absolute;
    bottom: 100%;
    text-align: center;
    width: 100%;
    padding: 2rem;
    color: white;
  }

  .swiper-wrapper {
    container-type: inline-size;
  }
}

.slider-layout .description .description-group {
  margin: 0 0 0.75rem;

  >* {
    margin: 0.25rem 0;
  }
}

.slider-layout .description .description-group:last-child {
  margin-bottom: 0;
}

.slider-layout .description .action-layout-2 {
  margin-top: auto;
}

.slider-layout .slider-hidden {
  display: none;
}

.action-layout-2 {
  padding-bottom: 10px;
  position: relative;
  justify-content: center;
}

.action-layout-2 .btn-overlay {
  position: absolute;
  top: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.action-layout-2 .btn-overlay .btn {
  width: 50%;
}

.action-layout-2 .btn-text {
  margin: auto;
  color: var(--primary);
}

@media only screen and (min-width: 550px) {
  .slider-overflow {
    margin-inline: auto;
  }

  .slider-layout {
    padding-inline: var(--edge);
  }
}

@media only screen and (min-width: 768px) {
  .slider-layout {
    padding-inline: calc(var(--swiper-navigation-size) / 2);
  }

  /* The side padding matches Swiper's 20px slide gap, so the next/previous
     slide starts right on the clip edge. At fractional positions (e.g. 125%
     Windows scaling) its first pixel column shows as a 1px line. Clip 1px
     inside the edge to hide it. */
  .slider-layout:not(.onhover) {
    clip-path: inset(0 1px);
  }

  .slider-layout.swiper-destroyed {
    .swiper-wrapper {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 20px;
    }

    [class*='swiper-button'] {
      display: none;
    }
  }
}

@media only screen and (min-width: 1024px) {
  .slider-layout {
    margin-inline: 0;
    overflow: hidden;
    /* 1px, not 0, so the arrows stay clear of the 1px clip above. */
    --swiper-navigation-sides-offset: 1px;
  }

  .slider-layout.swiper-destroyed {
    .swiper-wrapper {
      grid-template-columns: 1fr 1fr 1fr;
    }
  }

  .slider-layout.onhover {
    padding: 0;

    .img-container {
      z-index: 0;
    }

    .description {
      opacity: 0;
      background-color: rgba(0, 0, 0, 0.1);
      backdrop-filter: blur(5px);
      z-index: 1;
      padding: 2rem;
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      height: 100%;
      width: 100%;
      place-content: center;
      color: white;
      transition: opacity 350ms ease-in-out;

      >* {
        transition: transform 350ms ease-in-out;
        transform: translateY(1rem);
      }
    }

    .swiper-slide:hover {
      .description {
        opacity: 1;

        >* {
          transform: translateY(0);
        }
      }
    }
  }
}
/* --- Slider tiles in a grid ----------------------------------------------
   The same tiles, laid out by .grid instead of Swiper:
   <div class="slider-layout grid-container grid grid--cols-4 grid--sm-2 grid--flush">
     <div class="swiper-slide"><article>…</article></div> …
   </div>
   .grid-container keeps script.js from starting Swiper; .grid sets the
   columns. The slider's phone bleed, side padding and 1px clip make room for
   the peeking slides and arrows, so a grid drops them and keeps the gutter. */
.slider-layout.grid {
  margin-inline: 0;
  padding-inline: 0;
  overflow: visible;
  clip-path: none;
}

/* a Lucide icon before the date, e.g. <i data-lucide="calendar"> */
.slider-layout .date > :is(.lucide, i[data-lucide]) {
  width: 1em;
  height: 1em;
  margin-right: 0.375rem;
  vertical-align: -0.125em;
}
