/* Unique layout classes prevent collisions with Features List Cards. */
[data-acf-block-name="acf/features-list-cards-with-image"] .tp-flcwi-slider-viewport {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.3) rgba(0, 0, 0, 0.07);
  padding-bottom: 0.75rem;
}

[data-acf-block-name="acf/features-list-cards-with-image"] .tp-flcwi-slider-viewport::-webkit-scrollbar {
  height: 4px;
}

[data-acf-block-name="acf/features-list-cards-with-image"] .tp-flcwi-slider-viewport::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 2px;
}

/* Hide the native bar only when working arrow controls are available. */
[data-acf-block-name="acf/features-list-cards-with-image"] .tp-flcwi-slider-viewport[data-card-navigation-active] {
  scrollbar-width: none;
}

[data-acf-block-name="acf/features-list-cards-with-image"] .tp-flcwi-slider-viewport[data-card-navigation-active]::-webkit-scrollbar {
  display: none;
}

[data-acf-block-name="acf/features-list-cards-with-image"] [data-card-navigation] {
  display: flex;
  justify-content: flex-end;
  direction: ltr;
  gap: 8px;
}

[data-acf-block-name="acf/features-list-cards-with-image"] [data-card-navigation][hidden] {
  display: none;
}

[data-acf-block-name="acf/features-list-cards-with-image"] [data-card-navigation] button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: opacity 0.3s;
}

[data-acf-block-name="acf/features-list-cards-with-image"] [data-card-navigation] button:disabled {
  opacity: 0.3;
  cursor: default;
}

[data-acf-block-name="acf/features-list-cards-with-image"] [data-card-navigation] button:focus-visible {
  outline: 2px solid #3177ff;
  outline-offset: 2px;
}

[data-acf-block-name="acf/features-list-cards-with-image"] .tp-flcwi-slider-viewport:dir(rtl) + [data-card-navigation] svg {
  transform: scaleX(-1);
}

[data-acf-block-name="acf/features-list-cards-with-image"] .tp-flcwi-slider-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(333px, 85%, 411px);
  grid-template-rows: auto;
  gap: 24px;
  padding: 3rem 0;
}

[data-acf-block-name="acf/features-list-cards-with-image"] .tp-card-reveal {
  width: 100%;
  max-width: 411px;
  min-width: 0;
  aspect-ratio: 3 / 5;
  scroll-snap-align: start;
}

[data-acf-block-name="acf/features-list-cards-with-image"] .tp-flip-container {
  position: relative;
  width: 100%;
  height: 100%;
  cursor: pointer;
  border-radius: 1rem;
  perspective: 1200px;
  transform-style: preserve-3d;
  transition: box-shadow 0.2s ease;
}

[data-acf-block-name="acf/features-list-cards-with-image"] .tp-flip-container:hover:not(.tp-flip-animating) {
  box-shadow: 0 2px 4px rgba(26, 32, 46, 0.3);
}

[data-acf-block-name="acf/features-list-cards-with-image"] .tp-flip-container:has(> .tp-flcwi-flip-button:focus-visible) {
  outline: 3px solid #3177ff;
  outline-offset: 4px;
}

[data-acf-block-name="acf/features-list-cards-with-image"] .tp-flcwi-flip-button {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: inherit;
  padding: 0;
  background: transparent;
  color: transparent;
  cursor: pointer;
  outline: none;
}

/* The rotated back is its own stacking context. Raise it above the stretched
   button, but pass non-link clicks through so both faces remain clickable. */
[data-acf-block-name="acf/features-list-cards-with-image"] .tp-flip-back {
  z-index: 4;
  pointer-events: none;
}

[data-acf-block-name="acf/features-list-cards-with-image"] .tp-flcwi-back-content a {
  pointer-events: auto;
}

[data-acf-block-name="acf/features-list-cards-with-image"] .tp-flip-front,
[data-acf-block-name="acf/features-list-cards-with-image"] .tp-flip-back {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-sizing: border-box;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.645, 0.045, 0.355, 1), visibility 0s linear 0.3s;
}

[data-acf-block-name="acf/features-list-cards-with-image"] .tp-flip-front {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14%;
}

[data-acf-block-name="acf/features-list-cards-with-image"] .tp-flcwi-front-title {
  text-align: center;
  overflow-wrap: anywhere;
}

[data-acf-block-name="acf/features-list-cards-with-image"] .tp-flcwi-hint {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  opacity: 0.45;
  pointer-events: none;
}

[data-acf-block-name="acf/features-list-cards-with-image"] .tp-flip-back {
  visibility: hidden;
  background: #010f31;
  color: #fff;
}

[data-acf-block-name="acf/features-list-cards-with-image"] .tp-flip-flipped .tp-flip-back {
  visibility: visible;
  transition-delay: 0s;
}

[data-acf-block-name="acf/features-list-cards-with-image"] .tp-flip-flipped .tp-flip-front {
  visibility: hidden;
}

[data-acf-block-name="acf/features-list-cards-with-image"] .tp-flcwi-back-image,
[data-acf-block-name="acf/features-list-cards-with-image"] .tp-flcwi-back-overlay {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
}

[data-acf-block-name="acf/features-list-cards-with-image"] .tp-flcwi-back-image {
  z-index: 0;
}

/* Selected Card Color tint, darkened to protect white copy even for light colors. */
[data-acf-block-name="acf/features-list-cards-with-image"] .tp-flcwi-back-overlay {
  z-index: 1;
  background: linear-gradient(rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0.65)),
              linear-gradient(90deg, rgba(var(--tp-flcwi-overlay-rgb, 49, 119, 255), 0.92), rgba(var(--tp-flcwi-overlay-rgb, 49, 119, 255), 0.72));
}

[data-acf-block-name="acf/features-list-cards-with-image"] .tp-flcwi-back-content {
  z-index: 2;
}

[data-acf-block-name="acf/features-list-cards-with-image"] .tp-flcwi-back-image picture,
[data-acf-block-name="acf/features-list-cards-with-image"] .tp-flcwi-image {
  display: block;
  width: 100%;
  height: 100%;
}

[data-acf-block-name="acf/features-list-cards-with-image"] .tp-flcwi-image {
  object-fit: cover;
  object-position: center;
}

/* Below 1280px remains a single scrolling row for every card count. */
@media (min-width: 1280px) {
  [data-acf-block-name="acf/features-list-cards-with-image"] [data-card-navigation] {
    display: none;
  }

  [data-acf-block-name="acf/features-list-cards-with-image"] .tp-flcwi-slider-viewport {
    overflow: visible;
    scroll-snap-type: none;
    padding-bottom: 0;
  }

  [data-acf-block-name="acf/features-list-cards-with-image"] .tp-flcwi-slider-track {
    grid-auto-flow: row;
    grid-auto-columns: auto;
    grid-template-columns: repeat(var(--tp-flcwi-columns), minmax(0, 1fr));
    width: 100%;
    max-width: calc(var(--tp-flcwi-columns) * 411px + (var(--tp-flcwi-columns) - 1) * 24px);
    margin-inline: auto;
  }

  [data-acf-block-name="acf/features-list-cards-with-image"] .tp-card-reveal {
    scroll-snap-align: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-acf-block-name="acf/features-list-cards-with-image"] .tp-flip-front,
  [data-acf-block-name="acf/features-list-cards-with-image"] .tp-flip-back {
    transition: none;
  }
}