/**
 * Frontblocks Carousel – scoped under .frontblocks so other Glide instances are not affected.
 */

.frontblocks.glide {
  position: relative;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: visible;
  margin: 0;
  padding: 0;
}

.frontblocks.glide * {
  box-sizing: inherit;
}

.frontblocks .glide__track {
  overflow: hidden;
  width: 100%;
  position: relative;
  left: 0;
  margin: 0;
  padding: 0;
}

.frontblocks .glide__slides {
  position: relative;
  width: 100%;
  list-style: none;
  backface-visibility: hidden;
  transform-style: preserve-3d;
  touch-action: pan-Y;
  overflow: hidden;
  margin: 0;
  padding: 0;
  white-space: nowrap;
  display: flex;
  flex-wrap: nowrap;
  will-change: transform;
}

.frontblocks .glide__slides--dragging {
  user-select: none;
}

.frontblocks .glide__slide {
  width: 100%;
  height: 100%;
  flex-shrink: 0;
  white-space: normal;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  min-width: 0;
  overflow: hidden;
}

/* Prevent inner content (cards, AWB, etc.) from overflowing the slide and being cut off. */
.frontblocks .glide__slide > * {
  max-width: 100%;
  box-sizing: border-box;
}

.frontblocks .glide__slide a {
  user-select: none;
  -webkit-user-drag: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.frontblocks .glide__arrows {
  -webkit-touch-callout: none;
  user-select: none;
}

.frontblocks .glide__bullets {
  -webkit-touch-callout: none;
  user-select: none;
}

.frontblocks.glide--rtl {
  direction: rtl;
}

.frontblocks .glide__arrow {
  position: absolute;
  display: block;
  top: 50%;
  z-index: 2;
  color: white;
  text-transform: uppercase;
  padding: 9px 12px;
  background-color: transparent;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 4px;
  opacity: 1;
  cursor: pointer;
  transition: opacity 150ms ease, border 300ms ease-in-out;
  transform: translateY(-50%);
  line-height: 1;
}

.frontblocks .glide__arrow:focus {
  outline: none;
}

.frontblocks .glide__arrow:hover {
  border-color: white;
}

.frontblocks .glide__arrow--left {
  left: 1em;
}

.frontblocks .glide__arrow--right {
  right: 1em;
}

.frontblocks .glide__arrow--disabled {
  opacity: 0.33;
}

.frontblocks .glide__bullets {
  display: flex;
  justify-content: center;
  list-style: none;
  gap: 2px;
  margin: 0.75em 0 0;
  padding: 0;
}

.frontblocks .glide__bullet {
  box-sizing: content-box;
  width: 10px;
  height: 10px;
  padding: 0;
  border-radius: 50%;
  border: none;
  background-color: var(--frbl-bullet-bg, rgba(0, 0, 0, 0.25));
  cursor: pointer;
  transition: background-color 300ms ease-in-out, transform 300ms ease-in-out;
  margin: 0 2px;
  flex-shrink: 0;
}

.frontblocks .glide__bullet:focus {
  outline: 2px solid var(--frbl-bullet-color, rgba(0, 0, 0, 0.8));
  outline-offset: 2px;
}

.frontblocks .glide__bullet:hover {
  background-color: var(--frbl-bullet-color, rgba(0, 0, 0, 0.8));
  transform: scale(1.2);
}

.frontblocks .glide__bullet--active {
  background-color: var(--frbl-bullet-color, rgba(0, 0, 0, 0.8));
  transform: scale(1.2);
}

.frontblocks.glide--swipeable {
  cursor: grab;
  cursor: -moz-grab;
  cursor: -webkit-grab;
}

.frontblocks.glide--dragging {
  cursor: grabbing;
  cursor: -moz-grabbing;
  cursor: -webkit-grabbing;
}

.frontblocks .glide__arrows--bottom .glide__arrow {
  top: calc(100% + 25px);
  left: 0;
}

.frontblocks .glide__arrows--bottom .glide__arrow--right {
  left: 50px;
  right: unset;
}

.frontblocks .glide__arrows--top {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 10;
  pointer-events: none;
  transform: translateY(-50%);
}

.frontblocks .glide__arrows--top .glide__arrow {
  pointer-events: all;
}

.frontblocks .glide__arrows--top .glide__arrow--left {
  left: 2em;
}

.frontblocks .glide__arrows--top .glide__arrow--right {
  right: 2em;
}

@media only screen and (max-width: 768px) {
  .frontblocks .glide__arrow--left {
    left: 0.5em;
  }
  .frontblocks .glide__arrow--right {
    right: 0.5em;
  }
}

/**
 * Override native Gutenberg Grid styles when carousel is active (scoped to frontblocks carousel).
 */
.wp-block-group.frontblocks-carousel,
.wp-block-group.frontblocks-carousel.is-layout-grid {
  display: block;
  grid-template-columns: none;
  gap: 0;
}

.wp-block-group.frontblocks-carousel .frontblocks.glide,
.wp-block-group.frontblocks-carousel .frontblocks .glide__track {
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
  padding-left: 0;
  padding-right: 0;
}

.wp-block-group.frontblocks-carousel > * {
  width: 100%;
}

.wp-block-group.frontblocks-carousel > .wp-block-group__inner-container {
  display: block;
  grid-template-columns: none;
  gap: 0;
  width: 100%;
}

.frontblocks .glide__slides.wp-block-group,
.frontblocks .glide__slides.wp-block-group.is-layout-grid {
  display: flex;
  grid-template-columns: none;
  gap: 0;
  column-gap: 0;
  row-gap: 0;
}

.frontblocks .glide__slides > .glide__slide {
  min-width: 0;
  flex-shrink: 0;
}

/**
 * GenerateBlocks (and any other plugin) may inject column-gap via generated
 * utility classes on the carousel slides container.  Glide manages its own
 * spacing through margin-right on each slide, so any external column-gap
 * breaks the width calculation and must be zeroed out.
 */
.frontblocks-carousel,
.frontblocks .glide__slides {
  column-gap: 0 !important;
  gap: 0 !important;
}
