/**
 * Copyright since 2026 Yves Rocher Nouvelle-Calédonie
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License 3.0 (AFL-3.0).
 * The license is available at https://opensource.org/licenses/AFL-3.0
 *
 * @author Yves Rocher Nouvelle-Calédonie
 * @copyright Since 2026 Yves Rocher Nouvelle-Calédonie
 * @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
 */

.yrpg-section {
  --yrpg-gap: 16px;
  --yrpg-radius: 8px;
  background: var(--yrpg-background, #f8f1ec);
  color: #111;
  margin: 0;
  padding: clamp(28px, 4vw, 56px) 0;
  width: 100%;
}

.yrpg-container {
  margin: 0 auto;
  max-width: 1440px;
  padding: 0 clamp(16px, 3vw, 40px);
  width: 100%;
}

.yrpg-heading {
  margin: 0 auto clamp(22px, 3vw, 34px);
  text-align: center;
}

.yrpg-title,
.yrpg-subtitle {
  color: inherit;
  font-family: inherit;
  font-weight: 500;
  letter-spacing: .01em;
  line-height: 1.15;
  margin: 0;
  text-transform: uppercase;
}

.yrpg-title {
  font-size: clamp(20px, 2.1vw, 30px);
}

.yrpg-subtitle {
  font-size: clamp(16px, 1.8vw, 25px);
  margin-top: 3px;
}

.yrpg-slider-shell {
  position: relative;
}

.yrpg-track {
  display: grid;
  gap: var(--yrpg-gap);
  grid-template-columns: repeat(var(--yrpg-desktop-columns, 4), minmax(0, 1fr));
}

.yrpg-card {
  aspect-ratio: 2 / 3;
  border-radius: var(--yrpg-radius);
  margin: 0;
  min-width: 0;
  overflow: hidden;
  position: relative;
}

.yrpg-card-link,
.yrpg-card-link:hover,
.yrpg-card-link:focus {
  color: #fff;
  display: block;
  height: 100%;
  outline-offset: 3px;
  text-decoration: none;
  width: 100%;
}

.yrpg-card picture {
  display: block;
  height: 100%;
  width: 100%;
}

.yrpg-card-image {
  display: block;
  height: 100%;
  object-fit: cover;
  transform: scale(1);
  transition: transform .45s ease;
  width: 100%;
}

.yrpg-card-link:hover .yrpg-card-image {
  transform: scale(1.025);
}

.yrpg-card-shade {
  background: linear-gradient(180deg, transparent 42%, rgba(0, 0, 0, .08) 57%, rgba(0, 0, 0, .82) 100%);
  inset: 0;
  position: absolute;
}

.yrpg-card-content {
  align-items: flex-start;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 11px;
  left: 0;
  padding: clamp(16px, 1.7vw, 24px);
  position: absolute;
  right: 0;
  z-index: 1;
}

.yrpg-card-title {
  color: #fff;
  display: block;
  font-size: clamp(17px, 1.55vw, 23px);
  font-weight: 700;
  line-height: 1.15;
  margin: 0;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .35);
}

.yrpg-card-button {
  background: #fff;
  border: 2px solid #fff;
  border-radius: 8px;
  color: #090909;
  display: inline-flex;
  font-size: clamp(14px, 1.2vw, 18px);
  font-weight: 600;
  justify-content: center;
  line-height: 1;
  min-width: 128px;
  padding: 13px 20px;
  transition: background-color .2s ease, color .2s ease;
}

.yrpg-card-link:hover .yrpg-card-button,
.yrpg-card-link:focus .yrpg-card-button {
  background: #111;
  color: #fff;
}

.yrpg-arrow {
  align-items: center;
  background: #fff;
  border: 0;
  border-radius: 50%;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .2);
  color: #111;
  cursor: pointer;
  display: none;
  font-size: 35px;
  height: 44px;
  justify-content: center;
  line-height: 1;
  padding: 0 0 4px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  z-index: 2;
}

.yrpg-arrow:disabled {
  opacity: 0;
  pointer-events: none;
}

.yrpg-arrow-prev { left: 6px; }
.yrpg-arrow-next { right: 6px; }

@media (max-width: 1023px) and (min-width: 768px) {
  .yrpg-track {
    grid-template-columns: repeat(var(--yrpg-tablet-columns, 2), minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .yrpg-section {
    --yrpg-gap: 12px;
    padding: 28px 0 32px;
  }

  .yrpg-container {
    overflow: hidden;
    padding: 0;
  }

  .yrpg-heading {
    padding: 0 18px;
  }

  .yrpg-title { font-size: 20px; }
  .yrpg-subtitle { font-size: 15px; }

  .yrpg-track {
    display: flex;
    gap: var(--yrpg-gap);
    grid-template-columns: none;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding: 0 18px 10px;
    scroll-behavior: smooth;
    scroll-padding-left: 18px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .yrpg-track::-webkit-scrollbar { display: none; }

  .yrpg-card {
    flex: 0 0 var(--yrpg-mobile-width, 84%);
    scroll-snap-align: start;
  }

  .yrpg-card-content { padding: 18px; }
  .yrpg-card-title { font-size: 20px; }
  .yrpg-card-button { font-size: 16px; min-width: 128px; padding: 13px 19px; }
  .yrpg-arrow { display: flex; }
  .yrpg-arrow-prev { left: 8px; }
  .yrpg-arrow-next { right: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .yrpg-card-image,
  .yrpg-card-button,
  .yrpg-track {
    scroll-behavior: auto;
    transition: none;
  }
}
