/* Bande de photos : défile sur le côté (doigt, souris ou flèches).
   Téléphone : la photo du centre est plus grande, celles des côtés dépassent et sont plus petites. */

[section="photo-strip"] {
  display: grid;
  grid-template-columns: minmax(0, 1fr); /* empêche la bande de photos d'élargir toute la page */
  gap: var(--spacing-12);
}

[section="photo-strip"] .strip-wrap {
  position: relative;
  min-width: 0;
  max-width: 100%;
}

[section="photo-strip"] .strip {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-12);
  padding: var(--spacing-16) clamp(8px, 3vw, 48px) var(--spacing-32);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  outline: 2px solid transparent;
  outline-offset: -4px;
}

[section="photo-strip"] .strip::-webkit-scrollbar {
  display: none;
}

[section="photo-strip"] .strip:focus-visible {
  outline-color: var(--fm-ink);
  border-radius: var(--radius-md);
}

[section="photo-strip"] .strip-item {
  flex: 0 0 clamp(210px, 24vw, 340px);
  scroll-snap-align: center;
}

/* Les photos paires sont un peu plus basses : rythme de la maquette (ordinateur) */
[section="photo-strip"] .strip-item:nth-child(even) {
  margin-block-start: clamp(16px, 3vw, 44px);
}

[section="photo-strip"] .strip-item a {
  display: block;
}

[section="photo-strip"] .strip-item img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius-xl);
  background-color: var(--color-surface-container);
}

/* ---------- Flèches rondes ---------- */
[section="photo-strip"] .strip-nav {
  position: absolute;
  inset-block-start: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-block-start: -38px;
  padding: 0;
  border: none;
  border-radius: var(--radius-circled);
  color: var(--fm-bg);
  background: var(--fm-ink);
  box-shadow:
    0 0 0 6px color-mix(in srgb, var(--fm-bg) 70%, transparent),
    0 14px 30px color-mix(in srgb, var(--fm-ink) 28%, transparent);
  cursor: pointer;
  outline: 2px solid transparent;
  outline-offset: 8px;
  -webkit-tap-highlight-color: transparent;
  transition:
    scale 0.3s var(--lux-ease),
    opacity 0.3s ease;
}

[section="photo-strip"] .strip-nav[hidden] {
  display: none;
}

[section="photo-strip"] .strip-next {
  inset-inline-end: clamp(8px, 2vw, 28px);
}

[section="photo-strip"] .strip-prev {
  inset-inline-start: clamp(8px, 2vw, 28px);
}

[section="photo-strip"] .strip-prev [ui-icon] {
  rotate: 180deg;
}

[dir="rtl"] [section="photo-strip"] .strip-prev [ui-icon] {
  rotate: 0deg;
}

[dir="rtl"] [section="photo-strip"] .strip-next [ui-icon] {
  rotate: 180deg;
}

[section="photo-strip"] .strip-nav:focus-visible {
  outline-color: var(--fm-ink);
}

[section="photo-strip"] .strip-nav:active {
  scale: 0.92;
}

@media (hover: hover) {
  [section="photo-strip"] .strip-nav:hover {
    scale: 1.08;
  }
}

/* Invite à glisser : la flèche avance et un anneau pulse, jusqu'au premier mouvement */
@media (prefers-reduced-motion: no-preference) {
  [section="photo-strip"] .strip-next[data-hint] [ui-icon] {
    animation: strip-nudge 1.8s var(--lux-ease) infinite;
  }

  [section="photo-strip"] .strip-next[data-hint]::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    animation: strip-ring 2.4s ease-out infinite;
  }
}

@keyframes strip-nudge {
  0%, 55%, 100% { translate: 0 0; }
  25% { translate: 6px 0; }
}

[dir="rtl"] [section="photo-strip"] .strip-next[data-hint] [ui-icon] {
  animation-name: strip-nudge-rtl;
}

@keyframes strip-nudge-rtl {
  0%, 55%, 100% { translate: 0 0; }
  25% { translate: -6px 0; }
}

@keyframes strip-ring {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--fm-ink) 40%, transparent); }
  70%, 100% { box-shadow: 0 0 0 16px transparent; }
}

/* ---------- Points de pagination ---------- */
[section="photo-strip"] .strip-dots {
  display: none;
  justify-content: center;
  gap: 8px;
}

[section="photo-strip"] .strip-dots span {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-rounded);
  background: color-mix(in srgb, var(--fm-ink) 22%, transparent);
  transition:
    width 0.45s var(--lux-ease),
    background-color 0.3s ease;
}

[section="photo-strip"] .strip-dots span.is-active {
  width: 28px;
  background: var(--fm-ink);
}

[section="photo-strip"] .strip-cta {
  display: flex;
  justify-content: center;
  padding-block-end: var(--spacing-24);
}

/* ---------- Téléphone : photo du centre en grand ---------- */
@media (max-width: 769px) {
  [section="photo-strip"] .strip {
    align-items: center;
    gap: 10px;
    padding: var(--spacing-8) calc((100% - 64vw) / 2) var(--spacing-16);
    scroll-snap-type: x mandatory;
  }

  [section="photo-strip"] .strip-item,
  [section="photo-strip"] .strip-item:nth-child(even) {
    flex: 0 0 64vw;
    margin-block-start: 0;
    scroll-snap-align: center;
    scroll-snap-stop: always;
    scale: 0.84;
    opacity: 0.85;
    transition:
      scale 0.55s var(--lux-ease),
      opacity 0.4s ease;
  }

  [section="photo-strip"] .strip-item.is-active {
    scale: 1;
    opacity: 1;
  }

  [section="photo-strip"] .strip-item img {
    aspect-ratio: 4 / 5.2;
  }

  [section="photo-strip"] .strip-nav {
    width: 52px;
    height: 52px;
    margin-block-start: -26px;
  }

  [section="photo-strip"] .strip-next {
    inset-inline-end: 8px;
  }

  [section="photo-strip"] .strip-prev {
    inset-inline-start: 8px;
  }

  [section="photo-strip"].is-scrollable .strip-dots {
    display: flex;
  }
}

@media (prefers-reduced-motion: reduce) {
  [section="photo-strip"] .strip-item,
  [section="photo-strip"] .strip-dots span {
    transition: none;
  }
}
