/* Main carousel wrapper.
 * Keep the block constrained to its container and avoid slide overflow causing
 * images to visually stack over neighbouring content. */
.wp-block-kd-carousel.glide,
.glide {
  box-sizing: border-box;
  max-width: 100%;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.wp-block-kd-carousel.glide *,
.glide * {
  box-sizing: border-box;
}

/* Glide core handles transforms, but these rules provide a safe baseline while
 * JS is loading and prevent theme list styles/margins from breaking layout. */
.glide__track {
  overflow: hidden;
  width: 100%;
}

.glide__slides {
  align-items: stretch;
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
}

.glide__slide {
  flex-shrink: 0;
  height: auto;
  margin: 0;
  min-width: 0;
  overflow: hidden;
  position: relative;
}

/* Normalize image slides so different image dimensions do not overlap or create
 * uneven carousel heights. */
.glide__slide img {
  aspect-ratio: 16 / 9;
  display: block;
  height: auto;
  max-width: 100%;
  object-fit: cover;
  width: 100%;
}

/* Post carousel cards. */
.glide__slide > a {
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  text-decoration: none;
}

.glide__slide > a img {
  width: 100%;
}

.glide__slide h4 {
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  line-height: 1.3;
  margin: 0.75rem 0 0;
}

/* Optional arrow controls rendered by the block when enabled. */
.glide__arrows {
  display: flex;
  inset: 50% 0 auto;
  justify-content: space-between;
  left: 0;
  pointer-events: none;
  position: absolute;
  right: 0;
  transform: translateY(-50%);
  z-index: 2;
}

.glide__arrow {
  align-items: center;
  appearance: none;
  background: rgba(0, 0, 0, 0.65);
  border: 0;
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font-size: 2rem;
  height: 2.75rem;
  justify-content: center;
  line-height: 1;
  margin: 0 0.75rem;
  padding: 0;
  pointer-events: auto;
  transition:
    background 160ms ease,
    transform 160ms ease;
  width: 2.75rem;
}

.glide__arrow:hover,
.glide__arrow:focus-visible {
  background: rgba(0, 0, 0, 0.85);
  transform: scale(1.05);
}

/* Optional pagination bullets rendered by the block when enabled. */
.glide__bullets {
  align-items: center;
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  line-height: 1;
  margin-top: 1rem;
  padding: 0.125rem 0;
}

.glide__bullet {
  appearance: none;
  background: #c3c4c7;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  display: block;
  height: 0.75rem;
  line-height: 0;
  padding: 0;
  transition:
    background 160ms ease,
    transform 160ms ease;
  width: 0.75rem;
}

.glide__bullet:hover,
.glide__bullet:focus-visible,
.glide__bullet--active {
  background: #111;
  transform: scale(1.15);
}

/* Make empty-state slides visible without disturbing carousel dimensions. */
.glide__slide:only-child {
  background: #f6f7f7;
  border: 1px dashed #c3c4c7;
  color: #50575e;
  padding: 2rem;
  text-align: center;
}

/* Respect Gutenberg wide/full alignment support on themes that do not provide
 * their own alignment widths. */
.wp-block-kd-carousel.alignwide {
  max-width: min(1200px, 100%);
}

.wp-block-kd-carousel.alignfull {
  max-width: none;
  width: 100%;
}
